Home >
Community >
Given a CIF (crystallographic interchange format) file (and thus cartesian atomic coordinates), how can you find the bonds between atoms?
Upvote
VOTE
Downvote
+ Crystallography
+ Chemistry
Posted by
Ludwig Nijholt
Given a CIF (crystallographic interchange format) file (and thus cartesian atomic coordinates), how can you find the bonds between atoms?
how could one algorithmically find all bond pairs
Here is a sketch of an algorithm that takes crystal symmetry into account:
Move all atoms into a single asymmetric unit
Apply all symmetry operators (including centering) to the asymmetric unit to generate the content of the unit cell
Duplicate the unit cell content to also create the units cell contents on the left, right, top, bottom, front, back of the unit cell.
For each atom in the asymmetric unit, find the neighbors within bonding distance, using a fixed-radius near neighbors algorithm and appropriate distance cutoff.
Filter the list of neighboring pairs to exclude duplicates and unrealistic geometries.
This sketch of an algorithm might be slow for large structures, and there might be simple optimizations, especially for spacegroups where the asymmetric unit is a rectangular prism along the cartesian axes.
Example
The CIF file for sodium chloride contains two atoms, one sodium (purple) on the origin and one chloride (green) in the center of the unit cell. The crystal is face-centered. To find the closest neighbors of the chloride, you have to generate all the sodium ions in or touching the unit cell, using the centering operation and various unit-cell vector translations. Then, you can find the six sodium ions that are closest neighbors of the chloride ion (above, below, left, right, in front and behind the chloride ion on the faces of the unit cell).
To find which chloride ions make up the (inner) coordination sphere of the sodium ion, you have to generate the symmetry mates of the chloride ion within the unit cell. Then, you have to translate the unit cell in multiple directions (and combinations of directions) to make sure you also find bonding partners outside of the unit cell you started with.
Here is a sketch of an algorithm that takes crystal symmetry into account:
Move all atoms into a single asymmetric unit
Apply all symmetry operators (including centering) to the asymmetric unit to generate the content of the unit cell
Duplicate the unit cell content to also create the units cell contents on the left, right, top, bottom, front, back of the unit cell.
For each atom in the asymmetric unit, find the neighbors within bonding distance, using a fixed-radius near neighbors algorithm and appropriate distance cutoff.
Filter the list of neighboring pairs to exclude duplicates and unrealistic geometries.
This sketch of an algorithm might be slow for large structures, and there might be simple optimizations, especially for spacegroups where the asymmetric unit is a rectangular prism along the cartesian axes.
Example
The CIF file for sodium chloride contains two atoms, one sodium (purple) on the origin and one chloride (green) in the center of the unit cell. The crystal is face-centered. To find the closest neighbors of the chloride, you have to generate all the sodium ions in or touching the unit cell, using the centering operation and various unit-cell vector translations. Then, you can find the six sodium ions that are closest neighbors of the chloride ion (above, below, left, right, in front and behind the chloride ion on the faces of the unit cell).
To find which chloride ions make up the (inner) coordination sphere of the sodium ion, you have to generate the symmetry mates of the chloride ion within the unit cell. Then, you have to translate the unit cell in multiple directions (and combinations of directions) to make sure you also find bonding partners outside of the unit cell you started with.
The VESTA program allows one to try different cutoff distances for the bonds it displays. Sometimes it has a distance by default (that works and produces plausible bonds). Other times it shows no bonds (and inputting any cuttoff distance produces clearly inplausible bond pairs). How does one pick an "appropriate distance cutoff"?More
@maxbear123 "Chemical bonds" make the most sense in covalent compounds, but you are most probably dealing with inorganic (ionic or metallic ) structures, right? In those materials connecting atoms is not much more than an illustration of close interactions, but you shouldnt take it literally.More
@maxbear123 Jmol (the program used in for illustration) equally has this option. In the GUI, Edit -> Preferences -> Bonds allows you to switch off/on the automatic computation of bonds (if these are not stored in a connectivity table of the file read, like in a .sdf file (and contrasting to .cif/.xyz)). It then allows you to adjust (independently of each other) a minimal bond bond distance (0 to 1 Angstrom), and a bond tolerance (sum of van der Waals radii of the atoms in question + x) equally with an x in range of 0 to 1 Angstrom.More
Upvote
VOTE
Downvote
Your question does not detail out what you mean by how is it done. Indeed, your question may be answered twice:
determine the distances between atoms, pairwise compare the sum of van der Waals radii; if the distance is equal or less to a threshold (previously extracted from experiments, tabulated e.g., in the International Tables of X-ray crystallography); as in @Greg's answer. or
given a .cif file, I need to establish a file with a connection table and with information about bond orders. In this case, cod-tools by the Crystallography Open Database, freely available (e.g., repackaged for Linux Debian and related distributions like Ubuntu (tracker for Debian)) contain a nice tool codcif2sdf running on the command line to convert a .cif into a .sdf file.
Note that some databases (e.g., CSD by CCDC) allow the download of their data not only as .cif, yet equally in formats like .mol2 (reference), .sdf, .pdb, or SMILES strings from their more advanced interfaces (in case of CSD, conquest, or their Python API (an example).
The content of your example .cif file was copied into file test.cif. Because the data are not the result of a X-ray diffraction experiment with subsequent structure solution and structure refinement, one may pass some of the problems listed by checkcif, though PLAT113_ALERT_2_B should not be dropped.
The file was processed by codcif2sdf test.cif > test.sdf to yield a .sdf file. Jmol, running with the automatic computation of bonds (cf. the GUI, Edit -> Preferences -> Bonds) will assign a bond, while the .sdf file lacks the connectivity table typically seen for organic molecules.
At the level of codcif2sdf, in comparison to performing such a transformation for data about an organic molecule like benzene, the example of $\ce{LiF}$ might indicate a lack of encoded data. However, what do the struts drawn between the atoms represent? In crystallography, they indicate that the distance between two atoms is less than the sum of their van der Waals radii. As an example, see the drawing in this question on chemistry.se, and an answer tangentially relevant here:
In other fields, where you write one, or multiple dashes between two atoms, you state that there is non-zero electron density between the two atoms. This then covalent bond, two atoms participate (in an analogy, share with each other). This directed bond may be polarized, i.e. with one partner participating more in the electron density, than the other. However, this contrasts to $\ce{LiF}$ with a difference of electronegativity so large that one partner (here: $\ce{F}$) practically withdrew all electron density of this bond, where the other (here $\ce{Li}$) practically gave up all of its share by valence electrons.
As a result, $\ce{LiF}$ is not a covalent molecule, but an ionic salt. If you lower the level of description, and describe electrons as countable spheres, it consists of which consists of $\ce{Li^+}$ and $\ce{F^-}$. Their interactions in the sample resembles those of point charges. Have a look at illustrations in my answer here for a comparison of e.g., $\ce{N#N}$, $\ce{NaCl}$, and $\ce{Cu}$.
Your question does not detail out what you mean by how is it done. Indeed, your question may be answered twice:
determine the distances between atoms, pairwise compare the sum of van der Waals radii; if the distance is equal or less to a threshold (previously extracted from experiments, tabulated e.g., in the International Tables of X-ray crystallography); as in @Greg's answer. or
given a .cif file, I need to establish a file with a connection table and with information about bond orders. In this case, cod-tools by the Crystallography Open Database, freely available (e.g., repackaged for Linux Debian and related distributions like Ubuntu (tracker for Debian)) contain a nice tool codcif2sdf running on the command line to convert a .cif into a .sdf file.
Note that some databases (e.g., CSD by CCDC) allow the download of their data not only as .cif, yet equally in formats like .mol2 (reference), .sdf, .pdb, or SMILES strings from their more advanced interfaces (in case of CSD, conquest, or their Python API (an example).
The content of your example .cif file was copied into file test.cif. Because the data are not the result of a X-ray diffraction experiment with subsequent structure solution and structure refinement, one may pass some of the problems listed by checkcif, though PLAT113_ALERT_2_B should not be dropped.
The file was processed by codcif2sdf test.cif > test.sdf to yield a .sdf file. Jmol, running with the automatic computation of bonds (cf. the GUI, Edit -> Preferences -> Bonds) will assign a bond, while the .sdf file lacks the connectivity table typically seen for organic molecules.
At the level of codcif2sdf, in comparison to performing such a transformation for data about an organic molecule like benzene, the example of $\ce{LiF}$ might indicate a lack of encoded data. However, what do the struts drawn between the atoms represent? In crystallography, they indicate that the distance between two atoms is less than the sum of their van der Waals radii. As an example, see the drawing in this question on chemistry.se, and an answer tangentially relevant here:
In other fields, where you write one, or multiple dashes between two atoms, you state that there is non-zero electron density between the two atoms. This then covalent bond, two atoms participate (in an analogy, share with each other). This directed bond may be polarized, i.e. with one partner participating more in the electron density, than the other. However, this contrasts to $\ce{LiF}$ with a difference of electronegativity so large that one partner (here: $\ce{F}$) practically withdrew all electron density of this bond, where the other (here $\ce{Li}$) practically gave up all of its share by valence electrons.
As a result, $\ce{LiF}$ is not a covalent molecule, but an ionic salt. If you lower the level of description, and describe electrons as countable spheres, it consists of which consists of $\ce{Li^+}$ and $\ce{F^-}$. Their interactions in the sample resembles those of point charges. Have a look at illustrations in my answer here for a comparison of e.g., $\ce{N#N}$, $\ce{NaCl}$, and $\ce{Cu}$.
@maxbear123 One option may be to edit the original question and to add the problematic files content in a code block (enclosed by three grave signs in the line to start, three grave signs in the line after to end this). Alternatively, to add in the OP a link which points to a reference outside chemistry.se (e.g., on More
The most software find bonds in a structure from cartesian coordinates by finding atom pairs that are closer than a certain threshold distance (something shorter than the vdw radius of the given atoms). Generally, you can set this distance yourself if you need for some reason.
The most software find bonds in a structure from cartesian coordinates by finding atom pairs that are closer than a certain threshold distance (something shorter than the vdw radius of the given atoms). Generally, you can set this distance yourself if you need for some reason.
Here is a sketch of an algorithm that takes crystal symmetry into account:
This sketch of an algorithm might be slow for large structures, and there might be simple optimizations, especially for spacegroups where the asymmetric unit is a rectangular prism along the cartesian axes.
Example
The CIF file for sodium chloride contains two atoms, one sodium (purple) on the origin and one chloride (green) in the center of the unit cell. The crystal is face-centered. To find the closest neighbors of the chloride, you have to generate all the sodium ions in or touching the unit cell, using the centering operation and various unit-cell vector translations. Then, you can find the six sodium ions that are closest neighbors of the chloride ion (above, below, left, right, in front and behind the chloride ion on the faces of the unit cell).
To find which chloride ions make up the (inner) coordination sphere of the sodium ion, you have to generate the symmetry mates of the chloride ion within the unit cell. Then, you have to translate the unit cell in multiple directions (and combinations of directions) to make sure you also find bonding partners outside of the unit cell you started with.
Here is a sketch of an algorithm that takes crystal symmetry into account:
This sketch of an algorithm might be slow for large structures, and there might be simple optimizations, especially for spacegroups where the asymmetric unit is a rectangular prism along the cartesian axes.
Example
The CIF file for sodium chloride contains two atoms, one sodium (purple) on the origin and one chloride (green) in the center of the unit cell. The crystal is face-centered. To find the closest neighbors of the chloride, you have to generate all the sodium ions in or touching the unit cell, using the centering operation and various unit-cell vector translations. Then, you can find the six sodium ions that are closest neighbors of the chloride ion (above, below, left, right, in front and behind the chloride ion on the faces of the unit cell).
To find which chloride ions make up the (inner) coordination sphere of the sodium ion, you have to generate the symmetry mates of the chloride ion within the unit cell. Then, you have to translate the unit cell in multiple directions (and combinations of directions) to make sure you also find bonding partners outside of the unit cell you started with.
More
VOTE
VOTE
VOTE
VOTE
Your question does not detail out what you mean by how is it done. Indeed, your question may be answered twice:
determine the distances between atoms, pairwise compare the sum of van der Waals radii; if the distance is equal or less to a threshold (previously extracted from experiments, tabulated e.g., in the International Tables of X-ray crystallography); as in @Greg's answer. or
given a .cif file, I need to establish a file with a connection table and with information about bond orders. In this case, cod-tools by the Crystallography Open Database, freely available (e.g., repackaged for Linux Debian and related distributions like Ubuntu (tracker for Debian)) contain a nice tool
codcif2sdfrunning on the command line to convert a .cif into a .sdf file.Note that some databases (e.g., CSD by CCDC) allow the download of their data not only as .cif, yet equally in formats like .mol2 (reference), .sdf, .pdb, or SMILES strings from their more advanced interfaces (in case of CSD,
conquest, or their Python API (an example).The content of your example .cif file was copied into file
test.cif. Because the data are not the result of a X-ray diffraction experiment with subsequent structure solution and structure refinement, one may pass some of the problems listed by checkcif, thoughPLAT113_ALERT_2_Bshould not be dropped.The file was processed by
codcif2sdf test.cif > test.sdfto yield a .sdf file. Jmol, running with the automatic computation of bonds (cf. the GUI, Edit -> Preferences -> Bonds) will assign a bond, while the .sdf file lacks the connectivity table typically seen for organic molecules.At the level of
codcif2sdf, in comparison to performing such a transformation for data about an organic molecule like benzene, the example of $\ce{LiF}$ might indicate a lack of encoded data. However, what do the struts drawn between the atoms represent? In crystallography, they indicate that the distance between two atoms is less than the sum of their van der Waals radii. As an example, see the drawing in this question on chemistry.se, and an answer tangentially relevant here:In other fields, where you write one, or multiple dashes between two atoms, you state that there is non-zero electron density between the two atoms. This then covalent bond, two atoms participate (in an analogy, share with each other). This directed bond may be polarized, i.e. with one partner participating more in the electron density, than the other. However, this contrasts to $\ce{LiF}$ with a difference of electronegativity so large that one partner (here: $\ce{F}$) practically withdrew all electron density of this bond, where the other (here $\ce{Li}$) practically gave up all of its share by valence electrons.
As a result, $\ce{LiF}$ is not a covalent molecule, but an ionic salt. If you lower the level of description, and describe electrons as countable spheres, it consists of which consists of $\ce{Li^+}$ and $\ce{F^-}$. Their interactions in the sample resembles those of point charges. Have a look at illustrations in my answer here for a comparison of e.g., $\ce{N#N}$, $\ce{NaCl}$, and $\ce{Cu}$.
Your question does not detail out what you mean by how is it done. Indeed, your question may be answered twice:
determine the distances between atoms, pairwise compare the sum of van der Waals radii; if the distance is equal or less to a threshold (previously extracted from experiments, tabulated e.g., in the International Tables of X-ray crystallography); as in @Greg's answer. or
given a .cif file, I need to establish a file with a connection table and with information about bond orders. In this case, cod-tools by the Crystallography Open Database, freely available (e.g., repackaged for Linux Debian and related distributions like Ubuntu (tracker for Debian)) contain a nice tool
codcif2sdfrunning on the command line to convert a .cif into a .sdf file.Note that some databases (e.g., CSD by CCDC) allow the download of their data not only as .cif, yet equally in formats like .mol2 (reference), .sdf, .pdb, or SMILES strings from their more advanced interfaces (in case of CSD,
conquest, or their Python API (an example).The content of your example .cif file was copied into file
test.cif. Because the data are not the result of a X-ray diffraction experiment with subsequent structure solution and structure refinement, one may pass some of the problems listed by checkcif, thoughPLAT113_ALERT_2_Bshould not be dropped.The file was processed by
codcif2sdf test.cif > test.sdfto yield a .sdf file. Jmol, running with the automatic computation of bonds (cf. the GUI, Edit -> Preferences -> Bonds) will assign a bond, while the .sdf file lacks the connectivity table typically seen for organic molecules.At the level of
codcif2sdf, in comparison to performing such a transformation for data about an organic molecule like benzene, the example of $\ce{LiF}$ might indicate a lack of encoded data. However, what do the struts drawn between the atoms represent? In crystallography, they indicate that the distance between two atoms is less than the sum of their van der Waals radii. As an example, see the drawing in this question on chemistry.se, and an answer tangentially relevant here:In other fields, where you write one, or multiple dashes between two atoms, you state that there is non-zero electron density between the two atoms. This then covalent bond, two atoms participate (in an analogy, share with each other). This directed bond may be polarized, i.e. with one partner participating more in the electron density, than the other. However, this contrasts to $\ce{LiF}$ with a difference of electronegativity so large that one partner (here: $\ce{F}$) practically withdrew all electron density of this bond, where the other (here $\ce{Li}$) practically gave up all of its share by valence electrons.
As a result, $\ce{LiF}$ is not a covalent molecule, but an ionic salt. If you lower the level of description, and describe electrons as countable spheres, it consists of which consists of $\ce{Li^+}$ and $\ce{F^-}$. Their interactions in the sample resembles those of point charges. Have a look at illustrations in my answer here for a comparison of e.g., $\ce{N#N}$, $\ce{NaCl}$, and $\ce{Cu}$.
More
VOTE
VOTE
VOTE
VOTE
VOTE
VOTE
The most software find bonds in a structure from cartesian coordinates by finding atom pairs that are closer than a certain threshold distance (something shorter than the vdw radius of the given atoms). Generally, you can set this distance yourself if you need for some reason.
The most software find bonds in a structure from cartesian coordinates by finding atom pairs that are closer than a certain threshold distance (something shorter than the vdw radius of the given atoms). Generally, you can set this distance yourself if you need for some reason.
More
VOTE