Overview¶
What is it for?¶
Gemmi is a library, accompanied by a set of programs, developed primarily for use in structural biology, and in particular in macromolecular crystallography (MX). For working with:
macromolecular models (content of PDB, PDBx/mmCIF and mmJSON files),
refinement restraints (CIF files) and small molecule models,
reflection data (MTZ and mmCIF formats),
crystallographic symmetry,
data on a 3D grid with crystallographic symmetry (electron density maps, masks, MRC/CCP4 format)
Parts of this library can be useful in structural bioinformatics (for symmetry-aware analysis of protein models), in chemical crystallography and in other molecular-structure sciences that use CIF files (we have the fastest open-source CIF parser).
Gemmi is open-source (MPL) and portable – it runs on Linux, Windows, macOS and even inside a web browser when compiled to WebAssembly. It is written in C++14, with Python (3.8+) bindings and a partial C and Fortran 2003 interface.
The project also maintains web-based tools and fancy PDB statistics.
Gemmi is a joint project of Global Phasing Ltd and CCP4. It is named after Gemmi Pass. The name can also be expanded as GEneral MacroMolecular I/o.
Source code repository: https://github.com/project-gemmi/gemmi
Note
You can ask questions in Discussions or Issues on GitHub. Alternatively, send me an email.
Contents¶
Prerequisites
Working with Molecules
Working with Data
Other Docs
- ChangeLog
- Python API reference
- C++ API Reference
- Core Data Structures
gemmiAtomGroupConstAtomGroupCraProxyConstCraProxyCoorFormatCalcFlagResidueSsResidueStrandSenseremove_empty_children()is_same_conformer()add_distinct_altlocs()atom_str()atom_str()atom_matches()make_address()find_entity_of_subchain()find_entity_of_subchain()assign_residue_ss_from_file()gemmi::Atomgemmi::AtomGroup_gemmi::Chainchild_typeChain()Chain()whole()whole()get_residue_span()get_residue_span()get_polymer()get_polymer()get_ligands()get_ligands()get_waters()get_waters()get_subchain()get_subchain()subchains()subchains()find_residue_group()find_residue_group()find_residue()find_residue()find_or_add_residue()append_residues()empty_copy()children()children()is_first_in_group()previous_residue()next_residue()first_conformer()first_conformer()nameresidueswhat()
gemmi::const_CRAgemmi::ConstResidueGroupgemmi::ConstResidueSpangemmi::CRAgemmi::CraIterPolicygemmi::CraProxy_gemmi::Modelchild_typeModel()Model()find_chain()find_chain()find_last_chain()remove_chain()merge_chain_parts()get_subchain()get_subchain()subchains()subchains()subchain_to_chain()find_residue()find_residue()find_residue_group()sole_residue()get_all_residue_names()find_cra()find_cra()all()all()find_atom()find_atom()get_indices()present_elements()empty_copy()children()children()numchainswhat()
gemmi::PdbReadOptionsgemmi::ResidueOptionalNumchild_typeResidue()Residue()empty_copy()children()children()find_by_element()find_atom()find_atom()find_atom_iter()get()sole_atom()get_ca()get_c()get_n()get_o()get_p()get_o3prim()same_conformer()is_water()first_conformer()first_conformer()subchainentity_idlabel_seqentity_typehet_flagflagss_from_filestrand_sense_from_filesifts_unpgroup_idxatomswhat()
gemmi::ResidueGroupgemmi::ResidueSpangemmi::Structurechild_typefind_spacegroup()get_info()first_model()first_model()find_model()find_model()find_or_add_model()renumber_models()get_entity()get_entity()get_entity_of()get_entity_of()find_assembly()find_connection_by_name()find_connection_by_name()find_connection_by_cra()find_connection()ncs_given_count()get_ncs_multiplier()ncs_not_expanded()add_conect_one_way()add_conect()merge_chain_parts()remove_empty_chains()empty_copy()children()children()setup_cell_images()namecellspacegroup_hmmodelsncsentitiesconnectionscispepsmod_residuessiteshelicessheetsassembliesconect_mapmetainput_formathas_d_fractionnon_ascii_lineter_statushas_origxorigxinfochemcompsshortened_ccd_codesraw_remarksresolutionwhat()
gemmi::impl
MillerAsurot_as_mat33()rot_as_mat33()tran_as_vec3()operator*()gemmi::Fractionalgemmi::FTransformgemmi::MillerHashgemmi::NcsOpgemmi::NearestImagegemmi::Positiongemmi::UnitCellUnitCell()UnitCell()UnitCell()is_crystal()is_similar()calculate_properties()cos_alpha()calculate_matrix_B()calculate_u_eq()set_matrices_from_fract()set()set_from_parameters()set_from_array()set_from_vectors()changed_basis_backward()changed_basis_forward()is_compatible_with_groupops()is_compatible_with_spacegroup()set_cell_images_from_groupops()set_cell_images_from_spacegroup()add_ncs_images_to_cs_images()get_ncs_transforms()orthogonalize()fractionalize()orthogonalize_difference()fractionalize_difference()orthogonalize_box()orthogonalize_transform()op_as_transform()distance_sq()distance_sq()volume_per_image()find_nearest_image()apply_transform()find_nearest_pbc_image()find_nearest_pbc_image()find_nearest_pbc_images()orthogonalize_in_pbc()find_nearest_pbc_position()fract_image()is_special_position()is_special_position()calculate_1_d2_double()calculate_1_d2()calculate_d()calculate_stol_sq()metric_tensor()reciprocal_metric_tensor()reciprocal()get_hkl_limits()primitive_orth_matrix()orthfracvolumearbrcrcos_alpharcos_betarcos_gammarexplicit_matricescs_countimagessearch_pbc_images()
gemmi::UnitCellParametersCrystalSystemPointGroupLaueoperator==()operator!=()operator*()operator*=()seitz_to_op()append_op_fraction()parse_triplet_part()parse_triplet()centring_vectors()split_centering_vectors()generators_from_hall()symops_from_hall()crystal_system_str()point_group_hm()pointgroup_to_laue()laue_to_pointgroup()laue_class_str()crystal_system()crystal_system()point_group_index_and_category()point_group()is_sohncke()is_enantiomorphic()is_symmorphic()nonzero_inversion_center()get_basisop()centred_to_primitive()find_spacegroup_by_number()get_spacegroup_by_number()get_spacegroup_reference_setting()find_spacegroup_by_name()get_spacegroup_by_name()get_spacegroup_p1()find_spacegroup_by_ops()gemmi::GroupOpsorder()add_missing_elements()add_missing_elements_part2()add_inversion()find_centering()find_by_rotation()find_by_rotation()is_centrosymmetric()is_reflection_centric()epsilon_factor_without_centering()epsilon_factor()is_systematically_absent()change_basis_impl()change_basis_forward()change_basis_backward()all_ops_sorted()get_op()is_same_as()has_same_centring()has_same_rotations()find_grid_factors()are_directions_symmetry_related()derive_symmorphic()begin()end()sym_opscen_opshas_phase_shift()gemmi::GroupOps::Iter
gemmi::OpRotTranMilleris_hkl()as_hkl()as_xyz()triplet()inverse()wrapped_tran()wrap()translate()translated()add_centering()negated_rot()transposed_rot()det_rot()rot_type()combine()apply_to_xyz()apply_to_hkl_without_division()apply_to_hkl()phase_shift()int_seitz()float_seitz()operator<()rottrannotationtranspose()divide_hkl_by_DEN()identity()inversion_rot()DEN
gemmi::ReciprocalAsugemmi::SpaceGroupxhm()centring_type()ccp4_lattice_type()short_name()pdb_name()is_sohncke()is_enantiomorphic()is_symmorphic()point_group()point_group_hm()laue_class()laue_str()crystal_system()crystal_system_str()is_centrosymmetric()monoclinic_unique_axis()basisop_str()basisop()is_reference_setting()centred_to_primitive()change_of_hand_op()operations()numberccp4hmextqualifierhallbasisop_idx
gemmi::spacegroup_tablesgemmi::SpaceGroupAltNamestdEntityTypePolymerTypeis_polypeptide()is_polynucleotide()gemmi::Assemblygemmi::BasicRefinementInfogemmi::CisPepgemmi::Connectiongemmi::CrystalInfogemmi::DiffractionInfogemmi::Entitygemmi::ExperimentInfogemmi::Helixgemmi::Metadatagemmi::ModResgemmi::RefinementInfogemmi::ReflectionsInfogemmi::Sheetgemmi::SiftsUnpResiduegemmi::SoftwareItemgemmi::StructSitegemmi::TlsGroupelname_tElXHHeLiBeBCNOFNeNaMgAlSiPSClArKCaScTiVCrMnFeCoNiCuZnGaGeAsSeBrKrRbSrYZrNbMoTcRuRhPdAgCdInSnSbTeIXeCsBaLaCePrNdPmSmEuGdTbDyHoErTmYbLuHfTaWReOsIrPtAuHgTlPbBiPoAtRnFrRaAcThPaUNpPuAmCmBkCfEsFmMdNoLrRfDbSgBhHsMtDsRgCnNhFlMcLvTsOgDEND
is_hydrogen()element_row()element_group()is_metal_value()is_metal()set_is_metal()ce_almost_eq()molecular_weight()covalent_radius()vdw_radius()element_name()element_uppercase_name()find_element()gemmi::Elementfind_single_letter_element()atom_str()gemmi::AtomAddressgemmi::OptionalIntgemmi::ResidueIdgemmi::SeqIdstd::hash< gemmi::ResidueId >ResidueKindget_residue_info()find_tabulated_residue_idx()unknown_tabulated_residue_idx()find_tabulated_residue()expand_one_letter()expand_one_letter_sequence()expand_protein_one_letter()expand_protein_one_letter_string()gemmi::ResidueInfois_complete()triplets_to_ops()split_element_and_charge()gemmi::SmallStructureget_all_unit_cell_sites()determine_and_set_spacegroup()determine_spacegroup_from()check_spacegroup()get_atom_type()present_elements()remove_hydrogens()change_occupancies_to_crystallographic()setup_cell_images()namecellspacegroupspacegroup_hmspacegroup_hallspacegroup_numbersymopssitesatom_typeswavelengthgemmi::SmallStructure::AtomTypegemmi::SmallStructure::Site
- Map and Grid Data
- CIF Data Reading and Writing
gemmi::cifPairItemTypechar_table()assert_tag()ensure_mmcif_category()is_null()as_string()as_string()as_char()as_int()as_int()as_any()as_any()cif_fail()check_for_missing_values_in_block()check_for_missing_values()check_for_duplicates()check_empty_loops()is_text_field()quote()gemmi::cif::BlockBlock()Block()swap()find_pair_item()find_pair()find_loop()find_loop_item()find_value()find_values()has_tag()has_any_value()find()find()find_any()find_or_add()find_frame()item_as_table()get_index()set_pair()init_loop()move_item()get_mmcif_category_names()find_mmcif_category()has_mmcif_category()init_mmcif_loop()nameitemssetup_loop_item()setup_loop()
gemmi::cif::Columngemmi::cif::CommentArggemmi::cif::Documentgemmi::cif::FrameArggemmi::cif::Itemgemmi::cif::ItemSpangemmi::cif::Loopgemmi::cif::LoopArggemmi::cif::Tableget_loop()ok()width()length()size()has_column()tags()operator[]()at_check()at()one()get_prefix()find_row()append_row()append_row()remove_row()remove_rows()column_at_pos()column()move_row()find_column_position()find_column()erase()ensure_loop()begin()end()loop_itemblocpositionsprefix_lengthgemmi::cif::Table::iteratorgemmi::cif::Table::Row
error_msgGEMMI_CIF_FILE_INPUTerror_message()parse_input()read_input()parse_one_block()read_file()read_memory()read_cstream()read_istream()try_parse()read()check_syntax()read_one_block()gemmi::cif::Actiongemmi::cif::Action< rules::datablockname >gemmi::cif::Action< rules::endframe >gemmi::cif::Action< rules::framename >gemmi::cif::Action< rules::item_tag >gemmi::cif::Action< rules::item_value >gemmi::cif::Action< rules::loop >gemmi::cif::Action< rules::loop_tag >gemmi::cif::Action< rules::loop_value >gemmi::cif::Action< rules::str_global >gemmi::cif::Action< rules::str_loop >gemmi::cif::CheckActiongemmi::cif::CheckAction< rules::missing_value >gemmi::cif::rulesordinary_charws_chargemmi::cif::rules::anyprint_chgemmi::cif::rules::commentgemmi::cif::rules::contentgemmi::cif::rules::datablockgemmi::cif::rules::datablockheadinggemmi::cif::rules::datablocknamegemmi::cif::rules::dataitemgemmi::cif::rules::doublequotedgemmi::cif::rules::endframegemmi::cif::rules::endqgemmi::cif::rules::field_sepgemmi::cif::rules::filegemmi::cif::rules::framegemmi::cif::rules::framenamegemmi::cif::rules::item_taggemmi::cif::rules::item_valuegemmi::cif::rules::keywordgemmi::cif::rules::lookup_chargemmi::cif::rules::loopgemmi::cif::rules::loop_endgemmi::cif::rules::loop_taggemmi::cif::rules::loop_valuegemmi::cif::rules::missing_valuegemmi::cif::rules::nonblank_chgemmi::cif::rules::one_blockgemmi::cif::rules::quotedgemmi::cif::rules::quoted_tailgemmi::cif::rules::simunqgemmi::cif::rules::str_datagemmi::cif::rules::str_globalgemmi::cif::rules::str_loopgemmi::cif::rules::str_savegemmi::cif::rules::str_stopgemmi::cif::rules::taggemmi::cif::rules::textfieldgemmi::cif::rules::unquotedgemmi::cif::rules::valuegemmi::cif::rules::whitespacegemmi::cif::rules::ws_or_eof
read_cif_gz()check_cif_syntax_gz()read_mmjson_gz()read_into_buffer_gz()read_cif_from_memory()read_first_block_gz()read_cif_or_mmjson_gz()read_string()Stylewrite_text_field()write_out_pair()write_out_loop()write_out_item()should_be_separated_()write_cif_block_to_stream()write_cif_to_stream()gemmi::cif::BufOstreamgemmi::cif::WriteOptionswrite_json_to_stream()write_mmjson_to_stream()gemmi::cif::JsonWriteOptionsread_mmjson_insitu()read_mmjson_file()read_mmjson()as_number()is_numb()as_any()as_any()gemmi::cif::DdlDdl()Ddl()operator=()read_ddl()validate_cif()validate_block()check_audit_conform()regexes()loggerprint_unknown_tagsuse_regexuse_contextuse_parentsuse_mandatoryuse_unique_keysuse_deposition_checksmajor_versiondict_namedict_versionfind_rules()check_mandatory_items()check_unique_keys_in_loop()check_parents()check_parent_link()read_ddl1_block()read_ddl2_block()warn()ddl_docs_name_index_regexes_parents_item_parents_gemmi::cif::Ddl::ParentLink
- Structure I/O
ChemCompModelpopulate_structure_from_block()make_structure_from_block()make_structure()operator|()make_residue_from_chemcomp_block()make_model_from_chemcomp_block()make_structure_from_chemcomp_block()check_chemcomp_block_number()make_structure_from_chemcomp_doc()coor_format_from_ext()coor_format_from_content()make_structure_from_doc()read_structure_from_memory()read_structure_from_char_array()read_structure()read_structure_file()read_structure_gz()read_pdb_gz()read_structure_from_chemcomp_gz()coor_format_from_ext_gz()is_record_type4()is_record_type3()read_remark_290()populate_structure_from_pdb_stream()populate_structure_from_pdb_memory()populate_structure_from_pdb_string()read_pdb_from_stream()read_pdb_file()read_pdb_from_memory()read_pdb_string()read_pdb()update_mmcif_block()make_mmcif_document()make_mmcif_block()make_mmcif_headers()add_minimal_mmcif_data()write_ncs_oper()write_struct_conn()write_cispeps()write_struct_sites()gemmi::MmcifOutputGroupsMmcifOutputGroups()atomsblock_nameentrydatabase_statusauthorcellsymmetryentityentity_polystruct_refchem_compexptldiffrnreflnsrefinetitle_keywordsncsstruct_asymorigxstruct_confstruct_sheetstruct_biolassemblyconncismodresstruct_sitescaleatom_typeentity_poly_seqtlssoftwaregroup_pdbauth_all
use_hetatm()write_pdb()make_pdb_string()write_minimal_pdb()make_pdb_headers()gemmi::PdbWriteOptionssetup_for_crd()add_automatic_links()add_dictionary_blocks()prepare_refmac_crd()make_small_structure_from_block()make_cif_block_from_small_structure()copy_transform_to_mmdb()strcpy_to_mmdb()set_seqid_in_mmdb()seqid_from_mmdb()cispep_to_mmdb()cispep_from_mmdb()transfer_links_to_mmdb()transfer_links_from_mmdb()set_mmdb_seqres()has_sequences()transfer_seqres_to_mmdb()copy_to_mmdb()copy_atom_from_mmdb()copy_residue_from_mmdb()get_gemmi_sequence()copy_chain_from_mmdb()copy_model_from_mmdb()copy_from_mmdb()is_pir_format()read_pir_or_fasta()gemmi::FastaSeq
- Map and Grid Data
AxisOrderGridSizeRoundingmodulo()has_small_factorization()round_with_small_factorization()good_grid_size()check_grid_factors()lerp_()lerp_()cubic_interpolation()cubic_interpolation_der()interpolate_grid()calculate_correlation()gemmi::GridPointcopy_metadata_from()calculate_spacing()set_size_without_checking()set_size()set_size_from_spacing()set_unit_cell()set_unit_cell()setup_from()index_s()get_value()set_value()get_point()get_nearest_point()get_nearest_point()get_nearest_index()point_to_fractional()point_to_position()trilinear_interpolation()trilinear_interpolation()trilinear_interpolation()tricubic_interpolation()tricubic_interpolation()tricubic_interpolation()tricubic_interpolation_der()tricubic_interpolation_der()interpolate_value()interpolate_value()get_subarray()set_subarray()check_size_for_points_in_box()do_use_points_in_box()use_points_in_box()use_points_around()set_points_around()change_values()symmetrize()symmetrize_using_ops()symmetrize_min()symmetrize_max()symmetrize_abs_max()symmetrize_sum()symmetrize_nondefault()symmetrize_avg()normalize()spacingorth_ngrid_modulo()copy_4x4x4()
gemmi::GridBasegemmi::GridMetagemmi::GridOpfloat16_typeMapSetupread_ccp4_map()read_ccp4_mask()read_ccp4_header()gemmi::Ccp4gemmi::Ccp4Baseheader_word()header_word()header_i32()header_3i32()header_float()header_str()set_header_i32()set_header_3i32()set_header_float()set_header_str()axis_positions()header_rfloat()get_extent()has_skew_transformation()get_skew_transformation()get_origin()prepare_ccp4_header_except_mode_and_stats()update_header_mode_and_stats()full_cell_()read_ccp4_header_()hstatsccp4_headersame_byte_order
translate_map_point()translate_map_point< float, std::int8_t >()translate_map_point< float16_type, std::int8_t >()read_data()write_data()FPhiGridfriedel_mate_value()friedel_mate_value()gemmi::ReciprocalGriddetermine_cutoff_radius()it92_radius_approx()gemmi::DensityCalculatorCRealrequested_grid_spacing()set_refmac_compatible_blur()add_atom_density_to_grid()add_c_contribution_to_grid()estimate_radius()do_add_atom_density_to_grid()initialize_grid()add_model_density_to_grid()put_model_density_on_grid()set_grid_cell_and_spacegroup()reciprocal_space_multiplier()mott_bethe_factor()gridd_minrateblurcutoffaddends
find_asu_brick()get_asu_mask()masked_asu()get_nonzero_extent()gemmi::AsuBrickgemmi::MaskedGridtrim_false_values()AtomicRadiiSetcctbx_vdw_radius()refmac_radius_for_bulk_solvent()mask_points_in_radius()mask_points_in_constant_radius()distinct_altlocs()mask_points_using_occupancy()set_margin_around()mask_with_node_info()unmask_symmetry_mates()interpolate_grid_around_model()add_soft_edge_to_mask()gemmi::NodeInfogemmi::SolventMaskermask_nodes_above_threshold()flood_fill_above()gemmi::FloodFillPOCKETFFT_NO_MULTITHREADINGphase_in_angles()add_asu_f_phi_to_float_vector()get_size_for_hkl()data_fits_into()add_friedel_mates()initialize_hkl_grid()get_f_phi_on_grid()get_value_on_grid()transform_f_phi_grid_to_map_()transform_f_phi_grid_to_map()transform_f_phi_to_map()transform_f_phi_to_map2()transform_map_to_f_phi()gemmi::FPhiProxyfor_all_reflections()count_reflections()make_miller_vector()
- Chemistry and Restraints
BondTypeChiralityTypeis_aromatic_or_deloc()angle_z()chiral_abs_volume()bond_type_from_string()bond_type_to_string()order_of_bond_type()chirality_from_string()chirality_from_flag_and_volume()chirality_to_string()make_chemcomp_from_block()gemmi::ChemCompGroupget_aliasing()set_group()find_atom()find_atom()has_atom()find_atom_by_old_name()find_atom_by_old_name()has_old_names()get_atom_index()find_atom_index()make_atom_index()get_atom()remove_nonmatching_restraints()remove_hydrogens()nametype_or_groupgrouphas_coordinatesatomsaliasesrtread_group()group_str()is_peptide_group()is_nucleotide_group()gemmi::ChemComp::Aliasinggemmi::ChemComp::Atom
gemmi::RestraintsDistanceOfempty()find_bond()find_bond()get_bond()are_bonded()first_bonded_atom()find_shortest_path()find_angle()find_angle()get_angle()find_torsion()find_torsion()find_chir()find_chir()chiral_abs_volume()get_plane()get_or_add_plane()rename_atom()bondsanglestorsionschirsplaneslexicographic_str()gemmi::Restraints::Anglegemmi::Restraints::AtomIdgemmi::Restraints::Bondgemmi::Restraints::Chiralitygemmi::Restraints::Planegemmi::Restraints::Torsion
generate_chemcomp_xyz_from_restraints()refine_chemcomp_xyz()operator<()operator<()gemmi::EnerLibatom_match_with_alias()read_monomer_lib()gemmi::ChemLinkgemmi::ChemModgemmi::MonLibHydrogenChangeprepare_topology()make_chemcomp_with_restraints()find_missing_atoms()gemmi::TopoRKindTopo()Topo()operator=()find_resinfo()first_bond_in_link()take_bond()take_angle()get_chirality()ideal_chiral_abs_volume()apply_restraints()apply_restraints_from_link()initialize_refmac_topology()apply_all_restraints()create_indices()find_polymer_link()set_cispeps_in_structure()loggeronly_bondschain_infosextrasbondsanglestorsionschirsplanesbond_indexangle_indextorsion_indexplane_indexhas_atom()setup_connection()rt_storagecc_cachecc_storagegemmi::Topo::Anglegemmi::Topo::Bondgemmi::Topo::ChainInfogemmi::Topo::Chiralitygemmi::Topo::FinalChemCompgemmi::Topo::Linkgemmi::Topo::Modgemmi::Topo::Planegemmi::Topo::ResInfogemmi::Topo::Rulegemmi::Topo::Torsion
place_hydrogens_on_all_atoms()adjust_hydrogen_distances()gemmi::LinkHuntadd_chemcomp_to_block()
- Calculations and Analysis
has_hydrogen()has_hydrogen()count_atom_sites()count_atom_sites()count_occupancies()count_occupancies()calculate_mass()calculate_mass()calculate_center_of_mass()calculate_center_of_mass()calculate_b_iso_range()calculate_b_iso_range()calculate_b_aniso_range()expand_box()expand_box()calculate_box()calculate_fractional_box()calculate_b_est()calculate_angle()calculate_dihedral()calculate_dihedral_from_atoms()calculate_omega()is_peptide_bond_cis()calculate_chiral_volume()calculate_phi_psi()find_best_plane()get_distance_from_plane()parse_triplet_as_ftransform()calculate_u_from_tls()gemmi::CenterOfMassSupSelectprepare_positions_for_superposition()calculate_current_rmsd()calculate_superposition()calculate_superpositions_in_moving_window()prepare_target_gapo()align_sequence_to_polymer()seqid_matches_seqres()clear_sequences()assign_best_sequences()assign_label_seq_to_polymer()clear_label_seq_id()assign_label_seq_id()gemmi::NeighborSearchNeighborSearch()NeighborSearch()NeighborSearch()populate()add_chain()add_chain_n()add_atom()add_site()get_subcell()for_each_cell()for_each()sufficient_k()find_atoms()find_neighbors()find_site_neighbors()find_nearest_atom_within_k()find_nearest_atom()dist_sq()dist()get_image_transformation()gridradius_specifiedmodelsmall_structureuse_pbcinclude_hset_grid_size()set_bounding_cell()gemmi::NeighborSearch::Mark
gemmi::ContactSearchHowToNameCopiedChainensure_unique_chain_name()make_assembly()pseudo_assembly_for_unit_cell()transform_to_assembly()expand_ncs_model()merge_atoms_in_expanded_model()shorten_chain_names()expand_ncs()split_chains_by_segments()get_nearby_sym_ops()get_sym_image()gemmi::ChainNameGeneratorgemmi::SelectionSelection()Selection()str()matches()matches()matches()matches()matches()matches()models()chains()residues()atoms()first_in_model()first()add_matching_children()add_matching_children()set_residue_flags()set_atom_flags()copy_selection()remove_selected()remove_selected()remove_not_selected()remove_not_selected()mdlchain_idsfrom_seqidto_seqidresidue_namesentity_typeset_flagsatom_nameselementsaltlocsresidue_flagsatom_flagsatom_inequalitiesgemmi::Selection::AtomInequalitygemmi::Selection::FlagListgemmi::Selection::Listgemmi::Selection::SequenceId
remove_alternative_conformations()remove_alternative_conformations()remove_hydrogens()remove_hydrogens()assign_b_iso()assign_b_iso()remove_anisou()remove_anisou()ensure_anisou()ensure_anisou()transform_pos_and_adp()transform_pos_and_adp()assign_serial_numbers()assign_serial_numbers()process_addresses()process_sequence_ids()rename_chain()rename_residues()rename_atom_names()replace_d_fraction_with_altlocs()replace_deuterium_with_fraction()store_deuterium_as_fraction()set_deuterium_fraction_of_hydrogens()standardize_crystal_frame()check_polymer_type()get_or_check_polymer_type()get_mainchain_atoms()in_peptide_bond_distance()have_peptide_bond()in_nucleotide_bond_distance()have_nucleotide_bond()are_connected()are_connected2()are_connected3()make_one_letter_sequence()add_entity_types()add_entity_types()remove_entity_types()add_entity_ids()assign_subchain_names()assign_subchains()ensure_entities()deduplicate_entities()setup_entities()recommended_het_flag()assign_het_flags()assign_het_flags()remove_waters()remove_waters()remove_ligands_and_waters()remove_ligands_and_waters()trim_to_alanine()trim_to_alanine()shorten_ccd_codes()restore_full_ccd_codes()add_microhetero_to_sequences()add_tls_group_ids()gemmi::AtomNameElementSecondaryStructureTurnTypeHelixPositionBridgeTypeHydrogenModeHBondDefinitioncalculate_dssp()gemmi::Bridgegemmi::DsspCalculatorgemmi::DsspOptionsgemmi::HBondgemmi::SecondaryStructureInfo
- Structure Factor Calculations
calculate_sf_part()gemmi::StructureFactorCalculatorcoef_typeStructureFactorCalculator()set_stol2_and_scattering_factors()get_scattering_factor()dwf_iso()dwf_iso()dwf_aniso()dwf_aniso()calculate_sf_from_atom_sf()calculate_sf_from_atom()calculate_sf_from_model()calculate_mb_z()mott_bethe_factor()calculate_sf_from_small_structure()addendscell_stol2_scattering_factors_
calculate_amplitude_normalizers()Vec6vec6_dot()adp_symmetry_constraints()gemmi::ScalingScaling()set_b_overall()get_b_overall()scale_data()scale_value()get_parameters()set_parameters()set_parameters()prepare_points()get_solvent_scale()get_overall_scale_factor()get_fcalc()fit_isotropic_b_approximately()lsq_k_overall()fit_b_star_approximately()fit_parameters()calculate_r_factor()compute_value()compute_value_and_derivatives()cellk_overallb_starconstraint_matrixuse_solventfix_k_solfix_b_solk_solb_solpointsgemmi::Scaling::Point
- I/O and Filesystem Utilities
CifWalkMmCifWalkPdbWalkCoorFileWalkas_utf8()gemmi::DirWalkgemmi::GlobWalkis_rxsf_ent_filename()utf8_tinydir_file_open()gemmi::impl::IsAnyFilegemmi::impl::IsCifFilegemmi::impl::IsCoordinateFilegemmi::impl::IsMatchingFilegemmi::impl::IsMmCifFilegemmi::impl::IsPdbFilefileptr_tpath_basename()file_open()file_open_or_null()file_open_or()file_size()is_little_endian()swap_two_bytes()swap_four_bytes()swap_eight_bytes()read_file_into_buffer()read_stdin_into_buffer()read_into_buffer()gemmi::CharArraygemmi::needs_fcloseopen_stream_from_utf8_path()gemmi::Ifstreamgemmi::Ofstreamestimate_uncompressed_size()zlib_descriptiongemmi::GzStreamgemmi::MaybeGzippedgemmi::AnyStreamgemmi::BasicInputgemmi::FileStreamgemmi::MemoryStreamglob_match()gemmi::Loggerall_alnums()is_pdb_code()path_in_pdb_dir()expand_pdb_code_to_path()expand_if_pdb_code()append_to_str()append_to_str()append_to_str()append_to_str()cat_to()cat_to()cat()starts_with()starts_with()ends_with()lower()alpha_up()to_lower()to_upper()isame()iequal_from()iequal()istarts_with()iends_with()giends_with()trim_str()rtrim_str()rtrim_cstr()split_str_into()split_str()split_str_into_multi()split_str_multi()join_str()join_str()join_str()join_str()string_append_sep()replace_all()is_in_list()in_vector()in_vector_f()vector_end_ptr()vector_end_ptr()vector_move_extend()vector_remove_if()vector_insert_columns()vector_remove_column()ialpha4_id()ialpha3_id()length()length()
- Low-level Primitives
gemmi::MutableVectorSpangemmi::SpanStrideIterIndirectIterUniqIterGroupingIterFilterItergemmi::BidirIteratorgemmi::ConstFilterProxygemmi::ConstUniqProxygemmi::FilterIterPolicygemmi::FilterProxygemmi::GroupingIterPolicygemmi::IndirectIterPolicygemmi::ItemGroupgemmi::StrideIterPolicygemmi::UniqIterPolicygemmi::UniqProxyGEMMI_COLDGEMMI_LIKELYGEMMI_UNLIKELYGEMMI_DLLfail()fail()unreachable()fast_from_chars()fast_from_chars()fast_atof()is_space()is_blank()is_digit()skip_blank()skip_word()read_word()read_word()string_to_int()string_to_int()simple_atoi()no_sign_atoi()GEMMI_VERSION
- Miscellaneous
gemmi::Addendsgemmi::BondIndexread_dsn6_from_memory()read_dsn6_map()read_dsn6_i16()entity_type_to_string()entity_type_from_string()polymer_type_to_string()polymer_type_from_string()connection_type_to_string()connection_type_from_string()software_classification_to_string()software_classification_from_string()GEMMI_ATTRIBUTE_FORMATto_str()to_str_prec()to_chars_z()to_chars_z()combine_two_correlations()combine_correlations()calculate_data_statistics()gemmi::Correlationgemmi::Covariancegemmi::DataStatsgemmi::Variancemake_unique()compile_pymol_selection()select_atoms()remove_not_selected()gemmi::psimplChainNodeResnNodeAtomNameNodeCompareOpgemmi::psimpl::actiongemmi::psimpl::action< and_rest >gemmi::psimpl::action< op_eq >gemmi::psimpl::action< op_ge >gemmi::psimpl::action< op_gt >gemmi::psimpl::action< op_le >gemmi::psimpl::action< op_lt >gemmi::psimpl::action< op_ne >gemmi::psimpl::action< or_rest >gemmi::psimpl::action< rule_all >gemmi::psimpl::action< rule_backbone >gemmi::psimpl::action< rule_chain >gemmi::psimpl::action< rule_elem >gemmi::psimpl::action< rule_hetatm >gemmi::psimpl::action< rule_hydrogens >gemmi::psimpl::action< rule_name >gemmi::psimpl::action< rule_not >gemmi::psimpl::action< rule_polymer >gemmi::psimpl::action< rule_resn >gemmi::psimpl::action< rule_sidechain >gemmi::psimpl::action< rule_solvent >gemmi::psimpl::action< rule_water >gemmi::psimpl::action< val_alt >gemmi::psimpl::action< val_b_compare >gemmi::psimpl::action< val_chain_item >gemmi::psimpl::action< val_elem_item >gemmi::psimpl::action< val_index_range >gemmi::psimpl::action< val_index_single >gemmi::psimpl::action< val_name_item >gemmi::psimpl::action< val_q_compare >gemmi::psimpl::action< val_resi_range >gemmi::psimpl::action< val_resi_single >gemmi::psimpl::action< val_resn_item >gemmi::psimpl::AllNodegemmi::psimpl::AltLocNodegemmi::psimpl::and_restgemmi::psimpl::AndNodegemmi::psimpl::atom_name_strgemmi::psimpl::BackboneNodegemmi::psimpl::BfactorNodegemmi::psimpl::compare_opgemmi::psimpl::element_strgemmi::psimpl::ElementNodegemmi::psimpl::EntityTypeNodegemmi::psimpl::expressiongemmi::psimpl::factorgemmi::psimpl::float_numgemmi::psimpl::GlobMatchNodegemmi::psimpl::grammargemmi::psimpl::HetatmNodegemmi::psimpl::HydrogenNodegemmi::psimpl::identifiergemmi::psimpl::IndexRangeNodegemmi::psimpl::integergemmi::psimpl::kw_allgemmi::psimpl::kw_altgemmi::psimpl::kw_andgemmi::psimpl::kw_bgemmi::psimpl::kw_backbonegemmi::psimpl::kw_chaingemmi::psimpl::kw_elemgemmi::psimpl::kw_h_dotgemmi::psimpl::kw_hetatmgemmi::psimpl::kw_hydrogensgemmi::psimpl::kw_idgemmi::psimpl::kw_indexgemmi::psimpl::kw_namegemmi::psimpl::kw_notgemmi::psimpl::kw_orgemmi::psimpl::kw_polymergemmi::psimpl::kw_qgemmi::psimpl::kw_resigemmi::psimpl::kw_resngemmi::psimpl::kw_sidechaingemmi::psimpl::kw_solventgemmi::psimpl::kw_watergemmi::psimpl::Nodegemmi::psimpl::not_factorgemmi::psimpl::NotNodegemmi::psimpl::OccupancyNodegemmi::psimpl::op_eqgemmi::psimpl::op_gegemmi::psimpl::op_gtgemmi::psimpl::op_legemmi::psimpl::op_ltgemmi::psimpl::op_negemmi::psimpl::or_restgemmi::psimpl::OrNodegemmi::psimpl::parensgemmi::psimpl::propertygemmi::psimpl::ResiRangeNodegemmi::psimpl::rule_allgemmi::psimpl::rule_altgemmi::psimpl::rule_bgemmi::psimpl::rule_backbonegemmi::psimpl::rule_chaingemmi::psimpl::rule_elemgemmi::psimpl::rule_hetatmgemmi::psimpl::rule_hydrogensgemmi::psimpl::rule_indexgemmi::psimpl::rule_namegemmi::psimpl::rule_notgemmi::psimpl::rule_polymergemmi::psimpl::rule_qgemmi::psimpl::rule_resigemmi::psimpl::rule_resngemmi::psimpl::rule_sidechaingemmi::psimpl::rule_solventgemmi::psimpl::rule_watergemmi::psimpl::sepgemmi::psimpl::SidechainNodegemmi::psimpl::Stategemmi::psimpl::termgemmi::psimpl::val_altgemmi::psimpl::val_b_comparegemmi::psimpl::val_chain_itemgemmi::psimpl::val_chain_listgemmi::psimpl::val_elem_itemgemmi::psimpl::val_elem_listgemmi::psimpl::val_index_rangegemmi::psimpl::val_index_singlegemmi::psimpl::val_name_itemgemmi::psimpl::val_name_listgemmi::psimpl::val_q_comparegemmi::psimpl::val_resi_rangegemmi::psimpl::val_resi_singlegemmi::psimpl::val_resn_itemgemmi::psimpl::val_resn_listgemmi::psimpl::ws
- Scattering, Math, and Geometry
cromer_liberman_for_array()cromer_liberman()unsafe_expapprox()pow15()gemmi::ExpAnisoSumgemmi::ExpAnisoSum< N, float >gemmi::ExpSumgemmi::ExpSum< N, float >gemmi::GaussianCoefgemmi::IT92gemmi::C4322gemmi::CustomCoefgemmi::Neutron92gemmi::ZeroCoefevaluate_polynomial()bessel_i1_over_i0()bessel_i0()log_bessel_i0()gemmi::BesselTables_Vec3Vec3fpi()hc()bohrradius()mott_bethe_const()u_to_b()deg()rad()sq()sq()log_cosh()iround()angle_abs_diff()clamp()operator*()rotate_about_axis()gemmi::Boxgemmi::Mat33gemmi::SMat33gemmi::Transformgemmi::UpperTriangularMat33gemmi::Vec3_is_nan()is_nan()is_same()is_same()gemmi::GruberVectorGruberVector()GruberVector()GruberVector()GruberVector()set_change_of_basis()parameters()cell_parameters()get_cell()selling()is_normalized()is_buerger()normalize()buerger_step()buerger_reduce()niggli_step()niggli_reduce()is_niggli()ABCxietazetachange_of_basisswap_columns_and_negate()negate_column()add_column()
gemmi::SellingVector
- Sequence Alignment and Twinning
h2o_weight()calculate_sequence_weight()one_letter_code()pdbx_one_letter_code()sequence_kind()align_sequences()align_string_sequences()gemmi::AlignmentResultgemmi::AlignmentScoringOpObliquitycalculate_cos_obliquity()find_lattice_2fold_ops()find_lattice_symmetry_r()find_lattice_symmetry()find_twin_laws()TwoFoldgemmi::impl::TwoFold_gemmi::impl::TwoFoldDataSERIALIZESERIALIZE_PSERIALIZE_T1serialize()serialize()authorsatom_to_site()mx_to_sx_structure()gemmi::FlatAtomgemmi::FlatStructureSmartsMatchmatch_smarts()
- Density Analysis and Numerical Methods
find_blobs_by_flood_fill()gemmi::Blobgemmi::BlobCriteriamake_blob_of_points()gemmi::impl::GridConstPointIsoMethodiso_method_from_string()calculate_isosurface()extract_isosurface()gemmi::IsoSurfacejordan_solve()jordan_solve()print_parameters()compute_wssr()compute_gradients()compute_lm_matrices()gemmi::LevMarqcp_inner_product()fast_calc_rmsd_and_rotation()qcp_calculate_center()superpose_positions()calculate_rmsd_of_superposed_positions()gemmi::SupResult
- Reflection Data
read_mtz_file()read_mtz()data_proxy()gemmi::Mtzresolution_high()resolution_low()get_cell()get_cell()set_cell_for_all()get_average_cell_from_batch_headers()set_spacegroup()last_dataset()dataset()dataset()dataset_with_name()dataset_with_name()count()count_type()column_with_label()column_with_label()get_column_with_label()columns_with_type()positions_of_columns_with_type()positions_of_plus_minus_columns()column_with_one_of_labels()column_with_type_and_any_of_labels()rfree_column()rfree_column()imean_column()imean_column()iplus_column()iplus_column()iminus_column()iminus_column()has_data()is_merged()calculate_min_max_1_d2()update_reso()toggle_endianness()read_first_bytes()read_main_headers()read_history_and_batch_headers()setup_spacegroup()read_raw_data()read_all_headers()read_stream()read_file()read_input()read_file_gz()sorted_row_indices()sort()get_hkl()set_hkl()find_offset_of_hkl()ensure_asu()reindex()expand_to_p1()switch_to_original_hkl()switch_to_asu_hkl()add_dataset()add_column()replace_column()copy_column()remove_column()remove_rows_if()expand_data_rows()set_data()write_to_cstream()write_to_string()write_to_file()size_to_write()write_to_buffer()write_to_stream()Mtz()Mtz()operator=()Mtz()operator=()add_base()datasetscolumnsbatchesdatagemmi::Mtz::Batchgemmi::Mtz::Columngemmi::Mtz::Dataset
gemmi::MtzDataProxygemmi::MtzExternalDataProxygemmi::MtzMetadatagemmi::UnmergedHklMoveras_refln_blocks()get_refln_block()hkl_cif_as_refln_block()data_proxy()gemmi::ReflnBlockReflnBlock()ReflnBlock()ReflnBlock()operator=()operator=()ok()check_ok()tag_offset()use_unmerged()is_merged()is_unmerged()column_labels()find_column_index()get_column_index()make_vector()get_hkl_column_indices()make_miller_vector()make_1_d2_vector()make_d_vector()blockentry_idcellspacegroupwavelengthwavelength_countrefln_loopdiffrn_refln_loopdefault_loop
gemmi::ReflnDataProxypossible_old_style()transcript_old_anomalous_to_standard()gemmi::CifToMtzwrite_staraniso_b_in_mmcif()remove_appendix_from_column_names()validate_merged_mtz_deposition_columns()validate_merged_intensities()get_software_from_mtz_history()gemmi::MtzToCiflikely_in_house_source()read_xds_ascii_file()read_xds_ascii()gemmi::XdsAsciiXdsAscii()XdsAscii()find_or_add_iset()read_stream()read_input()is_merged()gather_iset_statistics()rot_angle()get_rotation_axis()get_s0_direction()has_cell_axes()calculate_conversion_from_cambridge()get_orientation()apply_polarization_correction()eliminate_overloads()eliminate_batchmin()datagemmi::XdsAscii::Refl
gemmi::XdsAsciiMetadataxds_to_mtz()DataTyperead_staraniso_b_from_mtz()check_data_type_under_symmetry()gemmi::Intensitiestype_str()spacegroup_str()resolution_range()calculate_correlation()add_if_valid()remove_systematic_absences()sort()merge_in_place()merged()calculate_merging_stats()prepare_for_merging()switch_to_asu_indices()import_unmerged_intensities_from_mtz()import_mean_intensities_from_mtz()import_anomalous_intensities_from_mtz()import_mtz()import_unmerged_intensities_from_mmcif()import_mean_intensities_from_mmcif()import_anomalous_intensities_from_mmcif()import_f_squared_from_mmcif()import_refln_block()import_xds()take_staraniso_b_from_mtz()take_staraniso_b_from_mmcif()prepare_merged_mtz()dataspacegroupunit_cellunit_cell_rmsdwavelengthtypeisym_opsstaraniso_btype_str()gemmi::Intensities::AnisoScalinggemmi::Intensities::Refl
gemmi::IntensitiesDataProxygemmi::MergingStatsgemmi::Binnerfor_matching_reflections()calculate_hkl_value_correlation()calculate_hkl_complex_correlation()count_equal_values()make_asu_data()make_asu_data()discard_by_sigma_ratio()gemmi::AsuDatagemmi::ComplexCorrelationgemmi::HklValuegemmi::ValueSigmamove_to_asu()move_to_asu()
- Map and Grid Data
- Core Data Structures
Credits¶
This project is using code from a number of third-party open-source projects.
Projects used in the C++ library, included under
include/gemmi/third_party/ (if used in headers) or third_party/:
PEGTL – library for creating PEG parsers. License: MIT.
sajson – high-performance JSON parser. License: MIT.
PocketFFT – FFT library. License: 3-clause BSD.
stb_sprintf – locale-independent snprintf() implementation. License: Public Domain.
fast_float – locale-independent number parsing. License: Apache 2.0.
tinydir – directory (filesystem) reader. License: 2-clause BSD.
Code derived from the following projects is used in the library:
ksw2 – sequence alignment in
seqalign.hppis based on the ksw_gg function from ksw2. License: MIT.QCProt – superposition method in
qcp.hppis taken from QCProt and adapted to our project. License: BSD.Larch – calculation of f’ and f” in
fprime.cppis based on CromerLiberman code from Larch. License: 2-clause BSD.
Projects included under third_party/ that are not used in the library
itself, but are used in command-line utilities, python bindings or tests:
zpp serializer – serialization framework. License: MIT.
The Lean Mean C++ Option Parser – command-line option parser. License: MIT.
doctest – testing framework. License: MIT.
linalg.h – linear algebra library. License: Public Domain.
zlib – a subset of the zlib library for decompressing gz files, used as a fallback when the zlib library is not found in the system. License: zlib.
Not distributed with Gemmi:
nanobind – used for creating Python bindings. License: 3-clause BSD.
zlib-ng – optional, can be used instead of zlib for faster reading of gzipped files.
cctbx – used in tests (if cctbx is not present, these tests are skipped) and in scripts that generated space group data and 2-fold twinning operations. License: 3-clause BSD.
Mentions:
NLOpt was used to try out various optimization methods for class Scaling. License: MIT.
Email me if I forgot about something.