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)  # doctest: +NORMALIZE_WHITESPACE
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.

API

Entry

class ccdc.entry.Entry(_entry=None)[source]

A database entry.

class CrossReference(_xr)[source]

A cross-reference between entries in the database.

identifiers

A tuple containing identifiers of the cross-referenced entries.

scope

Whether the cross-reference applies to the individual identifier or the family of related identifiers.

text

The text of the cross-reference.

type

The type of cross-reference.

Available types are ‘Unknown’, ‘Racemate’, ‘Stereoisomer’, ‘Isomer’, ‘Reinterpretation of’, ‘Reinterpretation ref’, and ‘Coordinates ref’.

analogue

Analogue information.

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
calculated_density

The density.

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
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
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
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
cross_references

The tuple of ccdc.entry.Entry.CrossReference for this entry. These are cross-references between entries of the CSD.

crystal

The ccdc.crystal.Crystal contained in a database entry.

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)  # doctest: +SKIP
as536be_ASER
deposition_date

The date when this entry was deposited as a datetime.date object or None if the date is not available.

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.
disordered_molecule

The ccdc.molecule.Molecule contained in a database entry, including disordered atoms.

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:

a ccdc.entry.Entry

Raises:

TypeError if the format string is not ‘’, ‘mol2’, ‘sdf’, ‘mol’ or ‘cif’.

Raises:

RuntimeError if the string representation is incorrectly formatted

habit

The crystal habit.

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
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
identifier

The string identifier of the entry, e.g. ‘ABEBUF’.

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
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
is_polymeric

Whether the structure contains polymeric bonds.

>>> from ccdc.io import EntryReader
>>> csd = EntryReader('CSD')
>>> abacuf = csd.entry('ABACUF')
>>> abacuf.is_polymeric
True
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
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
molecule

The ccdc.molecule.Molecule contained in a database entry.

peptide_sequence

The peptide sequence of the entry if any.

phase_transition

Phase transition of the entry.

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
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)
at 1.4 GPa
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
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) # doctest: +NORMALIZE_WHITESPACE
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
publications

All publications of the entry.

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
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'
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
solvent

Recrystallisation solvent.

>>> from ccdc.io import EntryReader
>>> csd_reader = EntryReader('CSD')
>>> rechul = csd_reader.entry('REKHUL')
>>> print(rechul.solvent)
pentane
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
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)) # doctest: +NORMALIZE_WHITESPACE
Aspirin
DrugBank: DB00945
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
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
to_string(format='mol2')[source]

Return a string representation of an entry.

Parameters:format – ‘mol2’, ‘sdf’, ‘mol’ or ‘cif’
Return type:string
Raises:TypeError if the format is not ‘mol2’, ‘sdf’, ‘mol’ or ‘cif’

Journals

class ccdc.entry.Journal(_journal)[source]

Information about a journal held in the CSD.

abbreviated_name

The abbreviated name of the journal.

abbreviated_translated_name

The abbreviated translated name of the journal.

eissn

The electronic international sequence number of the journal.

end_year

The date of termination of publication of the journal.

full_name

The full name of the journal.

image_url

The URL of an image of the journal.

international_coden

The ASTM international identifier of the journal.

issn

The international sequence number of the journal.

language_name

The name of the journal’s original language (where possible).

name

The name of the journal.

publisher_name

The name of the publisher of the journal.

start_year

The year of first publication of the journal.

state

Whether or not the journal is current.

translated_name

The translated name of the journal.

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.

by_abbreviated_name(value)[source]

The unique journal with a given abbreviated name or None.

by_full_name(value)[source]

The unique journal with a given full name or None.

match_abbreviated_name(regexp)[source]

Those journals matching a regular expression on the abbreviated name.

match_full_name(regexp)[source]

Those journals whose full name is matched by the regexp.

Those journals any of whose names contain the given pattern.