[Rdkit-discuss] property of name in smilesMolSupplier
Open-Source Cheminformatics and Machine Learning
Brought to you by:
glandrum
From: 杨弘宾 <yan...@16...> - 2016-10-13 10:48:39
|
Hi,? ? I spent a lot of time to explorer "How to get the property of name when using SmilesMolSupplier" I had a smiles file like this:===c1ccccc1\t1\n...===where 1 means that it is positve So I wanted to read this smiles file via SMilesMolSupplier and I knew that the second column is the default name column.suppl = Chem.SmilesMolSupplier('compounds.smi',delimiter='\t',titleLine=False) However, I could not get the property of 1 because I had no idea what the property_name was.In the document, it shows that :If the input file has a title line and more than two columns (smiles and id), the additional columns will be used to set properties on each molecule. The properties are accessible using the mol.GetProp(propName) method.But It was a "no title table", So I thought its property_name of "their names" should be "Name" or "name" as default. And I failed...After read the source code, I found that it should be _Namehttps://github.com/rdkit/rdkit/blob/f4529c910e546af590c56eba01f96e9015c269a6/Code/GraphMol/FileParsers/SmilesMolSupplier.cpp#L194?I think the document should be improved so that others may know how to get the name of each compoundBTW, I tried to use suppl[0].GetPropNames() but only to get "<rdkit.rdBase._vectclass std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > at 0x7402e90>" that seemed tell nothing. I wondered that is there any way to make it readable in python? Hongbin Yang 杨弘宾 Research: Toxicophore and Chemoinformatics Pharmaceutical Science, School of Pharmacy East China University of Science and Technology? |