Entry API¶
Introduction¶
The main class of the ccdc.entry
module is ccdc.entry.Entry
.
A ccdc.entry.Entry
is often a CSD entry. It contains attributes that
are beyond the concepts of chemistry and crystallography. An example of such
an attribute would be the publication details of a CSD entry.
>>> from ccdc.io import EntryReader
>>> csd_reader = EntryReader('CSD')
>>> abebuf = csd_reader.entry('ABEBUF')
>>> print(abebuf.publication)
Citation(authors='S.W.Gordon-Wylie, E.Teplin, J.C.Morris, M.I.Trombley, S.M.McCarthy, W.M.Cleaver, G.R.Clark',
journal='Journal(Crystal Growth and Design)',
volume='4', year=2004, first_page='789',
doi='10.1021/cg049957u')
However, a ccdc.entry.Entry
does not necessarily have to be a CSD
entry. If, for example, a sdf file is read in using a
ccdc.io.EntryReader
then the sdf tags will be added to a
dictionary-like object named attributes
of the entry. Entries read in from
CIF files will also contain attributes
with the raw data from the CIF
file.
See also
API¶
Entry¶
- class ccdc.entry.Entry(_entry=None)[source]¶
A database entry.
- class CrossReference(_xr)[source]¶
A cross-reference between entries in the database.
- property identifiers¶
A tuple containing identifiers of the cross-referenced entries.
- property scope¶
Whether the cross-reference applies to the individual identifier or the family of related identifiers.
- property text¶
The text of the cross-reference.
- property type¶
The type of cross-reference.
Available types are ‘Unknown’, ‘Racemate’, ‘Stereoisomer’, ‘Isomer’, ‘Reinterpretation of’, ‘Reinterpretation ref’, and ‘Coordinates ref’.
- property analogue¶
Analogue information.
- property bioactivity¶
Recorded information about bioactivity if available otherwise
None
.>>> from ccdc.io import EntryReader >>> csd_reader = EntryReader('CSD') >>> aadmpy10 = csd_reader.entry('AADMPY10') >>> print(aadmpy10.bioactivity) antineoplastic activity
- property calculated_density¶
The density.
- property ccdc_number¶
The CCDC deposition number.
>>> from ccdc.io import EntryReader >>> entry_reader = EntryReader('CSD') >>> abebuf = entry_reader.entry('ABEBUF') >>> print(abebuf.ccdc_number) 241370
- property chemical_name¶
The chemical name of the entry.
>>> from ccdc.io import EntryReader >>> csd_reader = EntryReader('CSD') >>> acsala13 = csd_reader.entry('ACSALA13') >>> print(acsala13.chemical_name) 2-acetoxybenzoic acid
- property chemical_name_as_html¶
The chemical name of the entry formatted as HTML.
>>> from ccdc.io import EntryReader >>> csd_reader = EntryReader('CSD') >>> e = csd_reader.entry('AACRHA') >>> print(e.chemical_name_as_html) Tetra-ammonium bis(bis(μ<sub>2</sub>-acetato-O,O')-bromo-rhodium(iv)) dibromide
- property color¶
The colour of the crystal if given, otherwise
None
.>>> from ccdc.io import EntryReader >>> csd_reader = EntryReader('CSD') >>> acesor = csd_reader.entry('ACESOR') >>> print(acesor.color) yellow
- property component_inchis¶
The list of component InChIs of this entry
Where available, the InChIs of the entry components are returned. Each InChI includes the following attributes:
- ivar inchi
the InChI string
- ivar key
the InChI key
- property cross_references¶
The tuple of
ccdc.entry.Entry.CrossReference
for this entry. These are cross-references between entries of the CSD.
- property crystal¶
The
ccdc.crystal.Crystal
contained in a database entry.
- property database_name¶
The name of the source database.
>>> from ccdc.io import EntryReader >>> csd_reader = EntryReader('CSD') >>> acesor = csd_reader.entry('ACESOR') >>> print(acesor.database_name) as536be_ASER
- property deposition_date¶
The date when this entry was deposited as a datetime.date object or None if the date is not available.
- property disorder_details¶
Information about any disorder present if given otherwise
None
.>>> from ccdc.io import EntryReader >>> csd_reader = EntryReader('CSD') >>> abacir = csd_reader.entry('ABACIR') >>> print(abacir.disorder_details) O4 and O4A disordered over two sites with occupancies 0.578:0.422.
- property disordered_molecule¶
The
ccdc.molecule.Molecule
contained in a database entry, including disordered atoms.
- property formatted_melting_point_range¶
Get the formatted melting point in default units.
- Returns
a three-item tuple containing the minimum value, maximum value and units string. If the melting point is a single value the min and max will be set to the same value.
- property formatted_melting_point_text¶
Get the formatted melting point descriptive text.
- property formula¶
The published chemical formula in an entry.
If no published chemical formula is available it will be calculated from the molecule.
>>> from ccdc.io import EntryReader >>> csd_reader = EntryReader('CSD') >>> aacani10 = csd_reader.entry('AACANI10') >>> print(aacani10.formula) C10 H18 N2 Ni1 O5,2(H2 O1)
- static from_molecule(mol, **attributes)[source]¶
Construct an entry from a molecule, using the keyword arguments as attributes.
- static from_string(s, format='')[source]¶
Create an entry from a string representation.
The format will be auto-detected if not specified.
- Parameters
s – string representation of an entry, crystal or molecule
format – one of ‘mol2’, ‘sdf’, ‘mol’ or ‘cif’
- Returns
- Raises
TypeError if the format string is not ‘’, ‘mol2’, ‘sdf’, ‘mol’, ‘cif’ or ‘smiles’.
- Raises
RuntimeError if the string representation is incorrectly formatted
- property habit¶
The crystal habit.
- property has_3d_structure¶
Whether the entry has 3d information.
>>> from ccdc.io import EntryReader >>> csd_reader = EntryReader('CSD') >>> aqefor = csd_reader.entry('AQEFOR') >>> aqefor.has_3d_structure False
- property has_disorder¶
Whether the structure has disorder.
>>> from ccdc.io import EntryReader >>> csd_reader = EntryReader('CSD') >>> abacir = csd_reader.entry('ABACIR') >>> abacir.has_disorder True
- property heat_capacity¶
Get or set the heat capacity.
- Returns
a two-item tuple containing the heat capacity value and units
When setting, pass a tuple with either a single value, or a value and a units string.
>>> from ccdc.entry import Entry >>> e=Entry.from_string("OCO") >>> e.heat_capacity=(54.55,) >>> e.heat_capacity (54.55, '') >>> e.heat_capacity=(54.55,'J/K') >>> e.heat_capacity (54.55, 'J/K')
- property heat_capacity_notes¶
Get or set the notes on the heat capacity
>>> from ccdc.entry import Entry >>> e=Entry.from_string("OCO") >>> e.heat_capacity_notes '' >>> e.heat_capacity_notes='from Wikipedia, at 189.78K' >>> e.heat_capacity_notes 'from Wikipedia, at 189.78K'
- property heat_of_fusion¶
Get or set the heat of fusion
A tuple is required to set this. The first item is a value or lower bound for heat of fusion. The optional second item is an upper bound for heat of fusion, or None. The optional third item is units for the heat of fusion.
>>> from ccdc.entry import Entry >>> e=Entry.from_string("OCO") >>> e.heat_of_fusion = (9.019,) >>> e.heat_of_fusion (9.019, 9.019, '') >>> e.heat_of_fusion = (9,9.1) >>> e.heat_of_fusion (9.0, 9.1, '') >>> e.heat_of_fusion = (9,9.1,'KJ/mol') >>> e.heat_of_fusion (9.0, 9.1, 'KJ/mol')
- property heat_of_fusion_notes¶
Get or set the notes of heat of fusion
- property identifier¶
The string identifier of the entry, e.g. ‘ABEBUF’.
- property input_melting_point_range¶
Set or get the original input unparsed melting point range.
When setting pass in a tuple e.g. (285,) no max value provided, use the default units. (28.2, None, “deg.C”) single value, use degrees centigrade (28.2, 29.5, “deg.C”) min, max, use degrees centigrade (275, 278) min and max, default units (275, 278, “K”) min and max in Kelvin
- property input_melting_point_text¶
Get or set the input melting point text.
- property is_organic¶
Whether the structure is organic.
>>> from ccdc.io import EntryReader >>> csd_reader = EntryReader('CSD') >>> aacani10 = csd_reader.entry('AACANI10') >>> aacani10.is_organic False
- property is_organometallic¶
Whether the structure is organometallic.
>>> from ccdc.io import EntryReader >>> csd_reader = EntryReader('CSD') >>> aacani10 = csd_reader.entry('AACANI10') >>> aacani10.is_organometallic True
- property is_polymeric¶
Whether the structure contains polymeric bonds.
>>> from ccdc.io import EntryReader >>> csd = EntryReader('CSD') >>> abacuf = csd.entry('ABACUF') >>> abacuf.is_polymeric True
- property is_powder_study¶
Whether or not the crystal determination was performed on a powder study
>>> from ccdc.io import EntryReader >>> csd = EntryReader('csd') >>> print(csd.entry('AABHTZ').is_powder_study) False >>> print(csd.entry('ACATAA').is_powder_study) True
- property melting_point¶
Melting point of the crystal if given otherwise
None
.>>> from ccdc.io import EntryReader >>> csd_reader = EntryReader('CSD') >>> acsala13 = csd_reader.entry('ACSALA13') >>> print(acsala13.melting_point) 135.5deg.C
- property melting_point_default_units¶
Return the default melting point units.
- property melting_point_display_string¶
The parsed and formatted melting point string.
- property molecule¶
The
ccdc.molecule.Molecule
contained in a database entry.
- property peptide_sequence¶
The peptide sequence of the entry if any.
- property phase_transition¶
Phase transition of the entry.
- property polymorph¶
Polymorphic information about the crystal if given otherwise
None
.>>> from ccdc.io import EntryReader >>> csd_reader = EntryReader('CSD') >>> acsala13 = csd_reader.entry('ACSALA13') >>> print(acsala13.polymorph) polymorph II
- property pressure¶
The experimental pressure of the crystallisation of the entry, where known.
This is a text field. If
None
the experiment was performed at ambient pressure or not recorded.>>> from ccdc.io import EntryReader >>> csd = EntryReader('csd') >>> print(csd.entry('AABHTZ').pressure) None >>> print(csd.entry('ABULIT03').pressure) 1.4 GPa
- property previous_identifier¶
Previous identifier if any.
>>> from ccdc.io import EntryReader >>> entry_reader = EntryReader('CSD') >>> acpret03 = entry_reader.entry('ACPRET03') >>> print(acpret03.identifier) ACPRET03 >>> print(acpret03.previous_identifier) DABHUJ
- property publication¶
The first publication of a structure.
This attribute gives the publication details of a CSD entry, expressed as a tuple of (authors, journal, volume, year, first_page, doi).
>>> from ccdc.io import EntryReader >>> csd_reader = EntryReader('CSD') >>> aqefor = csd_reader.entry('AQEFOR') >>> print(aqefor.publication) Citation(authors='M.E.Bluhm, M.Ciesielski, H.Gorls, O.Walter, M.Doring', journal='Journal(Inorganic Chemistry)', volume='42', year=2003, first_page='8878', doi='10.1021/ic034773a')
- Return type
Citation
- property publications¶
All publications of the entry.
- property r_factor¶
Resolution of crystallographic determination, given as a percentage value.
>>> from ccdc.io import EntryReader >>> csd_reader = EntryReader('CSD') >>> acsala13 = csd_reader.entry('ACSALA13') >>> acsala13.r_factor 16.22
- property radiation_source¶
The radiation source of the crystal’s determination.
>>> from ccdc.io import EntryReader >>> csd_reader = EntryReader('CSD') >>> aabhtz = csd_reader.entry('AABHTZ') >>> aabhtz.radiation_source 'X-ray' >>> csd_reader.entry('ABINOR01').radiation_source 'Neutron'
- property remarks¶
Any remarks on the entry registered by the editors of the database.
These may include details like a US Patent number:
>>> from ccdc.io import EntryReader >>> csd = EntryReader('csd') >>> print(csd.entry('ARISOK').remarks) U.S. Patent: US 6858644 B2
or reflect editorial decisions:
>>> print(csd.entry('ABAPCU').remarks) The position of the hydrate is dubious. It has been deleted
- property solubility_data¶
Get or set the solubility data, a list of
ccdc.entry.SolubilityMeasurement
>>> from ccdc.entry import Entry, SolubilityMeasurement >>> e=Entry.from_string('CC(C)Cc1ccc(cc1)C(C)C(O)=O') >>> sol = SolubilityMeasurement('21-22', 25, 'mg/L', 'deg.C', 'from PubChem') >>> sol.add_solvent('water', 100) >>> e.solubility_data = [sol] >>> e.solubility_data [SolubilityMeasurement(21 - 22, 25.0, "mg/L", "deg.C", from PubChem)] >>> e.solubility_data[0].solvents (('water', 100.0),)
- property solvent¶
Recrystallisation solvent.
>>> from ccdc.io import EntryReader >>> csd_reader = EntryReader('CSD') >>> rechul = csd_reader.entry('REKHUL') >>> print(rechul.solvent) pentane
- property source¶
The source of the compound(s) in the entry.
>>> from ccdc.io import EntryReader >>> entry_reader = EntryReader('CSD') >>> fifdut = entry_reader.entry('FIFDUT') >>> print(fifdut.source) dried venom of Chinese toad Ch'an Su
- property synonyms¶
List containing any recorded synonyms for the entry.
>>> from ccdc.io import EntryReader >>> csd_reader = EntryReader('CSD') >>> acsala13 = csd_reader.entry('ACSALA13') >>> print(' '.join(acsala13.synonyms)) Aspirin DrugBank: DB00945
- property synonyms_as_html¶
Tuple containing any recorded synonyms for the entry formatted as HTML.
>>> from ccdc.io import EntryReader >>> csd_reader = EntryReader('CSD') >>> aalpro = csd_reader.entry('AALPRO') >>> print(aalpro.synonyms_as_html[0]) α-Allylprodine hydrochloride
- property temperature¶
Experimental temperature of the entry
>>> from ccdc.io import EntryReader >>> csd_reader = EntryReader('CSD') >>> acsala13 = csd_reader.entry('ACSALA13') >>> print(acsala13.temperature) at 100 K
Journals¶
- class ccdc.entry.Journal(_journal)[source]¶
Information about a journal held in the CSD.
- property abbreviated_name¶
The abbreviated name of the journal.
- property abbreviated_translated_name¶
The abbreviated translated name of the journal.
- property eissn¶
The electronic international sequence number of the journal.
- property end_year¶
The date of termination of publication of the journal.
- property full_name¶
The full name of the journal.
- property image_url¶
The URL of an image of the journal.
- property international_coden¶
The ASTM international identifier of the journal.
- property issn¶
The international sequence number of the journal.
- property language_name¶
The name of the journal’s original language (where possible).
- property name¶
The name of the journal.
- property publisher_name¶
The name of the publisher of the journal.
- property start_year¶
The year of first publication of the journal.
- property state¶
Whether or not the journal is current.
- property translated_name¶
The translated name of the journal.
- property url¶
The URL of the journal on the publisher’s website.
- class ccdc.entry.JournalList(database)[source]¶
The collection of journals read from a database.
- class ccdc.entry.SolubilityMeasurement(solubility, temperature, solubility_unit='mg/mL', temperature_unit='deg.C', notes='')[source]¶
A solubility measurement.
- Parameters
solubility – a solubilty value, range tuple or string, see
ccdc.entry.SolubilityMeasurement.Solubility
temperature – a measurement temperature value.
solubility_unit – the solubility units, default mg/mL.
temperature_unit – the temperature units, default deg.C.
notes – notes for this measurement.
- class Solubility(solubility)[source]¶
A solubility value range.
This can be created from a single value. Or from a tuple of (lower, upper) bound values. Or from a string describing the range such as “< 15” or “3 - 8”.
- property max¶
The maximum solubility value, or None if there is no maximum value.
- property min¶
The minimum solubility value, or None if there is no minimum value.
- add_solvent(solvent, ratio)[source]¶
Add a solvent-ratio to the solubility measurement
Run this method for each solvent.
- Parameters
solvent – name of solvent
ratio – percentage of solvent
- property notes¶
The solubility measurement notes
- property solubility¶
The solubility value, a
ccdc.entry.SolubilityMeasurement.Solubility
- property solubility_unit¶
The solubility unit
- property solvents¶
The list of solvents and percentages
Each item is returned as a tuple of (name, percentage).
- property temperature¶
The temperature value
- property temperature_unit¶
The temperature unit