On Wed, Mar 23, 2011 at 7:15 PM, andi <ad...@mizzou.edu> wrote:
> I have two molecules, ethane and pentane. Whenever I query ethane onto
> pentane, it works, but not the other way around, even when I specify the
> masking bit to 2.
>
> OBQuery* query = QueryAtom::CompileMoleculeQuery(pentane,2);

This doesn't work because the OBBitVec(unsigned size_in_bits)
constructor is called automatically with argument 2 (i.e.
OBBitVec(2)). As a result, you still have a mask with no bits set and
you get the same behaviour as an empty mask (i.e. OBBitVec()). To use
a mask, the following code can be used:

OBBitVec mask;
mask.SetBitOn(1); // indexed from 1 like OBAtom::GetIdx()
mask.SetBitOn(2)
OBQuery* query = QueryAtom::CompileMoleculeQuery(pentane, mask);

with these changes, the first 2 atoms from the pentane will match ethane.

> Is this not a correct way?
>
> This is what the rest of the code looks like:
>
> OBIsomorphismMapper* mapper = OBIsomorphismMapper::GetInstance(query);
> OBIsomorphismMapper::Mapping map;
> mapper->MapFirst(ethane, map);

The rest of the code is fine.

Tim

>
> Thanks,
>
> Andi
>
> ethane
> http://forums.openbabel.org/file/n3400206/1-0.png
>
> pentane
> http://forums.openbabel.org/file/n3400206/1-9.png
>
> --
> View this message in context: 
> http://forums.openbabel.org/IsomorphismMapper-tp3400206p3400206.html
> Sent from the General discussion mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Enable your software for Intel(R) Active Management Technology to meet the
> growing manageability and security demands of your customers. Businesses
> are taking advantage of Intel(R) vPro (TM) technology - will your software
> be a part of the solution? Download the Intel(R) Manageability Checker
> today! http://p.sf.net/sfu/intel-dev2devmar
> _______________________________________________
> OpenBabel-discuss mailing list
> OpenBabel-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>

------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to