Answers.Body: <p>I couldn't find a way to directly convert these SMILES strings to a more canonical format. However, thanks to <a href="https://bioinformatics.stackexchange.com/users/6322/matteo-ferla">@Matteo Ferla</a>, I was able to get around the problem entirely by looking up the chemical names  and resolving the canonical SMILES programmatically.</p>
  <p>More specifically, I used the CAS no column given in the supplementary information of the referenced paper to pull the SMILES via <a href="https://cactus.nci.nih.gov/chemical/structure" rel="nofollow noreferrer">Chemical Identifier Resolver</a>. See <a href="https://stackoverflow.com/a/54932071/12215814">this answer</a> for an explanation on how to do so.</p>
  <p><strong>EDIT</strong>: Some of the CAS nos couldn't be resolved, so I manually converted them using the PubChem sketcher tool mentioned in the question. There are quite a few (~160) of such molecules, so if anyone needs the full parsed dataset but doesn't want to spend the time manually parsing those molecules, let me know.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-23T21:37:05.640Z
Answers.Text: As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer).
Answers.UserDisplayName: Community
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-23T16:22:44.117Z
Answers.LastActivityDate: 2022-04-27T13:21:35.187Z
Answers.LastEditDate: 2022-04-27T13:21:35.187Z
Answers.UserDisplayName: Ryan Park
Body: <p>How would one parse the SMILES string</p>
  <pre><code> BrC[2]:C[3]:C(:CH:CH:CH:@2):CH:CH:CH:CH:@3
  </code></pre>
  <p>I rely on tools like <code>rdkit</code> and <code>OpenBabel</code> to parse SMILES, but both tools aren't able to parse this string.</p>
  <p>More specifically, this SMILES string comes from the supplementary information of a <a href="https://pubs.acs.org/doi/10.1021/ci700096r" rel="nofollow noreferrer">2007 paper on solubility prediction</a>. After doing some searching, it seems that this paper was received prior to the 2007 standardization of OpenSMILES (this might be why canonical parsers like <code>rdkit</code> have trouble with it).</p>
  <p>After searching a bit more, I found an <a href="https://pubchem.ncbi.nlm.nih.gov//edit3/index.html" rel="nofollow noreferrer">older PubChem sketcher</a> that was able to convert the SMILES in question into a more recognizable format</p>
  <pre><code> (BrC1=C(C(=C(C2=C1C(=C(C(=C2[H])[H])[H])[H])[H])[H])[H])
  </code></pre>
  <p>(parsing this was successful via <code>rdkit</code>, see molecule image below) but still need a way to convert similarly-formatted SMILES strings into the OpenSMILES standard/canonical format en mass.</p>
  <p><a href="https://i.sstatic.net/j4TC9.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/j4TC9.png" alt="image for BrC1=C(C(=C(C2=C1C(=C(C(=C2[H])[H])[H])[H])[H])[H])[H]" /></a></p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-04-19T01:46:05.377Z
Comments.Text: Are the brackets dynamic? Thus one bracket pattern for one structure a different one for  a different structure or are they always as stated in the second expression? Hope that makes sense - it does make a difference to the answer.
Comments.UserDisplayName: M__
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-04-19T02:03:13.423Z
Comments.Text: I don't think they're dynamic but am not very familiar with the SMILES format specification.
Comments.UserDisplayName: Ryan Park
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-04-19T10:02:29.637Z
Comments.Text: "Welcome to Jurassic park" (theme music starts playing). Wow, that is proper ancient. And more similar to a SMARTS than a SMILES!
  Your outputted version is kekulised and a machine-made mess —I don't think that's a good option. It ought to be something like `[Br]c1c2c(ccc1)cccc2` if keeping your input order, but I think the canonical order is : `[Br]c1ccc2ccccc2c1` (unchecked, simply typed out while counting carbons aloud). As you can see the standard isn't too dissimilar, so one could write a conversion schema on a push —although I am not sure if it's worth it.
Comments.UserDisplayName: Matteo Ferla
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-04-19T12:43:12.263Z
Comments.Text: @MatteoFerla Do you know of any software tools that can execute this conversion? If not, how would you go about converting the older format to a more standard one?
Comments.UserDisplayName: Ryan Park
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-04-19T12:59:16.213Z
Comments.Text: I have not encountered pre-2007 SMILES nor do I know of any tool to do so. Few sites would still exist 15 years later. C++ pre-11 generally compiles —pre-98 is the nightmare. Scripting modules may exists, but in Perl, not Python... So CPAN would be the place to search. But the question is whether this is worth it... after all your example molecule is bromonaphthalene.
Comments.UserDisplayName: Matteo Ferla
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-04-19T13:02:50.697Z
Comments.Text: I see, thanks. My problem is not parsing this particular molecule but rather a whole host of similarly-formatted ones (around 2k), so an automated parser would definitely help!
Comments.UserDisplayName: Ryan Park
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-04-20T10:04:42.710Z
Comments.Text: I assumed as much, I meant it is a rather small compound and there are hordes of catalogues. However, I had a look at your source and it has a name field. Why not just search the name with PubChem PUG API to get the SMILES? 
  
  PS. If you do find a Perl module in CPAN that does do the conversion or a similar converter do post the answer!
Comments.UserDisplayName: Matteo Ferla
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-04-23T16:17:42.433Z
Comments.Text: I couldn't find a conversion module, but the name field trick worked - thanks! Am posting more details as an answer.
Comments.UserDisplayName: Ryan Park
Tags: <perl><computational-biochemistry><rdkit>
Title: Parsing pre-2007 SMILES string
ThreadText: # Parsing pre-2007 SMILES string
  
  (Asked by: username_0 on 2022-04-19)
  
  How would one parse the SMILES string
  
  ```
   BrC[2]:C[3]:C(:CH:CH:CH:@2):CH:CH:CH:CH:@3
  
  ```
  
  I rely on tools like `rdkit` and `OpenBabel` to parse SMILES, but both tools aren't able to parse this string.
  
  More specifically, this SMILES string comes from the supplementary information of a [2007 paper on solubility prediction](https://pubs.acs.org/doi/10.1021/ci700096r). After doing some searching, it seems that this paper was received prior to the 2007 standardization of OpenSMILES (this might be why canonical parsers like `rdkit` have trouble with it).
  
  After searching a bit more, I found an [older PubChem sketcher](https://pubchem.ncbi.nlm.nih.gov//edit3/index.html) that was able to convert the SMILES in question into a more recognizable format
  
  ```
   (BrC1=C(C(=C(C2=C1C(=C(C(=C2[H])[H])[H])[H])[H])[H])[H])
  
  ```
  
  (parsing this was successful via `rdkit`, see molecule image below) but still need a way to convert similarly-formatted SMILES strings into the OpenSMILES standard/canonical format en mass.
  
  [![image for BrC1=C(C(=C(C2=C1C(=C(C(=C2[H])[H])[H])[H])[H])[H])[H]](https://i.sstatic.net/j4TC9.png)](https://i.sstatic.net/j4TC9.png)
  
  **Tags:** perl, computational-biochemistry, rdkit
  
  > **Comments:**
  > **username_1**: Are the brackets dynamic? Thus one bracket pattern for one structure a different one for  a different structure or are they always as stated in the second expression? Hope that makes sense - it does make a difference to the answer.  
  > **username_0**: I don't think they're dynamic but am not very familiar with the SMILES format specification.  
  > **username_2**: "Welcome to Jurassic username_0" (theme music starts playing). Wow, that is proper ancient. And more similar to a SMARTS than a SMILES! Your outputted version is kekulised and a machine-made mess —I don't think that's a good option. It ought to be something like `[Br]c1c2c(ccc1)cccc2` if keeping your input order, but I think the canonical order is : `[Br]c1ccc2ccccc2c1` (unchecked, simply typed out while counting carbons aloud). As you can see the standard isn't too dissimilar, so one could write a conversion schema on a push —although I am not sure if it's worth it.  
  > **username_0**: @username_2 Do you know of any software tools that can execute this conversion? If not, how would you go about converting the older format to a more standard one?  
  > **username_2**: I have not encountered pre-2007 SMILES nor do I know of any tool to do so. Few sites would still exist 15 years later. C++ pre-11 generally compiles —pre-98 is the nightmare. Scripting modules may exists, but in Perl, not Python... So CPAN would be the place to search. But the question is whether this is worth it... after all your example molecule is bromonaphthalene.  
  > **username_0**: I see, thanks. My problem is not parsing this particular molecule but rather a whole host of similarly-formatted ones (around 2k), so an automated parser would definitely help!  
  > **username_2**: I assumed as much, I meant it is a rather small compound and there are hordes of catalogues. However, I had a look at your source and it has a name field. Why not just search the name with PubChem PUG API to get the SMILES?   PS. If you do find a Perl module in CPAN that does do the conversion or a similar converter do post the answer!  
  > **username_0**: I couldn't find a conversion module, but the name field trick worked - thanks! Am posting more details as an answer.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2022-04-23. Score: 1 | Accepted answer
  
  I couldn't find a way to directly convert these SMILES strings to a more canonical format. However, thanks to [@username_2](https://bioinformatics.stackexchange.com/users/6322/username_2-username_2), I was able to get around the problem entirely by looking up the chemical names and resolving the canonical SMILES programmatically.
  
  More specifically, I used the CAS no column given in the supplementary information of the referenced paper to pull the SMILES via [Chemical Identifier Resolver](https://cactus.nci.nih.gov/chemical/structure). See [this answer](https://stackoverflow.com/a/54932071/12215814) for an explanation on how to do so.
  
  **EDIT**: Some of the CAS nos couldn't be resolved, so I manually converted them using the PubChem sketcher tool mentioned in the question. There are quite a few (~160) of such molecules, so if anyone needs the full parsed dataset but doesn't want to spend the time manually parsing those molecules, let me know.
  
  > **Comments:**
  > **username_3**: As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer).  
  
  ---
  
  