Gemmi C++ API
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Enumerations | Functions
gemmi Namespace Reference

Namespaces

namespace  cif
 

Classes

struct  Addends
 
struct  AlignmentResult
 
struct  AlignmentScoring
 
struct  Assembly
 
struct  AsuBrick
 
struct  AsuData
 
struct  Atom
 Represents atom site in macromolecular structure (~100 bytes). More...
 
struct  AtomAddress
 
struct  AtomGroup_
 
struct  AtomNameElement
 
class  BasicInput
 
struct  BasicRefinementInfo
 
struct  BesselTables_
 
struct  BidirIterator
 
struct  Binner
 
struct  Blob
 
struct  BlobCriteria
 
struct  BondIndex
 
struct  Box
 
struct  C4322
 
struct  Ccp4
 
struct  Ccp4Base
 
struct  CenterOfMass
 
struct  Chain
 
struct  ChainNameGenerator
 
class  CharArray
 
struct  ChemComp
 
struct  ChemLink
 
struct  ChemMod
 
struct  CifToMtz
 
struct  CisPep
 
struct  ComplexCorrelation
 
struct  Connection
 
struct  const_CRA
 
struct  ConstFilterProxy
 
struct  ConstResidueGroup
 
struct  ConstResidueSpan
 
struct  ConstUniqProxy
 
struct  ContactSearch
 
struct  Correlation
 
struct  Covariance
 
struct  CRA
 
class  CraIterPolicy
 
struct  CraProxy_
 
struct  CrystalInfo
 
struct  DataStats
 
struct  DensityCalculator
 
struct  DiffractionInfo
 
class  DirWalk
 
struct  Element
 
struct  EnerLib
 
struct  Entity
 
struct  ExpAnisoSum
 
struct  ExpAnisoSum< N, float >
 
struct  ExperimentInfo
 
struct  ExpSum
 
struct  ExpSum< N, float >
 
struct  FastaSeq
 
struct  FileStream
 
class  FilterIterPolicy
 
struct  FilterProxy
 
struct  FloodFill
 
struct  FPhiProxy
 
struct  Fractional
 Fractional coordinates. More...
 
struct  FTransform
 Like Transform, but apply() arg is Fractional (not Vec3 - for type safety). More...
 
struct  GaussianCoef
 
struct  GlobWalk
 
struct  Grid
 Real-space grid. More...
 
struct  GridBase
 A common subset of Grid and ReciprocalGrid. More...
 
struct  GridMeta
 The base of Grid classes that does not depend on stored data type. More...
 
struct  GridOp
 
class  GroupingIterPolicy
 
struct  GroupOps
 
struct  GruberVector
 
struct  Helix
 
struct  HklMatch
 
struct  HklValue
 
struct  Ifstream
 
class  IndirectIterPolicy
 
struct  Intensities
 
struct  IT92
 
struct  ItemGroup
 
struct  LevMar
 
struct  LinkHunt
 
struct  MaskedGrid
 
struct  Mat33
 
class  MaybeGzipped
 
struct  MemoryStream
 
struct  Metadata
 
struct  MillerHash
 
struct  MmcifOutputGroups
 
struct  Model
 
struct  ModRes
 
struct  MonLib
 
struct  Mtz
 
struct  MtzDataProxy
 
struct  MtzExternalDataProxy
 
class  MtzToCif
 
struct  MutableVectorSpan
 
struct  NcsOp
 Non-crystallographic symmetry operation (such as in the MTRIXn record) More...
 
struct  NearestImage
 Result of find_nearest_image. More...
 
struct  NeighborSearch
 
struct  Neutron92
 
struct  NodeInfo
 
struct  Ofstream
 
struct  OldToNew
 helper type used for Structure::shortened_ccd_codes More...
 
struct  Op
 
struct  OptionalInt
 
struct  PdbReadOptions
 options affecting how pdb file is read More...
 
struct  PdbWriteOptions
 
struct  Position
 Coordinates in Angstroms - orthogonal (Cartesian) coordinates. More...
 
struct  ReciprocalAsu
 
struct  ReciprocalGrid
 
struct  RefinementInfo
 
struct  ReflectionsInfo
 
struct  ReflnBlock
 
struct  ReflnDataProxy
 
struct  Residue
 
struct  ResidueGroup
 
struct  ResidueId
 
struct  ResidueInfo
 
struct  ResidueSpan
 
struct  Restraints
 
struct  Scaling
 
struct  Selection
 
struct  SellingVector
 
struct  SeqId
 
struct  Sheet
 
struct  SiftsUnpResidue
 Reference to UniProt residue, based on _pdbx_sifts_xref_db. More...
 
struct  SmallStructure
 
struct  SMat33
 
struct  SoftwareItem
 
struct  SolventMasker
 
struct  SpaceGroup
 
struct  SpaceGroupAltName
 
struct  Span
 
class  StrideIterPolicy
 
struct  Structure
 
class  StructureFactorCalculator
 
struct  SupResult
 
struct  TlsGroup
 
struct  Topo
 
struct  Transform
 
class  UniqIterPolicy
 
struct  UniqProxy
 
struct  UnitCell
 Unit cell. More...
 
struct  UnmergedHklMover
 
struct  UpperTriangularMat33
 
struct  ValueSigma
 
struct  Variance
 
struct  Vec3_
 
struct  XdsAscii
 

Typedefs

using CifWalk = DirWalk< true, impl::IsCifFile >
 
using MmCifWalk = DirWalk< true, impl::IsMmCifFile >
 
using PdbWalk = DirWalk< true, impl::IsPdbFile >
 
using CoorFileWalk = DirWalk< true, impl::IsCoordinateFile >
 
typedef const char elname_t[3]
 
typedef std::unique_ptr< std::FILE, decltype(&std::fclose)> fileptr_t
 
template<typename Value >
using StrideIter = BidirIterator< StrideIterPolicy< Value > >
 
template<typename Redirect , typename Value >
using IndirectIter = BidirIterator< IndirectIterPolicy< Redirect, Value > >
 
template<typename Vector , typename Value >
using UniqIter = BidirIterator< UniqIterPolicy< Vector, Value > >
 
template<typename Vector , typename Value >
using GroupingIter = BidirIterator< GroupingIterPolicy< Vector, Value > >
 
template<typename Filter , typename Vector , typename Value >
using FilterIter = BidirIterator< FilterIterPolicy< Filter, Vector, Value > >
 
using Vec3 = Vec3_< double >
 
using Vec3f = Vec3_< float >
 
using AtomGroup = AtomGroup_< Atom >
 
using ConstAtomGroup = AtomGroup_< const Atom >
 
using CraProxy = CraProxy_< CRA, std::vector< Chain > & >
 
using ConstCraProxy = CraProxy_< const_CRA, const std::vector< Chain > & >
 
typedef cif::Document(* read_cif_func) (const std::string &)
 
template<typename T >
using FPhiGrid = ReciprocalGrid< std::complex< T > >
 
using Vec6 = std::array< double, 6 >
 
using spacegroup_tables = impl::Tables_< void >
 
using OpObliquity = std::pair< Op, double >
 
using Miller = std::array< int, 3 >
 A synonym for convenient passing of hkl.
 

Enumerations

enum class  SupSelect { CaP , MainChain , All }
 
enum class  HowToNameCopiedChain { Short , AddNumber , Dup }
 
enum class  MapSetup { Full , NoSymmetry , ReorderOnly }
 
enum class  BondType {
  Unspec , Single , Double , Triple ,
  Aromatic , Deloc , Metal
}
 
enum class  ChiralityType { Positive , Negative , Both }
 
enum class  ChemCompModel { Xyz , Example , Ideal }
 
enum class  El : unsigned char {
  X =0 , H =1 , He , Li ,
  Be , B , C , N ,
  O , F , Ne , Na ,
  Mg , Al , Si , P ,
  S , Cl , Ar , K ,
  Ca , Sc , Ti , V ,
  Cr , Mn , Fe , Co ,
  Ni , Cu , Zn , Ga ,
  Ge , As , Se , Br ,
  Kr , Rb , Sr , Y ,
  Zr , Nb , Mo , Tc ,
  Ru , Rh , Pd , Ag ,
  Cd , In , Sn , Sb ,
  Te , I , Xe , Cs ,
  Ba , La , Ce , Pr ,
  Nd , Pm , Sm , Eu ,
  Gd , Tb , Dy , Ho ,
  Er , Tm , Yb , Lu ,
  Hf , Ta , W , Re ,
  Os , Ir , Pt , Au ,
  Hg , Tl , Pb , Bi ,
  Po , At , Rn , Fr ,
  Ra , Ac , Th , Pa ,
  U , Np , Pu , Am ,
  Cm , Bk , Cf , Es ,
  Fm , Md , No , Lr ,
  Rf , Db , Sg , Bh ,
  Hs , Mt , Ds , Rg ,
  Cn , Nh , Fl , Mc ,
  Lv , Ts , Og , D ,
  END
}
 
enum class  AxisOrder : unsigned char { Unknown , XYZ , ZYX }
 Order of grid axis. More...
 
enum class  GridSizeRounding { Nearest , Up , Down }
 
enum class  EntityType : unsigned char {
  Unknown , Polymer , NonPolymer , Branched ,
  Water
}
 
enum class  PolymerType : unsigned char {
  Unknown , PeptideL , PeptideD , Dna ,
  Rna , DnaRnaHybrid , SaccharideD , SaccharideL ,
  Pna , CyclicPseudoPeptide , Other
}
 
enum class  CoorFormat {
  Unknown , Detect , Pdb , Mmcif ,
  Mmjson , ChemComp
}
 File format of a macromolecular model. More...
 
enum class  CalcFlag : signed char {
  NotSet =0 , NoHydrogen , Determined , Calculated ,
  Dummy
}
 corresponds to _atom_site.calc_flag in mmCIF More...
 
enum class  DataType { Unknown , Unmerged , Mean , Anomalous }
 
enum class  ResidueKind : unsigned char {
  UNKNOWN =0 , AA , AAD , PAA ,
  MAA , RNA , DNA , BUF ,
  HOH , PYR , KET , ELS
}
 
enum class  AtomicRadiiSet { VanDerWaals , Cctbx , Refmac , Constant }
 
enum class  CrystalSystem : unsigned char {
  Triclinic =0 , Monoclinic , Orthorhombic , Tetragonal ,
  Trigonal , Hexagonal , Cubic
}
 
enum class  PointGroup : unsigned char {
  C1 =0 , Ci , C2 , Cs ,
  C2h , D2 , C2v , D2h ,
  C4 , S4 , C4h , D4 ,
  C4v , D2d , D4h , C3 ,
  C3i , D3 , C3v , D3d ,
  C6 , C3h , C6h , D6 ,
  C6v , D3h , D6h , T ,
  Th , O , Td , Oh
}
 
enum class  Laue : unsigned char {
  L1 =0 , L2m , Lmmm , L4m ,
  L4mmm , L3 , L3m , L6m ,
  L6mmm , Lm3 , Lm3m
}
 
enum class  HydrogenChange {
  NoChange , Shift , Remove , ReAdd ,
  ReAddButWater , ReAddKnown
}
 
enum class  Asu : unsigned char { Same , Different , Any }
 

Functions

std::vector< intprepare_target_gapo (const ConstResidueSpan &polymer, PolymerType polymer_type, const AlignmentScoring *scoring=nullptr)
 
AlignmentResult align_sequence_to_polymer (const std::vector< std::string > &full_seq, const ConstResidueSpan &polymer, PolymerType polymer_type, const AlignmentScoring *scoring=nullptr)
 
bool seqid_matches_seqres (const ConstResidueSpan &polymer, const Entity &ent)
 
void clear_sequences (Structure &st)
 
GEMMI_DLL void assign_best_sequences (Structure &st, const std::vector< std::string > &fasta_sequences)
 
void assign_label_seq_to_polymer (ResidueSpan &polymer, const Entity *ent, bool force)
 
void clear_label_seq_id (Structure &st)
 
void assign_label_seq_id (Structure &st, bool force)
 
void prepare_positions_for_superposition (std::vector< Position > &pos1, std::vector< Position > &pos2, ConstResidueSpan fixed, ConstResidueSpan movable, PolymerType ptype, SupSelect sel, char altloc='\0', std::vector< int > *ca_offsets=nullptr)
 
SupResult calculate_current_rmsd (ConstResidueSpan fixed, ConstResidueSpan movable, PolymerType ptype, SupSelect sel, char altloc='\0')
 
SupResult calculate_superposition (ConstResidueSpan fixed, ConstResidueSpan movable, PolymerType ptype, SupSelect sel, int trim_cycles=0, double trim_cutoff=2.0, char altloc='\0')
 
std::vector< SupResultcalculate_superpositions_in_moving_window (ConstResidueSpan fixed, ConstResidueSpan movable, PolymerType ptype, double radius=10.0)
 
void ensure_unique_chain_name (const Model &model, Chain &chain)
 
GEMMI_DLL Model make_assembly (const Assembly &assembly, const Model &model, HowToNameCopiedChain how, std::ostream *out)
 
Assembly pseudo_assembly_for_unit_cell (const UnitCell &cell)
 
GEMMI_DLL void transform_to_assembly (Structure &st, const std::string &assembly_name, HowToNameCopiedChain how, std::ostream *out, bool keep_spacegroup=false, double merge_dist=0.2)
 If called with assembly_name="unit_cell" changes structure to unit cell (P1).
 
GEMMI_DLL Model expand_ncs_model (const Model &model, const std::vector< NcsOp > &ncs, HowToNameCopiedChain how)
 
GEMMI_DLL void merge_atoms_in_expanded_model (Model &model, const UnitCell &cell, double max_dist=0.2, bool compare_serial=true)
 Searches and merges overlapping equivalent atoms from different chains.
 
GEMMI_DLL void shorten_chain_names (Structure &st)
 
GEMMI_DLL void expand_ncs (Structure &st, HowToNameCopiedChain how, double merge_dist=0.2)
 
GEMMI_DLL void split_chains_by_segments (Model &model, HowToNameCopiedChain how)
 HowToNameCopiedChain::Dup adds segment name to chain name.
 
template<typename Func , typename T >
void for_matching_reflections (const std::vector< T > &a, const std::vector< T > &b, const Func &func)
 
template<typename T >
Correlation calculate_hkl_value_correlation (const std::vector< T > &a, const std::vector< T > &b)
 
template<typename T >
ComplexCorrelation calculate_hkl_complex_correlation (const std::vector< T > &a, const std::vector< T > &b)
 
template<typename T >
int count_equal_values (const std::vector< T > &a, const std::vector< T > &b)
 
template<typename T , int N, typename Data >
AsuData< Tmake_asu_data (const Data &data, const std::array< std::string, N > &labels, bool as_is=false)
 
template<typename T , typename Data >
AsuData< Tmake_asu_data (const Data &data, const std::string &label, bool as_is)
 
AsuBrick find_asu_brick (const SpaceGroup *sg)
 
template<typename V = std::int8_t>
std::vector< Vget_asu_mask (const GridMeta &grid)
 
template<typename T >
MaskedGrid< Tmasked_asu (Grid< T > &grid)
 
template<typename T >
Box< Fractionalget_nonzero_extent (const GridBase< T > &grid)
 
from_chars_result fast_from_chars (const char *start, const char *end, double &d)
 
from_chars_result fast_from_chars (const char *start, double &d)
 
double fast_atof (const char *p, const char **endptr=nullptr)
 
bool is_space (char c)
 
bool is_blank (char c)
 
bool is_digit (char c)
 
const charskip_blank (const char *p)
 
const charskip_word (const char *p)
 
std::string read_word (const char *line)
 
std::string read_word (const char *line, const char **endptr)
 
int string_to_int (const char *p, bool checked, size_t length=0)
 
int string_to_int (const std::string &str, bool checked)
 
int simple_atoi (const char *p, const char **endptr=nullptr)
 
int no_sign_atoi (const char *p, const char **endptr=nullptr)
 
template<int N>
double evaluate_polynomial (const double(&poly)[N], double x)
 
double bessel_i1_over_i0 (double x)
 
double bessel_i0 (double x)
 
double log_bessel_i0 (double x)
 
Correlation combine_two_correlations (const Correlation &a, const Correlation &b)
 
Correlation combine_correlations (const std::vector< Correlation > &cors)
 
std::vector< Blobfind_blobs_by_flood_fill (const gemmi::Grid< float > &grid, const BlobCriteria &criteria, bool negate=false)
 
template<class T >
bool has_hydrogen (const T &obj)
 
template<>
bool has_hydrogen (const Atom &atom)
 
template<class T >
size_t count_hydrogen_sites (const T &obj)
 deprecated, use has_hydrogen() or count_atom_sites(..., Selection("[H,D]")
 
template<>
size_t count_hydrogen_sites (const Atom &atom)
 
template<class T >
double calculate_mass (const T &obj)
 
template<>
double calculate_mass (const Atom &atom)
 
template<class T >
CenterOfMass calculate_center_of_mass (const T &obj)
 
template<>
CenterOfMass calculate_center_of_mass (const Atom &atom)
 
template<class T >
void expand_box (const T &obj, Box< Position > &box)
 
template<>
void expand_box (const Atom &atom, Box< Position > &box)
 
Box< Positioncalculate_box (const Structure &st, double margin=0.)
 
Box< Fractionalcalculate_fractional_box (const Structure &st, double margin=0.)
 
double calculate_b_est (const Atom &atom)
 
double calculate_angle (const Position &p0, const Position &p1, const Position &p2)
 
double calculate_dihedral (const Position &p0, const Position &p1, const Position &p2, const Position &p3)
 
double calculate_dihedral_from_atoms (const Atom *a, const Atom *b, const Atom *c, const Atom *d)
 the return value is in the same range as that of atan2(), i.e. [-pi, pi]
 
double calculate_omega (const Residue &res, const Residue &next)
 
bool is_peptide_bond_cis (const Atom *ca1, const Atom *c, const Atom *n, const Atom *ca2)
 
double calculate_chiral_volume (const Position &actr, const Position &a1, const Position &a2, const Position &a3)
 
std::array< double, 2 > calculate_phi_psi (const Residue *prev, const Residue &res, const Residue *next)
 
GEMMI_DLL std::array< double, 4 > find_best_plane (const std::vector< Atom * > &atoms)
 
double get_distance_from_plane (const Position &pos, const std::array< double, 4 > &coeff)
 
template<typename Restr >
double angle_z (double value_rad, const Restr &restr, double full=360.)
 
double chiral_abs_volume (double bond1, double bond2, double bond3, double angle1, double angle2, double angle3)
 
BondType bond_type_from_string (const std::string &s)
 
const charbond_type_to_string (BondType btype)
 
float order_of_bond_type (BondType btype)
 
ChiralityType chirality_from_string (const std::string &s)
 
ChiralityType chirality_from_flag_and_volume (const std::string &s, double volume)
 
const charchirality_to_string (ChiralityType chir_type)
 
ChemComp make_chemcomp_from_block (const cif::Block &block_)
 
Residue make_residue_from_chemcomp_block (const cif::Block &block, ChemCompModel kind)
 
Model make_model_from_chemcomp_block (const cif::Block &block, ChemCompModel kind)
 
Structure make_structure_from_chemcomp_block (const cif::Block &block)
 
int check_chemcomp_block_number (const cif::Document &doc)
 
Structure make_structure_from_chemcomp_doc (const cif::Document &doc)
 
template<typename DataProxy >
std::pair< DataType, size_t > check_data_type_under_symmetry (const DataProxy &proxy)
 
bool possible_old_style (const ReflnBlock &rb, DataType data_type)
 
cif::Loop transcript_old_anomalous_to_standard (const cif::Loop &loop, const SpaceGroup *sg)
 Before refln.pdbx_F_plus/minus was introduced, anomalous data was stored as two F_meas_au reflections, say (1,1,3) and (-1,-1,-3).
 
GEMMI_DLL void setup_for_crd (Structure &st)
 
GEMMI_DLL void add_automatic_links (Model &model, Structure &st, const MonLib &monlib)
 
GEMMI_DLL cif::Document prepare_refmac_crd (const Structure &st, const Topo &topo, const MonLib &monlib, HydrogenChange h_change)
 
template<int N, typename Real >
Real determine_cutoff_radius (Real x1, const ExpSum< N, Real > &precal, Real cutoff_level)
 
template<typename Real >
Real it92_radius_approx (Real b)
 
double get_minimum_b (const Model &model)
 
std::string as_utf8 (const _tinydir_char_t *path)
 
bool glob_match (const std::string &pattern, const std::string &str)
 
template<typename DataProxy >
std::vector< doublecalculate_amplitude_normalizers (const DataProxy &data, int fcol_idx, const Binner &binner)
 
GEMMI_DLL Mat33 eigen_decomposition (const SMat33< double > &A, double(&d)[3])
 
bool is_hydrogen (El el)
 
bool is_metal (El el)
 
double molecular_weight (El el)
 
float covalent_radius (El el)
 
float vdw_radius (El el)
 
const charelement_name (El el)
 
elname_telement_uppercase_name (El el)
 
El find_element (const char *symbol)
 
const charentity_type_to_string (EntityType entity_type)
 
EntityType entity_type_from_string (const std::string &t)
 
const charpolymer_type_to_string (PolymerType polymer_type)
 
PolymerType polymer_type_from_string (const std::string &t)
 
const charconnection_type_to_string (Connection::Type t)
 
Connection::Type connection_type_from_string (const std::string &t)
 
std::string software_classification_to_string (SoftwareItem::Classification c)
 
SoftwareItem::Classification software_classification_from_string (const std::string &str)
 
void fail (const std::string &msg)
 
template<typename T , typename... Args>
void fail (std::string &&str, T &&arg1, Args &&... args)
 
GEMMI_COLD void fail (const char *msg)
 
GEMMI_COLD void sys_fail (const std::string &msg)
 
GEMMI_COLD void sys_fail (const char *msg)
 
void unreachable ()
 
std::string path_basename (const std::string &path, std::initializer_list< const char * > exts)
 
fileptr_t file_open (const char *path, const char *mode)
 
fileptr_t file_open_or (const char *path, const char *mode, std::FILE *dash_stream)
 
std::size_t file_size (std::FILE *f, const std::string &path)
 
bool is_little_endian ()
 
void swap_two_bytes (void *start)
 
void swap_four_bytes (void *start)
 
void swap_eight_bytes (void *start)
 
CharArray read_file_into_buffer (const std::string &path)
 
CharArray read_stdin_into_buffer ()
 
template<typename T >
CharArray read_into_buffer (T &&input)
 
void mask_nodes_above_threshold (Grid< std::int8_t > &mask, const Grid< float > &grid, double threshold, bool negate=false)
 
Grid< std::int8_t > flood_fill_above (const Grid< float > &grid, const std::vector< Position > &seeds, double threshold, bool negate=false)
 
float unsafe_expapprox (float x)
 
template<typename Real >
Real pow15 (Real x)
 
template<typename T >
double phase_in_angles (const std::complex< T > &v)
 
void add_asu_f_phi_to_float_vector (std::vector< float > &float_data, const AsuData< std::complex< float > > &asu_data)
 
template<typename DataProxy >
std::array< int, 3 > get_size_for_hkl (const DataProxy &data, std::array< int, 3 > min_size, double sample_rate)
 
template<typename DataProxy >
bool data_fits_into (const DataProxy &data, std::array< int, 3 > size)
 
template<typename T >
void add_friedel_mates (ReciprocalGrid< T > &grid)
 
template<typename T , typename DataProxy >
void initialize_hkl_grid (ReciprocalGrid< T > &grid, const DataProxy &data, std::array< int, 3 > size, bool half_l, AxisOrder axis_order)
 
template<typename T , typename FPhi >
FPhiGrid< Tget_f_phi_on_grid (const FPhi &fphi, std::array< int, 3 > size, bool half_l, AxisOrder axis_order=AxisOrder::XYZ)
 
template<typename T , typename DataProxy >
ReciprocalGrid< Tget_value_on_grid (const DataProxy &data, size_t column, std::array< int, 3 > size, bool half_l, AxisOrder axis_order=AxisOrder::XYZ)
 
template<typename T >
Grid< Ttransform_f_phi_grid_to_map (FPhiGrid< T > &&hkl)
 
template<typename T , typename FPhi >
Grid< Ttransform_f_phi_to_map (const FPhi &fphi, std::array< int, 3 > size, double sample_rate, bool exact_size=false, AxisOrder order=AxisOrder::XYZ)
 
template<typename T , typename FPhi >
Grid< Ttransform_f_phi_to_map2 (const FPhi &fphi, std::array< int, 3 > min_size, double sample_rate, std::array< int, 3 > exact_size, AxisOrder order=AxisOrder::XYZ)
 
template<typename T >
FPhiGrid< Ttransform_map_to_f_phi (const Grid< T > &map, bool half_l, bool use_scale=true)
 
void cromer_liberman_for_array (int z, int npts, const double *energy, double *fp, double *fpp)
 
double cromer_liberman (int z, double energy, double *fpp)
 
template<typename Iter >
void add_cl_fprime_for_all_elements (Iter out, double energy)
 
template<typename T >
void open_stream_from_utf8_path (T &ptr, const std::string &filename)
 
int modulo (int a, int n)
 
bool has_small_factorization (int n)
 
int round_with_small_factorization (double exact, GridSizeRounding rounding)
 
std::array< int, 3 > good_grid_size (const std::array< double, 3 > &limit, GridSizeRounding rounding, const SpaceGroup *sg)
 
void check_grid_factors (const SpaceGroup *sg, std::array< int, 3 > size)
 
double cubic_interpolation (double u, double a, double b, double c, double d)
 Catmull–Rom spline interpolation.
 
double cubic_interpolation_der (double u, double a, double b, double c, double d)
 df/du (from Wolfram Alpha)
 
template<typename T >
Correlation calculate_correlation (const GridBase< T > &a, const GridBase< T > &b)
 
size_t estimate_uncompressed_size (const std::string &path)
 
size_t big_gzread (gzFile file, void *buf, size_t len)
 
template<typename Input >
size_t copy_line_from_stream (char *line, int size, Input &&in)
 
SmallStructure::Site atom_to_site (const Atom &atom, const UnitCell &cell)
 
SmallStructure mx_to_sx_structure (const Structure &st, int n=0)
 
void jordan_solve (std::vector< double > &a, std::vector< double > &b)
 This function solves a set of linear algebraic equations using Gauss-Jordan elimination with partial pivoting.
 
void debug_print (const std::string &, std::vector< double > &)
 
constexpr double pi ()
 
constexpr double hc ()
 
constexpr double bohrradius ()
 
constexpr double mott_bethe_const ()
 
constexpr double u_to_b ()
 
constexpr double deg (double angle)
 
constexpr double rad (double angle)
 
constexpr float sq (float x)
 
constexpr double sq (double x)
 
int iround (double d)
 
double angle_abs_diff (double a, double b, double full=360.0)
 
Vec3 operator* (double d, const Vec3 &v)
 
Vec3 rotate_about_axis (const Vec3 &v, const Vec3 &axis, double theta)
 Rodrigues' rotation formula: rotate vector v about given axis of rotation (which must be a unit vector) by given angle (in radians).
 
std::string miller_str (const Miller &hkl)
 
bool parse_voigt_notation (const char *start, const char *end, SMat33< double > &b)
 
bool read_staraniso_b_from_mmcif (const cif::Block &block, SMat33< double > &output)
 
std::string read_staraniso_b_from_mtz (const Mtz &mtz, SMat33< double > &output)
 
bool is_polypeptide (PolymerType pt)
 
bool is_polynucleotide (PolymerType pt)
 
GEMMI_DLL Structure make_structure_from_block (const cif::Block &block)
 
Structure make_structure (cif::Document &&doc, cif::Document *save_doc=nullptr)
 
void copy_transform_to_mmdb (const Transform &tr, mmdb::mat33 &mat, mmdb::vect3 &vec)
 
template<int N>
void strcpy_to_mmdb (char(&dest)[N], const std::string &src)
 
void set_seqid_in_mmdb (int *seqnum, mmdb::InsCode &icode, SeqId seqid)
 
mmdb::Manager * copy_to_mmdb (const Structure &st, mmdb::Manager *manager)
 
Atom copy_atom_from_mmdb (mmdb::Atom &m_atom)
 
Residue copy_residue_from_mmdb (mmdb::Residue &m_res)
 
Chain copy_chain_from_mmdb (mmdb::Chain &m_chain)
 
Model copy_model_from_mmdb (mmdb::Model &m_model)
 
Structure copy_from_mmdb (mmdb::Manager *manager)
 
CoorFormat coor_format_from_ext (const std::string &path)
 
CoorFormat coor_format_from_content (const char *buf, const char *end)
 
Structure make_structure_from_doc (cif::Document &&doc, bool possible_chemcomp, cif::Document *save_doc=nullptr)
 
Structure read_structure_from_char_array (char *data, size_t size, const std::string &path, cif::Document *save_doc=nullptr)
 
template<typename T >
Structure read_structure (T &&input, CoorFormat format=CoorFormat::Unknown, cif::Document *save_doc=nullptr)
 
Structure read_structure_file (const std::string &path, CoorFormat format=CoorFormat::Unknown)
 
GEMMI_DLL Structure read_structure_gz (const std::string &path, CoorFormat format=CoorFormat::Unknown, cif::Document *save_doc=nullptr)
 
GEMMI_DLL Structure read_pdb_gz (const std::string &path, PdbReadOptions options=PdbReadOptions())
 
GEMMI_DLL CoorFormat coor_format_from_ext_gz (const std::string &path)
 
template<class T >
void remove_empty_children (T &obj)
 
bool is_same_conformer (char altloc1, char altloc2)
 
std::string atom_str (const Chain &chain, const ResidueId &res_id, const Atom &atom)
 
std::string atom_str (const const_CRA &cra)
 
bool atom_matches (const const_CRA &cra, const AtomAddress &addr, bool ignore_segment=false)
 
AtomAddress make_address (const Chain &ch, const Residue &res, const Atom &at)
 
Entityfind_entity_of_subchain (const std::string &subchain_id, std::vector< Entity > &entities)
 
const Entityfind_entity_of_subchain (const std::string &subchain_id, const std::vector< Entity > &entities)
 
template<class T >
void remove_alternative_conformations (T &obj)
 Remove alternative conformations.
 
template<>
void remove_alternative_conformations (Chain &chain)
 
template<class T >
void remove_hydrogens (T &obj)
 Remove hydrogens.
 
template<>
void remove_hydrogens (Residue &res)
 
template<class T >
void assign_b_iso (T &obj, float b_min, float b_max)
 Set isotropic ADP to the range (b_min, b_max).
 
template<>
void assign_b_iso (Atom &atom, float b_min, float b_max)
 
template<class T >
void remove_anisou (T &obj)
 Remove anisotropic ADP.
 
template<>
void remove_anisou (Atom &atom)
 
template<class T >
void ensure_anisou (T &obj)
 Set absent ANISOU to value from B_iso.
 
template<>
void ensure_anisou (Atom &atom)
 
template<class T >
void transform_pos_and_adp (T &obj, const Transform &tr)
 apply Transform to both atom's position and ADP
 
template<>
void transform_pos_and_adp (Atom &atom, const Transform &tr)
 
void assign_serial_numbers (Model &model, bool numbered_ter=false)
 set atom site serial numbers to 1, 2, ..., optionally leaving gaps for TERs
 
void assign_serial_numbers (Structure &st, bool numbered_ter=false)
 
template<typename Func >
void process_addresses (Structure &st, Func func)
 
void rename_chain (Structure &st, const std::string &old_name, const std::string &new_name)
 
void rename_atom_names (Structure &st, const std::string &res_name, const std::map< std::string, std::string > &old_new)
 
void replace_d_fraction_with_altlocs (Residue &res)
 
bool replace_deuterium_with_fraction (Residue &res)
 
void store_deuterium_as_fraction (Structure &st, bool store_fraction)
 Hydrogens modelled as H/D mixture (altlocs H and D with the same position and ADP, but with refined fraction of D), it can be stored in mmCIF either as two atoms (H and D) or, using CCP4/Refmac extension, as H atoms with the ccp4_deuterium_fraction parameter.
 
void standardize_crystal_frame (Structure &st)
 Convert coordinates to the standard coordinate system for the unit cell.
 
void add_distinct_altlocs (const Residue &res, std::string &altlocs)
 
bool atom_match_with_alias (const std::string &atom_id, const std::string &atom, const ChemComp::Aliasing *aliasing)
 
MonLib read_monomer_lib (const std::string &monomer_dir, const std::vector< std::string > &resnames, read_cif_func read_cif, const std::string &libin="", bool ignore_missing=false)
 
template<typename T , typename FP = typename std::iterator_traits<T>::value_type>
std::array< FP, 2 > calculate_min_max_disregarding_nans (T begin, T end)
 
Mtz read_mtz_file (const std::string &path)
 
template<typename Input >
Mtz read_mtz (Input &&input, bool with_data)
 
MtzDataProxy data_proxy (const Mtz &mtz)
 
GEMMI_DLL void write_staraniso_b_in_mmcif (const SMat33< double > &b, const std::string &entry_id, char *buf, std::ostream &os)
 
GEMMI_DLL void remove_appendix_from_column_names (Mtz &mtz, std::ostream &out)
 remove '_dataset_name' that can be appended to column names in ccp4i
 
GEMMI_DLL bool validate_merged_mtz_deposition_columns (const Mtz &mtz, std::ostream &out)
 
GEMMI_DLL bool validate_merged_intensities (Intensities &mi, Intensities &ui, bool relaxed_check, std::ostream &out)
 
Structure read_pdb_file (const std::string &path, PdbReadOptions options=PdbReadOptions())
 
Structure read_pdb_from_memory (const char *data, size_t size, const std::string &name, PdbReadOptions options=PdbReadOptions())
 
Structure read_pdb_string (const std::string &str, const std::string &name, PdbReadOptions options=PdbReadOptions())
 
template<typename T >
Structure read_pdb (T &&input, PdbReadOptions options=PdbReadOptions())
 
bool is_pdb_code (const std::string &str)
 
std::string expand_pdb_code_to_path (const std::string &code, char type, bool throw_if_unset=false)
 Call it after checking the code with gemmi::is_pdb_code(code).
 
std::string expand_if_pdb_code (const std::string &input, char type='M')
 
bool is_pir_format (const std::string &s)
 
std::vector< FastaSeqread_pir_or_fasta (const std::string &str)
 
GEMMI_DLL PolymerType check_polymer_type (const ConstResidueSpan &span, bool ignore_entity_type=false)
 
PolymerType get_or_check_polymer_type (const Entity *ent, const ConstResidueSpan &polymer)
 
std::vector< AtomNameElementget_mainchain_atoms (PolymerType ptype)
 
bool in_peptide_bond_distance (const Atom *a1, const Atom *a2)
 distance-based check for peptide bond
 
bool have_peptide_bond (const Residue &r1, const Residue &r2)
 
bool in_nucleotide_bond_distance (const Atom *a1, const Atom *a2)
 distance-based check for phosphodiester bond between nucleotide
 
bool have_nucleotide_bond (const Residue &r1, const Residue &r2)
 
bool are_connected (const Residue &r1, const Residue &r2, PolymerType ptype)
 check C-N or O3'-P distance
 
bool are_connected2 (const Residue &r1, const Residue &r2, PolymerType ptype)
 are_connected2() is less exact, but requires only CA (or P) atoms.
 
bool are_connected3 (const Residue &r1, const Residue &r2, PolymerType ptype)
 are_connected3() = are_connected() + fallback to are_connected2()
 
std::string make_one_letter_sequence (const ConstResidueSpan &polymer)
 
GEMMI_DLL void add_entity_types (Chain &chain, bool overwrite)
 Assigns entity_type=Polymer|NonPolymer|Water for each Residue (only for residues with entity_type==Unknown, unless overwrite=true).
 
GEMMI_DLL void add_entity_types (Structure &st, bool overwrite)
 
GEMMI_DLL void remove_entity_types (Structure &st)
 Assigns entity_type=Unknown for all residues.
 
GEMMI_DLL void add_entity_ids (Structure &st, bool overwrite)
 Assigns Residue::entity_id based on Residue::subchain and Entity::subchains.
 
GEMMI_DLL void assign_subchain_names (Chain &chain, int &nonpolymer_counter)
 The subchain field in the residue is where we store_atom_site.label_asym_id from mmCIF files.
 
GEMMI_DLL void assign_subchains (Structure &st, bool force, bool fail_if_unknown=true)
 
GEMMI_DLL void ensure_entities (Structure &st)
 
GEMMI_DLL void deduplicate_entities (Structure &st)
 
void setup_entities (Structure &st)
 
template<class T >
void remove_waters (T &obj)
 
template<>
void remove_waters (Chain &ch)
 
template<class T >
void remove_ligands_and_waters (T &obj)
 
template<>
void remove_ligands_and_waters (Chain &ch)
 
bool trim_to_alanine (Residue &res)
 
void trim_to_alanine (Chain &chain)
 
GEMMI_DLL void change_ccd_code (Structure &st, const std::string &old, const std::string &new_)
 
GEMMI_DLL void shorten_ccd_codes (Structure &st)
 
void restore_full_ccd_codes (Structure &st)
 
double qcp_inner_product (Mat33 &mat, const Position *pos1, const Position &ctr1, const Position *pos2, const Position &ctr2, size_t len, const double *weight)
 
int fast_calc_rmsd_and_rotation (Mat33 *rot, const Mat33 &A, double *rmsd, double E0, double len, double min_score)
 
Position qcp_calculate_center (const Position *pos, size_t len, const double *weight)
 
SupResult superpose_positions (const Position *pos1, const Position *pos2, size_t len, const double *weight)
 
double calculate_rmsd_of_superposed_positions (const Position *pos1, const Position *pos2, size_t len, const double *weight)
 
GEMMI_DLL cif::Document read_cif_gz (const std::string &path)
 
GEMMI_DLL cif::Document read_mmjson_gz (const std::string &path)
 
GEMMI_DLL CharArray read_into_buffer_gz (const std::string &path)
 
GEMMI_DLL cif::Document read_cif_from_buffer (const CharArray &buffer, const char *name)
 
GEMMI_DLL cif::Document read_first_block_gz (const std::string &path, size_t limit)
 
cif::Document read_cif_or_mmjson_gz (const std::string &path)
 
Ccp4< floatread_ccp4_map (const std::string &path, bool setup)
 
Ccp4< int8_tread_ccp4_mask (const std::string &path, bool setup)
 
signed char friedel_mate_value (signed char v)
 
float friedel_mate_value (float v)
 
double friedel_mate_value (double v)
 
template<typename T >
std::complex< Tfriedel_mate_value (const std::complex< T > &v)
 
template<typename Func >
void for_all_reflections (Func func, const UnitCell &cell, const SpaceGroup *spacegroup, double dmin, double dmax=0., bool unique=true)
 
int count_reflections (const UnitCell &cell, const SpaceGroup *spacegroup, double dmin, double dmax=0., bool unique=true)
 
std::vector< Millermake_miller_vector (const UnitCell &cell, const SpaceGroup *spacegroup, double dmin, double dmax=0., bool unique=true)
 
std::vector< ReflnBlockas_refln_blocks (std::vector< cif::Block > &&blocks)
 
ReflnBlock get_refln_block (std::vector< cif::Block > &&blocks, const std::vector< std::string > &labels, const char *block_name=nullptr)
 
ReflnBlock hkl_cif_as_refln_block (cif::Block &block)
 
ReflnDataProxy data_proxy (const ReflnBlock &rb)
 
int remark_number (const std::string &remark)
 
void read_metadata_from_remarks (Structure &st)
 
std::vector< Opread_remark_290 (const std::vector< std::string > &raw_remarks)
 
GEMMI_DLL ResidueInfo find_tabulated_residue (const std::string &name)
 
const charexpand_one_letter (char c, ResidueKind kind)
 kind can be AA, RNA or DNA
 
GEMMI_DLL std::vector< std::string > expand_one_letter_sequence (const std::string &seq, ResidueKind kind)
 kind can be AA, RNA or DNA
 
const charexpand_protein_one_letter (char c)
 
std::vector< std::string > expand_protein_one_letter_string (const std::string &s)
 
GEMMI_DLL void place_hydrogens_on_all_atoms (Topo &topo)
 
void adjust_hydrogen_distances (Topo &topo, Restraints::DistanceOf of, double default_scale=1.)
 
double vec6_dot (const Vec6 &a, const SMat33< double > &s)
 
std::vector< Vec6adp_symmetry_constraints (const SpaceGroup *sg)
 Symmetry constraints of ADP.
 
template<class T >
size_t count_atom_sites (const T &obj, const Selection *sel=nullptr)
 
template<>
size_t count_atom_sites (const Atom &atom, const Selection *sel)
 
template<class T >
double count_occupancies (const T &obj, const Selection *sel=nullptr)
 
template<>
double count_occupancies (const Atom &atom, const Selection *sel)
 
AlignmentResult align_sequences (const std::vector< std::uint8_t > &query, const std::vector< std::uint8_t > &target, const std::vector< int > &target_gapo, std::uint8_t m, const AlignmentScoring &scoring)
 All values in query and target must be less then m.
 
AlignmentResult align_string_sequences (const std::vector< std::string > &query, const std::vector< std::string > &target, const std::vector< int > &target_gapo, const AlignmentScoring *scoring)
 
std::string atom_str (const std::string &chain_name, const ResidueId &res_id, const std::string &atom_name, char altloc)
 
constexpr double h2o_weight ()
 
double calculate_sequence_weight (const std::vector< std::string > &seq, double unknown=0.)
 
std::string one_letter_code (const std::vector< std::string > &seq)
 
std::string pdbx_one_letter_code (const std::vector< std::string > &seq, ResidueKind kind)
 Returns the format used in _entity_poly.pdbx_seq_one_letter_code, in which non-standard amino acids/nucleotides are represented by CCD codes in parenthesis, e.g.
 
ResidueKind sequence_kind (PolymerType ptype)
 used with expand_one_letter_sequence()
 
std::complex< doublecalculate_sf_part (const Fractional &fpos, const Miller &hkl)
 
template<typename T >
void split_element_and_charge (const std::string &label, T *dest)
 
SmallStructure make_small_structure_from_block (const cif::Block &block_)
 
cif::Block make_cif_block_from_small_structure (const SmallStructure &st)
 
float cctbx_vdw_radius (El el)
 
float refmac_radius_for_bulk_solvent (El el)
 
template<typename T >
void mask_points_in_constant_radius (Grid< T > &mask, const Model &model, double radius, T value, bool ignore_hydrogen, bool ignore_zero_occupancy_atoms)
 
template<typename T >
void mask_points_in_varied_radius (Grid< T > &mask, const Model &model, AtomicRadiiSet atomic_radii_set, double r_probe, T value, bool ignore_hydrogen, bool ignore_zero_occupancy_atoms)
 
template<typename T >
void set_margin_around (Grid< T > &mask, double r, T value, T margin_value)
 
template<typename T >
void interpolate_grid (Grid< T > &dest, const Grid< T > &src, const Transform &tr, int order=2)
 
void mask_with_node_info (Grid< NodeInfo > &mask, const Model &model, double radius)
 Populate NodeInfo grid for nodes near the model.
 
void unmask_symmetry_mates (Grid< NodeInfo > &mask)
 Skip nodes that are closer to a symmetry mate of the model than to the original model.
 
template<typename T >
void interpolate_grid_of_aligned_model2 (Grid< T > &dest, const Grid< T > &src, const Transform &tr, const Model &dest_model, double radius, int order=2)
 
template<typename T >
void add_soft_edge_to_mask (Grid< T > &grid, double width)
 
GEMMI_DLL int snprintf_z (char *buf, int count, char const *fmt,...) GEMMI_ATTRIBUTE_FORMAT(3
 stb_snprintf in gemmi namespace - like snprintf, but ignores locale and is always zero-terminated (hence _z).
 
GEMMI_DLL int GEMMI_DLL int sprintf_z (char *buf, char const *fmt,...) GEMMI_ATTRIBUTE_FORMAT(2
 stb_sprintf in gemmi namespace
 
GEMMI_DLL int GEMMI_DLL int std::string to_str (double d)
 
std::string to_str (float d)
 
template<int Prec>
std::string to_str_prec (double d)
 
charto_chars_z (char *first, char *last, int value)
 zero-terminated to_chars()
 
charto_chars_z (char *first, char *last, size_t value)
 
template<typename T >
DataStats calculate_data_statistics (const std::vector< T > &data)
 
bool operator== (const Op &a, const Op &b)
 
bool operator!= (const Op &a, const Op &b)
 
Op operator* (const Op &a, const Op &b)
 
Opoperator*= (Op &a, const Op &b)
 
Op seitz_to_op (const std::array< std::array< double, 4 >, 4 > &t)
 
int interpret_miller_character (char c, const std::string &s)
 
std::array< int, 4 > parse_triplet_part (const std::string &s)
 
Op parse_triplet (const std::string &s)
 
std::string make_triplet_part (const std::array< int, 3 > &xyz, int w, char style='x')
 
std::vector< Op::Trancentring_vectors (char centring_type)
 
GroupOps split_centering_vectors (const std::vector< Op > &ops)
 
Op::Rot hall_rotation_z (int N)
 
Op::Tran hall_translation_from_symbol (char symbol)
 
Op hall_matrix_symbol (const char *start, const char *end, int pos, int &prev)
 
Op parse_hall_change_of_basis (const char *start, const char *end)
 
GroupOps generators_from_hall (const char *hall)
 
GroupOps symops_from_hall (const char *hall)
 
const charcrystal_system_str (CrystalSystem system)
 
const charpoint_group_hm (PointGroup pg)
 
Laue pointgroup_to_laue (PointGroup pg)
 
PointGroup laue_to_pointgroup (Laue laue)
 
const charlaue_class_str (Laue laue)
 
CrystalSystem crystal_system (Laue laue)
 
CrystalSystem crystal_system (PointGroup pg)
 
unsigned char point_group_index_and_category (int space_group_number)
 
PointGroup point_group (int space_group_number)
 
bool is_sohncke (int space_group_number)
 
bool is_enantiomorphic (int space_group_number)
 
bool is_symmorphic (int space_group_number)
 
Op::Tran nonzero_inversion_center (int space_group_number)
 Inversion center of the Euclidean normalizer that is not at the origin of reference settings.
 
const charget_basisop (int basisop_idx)
 
Op::Rot centred_to_primitive (char centring_type)
 
const SpaceGroupfind_spacegroup_by_number (int ccp4) noexcept
 
const SpaceGroupget_spacegroup_by_number (int ccp4)
 
const SpaceGroupget_spacegroup_reference_setting (int number)
 
const SpaceGroupfind_spacegroup_by_name (std::string name, double alpha=0., double gamma=0.) noexcept
 
const SpaceGroupget_spacegroup_by_name (const std::string &name)
 
const SpaceGroupget_spacegroup_p1 ()
 
const SpaceGroupfind_spacegroup_by_ops (const GroupOps &gops)
 
void add_chemcomp_to_block (const ChemComp &cc, cif::Block &block)
 
void write_mmjson_to_stream (std::ostream &os, const Document &doc)
 
GEMMI_DLL void update_mmcif_block (const Structure &st, cif::Block &block, MmcifOutputGroups groups=MmcifOutputGroups(true))
 
GEMMI_DLL cif::Document make_mmcif_document (const Structure &st, MmcifOutputGroups groups=MmcifOutputGroups(true))
 
GEMMI_DLL cif::Block make_mmcif_block (const Structure &st, MmcifOutputGroups groups=MmcifOutputGroups(true))
 
GEMMI_DLL cif::Block make_mmcif_headers (const Structure &st)
 
GEMMI_DLL void add_minimal_mmcif_data (const Structure &st, cif::Block &block)
 
GEMMI_DLL void write_struct_conn (const Structure &st, cif::Block &block)
 
GEMMI_DLL void write_cispeps (const Structure &st, cif::Block &block)
 
GEMMI_DLL void write_pdb (const Structure &st, std::ostream &os, PdbWriteOptions opt=PdbWriteOptions())
 
GEMMI_DLL std::string make_pdb_string (const Structure &st, PdbWriteOptions opt=PdbWriteOptions())
 
void write_minimal_pdb (const Structure &st, std::ostream &os)
 
std::string make_pdb_headers (const Structure &st)
 
GEMMI_DLL std::unique_ptr< Topoprepare_topology (Structure &st, MonLib &monlib, size_t model_index, HydrogenChange h_change, bool reorder, std::ostream *warnings=nullptr, bool ignore_unknown_links=false, bool use_cispeps=false)
 
GEMMI_DLL std::unique_ptr< ChemCompmake_chemcomp_with_restraints (const Residue &res)
 
GEMMI_DLL std::vector< AtomAddressfind_missing_atoms (const Topo &topo, bool including_hydrogen=false)
 
double calculate_cos_obliquity (const UnitCell &reduced_cell, const Vec3 &d_axis, const Vec3 &r_axis)
 
std::vector< OpObliquityfind_lattice_2fold_ops (const UnitCell &reduced_cell, double max_obliq)
 
GroupOps find_lattice_symmetry_r (const UnitCell &reduced_cell, double max_obliq)
 
GroupOps find_lattice_symmetry (const UnitCell &cell, char centring, double max_obliq)
 
std::vector< Opfind_twin_laws (const UnitCell &cell, const SpaceGroup *sg, double max_obliq, bool all_ops)
 
Mat33 rot_as_mat33 (const Op::Rot &rot)
 
Mat33 rot_as_mat33 (const Op &op)
 
Vec3 tran_as_vec3 (const Op &op)
 
Position operator* (double d, const Position &v)
 
std::wstring UTF8_to_wchar (const char *in)
 
std::string wchar_to_UTF8 (const wchar_t *in)
 
void append_to_str (std::string &out, int v)
 
void append_to_str (std::string &out, size_t v)
 
template<typename T >
void append_to_str (std::string &out, const T &v)
 
void cat_to (std::string &)
 
template<typename T , typename... Args>
void cat_to (std::string &out, const T &value, Args const &... args)
 
template<class... Args>
std::string cat (Args const &... args)
 
bool starts_with (const std::string &str, const std::string &prefix)
 
template<size_t N>
bool starts_with (const char *a, const char(&b)[N])
 
bool ends_with (const std::string &str, const std::string &suffix)
 
char lower (char c)
 
char alpha_up (char c)
 
std::string to_lower (std::string str)
 
std::string to_upper (std::string str)
 
bool isame (char a, char b)
 
bool iequal_from (const std::string &str, size_t offset, const std::string &low)
 
bool iequal (const std::string &str, const std::string &low)
 
bool istarts_with (const std::string &str, const std::string &prefix)
 
bool iends_with (const std::string &str, const std::string &suffix)
 
bool giends_with (const std::string &str, const std::string &suffix)
 
std::string trim_str (const std::string &str)
 
std::string rtrim_str (const std::string &str)
 
const charrtrim_cstr (const char *start, const char *end=nullptr)
 
template<typename S >
void split_str_into (const std::string &str, S sep, std::vector< std::string > &result)
 
template<typename S >
std::vector< std::string > split_str (const std::string &str, S sep)
 
void split_str_into_multi (const std::string &str, const char *seps, std::vector< std::string > &result)
 
std::vector< std::string > split_str_multi (const std::string &str, const char *seps=" \t")
 
template<typename T , typename S , typename F >
std::string join_str (T begin, T end, const S &sep, const F &getter)
 
template<typename T , typename S >
std::string join_str (T begin, T end, const S &sep)
 
template<typename T , typename S , typename F >
std::string join_str (const T &iterable, const S &sep, const F &getter)
 
template<typename T , typename S >
std::string join_str (const T &iterable, const S &sep)
 
template<typename T , typename S >
void string_append_sep (std::string &str, S sep, const T &item)
 
void replace_all (std::string &s, const std::string &old, const std::string &new_)
 
bool is_in_list (const std::string &name, const std::string &list, char sep=',')
 
template<class T >
bool in_vector (const T &x, const std::vector< T > &v)
 
template<typename F , typename T >
bool in_vector_f (F f, const std::vector< T > &v)
 
template<class T >
Tvector_end_ptr (std::vector< T > &v)
 
template<class T >
const Tvector_end_ptr (const std::vector< T > &v)
 
template<class T >
void vector_move_extend (std::vector< T > &dst, std::vector< T > &&src)
 
template<class T , typename F >
void vector_remove_if (std::vector< T > &v, F &&condition)
 
template<class T >
void vector_insert_columns (std::vector< T > &data, size_t old_width, size_t length, size_t n, size_t pos, T new_value)
 
template<class T >
void vector_remove_column (std::vector< T > &data, size_t new_width, size_t pos)
 
constexpr int ialpha4_id (const char *s)
 
constexpr int ialpha3_id (const char *s)
 
bool likely_in_house_source (double wavelength)
 
template<size_t N>
bool starts_with_ptr (const char *a, const char(&b)[N], const char **endptr)
 
template<size_t N>
bool starts_with_ptr_b (const char *a, const char(&b)[N], const char **endptr)
 
const charparse_number_into (const char *start, const char *end, double &val, const char *line)
 
template<int N>
void parse_numbers_into_array (const char *start, const char *end, double(&arr)[N], const char *line)
 
XdsAscii read_xds_ascii_file (const std::string &path)
 

Typedef Documentation

◆ CifWalk

using gemmi::CifWalk = typedef DirWalk<true, impl::IsCifFile>

Definition at line 247 of file dirwalk.hpp.

◆ MmCifWalk

using gemmi::MmCifWalk = typedef DirWalk<true, impl::IsMmCifFile>

Definition at line 248 of file dirwalk.hpp.

◆ PdbWalk

using gemmi::PdbWalk = typedef DirWalk<true, impl::IsPdbFile>

Definition at line 249 of file dirwalk.hpp.

◆ CoorFileWalk

using gemmi::CoorFileWalk = typedef DirWalk<true, impl::IsCoordinateFile>

Definition at line 250 of file dirwalk.hpp.

◆ elname_t

typedef const char gemmi::elname_t[3]

Definition at line 193 of file elem.hpp.

◆ fileptr_t

typedef std::unique_ptr<std::FILE, decltype(&std::fclose)> gemmi::fileptr_t

Definition at line 37 of file fileutil.hpp.

◆ StrideIter

Definition at line 71 of file iterator.hpp.

◆ IndirectIter

Definition at line 94 of file iterator.hpp.

◆ UniqIter

Definition at line 126 of file iterator.hpp.

◆ GroupingIter

Definition at line 177 of file iterator.hpp.

◆ FilterIter

Definition at line 204 of file iterator.hpp.

◆ Vec3

Definition at line 101 of file math.hpp.

◆ Vec3f

Definition at line 102 of file math.hpp.

◆ AtomGroup

Definition at line 173 of file model.hpp.

◆ ConstAtomGroup

Definition at line 174 of file model.hpp.

◆ CraProxy

using gemmi::CraProxy = typedef CraProxy_<CRA, std::vector<Chain>&>

Definition at line 694 of file model.hpp.

◆ ConstCraProxy

using gemmi::ConstCraProxy = typedef CraProxy_<const_CRA, const std::vector<Chain>&>

Definition at line 695 of file model.hpp.

◆ read_cif_func

typedef cif::Document(* gemmi::read_cif_func) (const std::string &)

Definition at line 21 of file monlib.hpp.

◆ FPhiGrid

template<typename T >
using gemmi::FPhiGrid = typedef ReciprocalGrid<std::complex<T> >

Definition at line 170 of file recgrid.hpp.

◆ Vec6

using gemmi::Vec6 = typedef std::array<double, 6>

Definition at line 13 of file scaling.hpp.

◆ spacegroup_tables

Definition at line 1876 of file symmetry.hpp.

◆ OpObliquity

Definition at line 128 of file twin.hpp.

◆ Miller

using gemmi::Miller = typedef std::array<int, 3>

A synonym for convenient passing of hkl.

Definition at line 128 of file unitcell.hpp.

Enumeration Type Documentation

◆ SupSelect

Enumerator
CaP 
MainChain 
All 

Definition at line 164 of file align.hpp.

◆ HowToNameCopiedChain

Enumerator
Short 
AddNumber 
Dup 

Definition at line 16 of file assembly.hpp.

◆ MapSetup

Enumerator
Full 
NoSymmetry 
ReorderOnly 

Definition at line 28 of file ccp4.hpp.

◆ BondType

Enumerator
Unspec 
Single 
Double 
Triple 
Aromatic 
Deloc 
Metal 

Definition at line 20 of file chemcomp.hpp.

◆ ChiralityType

Enumerator
Positive 
Negative 
Both 

Definition at line 23 of file chemcomp.hpp.

◆ ChemCompModel

Enumerator
Xyz 
Example 
Ideal 

Definition at line 17 of file chemcomp_xyz.hpp.

◆ El

Enumerator
He 
Li 
Be 
Ne 
Na 
Mg 
Al 
Si 
Cl 
Ar 
Ca 
Sc 
Ti 
Cr 
Mn 
Fe 
Co 
Ni 
Cu 
Zn 
Ga 
Ge 
As 
Se 
Br 
Kr 
Rb 
Sr 
Zr 
Nb 
Mo 
Tc 
Ru 
Rh 
Pd 
Ag 
Cd 
In 
Sn 
Sb 
Te 
Xe 
Cs 
Ba 
La 
Ce 
Pr 
Nd 
Pm 
Sm 
Eu 
Gd 
Tb 
Dy 
Ho 
Er 
Tm 
Yb 
Lu 
Hf 
Ta 
Re 
Os 
Ir 
Pt 
Au 
Hg 
Tl 
Pb 
Bi 
Po 
At 
Rn 
Fr 
Ra 
Ac 
Th 
Pa 
Np 
Pu 
Am 
Cm 
Bk 
Cf 
Es 
Fm 
Md 
No 
Lr 
Rf 
Db 
Sg 
Bh 
Hs 
Mt 
Ds 
Rg 
Cn 
Nh 
Fl 
Mc 
Lv 
Ts 
Og 
END 

Definition at line 13 of file elem.hpp.

◆ AxisOrder

Order of grid axis.

Some Grid functionality works only with the XYZ order. The values XYZ and ZYX are used only when the grid covers whole unit cell.

Enumerator
Unknown 
XYZ 
ZYX 

Definition at line 25 of file grid.hpp.

◆ GridSizeRounding

Enumerator
Nearest 
Up 
Down 

Definition at line 32 of file grid.hpp.

◆ EntityType

Enumerator
Unknown 
Polymer 
NonPolymer 
Branched 
Water 

Definition at line 186 of file metadata.hpp.

◆ PolymerType

Enumerator
Unknown 
PeptideL 
PeptideD 
Dna 
Rna 
DnaRnaHybrid 
SaccharideD 
SaccharideL 
Pna 
CyclicPseudoPeptide 
Other 

Definition at line 197 of file metadata.hpp.

◆ CoorFormat

File format of a macromolecular model.

When passed to read_structure(): Unknown = guess format from the extension, Detect = guess format from the content.

Enumerator
Unknown 
Detect 
Pdb 
Mmcif 
Mmjson 
ChemComp 

Definition at line 80 of file model.hpp.

◆ CalcFlag

corresponds to _atom_site.calc_flag in mmCIF

Enumerator
NotSet 
NoHydrogen 
Determined 
Calculated 
Dummy 

Definition at line 83 of file model.hpp.

◆ DataType

Enumerator
Unknown 
Unmerged 
Mean 
Anomalous 

Definition at line 18 of file refln.hpp.

◆ ResidueKind

Enumerator
UNKNOWN 
AA 
AAD 
PAA 
MAA 
RNA 
DNA 
BUF 
HOH 
PYR 
KET 
ELS 

Definition at line 26 of file resinfo.hpp.

◆ AtomicRadiiSet

Enumerator
VanDerWaals 
Cctbx 
Refmac 
Constant 

Definition at line 14 of file solmask.hpp.

◆ CrystalSystem

Enumerator
Triclinic 
Monoclinic 
Orthorhombic 
Tetragonal 
Trigonal 
Hexagonal 
Cubic 

Definition at line 908 of file symmetry.hpp.

◆ PointGroup

Enumerator
C1 
Ci 
C2 
Cs 
C2h 
D2 
C2v 
D2h 
C4 
S4 
C4h 
D4 
C4v 
D2d 
D4h 
C3 
C3i 
D3 
C3v 
D3d 
C6 
C3h 
C6h 
D6 
C6v 
D3h 
D6h 
Th 
Td 
Oh 

Definition at line 920 of file symmetry.hpp.

◆ Laue

Enumerator
L1 
L2m 
Lmmm 
L4m 
L4mmm 
L3 
L3m 
L6m 
L6mmm 
Lm3 
Lm3m 

Definition at line 936 of file symmetry.hpp.

◆ HydrogenChange

Enumerator
NoChange 
Shift 
Remove 
ReAdd 
ReAddButWater 
ReAddKnown 

Definition at line 19 of file topo.hpp.

◆ Asu

Enumerator
Same 
Different 
Any 

Definition at line 76 of file unitcell.hpp.

Function Documentation

◆ prepare_target_gapo()

std::vector< int > gemmi::prepare_target_gapo ( const ConstResidueSpan polymer,
PolymerType  polymer_type,
const AlignmentScoring scoring = nullptr 
)
inline

Definition at line 18 of file align.hpp.

◆ align_sequence_to_polymer()

AlignmentResult gemmi::align_sequence_to_polymer ( const std::vector< std::string > &  full_seq,
const ConstResidueSpan polymer,
PolymerType  polymer_type,
const AlignmentScoring scoring = nullptr 
)
inline

Definition at line 39 of file align.hpp.

◆ seqid_matches_seqres()

bool gemmi::seqid_matches_seqres ( const ConstResidueSpan polymer,
const Entity ent 
)
inline

Definition at line 71 of file align.hpp.

◆ clear_sequences()

void gemmi::clear_sequences ( Structure st)
inline

Definition at line 84 of file align.hpp.

◆ assign_best_sequences()

GEMMI_DLL void gemmi::assign_best_sequences ( Structure st,
const std::vector< std::string > &  fasta_sequences 
)

◆ assign_label_seq_to_polymer()

void gemmi::assign_label_seq_to_polymer ( ResidueSpan polymer,
const Entity ent,
bool  force 
)
inline

Definition at line 97 of file align.hpp.

◆ clear_label_seq_id()

void gemmi::clear_label_seq_id ( Structure st)
inline

Definition at line 144 of file align.hpp.

◆ assign_label_seq_id()

void gemmi::assign_label_seq_id ( Structure st,
bool  force 
)
inline

Definition at line 151 of file align.hpp.

◆ prepare_positions_for_superposition()

void gemmi::prepare_positions_for_superposition ( std::vector< Position > &  pos1,
std::vector< Position > &  pos2,
ConstResidueSpan  fixed,
ConstResidueSpan  movable,
PolymerType  ptype,
SupSelect  sel,
char  altloc = '\0',
std::vector< int > *  ca_offsets = nullptr 
)
inline

Definition at line 170 of file align.hpp.

◆ calculate_current_rmsd()

SupResult gemmi::calculate_current_rmsd ( ConstResidueSpan  fixed,
ConstResidueSpan  movable,
PolymerType  ptype,
SupSelect  sel,
char  altloc = '\0' 
)
inline

Definition at line 228 of file align.hpp.

◆ calculate_superposition()

SupResult gemmi::calculate_superposition ( ConstResidueSpan  fixed,
ConstResidueSpan  movable,
PolymerType  ptype,
SupSelect  sel,
int  trim_cycles = 0,
double  trim_cutoff = 2.0,
char  altloc = '\0' 
)
inline

Definition at line 244 of file align.hpp.

◆ calculate_superpositions_in_moving_window()

std::vector< SupResult > gemmi::calculate_superpositions_in_moving_window ( ConstResidueSpan  fixed,
ConstResidueSpan  movable,
PolymerType  ptype,
double  radius = 10.0 
)
inline

Definition at line 284 of file align.hpp.

◆ ensure_unique_chain_name()

void gemmi::ensure_unique_chain_name ( const Model model,
Chain chain 
)
inline

Definition at line 85 of file assembly.hpp.

◆ make_assembly()

GEMMI_DLL Model gemmi::make_assembly ( const Assembly assembly,
const Model model,
HowToNameCopiedChain  how,
std::ostream *  out 
)

◆ pseudo_assembly_for_unit_cell()

Assembly gemmi::pseudo_assembly_for_unit_cell ( const UnitCell cell)
inline

Definition at line 96 of file assembly.hpp.

◆ transform_to_assembly()

GEMMI_DLL void gemmi::transform_to_assembly ( Structure st,
const std::string &  assembly_name,
HowToNameCopiedChain  how,
std::ostream *  out,
bool  keep_spacegroup = false,
double  merge_dist = 0.2 
)

If called with assembly_name="unit_cell" changes structure to unit cell (P1).

keep_spacegroup preserves space group and unit cell - is it needed?

◆ expand_ncs_model()

GEMMI_DLL Model gemmi::expand_ncs_model ( const Model model,
const std::vector< NcsOp > &  ncs,
HowToNameCopiedChain  how 
)

◆ merge_atoms_in_expanded_model()

GEMMI_DLL void gemmi::merge_atoms_in_expanded_model ( Model model,
const UnitCell cell,
double  max_dist = 0.2,
bool  compare_serial = true 
)

Searches and merges overlapping equivalent atoms from different chains.

To be used after expand_ncs() and make_assembly().

◆ shorten_chain_names()

GEMMI_DLL void gemmi::shorten_chain_names ( Structure st)

◆ expand_ncs()

GEMMI_DLL void gemmi::expand_ncs ( Structure st,
HowToNameCopiedChain  how,
double  merge_dist = 0.2 
)

◆ split_chains_by_segments()

GEMMI_DLL void gemmi::split_chains_by_segments ( Model model,
HowToNameCopiedChain  how 
)

HowToNameCopiedChain::Dup adds segment name to chain name.

◆ for_matching_reflections()

template<typename Func , typename T >
void gemmi::for_matching_reflections ( const std::vector< T > &  a,
const std::vector< T > &  b,
const Func func 
)
Precondition
a and b are sorted

Definition at line 45 of file asudata.hpp.

◆ calculate_hkl_value_correlation()

template<typename T >
Correlation gemmi::calculate_hkl_value_correlation ( const std::vector< T > &  a,
const std::vector< T > &  b 
)
Precondition
a and b are sorted

Definition at line 65 of file asudata.hpp.

◆ calculate_hkl_complex_correlation()

template<typename T >
ComplexCorrelation gemmi::calculate_hkl_complex_correlation ( const std::vector< T > &  a,
const std::vector< T > &  b 
)
Precondition
a and b are sorted

Definition at line 76 of file asudata.hpp.

◆ count_equal_values()

template<typename T >
int gemmi::count_equal_values ( const std::vector< T > &  a,
const std::vector< T > &  b 
)
Precondition
a and b are sorted

Definition at line 87 of file asudata.hpp.

◆ make_asu_data() [1/2]

template<typename T , int N, typename Data >
AsuData< T > gemmi::make_asu_data ( const Data data,
const std::array< std::string, N > &  labels,
bool  as_is = false 
)

Definition at line 230 of file asudata.hpp.

◆ make_asu_data() [2/2]

template<typename T , typename Data >
AsuData< T > gemmi::make_asu_data ( const Data data,
const std::string &  label,
bool  as_is 
)

Definition at line 237 of file asudata.hpp.

◆ find_asu_brick()

AsuBrick gemmi::find_asu_brick ( const SpaceGroup sg)
inline

Definition at line 67 of file asumask.hpp.

◆ get_asu_mask()

template<typename V = std::int8_t>
std::vector< V > gemmi::get_asu_mask ( const GridMeta grid)

Definition at line 255 of file asumask.hpp.

◆ masked_asu()

template<typename T >
MaskedGrid< T > gemmi::masked_asu ( Grid< T > &  grid)

Definition at line 280 of file asumask.hpp.

◆ get_nonzero_extent()

template<typename T >
Box< Fractional > gemmi::get_nonzero_extent ( const GridBase< T > &  grid)

Definition at line 331 of file asumask.hpp.

◆ fast_from_chars() [1/2]

from_chars_result gemmi::fast_from_chars ( const char start,
const char end,
double d 
)
inline

Definition at line 16 of file atof.hpp.

◆ fast_from_chars() [2/2]

from_chars_result gemmi::fast_from_chars ( const char start,
double d 
)
inline

Definition at line 24 of file atof.hpp.

◆ fast_atof()

double gemmi::fast_atof ( const char p,
const char **  endptr = nullptr 
)
inline

Definition at line 32 of file atof.hpp.

◆ is_space()

bool gemmi::is_space ( char  c)
inline

Definition at line 23 of file atox.hpp.

◆ is_blank()

bool gemmi::is_blank ( char  c)
inline

Definition at line 38 of file atox.hpp.

◆ is_digit()

bool gemmi::is_digit ( char  c)
inline

Definition at line 43 of file atox.hpp.

◆ skip_blank()

const char * gemmi::skip_blank ( const char p)
inline

Definition at line 47 of file atox.hpp.

◆ skip_word()

const char * gemmi::skip_word ( const char p)
inline

Definition at line 54 of file atox.hpp.

◆ read_word() [1/2]

std::string gemmi::read_word ( const char line)
inline

Definition at line 61 of file atox.hpp.

◆ read_word() [2/2]

std::string gemmi::read_word ( const char line,
const char **  endptr 
)
inline

Definition at line 66 of file atox.hpp.

◆ string_to_int() [1/2]

int gemmi::string_to_int ( const char p,
bool  checked,
size_t  length = 0 
)
inline

Definition at line 73 of file atox.hpp.

◆ string_to_int() [2/2]

int gemmi::string_to_int ( const std::string &  str,
bool  checked 
)
inline

Definition at line 101 of file atox.hpp.

◆ simple_atoi()

int gemmi::simple_atoi ( const char p,
const char **  endptr = nullptr 
)
inline

Definition at line 105 of file atox.hpp.

◆ no_sign_atoi()

int gemmi::no_sign_atoi ( const char p,
const char **  endptr = nullptr 
)
inline

Definition at line 123 of file atox.hpp.

◆ evaluate_polynomial()

template<int N>
double gemmi::evaluate_polynomial ( const double(&)  poly[N],
double  x 
)
inline

Definition at line 22 of file bessel.hpp.

◆ bessel_i1_over_i0()

double gemmi::bessel_i1_over_i0 ( double  x)
inline

Definition at line 81 of file bessel.hpp.

◆ bessel_i0()

double gemmi::bessel_i0 ( double  x)
inline

Definition at line 101 of file bessel.hpp.

◆ log_bessel_i0()

double gemmi::log_bessel_i0 ( double  x)
inline

Definition at line 115 of file bessel.hpp.

◆ combine_two_correlations()

Correlation gemmi::combine_two_correlations ( const Correlation a,
const Correlation b 
)
inline

Definition at line 176 of file binner.hpp.

◆ combine_correlations()

Correlation gemmi::combine_correlations ( const std::vector< Correlation > &  cors)
inline

Definition at line 190 of file binner.hpp.

◆ find_blobs_by_flood_fill()

std::vector< Blob > gemmi::find_blobs_by_flood_fill ( const gemmi::Grid< float > &  grid,
const BlobCriteria criteria,
bool  negate = false 
)
inline

Definition at line 82 of file blob.hpp.

◆ has_hydrogen() [1/2]

template<class T >
bool gemmi::has_hydrogen ( const T obj)

Definition at line 13 of file calculate.hpp.

◆ has_hydrogen() [2/2]

template<>
bool gemmi::has_hydrogen ( const Atom atom)
inline

Definition at line 19 of file calculate.hpp.

◆ count_hydrogen_sites() [1/2]

template<class T >
size_t gemmi::count_hydrogen_sites ( const T obj)

deprecated, use has_hydrogen() or count_atom_sites(..., Selection("[H,D]")

Definition at line 24 of file calculate.hpp.

◆ count_hydrogen_sites() [2/2]

template<>
size_t gemmi::count_hydrogen_sites ( const Atom atom)
inline

Definition at line 30 of file calculate.hpp.

◆ calculate_mass() [1/2]

template<class T >
double gemmi::calculate_mass ( const T obj)

Definition at line 34 of file calculate.hpp.

◆ calculate_mass() [2/2]

template<>
double gemmi::calculate_mass ( const Atom atom)
inline

Definition at line 40 of file calculate.hpp.

◆ calculate_center_of_mass() [1/2]

template<class T >
CenterOfMass gemmi::calculate_center_of_mass ( const T obj)

Definition at line 50 of file calculate.hpp.

◆ calculate_center_of_mass() [2/2]

template<>
CenterOfMass gemmi::calculate_center_of_mass ( const Atom atom)
inline

Definition at line 58 of file calculate.hpp.

◆ expand_box() [1/2]

template<class T >
void gemmi::expand_box ( const T obj,
Box< Position > &  box 
)

Definition at line 63 of file calculate.hpp.

◆ expand_box() [2/2]

template<>
void gemmi::expand_box ( const Atom atom,
Box< Position > &  box 
)
inline

Definition at line 67 of file calculate.hpp.

◆ calculate_box()

Box< Position > gemmi::calculate_box ( const Structure st,
double  margin = 0. 
)
inline

Definition at line 72 of file calculate.hpp.

◆ calculate_fractional_box()

Box< Fractional > gemmi::calculate_fractional_box ( const Structure st,
double  margin = 0. 
)
inline

Definition at line 80 of file calculate.hpp.

◆ calculate_b_est()

double gemmi::calculate_b_est ( const Atom atom)
inline

Definition at line 96 of file calculate.hpp.

◆ calculate_angle()

double gemmi::calculate_angle ( const Position p0,
const Position p1,
const Position p2 
)
inline

Definition at line 102 of file calculate.hpp.

◆ calculate_dihedral()

double gemmi::calculate_dihedral ( const Position p0,
const Position p1,
const Position p2,
const Position p3 
)
inline

Definition at line 108 of file calculate.hpp.

◆ calculate_dihedral_from_atoms()

double gemmi::calculate_dihedral_from_atoms ( const Atom a,
const Atom b,
const Atom c,
const Atom d 
)
inline

the return value is in the same range as that of atan2(), i.e. [-pi, pi]

Definition at line 121 of file calculate.hpp.

◆ calculate_omega()

double gemmi::calculate_omega ( const Residue res,
const Residue next 
)
inline

Definition at line 128 of file calculate.hpp.

◆ is_peptide_bond_cis()

bool gemmi::is_peptide_bond_cis ( const Atom ca1,
const Atom c,
const Atom n,
const Atom ca2 
)
inline

Definition at line 133 of file calculate.hpp.

◆ calculate_chiral_volume()

double gemmi::calculate_chiral_volume ( const Position actr,
const Position a1,
const Position a2,
const Position a3 
)
inline

Definition at line 139 of file calculate.hpp.

◆ calculate_phi_psi()

std::array< double, 2 > gemmi::calculate_phi_psi ( const Residue prev,
const Residue res,
const Residue next 
)
inline

Definition at line 144 of file calculate.hpp.

◆ find_best_plane()

GEMMI_DLL std::array< double, 4 > gemmi::find_best_plane ( const std::vector< Atom * > &  atoms)

◆ get_distance_from_plane()

double gemmi::get_distance_from_plane ( const Position pos,
const std::array< double, 4 > &  coeff 
)
inline

Definition at line 162 of file calculate.hpp.

◆ angle_z()

template<typename Restr >
double gemmi::angle_z ( double  value_rad,
const Restr &  restr,
double  full = 360. 
)

Definition at line 300 of file chemcomp.hpp.

◆ chiral_abs_volume()

double gemmi::chiral_abs_volume ( double  bond1,
double  bond2,
double  bond3,
double  angle1,
double  angle2,
double  angle3 
)
inline

Definition at line 304 of file chemcomp.hpp.

◆ bond_type_from_string()

BondType gemmi::bond_type_from_string ( const std::string &  s)
inline

Definition at line 509 of file chemcomp.hpp.

◆ bond_type_to_string()

const char * gemmi::bond_type_to_string ( BondType  btype)
inline

Definition at line 527 of file chemcomp.hpp.

◆ order_of_bond_type()

float gemmi::order_of_bond_type ( BondType  btype)
inline

Definition at line 540 of file chemcomp.hpp.

◆ chirality_from_string()

ChiralityType gemmi::chirality_from_string ( const std::string &  s)
inline

Definition at line 554 of file chemcomp.hpp.

◆ chirality_from_flag_and_volume()

ChiralityType gemmi::chirality_from_flag_and_volume ( const std::string &  s,
double  volume 
)
inline

Definition at line 564 of file chemcomp.hpp.

◆ chirality_to_string()

const char * gemmi::chirality_to_string ( ChiralityType  chir_type)
inline

Definition at line 574 of file chemcomp.hpp.

◆ make_chemcomp_from_block()

ChemComp gemmi::make_chemcomp_from_block ( const cif::Block block_)
inline

Definition at line 583 of file chemcomp.hpp.

◆ make_residue_from_chemcomp_block()

Residue gemmi::make_residue_from_chemcomp_block ( const cif::Block block,
ChemCompModel  kind 
)
inline

Definition at line 23 of file chemcomp_xyz.hpp.

◆ make_model_from_chemcomp_block()

Model gemmi::make_model_from_chemcomp_block ( const cif::Block block,
ChemCompModel  kind 
)
inline

Definition at line 67 of file chemcomp_xyz.hpp.

◆ make_structure_from_chemcomp_block()

Structure gemmi::make_structure_from_chemcomp_block ( const cif::Block block)
inline

Definition at line 86 of file chemcomp_xyz.hpp.

◆ check_chemcomp_block_number()

int gemmi::check_chemcomp_block_number ( const cif::Document doc)
inline

Definition at line 107 of file chemcomp_xyz.hpp.

◆ make_structure_from_chemcomp_doc()

Structure gemmi::make_structure_from_chemcomp_doc ( const cif::Document doc)
inline

Definition at line 124 of file chemcomp_xyz.hpp.

◆ check_data_type_under_symmetry()

template<typename DataProxy >
std::pair< DataType, size_t > gemmi::check_data_type_under_symmetry ( const DataProxy &  proxy)

Definition at line 23 of file cif2mtz.hpp.

◆ possible_old_style()

bool gemmi::possible_old_style ( const ReflnBlock rb,
DataType  data_type 
)
inline

Definition at line 49 of file cif2mtz.hpp.

◆ transcript_old_anomalous_to_standard()

cif::Loop gemmi::transcript_old_anomalous_to_standard ( const cif::Loop loop,
const SpaceGroup sg 
)
inline

Before refln.pdbx_F_plus/minus was introduced, anomalous data was stored as two F_meas_au reflections, say (1,1,3) and (-1,-1,-3).

This function transcribes it to how the anomalous data is stored in PDBx/mmCIF nowadays: _refln.F_meas_au -> pdbx_F_plus / pdbx_F_minus, _refln.F_meas_sigma_au -> pdbx_F_plus_sigma / pdbx_F_minus_sigma. _refln.intensity{meas,sigma} -> _refln.pdbx_F_plus{,_sigma} / ...

Definition at line 78 of file cif2mtz.hpp.

◆ setup_for_crd()

GEMMI_DLL void gemmi::setup_for_crd ( Structure st)

◆ add_automatic_links()

GEMMI_DLL void gemmi::add_automatic_links ( Model model,
Structure st,
const MonLib monlib 
)

◆ prepare_refmac_crd()

GEMMI_DLL cif::Document gemmi::prepare_refmac_crd ( const Structure st,
const Topo topo,
const MonLib monlib,
HydrogenChange  h_change 
)

◆ determine_cutoff_radius()

template<int N, typename Real >
Real gemmi::determine_cutoff_radius ( Real  x1,
const ExpSum< N, Real > &  precal,
Real  cutoff_level 
)

Definition at line 17 of file dencalc.hpp.

◆ it92_radius_approx()

template<typename Real >
Real gemmi::it92_radius_approx ( Real  b)

Definition at line 65 of file dencalc.hpp.

◆ get_minimum_b()

double gemmi::get_minimum_b ( const Model model)
inline

Definition at line 69 of file dencalc.hpp.

◆ as_utf8()

std::string gemmi::as_utf8 ( const _tinydir_char_t path)
inline

Definition at line 43 of file dirwalk.hpp.

◆ glob_match()

bool gemmi::glob_match ( const std::string &  pattern,
const std::string &  str 
)
inline

Definition at line 52 of file dirwalk.hpp.

◆ calculate_amplitude_normalizers()

template<typename DataProxy >
std::vector< double > gemmi::calculate_amplitude_normalizers ( const DataProxy &  data,
int  fcol_idx,
const Binner binner 
)

Definition at line 14 of file ecalc.hpp.

◆ eigen_decomposition()

GEMMI_DLL Mat33 gemmi::eigen_decomposition ( const SMat33< double > &  A,
double(&)  d[3] 
)

◆ is_hydrogen()

bool gemmi::is_hydrogen ( El  el)
inline

Definition at line 26 of file elem.hpp.

◆ is_metal()

bool gemmi::is_metal ( El  el)
inline

Definition at line 29 of file elem.hpp.

◆ molecular_weight()

double gemmi::molecular_weight ( El  el)
inline

Definition at line 67 of file elem.hpp.

◆ covalent_radius()

float gemmi::covalent_radius ( El  el)
inline

Definition at line 109 of file elem.hpp.

◆ vdw_radius()

float gemmi::vdw_radius ( El  el)
inline

Definition at line 154 of file elem.hpp.

◆ element_name()

const char * gemmi::element_name ( El  el)
inline

Definition at line 195 of file elem.hpp.

◆ element_uppercase_name()

elname_t & gemmi::element_uppercase_name ( El  el)
inline

Definition at line 220 of file elem.hpp.

◆ find_element()

El gemmi::find_element ( const char symbol)
inline

Definition at line 267 of file elem.hpp.

◆ entity_type_to_string()

const char * gemmi::entity_type_to_string ( EntityType  entity_type)
inline

Definition at line 14 of file enumstr.hpp.

◆ entity_type_from_string()

EntityType gemmi::entity_type_from_string ( const std::string &  t)
inline

Definition at line 24 of file enumstr.hpp.

◆ polymer_type_to_string()

const char * gemmi::polymer_type_to_string ( PolymerType  polymer_type)
inline

Definition at line 33 of file enumstr.hpp.

◆ polymer_type_from_string()

PolymerType gemmi::polymer_type_from_string ( const std::string &  t)
inline

Definition at line 50 of file enumstr.hpp.

◆ connection_type_to_string()

const char * gemmi::connection_type_to_string ( Connection::Type  t)
inline

Definition at line 66 of file enumstr.hpp.

◆ connection_type_from_string()

Connection::Type gemmi::connection_type_from_string ( const std::string &  t)
inline

Definition at line 73 of file enumstr.hpp.

◆ software_classification_to_string()

std::string gemmi::software_classification_to_string ( SoftwareItem::Classification  c)
inline

Definition at line 81 of file enumstr.hpp.

◆ software_classification_from_string()

SoftwareItem::Classification gemmi::software_classification_from_string ( const std::string &  str)
inline

Definition at line 97 of file enumstr.hpp.

◆ fail() [1/3]

void gemmi::fail ( const std::string &  msg)
inline

Definition at line 59 of file fail.hpp.

◆ fail() [2/3]

template<typename T , typename... Args>
void gemmi::fail ( std::string &&  str,
T &&  arg1,
Args &&...  args 
)

Definition at line 62 of file fail.hpp.

◆ fail() [3/3]

GEMMI_COLD void gemmi::fail ( const char msg)
inline

Definition at line 68 of file fail.hpp.

◆ sys_fail() [1/2]

GEMMI_COLD void gemmi::sys_fail ( const std::string &  msg)
inline

Definition at line 71 of file fail.hpp.

◆ sys_fail() [2/2]

GEMMI_COLD void gemmi::sys_fail ( const char msg)
inline

Definition at line 75 of file fail.hpp.

◆ unreachable()

void gemmi::unreachable ( )
inline

Definition at line 80 of file fail.hpp.

◆ path_basename()

std::string gemmi::path_basename ( const std::string &  path,
std::initializer_list< const char * >  exts 
)
inline

Definition at line 23 of file fileutil.hpp.

◆ file_open()

fileptr_t gemmi::file_open ( const char path,
const char mode 
)
inline

Definition at line 39 of file fileutil.hpp.

◆ file_open_or()

fileptr_t gemmi::file_open_or ( const char path,
const char mode,
std::FILE *  dash_stream 
)
inline

Definition at line 54 of file fileutil.hpp.

◆ file_size()

std::size_t gemmi::file_size ( std::FILE *  f,
const std::string &  path 
)
inline

Definition at line 61 of file fileutil.hpp.

◆ is_little_endian()

bool gemmi::is_little_endian ( )
inline

Definition at line 73 of file fileutil.hpp.

◆ swap_two_bytes()

void gemmi::swap_two_bytes ( void start)
inline

Definition at line 78 of file fileutil.hpp.

◆ swap_four_bytes()

void gemmi::swap_four_bytes ( void start)
inline

Definition at line 83 of file fileutil.hpp.

◆ swap_eight_bytes()

void gemmi::swap_eight_bytes ( void start)
inline

Definition at line 89 of file fileutil.hpp.

◆ read_file_into_buffer()

CharArray gemmi::read_file_into_buffer ( const std::string &  path)
inline

Definition at line 98 of file fileutil.hpp.

◆ read_stdin_into_buffer()

CharArray gemmi::read_stdin_into_buffer ( )
inline

Definition at line 107 of file fileutil.hpp.

◆ read_into_buffer()

template<typename T >
CharArray gemmi::read_into_buffer ( T &&  input)
inline

Definition at line 122 of file fileutil.hpp.

◆ mask_nodes_above_threshold()

void gemmi::mask_nodes_above_threshold ( Grid< std::int8_t > &  mask,
const Grid< float > &  grid,
double  threshold,
bool  negate = false 
)
inline

Definition at line 134 of file floodfill.hpp.

◆ flood_fill_above()

Grid< std::int8_t > gemmi::flood_fill_above ( const Grid< float > &  grid,
const std::vector< Position > &  seeds,
double  threshold,
bool  negate = false 
)
inline

Definition at line 143 of file floodfill.hpp.

◆ unsafe_expapprox()

float gemmi::unsafe_expapprox ( float  x)
inline

Definition at line 21 of file formfact.hpp.

◆ pow15()

template<typename Real >
Real gemmi::pow15 ( Real  x)

Definition at line 120 of file formfact.hpp.

◆ phase_in_angles()

template<typename T >
double gemmi::phase_in_angles ( const std::complex< T > &  v)

Definition at line 24 of file fourier.hpp.

◆ add_asu_f_phi_to_float_vector()

void gemmi::add_asu_f_phi_to_float_vector ( std::vector< float > &  float_data,
const AsuData< std::complex< float > > &  asu_data 
)
inline

Definition at line 34 of file fourier.hpp.

◆ get_size_for_hkl()

template<typename DataProxy >
std::array< int, 3 > gemmi::get_size_for_hkl ( const DataProxy &  data,
std::array< int, 3 >  min_size,
double  sample_rate 
)

Definition at line 46 of file fourier.hpp.

◆ data_fits_into()

template<typename DataProxy >
bool gemmi::data_fits_into ( const DataProxy &  data,
std::array< int, 3 >  size 
)

Definition at line 75 of file fourier.hpp.

◆ add_friedel_mates()

template<typename T >
void gemmi::add_friedel_mates ( ReciprocalGrid< T > &  grid)

Definition at line 86 of file fourier.hpp.

◆ initialize_hkl_grid()

template<typename T , typename DataProxy >
void gemmi::initialize_hkl_grid ( ReciprocalGrid< T > &  grid,
const DataProxy &  data,
std::array< int, 3 >  size,
bool  half_l,
AxisOrder  axis_order 
)

Definition at line 130 of file fourier.hpp.

◆ get_f_phi_on_grid()

template<typename T , typename FPhi >
FPhiGrid< T > gemmi::get_f_phi_on_grid ( const FPhi fphi,
std::array< int, 3 >  size,
bool  half_l,
AxisOrder  axis_order = AxisOrder::XYZ 
)

Definition at line 166 of file fourier.hpp.

◆ get_value_on_grid()

template<typename T , typename DataProxy >
ReciprocalGrid< T > gemmi::get_value_on_grid ( const DataProxy &  data,
size_t  column,
std::array< int, 3 >  size,
bool  half_l,
AxisOrder  axis_order = AxisOrder::XYZ 
)

Definition at line 200 of file fourier.hpp.

◆ transform_f_phi_grid_to_map()

template<typename T >
Grid< T > gemmi::transform_f_phi_grid_to_map ( FPhiGrid< T > &&  hkl)

Definition at line 282 of file fourier.hpp.

◆ transform_f_phi_to_map()

template<typename T , typename FPhi >
Grid< T > gemmi::transform_f_phi_to_map ( const FPhi fphi,
std::array< int, 3 >  size,
double  sample_rate,
bool  exact_size = false,
AxisOrder  order = AxisOrder::XYZ 
)

Definition at line 289 of file fourier.hpp.

◆ transform_f_phi_to_map2()

template<typename T , typename FPhi >
Grid< T > gemmi::transform_f_phi_to_map2 ( const FPhi fphi,
std::array< int, 3 >  min_size,
double  sample_rate,
std::array< int, 3 >  exact_size,
AxisOrder  order = AxisOrder::XYZ 
)

Definition at line 303 of file fourier.hpp.

◆ transform_map_to_f_phi()

template<typename T >
FPhiGrid< T > gemmi::transform_map_to_f_phi ( const Grid< T > &  map,
bool  half_l,
bool  use_scale = true 
)

Definition at line 314 of file fourier.hpp.

◆ cromer_liberman_for_array()

void gemmi::cromer_liberman_for_array ( int  z,
int  npts,
const double energy,
double fp,
double fpp 
)
inline

Definition at line 2946 of file fprime.hpp.

◆ cromer_liberman()

double gemmi::cromer_liberman ( int  z,
double  energy,
double fpp 
)
inline

Definition at line 2961 of file fprime.hpp.

◆ add_cl_fprime_for_all_elements()

template<typename Iter >
void gemmi::add_cl_fprime_for_all_elements ( Iter  out,
double  energy 
)

Definition at line 2971 of file fprime.hpp.

◆ open_stream_from_utf8_path()

template<typename T >
void gemmi::open_stream_from_utf8_path ( T ptr,
const std::string &  filename 
)
inline

Definition at line 27 of file fstream.hpp.

◆ modulo()

int gemmi::modulo ( int  a,
int  n 
)
inline

Definition at line 38 of file grid.hpp.

◆ has_small_factorization()

bool gemmi::has_small_factorization ( int  n)
inline

Definition at line 46 of file grid.hpp.

◆ round_with_small_factorization()

int gemmi::round_with_small_factorization ( double  exact,
GridSizeRounding  rounding 
)
inline

Definition at line 55 of file grid.hpp.

◆ good_grid_size()

std::array< int, 3 > gemmi::good_grid_size ( const std::array< double, 3 > &  limit,
GridSizeRounding  rounding,
const SpaceGroup sg 
)
inline

Definition at line 79 of file grid.hpp.

◆ check_grid_factors()

void gemmi::check_grid_factors ( const SpaceGroup sg,
std::array< int, 3 >  size 
)
inline

Definition at line 121 of file grid.hpp.

◆ cubic_interpolation()

double gemmi::cubic_interpolation ( double  u,
double  a,
double  b,
double  c,
double  d 
)
inline

Catmull–Rom spline interpolation.

CINT_u from: https://en.wikipedia.org/wiki/Cubic_Hermite_spline The same as (24) in https://journals.iucr.org/d/issues/2018/06/00/ic5103/

Definition at line 146 of file grid.hpp.

◆ cubic_interpolation_der()

double gemmi::cubic_interpolation_der ( double  u,
double  a,
double  b,
double  c,
double  d 
)
inline

df/du (from Wolfram Alpha)

Definition at line 154 of file grid.hpp.

◆ calculate_correlation()

template<typename T >
Correlation gemmi::calculate_correlation ( const GridBase< T > &  a,
const GridBase< T > &  b 
)

Definition at line 794 of file grid.hpp.

◆ estimate_uncompressed_size()

size_t gemmi::estimate_uncompressed_size ( const std::string &  path)
inline

Definition at line 24 of file gz.hpp.

◆ big_gzread()

size_t gemmi::big_gzread ( gzFile  file,
void buf,
size_t  len 
)
inline

Definition at line 49 of file gz.hpp.

◆ copy_line_from_stream()

template<typename Input >
size_t gemmi::copy_line_from_stream ( char line,
int  size,
Input &&  in 
)
inline

Definition at line 155 of file input.hpp.

◆ atom_to_site()

SmallStructure::Site gemmi::atom_to_site ( const Atom atom,
const UnitCell cell 
)
inline

Definition at line 13 of file interop.hpp.

◆ mx_to_sx_structure()

SmallStructure gemmi::mx_to_sx_structure ( const Structure st,
int  n = 0 
)
inline

Definition at line 45 of file interop.hpp.

◆ jordan_solve()

void gemmi::jordan_solve ( std::vector< double > &  a,
std::vector< double > &  b 
)
inline

This function solves a set of linear algebraic equations using Gauss-Jordan elimination with partial pivoting.

A * x = b

a is n x n matrix (in vector) b is vector of length n, This function returns vector x[] in b[], and 1-matrix in a[].

Definition at line 28 of file levmar.hpp.

◆ debug_print()

void gemmi::debug_print ( const std::string &  ,
std::vector< double > &   
)
inline

Definition at line 82 of file levmar.hpp.

◆ pi()

constexpr double gemmi::pi ( )
constexpr

Definition at line 16 of file math.hpp.

◆ hc()

constexpr double gemmi::hc ( )
constexpr

Definition at line 20 of file math.hpp.

◆ bohrradius()

constexpr double gemmi::bohrradius ( )
constexpr

Definition at line 23 of file math.hpp.

◆ mott_bethe_const()

constexpr double gemmi::mott_bethe_const ( )
constexpr

Definition at line 26 of file math.hpp.

◆ u_to_b()

constexpr double gemmi::u_to_b ( )
constexpr

Definition at line 29 of file math.hpp.

◆ deg()

constexpr double gemmi::deg ( double  angle)
constexpr

Definition at line 31 of file math.hpp.

◆ rad()

constexpr double gemmi::rad ( double  angle)
constexpr

Definition at line 32 of file math.hpp.

◆ sq() [1/2]

constexpr float gemmi::sq ( float  x)
constexpr

Definition at line 34 of file math.hpp.

◆ sq() [2/2]

constexpr double gemmi::sq ( double  x)
constexpr

Definition at line 35 of file math.hpp.

◆ iround()

int gemmi::iround ( double  d)
inline

Definition at line 37 of file math.hpp.

◆ angle_abs_diff()

double gemmi::angle_abs_diff ( double  a,
double  b,
double  full = 360.0 
)
inline

Definition at line 39 of file math.hpp.

◆ operator*() [1/3]

Vec3 gemmi::operator* ( double  d,
const Vec3 v 
)
inline

Definition at line 104 of file math.hpp.

◆ rotate_about_axis()

Vec3 gemmi::rotate_about_axis ( const Vec3 v,
const Vec3 axis,
double  theta 
)
inline

Rodrigues' rotation formula: rotate vector v about given axis of rotation (which must be a unit vector) by given angle (in radians).

Definition at line 108 of file math.hpp.

◆ miller_str()

std::string gemmi::miller_str ( const Miller hkl)
inline

Definition at line 22 of file merge.hpp.

◆ parse_voigt_notation()

bool gemmi::parse_voigt_notation ( const char start,
const char end,
SMat33< double > &  b 
)
inline

Definition at line 32 of file merge.hpp.

◆ read_staraniso_b_from_mmcif()

bool gemmi::read_staraniso_b_from_mmcif ( const cif::Block block,
SMat33< double > &  output 
)
inline

Definition at line 46 of file merge.hpp.

◆ read_staraniso_b_from_mtz()

std::string gemmi::read_staraniso_b_from_mtz ( const Mtz mtz,
SMat33< double > &  output 
)
inline

Definition at line 73 of file merge.hpp.

◆ is_polypeptide()

bool gemmi::is_polypeptide ( PolymerType  pt)
inline

Definition at line 211 of file metadata.hpp.

◆ is_polynucleotide()

bool gemmi::is_polynucleotide ( PolymerType  pt)
inline

Definition at line 215 of file metadata.hpp.

◆ make_structure_from_block()

GEMMI_DLL Structure gemmi::make_structure_from_block ( const cif::Block block)

◆ make_structure()

Structure gemmi::make_structure ( cif::Document &&  doc,
cif::Document save_doc = nullptr 
)
inline

Definition at line 17 of file mmcif.hpp.

◆ copy_transform_to_mmdb()

void gemmi::copy_transform_to_mmdb ( const Transform tr,
mmdb::mat33 &  mat,
mmdb::vect3 &  vec 
)
inline

Definition at line 16 of file mmdb.hpp.

◆ strcpy_to_mmdb()

template<int N>
void gemmi::strcpy_to_mmdb ( char(&)  dest[N],
const std::string &  src 
)

Definition at line 26 of file mmdb.hpp.

◆ set_seqid_in_mmdb()

void gemmi::set_seqid_in_mmdb ( int seqnum,
mmdb::InsCode &  icode,
SeqId  seqid 
)
inline

Definition at line 32 of file mmdb.hpp.

◆ copy_to_mmdb()

mmdb::Manager * gemmi::copy_to_mmdb ( const Structure st,
mmdb::Manager *  manager 
)
inline

Definition at line 38 of file mmdb.hpp.

◆ copy_atom_from_mmdb()

Atom gemmi::copy_atom_from_mmdb ( mmdb::Atom &  m_atom)
inline

Definition at line 130 of file mmdb.hpp.

◆ copy_residue_from_mmdb()

Residue gemmi::copy_residue_from_mmdb ( mmdb::Residue &  m_res)
inline

Definition at line 151 of file mmdb.hpp.

◆ copy_chain_from_mmdb()

Chain gemmi::copy_chain_from_mmdb ( mmdb::Chain &  m_chain)
inline

Definition at line 176 of file mmdb.hpp.

◆ copy_model_from_mmdb()

Model gemmi::copy_model_from_mmdb ( mmdb::Model &  m_model)
inline

Definition at line 196 of file mmdb.hpp.

◆ copy_from_mmdb()

Structure gemmi::copy_from_mmdb ( mmdb::Manager *  manager)
inline

Definition at line 206 of file mmdb.hpp.

◆ coor_format_from_ext()

CoorFormat gemmi::coor_format_from_ext ( const std::string &  path)
inline

Definition at line 20 of file mmread.hpp.

◆ coor_format_from_content()

CoorFormat gemmi::coor_format_from_content ( const char buf,
const char end 
)
inline

Definition at line 31 of file mmread.hpp.

◆ make_structure_from_doc()

Structure gemmi::make_structure_from_doc ( cif::Document &&  doc,
bool  possible_chemcomp,
cif::Document save_doc = nullptr 
)
inline

Definition at line 49 of file mmread.hpp.

◆ read_structure_from_char_array()

Structure gemmi::read_structure_from_char_array ( char data,
size_t  size,
const std::string &  path,
cif::Document save_doc = nullptr 
)
inline

Definition at line 60 of file mmread.hpp.

◆ read_structure()

template<typename T >
Structure gemmi::read_structure ( T &&  input,
CoorFormat  format = CoorFormat::Unknown,
cif::Document save_doc = nullptr 
)

Definition at line 77 of file mmread.hpp.

◆ read_structure_file()

Structure gemmi::read_structure_file ( const std::string &  path,
CoorFormat  format = CoorFormat::Unknown 
)
inline

Definition at line 104 of file mmread.hpp.

◆ read_structure_gz()

GEMMI_DLL Structure gemmi::read_structure_gz ( const std::string &  path,
CoorFormat  format = CoorFormat::Unknown,
cif::Document save_doc = nullptr 
)

◆ read_pdb_gz()

GEMMI_DLL Structure gemmi::read_pdb_gz ( const std::string &  path,
PdbReadOptions  options = PdbReadOptions() 
)

◆ coor_format_from_ext_gz()

GEMMI_DLL CoorFormat gemmi::coor_format_from_ext_gz ( const std::string &  path)

◆ remove_empty_children()

template<class T >
void gemmi::remove_empty_children ( T obj)

Definition at line 102 of file model.hpp.

◆ is_same_conformer()

bool gemmi::is_same_conformer ( char  altloc1,
char  altloc2 
)
inline

Definition at line 107 of file model.hpp.

◆ atom_str() [1/3]

std::string gemmi::atom_str ( const Chain chain,
const ResidueId res_id,
const Atom atom 
)
inline

Definition at line 591 of file model.hpp.

◆ atom_str() [2/3]

std::string gemmi::atom_str ( const const_CRA cra)
inline

Definition at line 610 of file model.hpp.

◆ atom_matches()

bool gemmi::atom_matches ( const const_CRA cra,
const AtomAddress addr,
bool  ignore_segment = false 
)
inline

Definition at line 618 of file model.hpp.

◆ make_address()

AtomAddress gemmi::make_address ( const Chain ch,
const Residue res,
const Atom at 
)
inline

Definition at line 626 of file model.hpp.

◆ find_entity_of_subchain() [1/2]

Entity * gemmi::find_entity_of_subchain ( const std::string &  subchain_id,
std::vector< Entity > &  entities 
)
inline

Definition at line 908 of file model.hpp.

◆ find_entity_of_subchain() [2/2]

const Entity * gemmi::find_entity_of_subchain ( const std::string &  subchain_id,
const std::vector< Entity > &  entities 
)
inline

Definition at line 916 of file model.hpp.

◆ remove_alternative_conformations() [1/2]

template<class T >
void gemmi::remove_alternative_conformations ( T obj)

Remove alternative conformations.

Definition at line 17 of file modify.hpp.

◆ remove_alternative_conformations() [2/2]

template<>
void gemmi::remove_alternative_conformations ( Chain chain)
inline

Definition at line 21 of file modify.hpp.

◆ remove_hydrogens() [1/2]

template<class T >
void gemmi::remove_hydrogens ( T obj)

Remove hydrogens.

Definition at line 43 of file modify.hpp.

◆ remove_hydrogens() [2/2]

template<>
void gemmi::remove_hydrogens ( Residue res)
inline

Definition at line 47 of file modify.hpp.

◆ assign_b_iso() [1/2]

template<class T >
void gemmi::assign_b_iso ( T obj,
float  b_min,
float  b_max 
)

Set isotropic ADP to the range (b_min, b_max).

Values smaller than b_min are changed to b_min, values larger than b_max to b_max. Anisotropic ADP is left unchanged.

Definition at line 56 of file modify.hpp.

◆ assign_b_iso() [2/2]

template<>
void gemmi::assign_b_iso ( Atom atom,
float  b_min,
float  b_max 
)
inline

Definition at line 60 of file modify.hpp.

◆ remove_anisou() [1/2]

template<class T >
void gemmi::remove_anisou ( T obj)

Remove anisotropic ADP.

Definition at line 65 of file modify.hpp.

◆ remove_anisou() [2/2]

template<>
void gemmi::remove_anisou ( Atom atom)
inline

Definition at line 69 of file modify.hpp.

◆ ensure_anisou() [1/2]

template<class T >
void gemmi::ensure_anisou ( T obj)

Set absent ANISOU to value from B_iso.

Definition at line 74 of file modify.hpp.

◆ ensure_anisou() [2/2]

template<>
void gemmi::ensure_anisou ( Atom atom)
inline

Definition at line 78 of file modify.hpp.

◆ transform_pos_and_adp() [1/2]

template<class T >
void gemmi::transform_pos_and_adp ( T obj,
const Transform tr 
)

apply Transform to both atom's position and ADP

Definition at line 86 of file modify.hpp.

◆ transform_pos_and_adp() [2/2]

template<>
void gemmi::transform_pos_and_adp ( Atom atom,
const Transform tr 
)
inline

Definition at line 90 of file modify.hpp.

◆ assign_serial_numbers() [1/2]

void gemmi::assign_serial_numbers ( Model model,
bool  numbered_ter = false 
)
inline

set atom site serial numbers to 1, 2, ..., optionally leaving gaps for TERs

Definition at line 97 of file modify.hpp.

◆ assign_serial_numbers() [2/2]

void gemmi::assign_serial_numbers ( Structure st,
bool  numbered_ter = false 
)
inline

Definition at line 108 of file modify.hpp.

◆ process_addresses()

template<typename Func >
void gemmi::process_addresses ( Structure st,
Func  func 
)

Definition at line 115 of file modify.hpp.

◆ rename_chain()

void gemmi::rename_chain ( Structure st,
const std::string &  old_name,
const std::string &  new_name 
)
inline

Definition at line 138 of file modify.hpp.

◆ rename_atom_names()

void gemmi::rename_atom_names ( Structure st,
const std::string &  res_name,
const std::map< std::string, std::string > &  old_new 
)
inline

Definition at line 155 of file modify.hpp.

◆ replace_d_fraction_with_altlocs()

void gemmi::replace_d_fraction_with_altlocs ( Residue res)
inline

Definition at line 176 of file modify.hpp.

◆ replace_deuterium_with_fraction()

bool gemmi::replace_deuterium_with_fraction ( Residue res)
inline

Definition at line 207 of file modify.hpp.

◆ store_deuterium_as_fraction()

void gemmi::store_deuterium_as_fraction ( Structure st,
bool  store_fraction 
)
inline

Hydrogens modelled as H/D mixture (altlocs H and D with the same position and ADP, but with refined fraction of D), it can be stored in mmCIF either as two atoms (H and D) or, using CCP4/Refmac extension, as H atoms with the ccp4_deuterium_fraction parameter.

This function switches fraction <-> altlocs

Definition at line 243 of file modify.hpp.

◆ standardize_crystal_frame()

void gemmi::standardize_crystal_frame ( Structure st)
inline

Convert coordinates to the standard coordinate system for the unit cell.

Definition at line 259 of file modify.hpp.

◆ add_distinct_altlocs()

void gemmi::add_distinct_altlocs ( const Residue res,
std::string &  altlocs 
)
inline

Definition at line 23 of file monlib.hpp.

◆ atom_match_with_alias()

bool gemmi::atom_match_with_alias ( const std::string &  atom_id,
const std::string &  atom,
const ChemComp::Aliasing aliasing 
)
inline

Definition at line 29 of file monlib.hpp.

◆ read_monomer_lib()

MonLib gemmi::read_monomer_lib ( const std::string &  monomer_dir,
const std::vector< std::string > &  resnames,
read_cif_func  read_cif,
const std::string &  libin = "",
bool  ignore_missing = false 
)
inline

Definition at line 315 of file monlib.hpp.

◆ calculate_min_max_disregarding_nans()

template<typename T , typename FP = typename std::iterator_traits<T>::value_type>
std::array< FP, 2 > gemmi::calculate_min_max_disregarding_nans ( T  begin,
T  end 
)

Definition at line 32 of file mtz.hpp.

◆ read_mtz_file()

Mtz gemmi::read_mtz_file ( const std::string &  path)
inline

Definition at line 1051 of file mtz.hpp.

◆ read_mtz()

template<typename Input >
Mtz gemmi::read_mtz ( Input &&  input,
bool  with_data 
)

Definition at line 1058 of file mtz.hpp.

◆ data_proxy() [1/2]

MtzDataProxy gemmi::data_proxy ( const Mtz mtz)
inline

Definition at line 1096 of file mtz.hpp.

◆ write_staraniso_b_in_mmcif()

GEMMI_DLL void gemmi::write_staraniso_b_in_mmcif ( const SMat33< double > &  b,
const std::string &  entry_id,
char buf,
std::ostream &  os 
)

◆ remove_appendix_from_column_names()

GEMMI_DLL void gemmi::remove_appendix_from_column_names ( Mtz mtz,
std::ostream &  out 
)

remove '_dataset_name' that can be appended to column names in ccp4i

◆ validate_merged_mtz_deposition_columns()

GEMMI_DLL bool gemmi::validate_merged_mtz_deposition_columns ( const Mtz mtz,
std::ostream &  out 
)

◆ validate_merged_intensities()

GEMMI_DLL bool gemmi::validate_merged_intensities ( Intensities mi,
Intensities ui,
bool  relaxed_check,
std::ostream &  out 
)

◆ read_pdb_file()

Structure gemmi::read_pdb_file ( const std::string &  path,
PdbReadOptions  options = PdbReadOptions() 
)
inline

Definition at line 674 of file pdb.hpp.

◆ read_pdb_from_memory()

Structure gemmi::read_pdb_from_memory ( const char data,
size_t  size,
const std::string &  name,
PdbReadOptions  options = PdbReadOptions() 
)
inline

Definition at line 680 of file pdb.hpp.

◆ read_pdb_string()

Structure gemmi::read_pdb_string ( const std::string &  str,
const std::string &  name,
PdbReadOptions  options = PdbReadOptions() 
)
inline

Definition at line 686 of file pdb.hpp.

◆ read_pdb()

template<typename T >
Structure gemmi::read_pdb ( T &&  input,
PdbReadOptions  options = PdbReadOptions() 
)
inline

Definition at line 694 of file pdb.hpp.

◆ is_pdb_code()

bool gemmi::is_pdb_code ( const std::string &  str)
inline

Definition at line 16 of file pdb_id.hpp.

◆ expand_pdb_code_to_path()

std::string gemmi::expand_pdb_code_to_path ( const std::string &  code,
char  type,
bool  throw_if_unset = false 
)
inline

Call it after checking the code with gemmi::is_pdb_code(code).

The convention for $PDB_DIR is the same as in BioJava, see the docs.

type is the requested file type: 'M' for mmCIF or 'P' for PDB, 'S' for SF-mmCIF.

Definition at line 26 of file pdb_id.hpp.

◆ expand_if_pdb_code()

std::string gemmi::expand_if_pdb_code ( const std::string &  input,
char  type = 'M' 
)
inline
type is: 'M' for mmCIF or 'P' for PDB, 'S' for SF-mmCIF.

Definition at line 55 of file pdb_id.hpp.

◆ is_pir_format()

bool gemmi::is_pir_format ( const std::string &  s)
inline

Definition at line 21 of file pirfasta.hpp.

◆ read_pir_or_fasta()

std::vector< FastaSeq > gemmi::read_pir_or_fasta ( const std::string &  str)
inline

Definition at line 28 of file pirfasta.hpp.

◆ check_polymer_type()

GEMMI_DLL PolymerType gemmi::check_polymer_type ( const ConstResidueSpan span,
bool  ignore_entity_type = false 
)

◆ get_or_check_polymer_type()

PolymerType gemmi::get_or_check_polymer_type ( const Entity ent,
const ConstResidueSpan polymer 
)
inline

Definition at line 22 of file polyheur.hpp.

◆ get_mainchain_atoms()

std::vector< AtomNameElement > gemmi::get_mainchain_atoms ( PolymerType  ptype)
inline

Definition at line 31 of file polyheur.hpp.

◆ in_peptide_bond_distance()

bool gemmi::in_peptide_bond_distance ( const Atom a1,
const Atom a2 
)
inline

distance-based check for peptide bond

Definition at line 40 of file polyheur.hpp.

◆ have_peptide_bond()

bool gemmi::have_peptide_bond ( const Residue r1,
const Residue r2 
)
inline

Definition at line 43 of file polyheur.hpp.

◆ in_nucleotide_bond_distance()

bool gemmi::in_nucleotide_bond_distance ( const Atom a1,
const Atom a2 
)
inline

distance-based check for phosphodiester bond between nucleotide

Definition at line 48 of file polyheur.hpp.

◆ have_nucleotide_bond()

bool gemmi::have_nucleotide_bond ( const Residue r1,
const Residue r2 
)
inline

Definition at line 51 of file polyheur.hpp.

◆ are_connected()

bool gemmi::are_connected ( const Residue r1,
const Residue r2,
PolymerType  ptype 
)
inline

check C-N or O3'-P distance

Definition at line 56 of file polyheur.hpp.

◆ are_connected2()

bool gemmi::are_connected2 ( const Residue r1,
const Residue r2,
PolymerType  ptype 
)
inline

are_connected2() is less exact, but requires only CA (or P) atoms.

Definition at line 65 of file polyheur.hpp.

◆ are_connected3()

bool gemmi::are_connected3 ( const Residue r1,
const Residue r2,
PolymerType  ptype 
)
inline

are_connected3() = are_connected() + fallback to are_connected2()

Definition at line 87 of file polyheur.hpp.

◆ make_one_letter_sequence()

std::string gemmi::make_one_letter_sequence ( const ConstResidueSpan polymer)
inline

Definition at line 106 of file polyheur.hpp.

◆ add_entity_types() [1/2]

GEMMI_DLL void gemmi::add_entity_types ( Chain chain,
bool  overwrite 
)

Assigns entity_type=Polymer|NonPolymer|Water for each Residue (only for residues with entity_type==Unknown, unless overwrite=true).

Determining where the polymer ends and ligands start is sometimes arbitrary – there can be a non-standard residue at the end that can be regarded as as either the last residue or a linked ligand.

◆ add_entity_types() [2/2]

GEMMI_DLL void gemmi::add_entity_types ( Structure st,
bool  overwrite 
)

◆ remove_entity_types()

GEMMI_DLL void gemmi::remove_entity_types ( Structure st)

Assigns entity_type=Unknown for all residues.

◆ add_entity_ids()

GEMMI_DLL void gemmi::add_entity_ids ( Structure st,
bool  overwrite 
)

◆ assign_subchain_names()

GEMMI_DLL void gemmi::assign_subchain_names ( Chain chain,
int nonpolymer_counter 
)

The subchain field in the residue is where we store_atom_site.label_asym_id from mmCIF files.

As of 2018 wwPDB software splits author's chains (auth_asym_id) into label_asym_id units:

  • linear polymer,
  • non-polymers (each residue has different separate label_asym_id),
  • and waters. Refmac/makecif is doing similar thing but using different naming and somewhat different rules (it was written in 1990's before PDBx/mmCIF).

Here we use naming and rules different from both wwPDB and makecif. Note: call add_entity_types() first.

◆ assign_subchains()

GEMMI_DLL void gemmi::assign_subchains ( Structure st,
bool  force,
bool  fail_if_unknown = true 
)

◆ ensure_entities()

GEMMI_DLL void gemmi::ensure_entities ( Structure st)

◆ deduplicate_entities()

GEMMI_DLL void gemmi::deduplicate_entities ( Structure st)

◆ setup_entities()

void gemmi::setup_entities ( Structure st)
inline

Definition at line 153 of file polyheur.hpp.

◆ remove_waters() [1/2]

template<class T >
void gemmi::remove_waters ( T obj)

Definition at line 161 of file polyheur.hpp.

◆ remove_waters() [2/2]

template<>
void gemmi::remove_waters ( Chain ch)
inline

Definition at line 165 of file polyheur.hpp.

◆ remove_ligands_and_waters() [1/2]

template<class T >
void gemmi::remove_ligands_and_waters ( T obj)

Definition at line 171 of file polyheur.hpp.

◆ remove_ligands_and_waters() [2/2]

template<>
void gemmi::remove_ligands_and_waters ( Chain ch)
inline

Definition at line 175 of file polyheur.hpp.

◆ trim_to_alanine() [1/2]

bool gemmi::trim_to_alanine ( Residue res)
inline

Definition at line 184 of file polyheur.hpp.

◆ trim_to_alanine() [2/2]

void gemmi::trim_to_alanine ( Chain chain)
inline

Definition at line 200 of file polyheur.hpp.

◆ change_ccd_code()

GEMMI_DLL void gemmi::change_ccd_code ( Structure st,
const std::string &  old,
const std::string &  new_ 
)

◆ shorten_ccd_codes()

GEMMI_DLL void gemmi::shorten_ccd_codes ( Structure st)

◆ restore_full_ccd_codes()

void gemmi::restore_full_ccd_codes ( Structure st)
inline

Definition at line 212 of file polyheur.hpp.

◆ qcp_inner_product()

double gemmi::qcp_inner_product ( Mat33 mat,
const Position pos1,
const Position ctr1,
const Position pos2,
const Position ctr2,
size_t  len,
const double weight 
)
inline

Definition at line 94 of file qcp.hpp.

◆ fast_calc_rmsd_and_rotation()

int gemmi::fast_calc_rmsd_and_rotation ( Mat33 rot,
const Mat33 A,
double rmsd,
double  E0,
double  len,
double  min_score 
)
inline

Definition at line 120 of file qcp.hpp.

◆ qcp_calculate_center()

Position gemmi::qcp_calculate_center ( const Position pos,
size_t  len,
const double weight 
)
inline

Definition at line 284 of file qcp.hpp.

◆ superpose_positions()

SupResult gemmi::superpose_positions ( const Position pos1,
const Position pos2,
size_t  len,
const double weight 
)
inline

Definition at line 297 of file qcp.hpp.

◆ calculate_rmsd_of_superposed_positions()

double gemmi::calculate_rmsd_of_superposed_positions ( const Position pos1,
const Position pos2,
size_t  len,
const double weight 
)
inline

Definition at line 325 of file qcp.hpp.

◆ read_cif_gz()

GEMMI_DLL cif::Document gemmi::read_cif_gz ( const std::string &  path)

◆ read_mmjson_gz()

GEMMI_DLL cif::Document gemmi::read_mmjson_gz ( const std::string &  path)

◆ read_into_buffer_gz()

GEMMI_DLL CharArray gemmi::read_into_buffer_gz ( const std::string &  path)

◆ read_cif_from_buffer()

GEMMI_DLL cif::Document gemmi::read_cif_from_buffer ( const CharArray buffer,
const char name 
)

◆ read_first_block_gz()

GEMMI_DLL cif::Document gemmi::read_first_block_gz ( const std::string &  path,
size_t  limit 
)

◆ read_cif_or_mmjson_gz()

cif::Document gemmi::read_cif_or_mmjson_gz ( const std::string &  path)
inline

Definition at line 21 of file read_cif.hpp.

◆ read_ccp4_map()

Ccp4< float > gemmi::read_ccp4_map ( const std::string &  path,
bool  setup 
)

◆ read_ccp4_mask()

Ccp4< int8_t > gemmi::read_ccp4_mask ( const std::string &  path,
bool  setup 
)

◆ friedel_mate_value() [1/4]

signed char gemmi::friedel_mate_value ( signed char  v)
inline

Definition at line 13 of file recgrid.hpp.

◆ friedel_mate_value() [2/4]

float gemmi::friedel_mate_value ( float  v)
inline

Definition at line 14 of file recgrid.hpp.

◆ friedel_mate_value() [3/4]

double gemmi::friedel_mate_value ( double