GetMapList not working?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

GetMapList not working?

Martin Guetlein
Hello All,

I am using OBMol->GetMapList to get the occurrences of fragments in
molecules. I'm not to sure that everything works correctly, though.
OpenBabel(-2.2.3) apparently tells me that N matches only twice in
C10H19N5O:

code:
[[[
OBMol * mol = new OBMol();
OBConversion obconversion;
obconversion.SetInFormat("smiles");
obconversion.ReadString(mol, "C1(N=C(NC(C)C)N=C(N=1)OC)NC(C)C");
cout << "formula "<< mol->GetFormula() << "\n";
OBSmartsPattern smartsPattern;
smartsPattern.Init( "N" );
smartsPattern.Match( *mol );
vector<vector <int> > map = smartsPattern.GetMapList();
cout << "num matches of N: "<< map.size() << "\n";
]]]

output:
> formula C10H19N5O
> num matches of N: 2

Regards,
Martin

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: GetMapList not working?

Geoffrey Hutchison
> I am using OBMol->GetMapList to get the occurrences of fragments in
> molecules. I'm not to sure that everything works correctly, though.
...
> obconversion.ReadString(mol, "C1(N=C(NC(C)C)N=C(N=1)OC)NC(C)C");
...
> smartsPattern.Init( "N" );

The SMARTS pattern "N" matches only non-aromatic nitrogen atoms. There are two in your SMILES: the two amines. The aromatic nitrogens will not match "N" but would match "[#14]"
http://www.daylight.com/dayhtml/doc/theory/theory.smarts.html

Hope that helps,
-Geoff
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: GetMapList not working?

Martin Guetlein
On Wed, Jul 14, 2010 at 3:59 PM, Geoffrey Hutchison
<[hidden email]> wrote:

>> I am using OBMol->GetMapList to get the occurrences of fragments in
>> molecules. I'm not to sure that everything works correctly, though.
> ...
>> obconversion.ReadString(mol, "C1(N=C(NC(C)C)N=C(N=1)OC)NC(C)C");
> ...
>> smartsPattern.Init( "N" );
>
> The SMARTS pattern "N" matches only non-aromatic nitrogen atoms. There are two in your SMILES: the two amines. The aromatic nitrogens will not match "N" but would match "[#14]"
> http://www.daylight.com/dayhtml/doc/theory/theory.smarts.html
>
> Hope that helps,
> -Geoff

Ooops, you are right, of course. "n" matches the other 3 aromatic nitrogens.

Thanks,
Martin

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss