1

I have actually a molecule in cif format. I don't think that the format is really important, but provide it for those who are interested. This file has lots of data inside. What is most important (as this part of file actually describes molecule as a graph) is this part:

017 N1  C2   SING N N 1  
017 N1  H11  SING N N 2  
017 N1  H12  SING N N 3  
017 C2  C3   DOUB Y N 4  
017 C2  C7   SING Y N 5  
017 C3  C4   SING Y N 6

This is not the whole file, it is just an example. This molecule may contain lots of cyclic structures. Aromatic ones I can define by Y flag in the 6 column. But there are also other cycles, which can be quiet different: example1 or like thatexample2 or like that: example3. Or even such ones: example4

What I need is to extract all the cycles in such a way, that if two cycles share the bond, like in the first example, they are considered as one cycle. Tarjan's algorithm won't work here because it runs each node once only. So how can I do that? Please provide as detailed information as possible. I am not really much interested in libraries, such as OpenBabel as I am going to write the thing in Swift and use graph description from cif file.

Anna-Lischen
  • 856
  • 1
  • 16
  • 35
  • For your first diagram, do you just want to output one cycle (consisting of the outer ring)? – James Trimble Mar 04 '15 at 18:23
  • What I actually want to is to find all cycles and re-write a cif file like that, let us say C2 and C3 are ring members, in such a case: `017 N1 C2R SING N N 1 017 N1 H11 SING N N 2 017 N1 H12 SING N N 3 017 C2R C3R DOUB Y N 4 017 C2R C7 SING Y N 5 017 C3R C4 SING Y N 6` And also let C7 be a member of a different ring, in such a case I rewrite file like that: `017 N1 C2R1 SING N N 1 017 N1 H11 SING N N 2 017 N1 H12 SING N N 3 017 C2R1 C3R1 DOUB Y N 4 017 C2R1 C7R2 SING Y N 5 017 C3R1 C4 SING Y N 6` Or in a separate column. – Anna-Lischen Mar 04 '15 at 18:42
  • And yes, I would like it to be considered as one structure. All the atoms of structure 1 should be named as atomNameR1. As well as I would like to be the same for this structure: http://upload.wikimedia.org/wikipedia/commons/c/cf/Adamantane_structure.svg – Anna-Lischen Mar 04 '15 at 18:45
  • 1
    [This method for finding all cycles](http://stackoverflow.com/a/18388696/3347737) looks like it could be useful. After that I think you could partition the set of cycles such that if two cycles share an edge, they are in the same subset. I'm not sure what the best way to do this is. – James Trimble Mar 05 '15 at 08:58
  • This does **not** look like a part of a real **CIF** file from xray diffraction to me. Connectivity matrices like the one shown are typically part of files used in molecular mechanics calculations. However, this isn't a MDL mol file either. Would you mind to tell how the data was generated? – Klaus-Dieter Warzecha Mar 22 '15 at 07:56
  • 1
    @KlausWarzecha I have taken this data from PDB CIF file: http://www.rcsb.org/pdb/files/ligand/017.cif – Anna-Lischen Mar 24 '15 at 10:08
  • @Anna-Lischen Wow, that's great. Thank you very much. That explains why it looks so un-crystallographic. It's from a PDBx/mmCIF file. This format is supposed to become the successor of the old PDB format. – Klaus-Dieter Warzecha Mar 24 '15 at 10:16

0 Answers0