{
  "id": 93768,
  "title": "chemical formula for the molecules ",
  "url": "/competitions/champs-scalar-coupling/discussion/93768",
  "author_name": "",
  "post_date": "2019-05-29T21:55:13.296573700Z",
  "votes": 8,
  "comment_count": 9,
  "views": 0,
  "content": "<p>In the column named \"molecule name\" in the train.csv file, I saw something like this \"dsgdb9nsd_000001\". Is there a way to extract the chemical formula from a molecule name? </p>",
  "messages": [
    {
      "id": "539307",
      "postDate": "05/29/2019 21:55:13",
      "content": "<p>In the column named \"molecule name\" in the train.csv file, I saw something like this \"dsgdb9nsd_000001\". Is there a way to extract the chemical formula from a molecule name? </p>",
      "rawMarkdown": "In the column named \"molecule name\" in the train.csv file, I saw something like this \"dsgdb9nsd_000001\". Is there a way to extract the chemical formula from a molecule name?",
      "votes": null
    },
    {
      "id": "539316",
      "postDate": "05/29/2019 22:12:53",
      "content": "<p>This is pretty easy to determine using the structures.cav file. For example, there are 4 entries for dsgdb9nsd_000001, C, H, H and H. From this, we can tell that the formula is CH4, or methane.</p>",
      "rawMarkdown": "This is pretty easy to determine using the structures.cav file. For example, there are 4 entries for dsgdb9nsd_000001, C, H, H and H. From this, we can tell that the formula is CH4, or methane.",
      "votes": null
    },
    {
      "id": "539350",
      "postDate": "05/30/2019 00:18:20",
      "content": "<p>How I managed to extract the \"formula\" :\n<code>structures.groupby(by='molecule_name')['atom'].agg(lambda x :''.join(x))</code></p>",
      "rawMarkdown": "How I managed to extract the \"formula\" :\n`structures.groupby(by='molecule_name')['atom'].agg(lambda x :''.join(x))`",
      "votes": null
    },
    {
      "id": "539442",
      "postDate": "05/30/2019 03:45:14",
      "content": "<p>If you just want the chemical formula, you can probably just write a script to sum each atom type per molecule. However, I'm not sure how helpful this will be.</p>\n\n<p>If you want something more usable, like SMILES (which can encode a canonical representation of the molecule in the form of a string), you can use an outside tool to convert from the XYZ structures. You should be able to use something like openbabel with a command like:\n<code>obabel -ixyz -osmi [molecule xyz file] -O [molecule smiles file]</code></p>",
      "rawMarkdown": "If you just want the chemical formula, you can probably just write a script to sum each atom type per molecule. However, I'm not sure how helpful this will be.\n\nIf you want something more usable, like SMILES (which can encode a canonical representation of the molecule in the form of a string), you can use an outside tool to convert from the XYZ structures. You should be able to use something like openbabel with a command like:\n`obabel -ixyz -osmi [molecule xyz file] -O [molecule smiles file]`",
      "votes": null
    },
    {
      "id": "539476",
      "postDate": "05/30/2019 05:13:53",
      "content": "<p>Cool. I am looking for a way to generate SMILE for each molecule. Is it possible that a chemical formula corresponds to multiple structures?</p>",
      "rawMarkdown": "Cool. I am looking for a way to generate SMILE for each molecule. Is it possible that a chemical formula corresponds to multiple structures?",
      "votes": null
    },
    {
      "id": "539480",
      "postDate": "05/30/2019 05:20:25",
      "content": "<p>Yes exactly, different chemical structures with the same formula are called constitutional isomers. For example, these three chemicals have the exact same formula (C5H12O) but have different structures:\n<a href=\"https://en.wikipedia.org/wiki/3-Pentanol\">https://en.wikipedia.org/wiki/3-Pentanol</a>\n<a href=\"https://en.wikipedia.org/wiki/2-Pentanol\">https://en.wikipedia.org/wiki/2-Pentanol</a>\n<a href=\"https://en.wikipedia.org/wiki/1-Pentanol\">https://en.wikipedia.org/wiki/1-Pentanol</a></p>",
      "rawMarkdown": "Yes exactly, different chemical structures with the same formula are called constitutional isomers. For example, these three chemicals have the exact same formula (C5H12O) but have different structures:\nhttps://en.wikipedia.org/wiki/3-Pentanol\nhttps://en.wikipedia.org/wiki/2-Pentanol\nhttps://en.wikipedia.org/wiki/1-Pentanol",
      "votes": null
    },
    {
      "id": "540031",
      "postDate": "05/30/2019 22:48:18",
      "content": "<p>Hi,</p>\n\n<p>My question is, is it possible to determine the specific molecule from the current provided data?\nAs was already posted in this thread, different molecules can share the same chemical formula.  Therefore any external data I find that corresponds to a given chemical formula is likely useless because I won't know which molecule to apply that data to.</p>",
      "rawMarkdown": "Hi,\n\nMy question is, is it possible to determine the specific molecule from the current provided data?\nAs was already posted in this thread, different molecules can share the same chemical formula.  Therefore any external data I find that corresponds to a given chemical formula is likely useless because I won't know which molecule to apply that data to.",
      "votes": null
    },
    {
      "id": "540042",
      "postDate": "05/30/2019 23:33:35",
      "content": "<p>Yes, you can determine the specific molecule by using the xyz file and convert to SMILES, as I described elsewhere in this thread. There really is no reason that I can see to using molecular formula.</p>",
      "rawMarkdown": "Yes, you can determine the specific molecule by using the xyz file and convert to SMILES, as I described elsewhere in this thread. There really is no reason that I can see to using molecular formula.",
      "votes": null
    },
    {
      "id": "540049",
      "postDate": "05/31/2019 00:00:57",
      "content": "<p>not sure how I missed that.  thanks!</p>",
      "rawMarkdown": "not sure how I missed that.  thanks!",
      "votes": null
    },
    {
      "id": "573240",
      "postDate": "07/12/2019 02:31:37",
      "content": "<p>You are using domain knowledge and methane is a simple chemical formula. But it is not possible to do for lakhs of data. </p>",
      "rawMarkdown": "You are using domain knowledge and methane is a simple chemical formula. But it is not possible to do for lakhs of data.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 539316,
      "author_name": "brokndremes",
      "author_url": "",
      "post_date": "05/29/2019 22:12:53",
      "content": "<p>This is pretty easy to determine using the structures.cav file. For example, there are 4 entries for dsgdb9nsd_000001, C, H, H and H. From this, we can tell that the formula is CH4, or methane.</p>",
      "votes": null,
      "replies": [
        {
          "id": 573240,
          "author_name": "saravanansaminathan",
          "author_url": "",
          "post_date": "07/12/2019 02:31:37",
          "content": "<p>You are using domain knowledge and methane is a simple chemical formula. But it is not possible to do for lakhs of data. </p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 539350,
      "author_name": "adilztn",
      "author_url": "",
      "post_date": "05/30/2019 00:18:20",
      "content": "<p>How I managed to extract the \"formula\" :\n<code>structures.groupby(by='molecule_name')['atom'].agg(lambda x :''.join(x))</code></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 539442,
      "author_name": "matthewmasters",
      "author_url": "",
      "post_date": "05/30/2019 03:45:14",
      "content": "<p>If you just want the chemical formula, you can probably just write a script to sum each atom type per molecule. However, I'm not sure how helpful this will be.</p>\n\n<p>If you want something more usable, like SMILES (which can encode a canonical representation of the molecule in the form of a string), you can use an outside tool to convert from the XYZ structures. You should be able to use something like openbabel with a command like:\n<code>obabel -ixyz -osmi [molecule xyz file] -O [molecule smiles file]</code></p>",
      "votes": null,
      "replies": [
        {
          "id": 539476,
          "author_name": "xiaokangwang",
          "author_url": "",
          "post_date": "05/30/2019 05:13:53",
          "content": "<p>Cool. I am looking for a way to generate SMILE for each molecule. Is it possible that a chemical formula corresponds to multiple structures?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 539480,
          "author_name": "matthewmasters",
          "author_url": "",
          "post_date": "05/30/2019 05:20:25",
          "content": "<p>Yes exactly, different chemical structures with the same formula are called constitutional isomers. For example, these three chemicals have the exact same formula (C5H12O) but have different structures:\n<a href=\"https://en.wikipedia.org/wiki/3-Pentanol\">https://en.wikipedia.org/wiki/3-Pentanol</a>\n<a href=\"https://en.wikipedia.org/wiki/2-Pentanol\">https://en.wikipedia.org/wiki/2-Pentanol</a>\n<a href=\"https://en.wikipedia.org/wiki/1-Pentanol\">https://en.wikipedia.org/wiki/1-Pentanol</a></p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 540031,
      "author_name": "tblack",
      "author_url": "",
      "post_date": "05/30/2019 22:48:18",
      "content": "<p>Hi,</p>\n\n<p>My question is, is it possible to determine the specific molecule from the current provided data?\nAs was already posted in this thread, different molecules can share the same chemical formula.  Therefore any external data I find that corresponds to a given chemical formula is likely useless because I won't know which molecule to apply that data to.</p>",
      "votes": null,
      "replies": [
        {
          "id": 540042,
          "author_name": "matthewmasters",
          "author_url": "",
          "post_date": "05/30/2019 23:33:35",
          "content": "<p>Yes, you can determine the specific molecule by using the xyz file and convert to SMILES, as I described elsewhere in this thread. There really is no reason that I can see to using molecular formula.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 540049,
          "author_name": "tblack",
          "author_url": "",
          "post_date": "05/31/2019 00:00:57",
          "content": "<p>not sure how I missed that.  thanks!</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "539307": "In the column named \"molecule name\" in the train.csv file, I saw something like this \"dsgdb9nsd_000001\". Is there a way to extract the chemical formula from a molecule name?",
    "539316": "This is pretty easy to determine using the structures.cav file. For example, there are 4 entries for dsgdb9nsd_000001, C, H, H and H. From this, we can tell that the formula is CH4, or methane.",
    "539350": "How I managed to extract the \"formula\" :\n`structures.groupby(by='molecule_name')['atom'].agg(lambda x :''.join(x))`",
    "539442": "If you just want the chemical formula, you can probably just write a script to sum each atom type per molecule. However, I'm not sure how helpful this will be.\n\nIf you want something more usable, like SMILES (which can encode a canonical representation of the molecule in the form of a string), you can use an outside tool to convert from the XYZ structures. You should be able to use something like openbabel with a command like:\n`obabel -ixyz -osmi [molecule xyz file] -O [molecule smiles file]`",
    "539476": "Cool. I am looking for a way to generate SMILE for each molecule. Is it possible that a chemical formula corresponds to multiple structures?",
    "539480": "Yes exactly, different chemical structures with the same formula are called constitutional isomers. For example, these three chemicals have the exact same formula (C5H12O) but have different structures:\nhttps://en.wikipedia.org/wiki/3-Pentanol\nhttps://en.wikipedia.org/wiki/2-Pentanol\nhttps://en.wikipedia.org/wiki/1-Pentanol",
    "540031": "Hi,\n\nMy question is, is it possible to determine the specific molecule from the current provided data?\nAs was already posted in this thread, different molecules can share the same chemical formula.  Therefore any external data I find that corresponds to a given chemical formula is likely useless because I won't know which molecule to apply that data to.",
    "540042": "Yes, you can determine the specific molecule by using the xyz file and convert to SMILES, as I described elsewhere in this thread. There really is no reason that I can see to using molecular formula.",
    "540049": "not sure how I missed that.  thanks!",
    "573240": "You are using domain knowledge and methane is a simple chemical formula. But it is not possible to do for lakhs of data."
  },
  "source": "meta"
}