in the API a component is a connected set of atoms and the bonds connecting them. These can be copies of the fundamental molecular structure as is the case with PENCEN03 where there are two copies of pentane, or different structures as in the case of ABEBUF. These may be solvent molecules, coformer molecules, cocrystals or salts.
When we pack the unit cell, we can get copies of all these components in a single molecule. So in PENCEN03 you will get 10 copies of the pentane molecule. When we pack ABEBUF, we get eight copies of each of the two structures of the crystal.
I hope this is clear. If not, I'll try to expand on it, or ask a crystallographer here to make things clearer.
I really don't mind whether you open another topic or keep it here, but since it naturally follows on from your earlier question, perhaps here is best.
as long as the mol2 file contains the crystallographic information, i.e. a CRYSIN line, then we can do this very easily:
from ccdc import io
reader = io.CrystalReader('/path/to/crystals.mol2')
for c in reader:
unit_cell_molecule = c.packing()
coordinates = [a.coordinates for a in unit_cell_molecule.atoms]
The packing method of the crystal will return a molecule, which may be several disconnected structures, which are found in the specified box, which by default is the unit cell. There is an optional inclusion paramter to this method which controls whether or not to include atoms. By default this is to include the whole molecule if the centroid is found in the unit cell. Other options are, 'AllAtomsIncluded', 'AnyAtomIncluded' and 'OnlyAtomsIncluded'.
Hope this is helpful.
It looks as if you've spelled csd_licence.dat as csd_licencw.dat, so that may be the source of the problem.
Incidentally, you're a brave man to be running these things as root!
the warning is issued by the underlying C++ code, and is not under the control of the python API. The only thing I can think of is to record the identifiers of the molecules involved before performing the search, possibly using ccdc.utilities.Logger, then inspecting the output.
I'm sorry I can't be any more helpful at the moment.
can you run mercury successfully? If so, the Help->About mercury should say where it found the licence. If the licence is in a non-standard place, i.e. not in CSD_2018/CSD_539/csd_licence.dat or /home/.../csd_licence.dat then you may need to set the environment variable CCDC_CSD_LICENCE_FILE to point to its location.
Let me know if this works.
I think you need to set the environment variable, CSDHOME so the API can find where the CSD is located:
Try this, and see if that works, please.
yes, that should be the full path to the miniconda under your CSD installation. So on my network it was:
This sets your path to include the miniconda bin directory at the front, so things like python and conda will be those in that directory. You can call these directly from this bin directory without activating the miniconda, but it's usually easier to activate and make sure that you are using a consistent set of programs.
You can deactivate, i.e. return to your normal path settings by:
I've just done a clean install of the latest CSD system on a Mac, and installed jupyter on it with no problems:
conda install jupyter
In : from ccdc import io
In : csd = io.EntryReader('csd')
In : len(csd)
So I'm really not sure what's happening when you try it. Is it possibly an instance of this issue?
If not, are there any other details you can give me, like how you installed jupyter, and what error messages you have seen?
putting the * before an argument essentially says 'treat the expression after the * as the remaining positional arguments to the function'. Here I used it as a shorthand for:
m.add_bond('Aromatic', b, b)
Mostly because I'm lazy.
Here is a good explanation of the basics behind *args, **kwargs:
the problem is with the delocalised bonds in these structures, and we do not have any method in the API to replace them.
You can get a SMILES representation of the molecule by replacing the delocalised bonds with aromatic bonds:
from ccdc import io, utilities
csd = io.EntryReader('csd')
m = csd.molecule('ABACUF')
deloc = [b.atoms for b in m.bonds if b.bond_type == 'Delocalised']
m.remove_bonds(b for b in m.bonds if b.bond_type == 'Delocalised')
for b in deloc:
I'm not perfectly convinced that the SMILES is legitimate, so I would be very wary of submitting it to other programs.