Hi,

I don't know about your first problem, but I can tell you that the  
argument to StripSalts is the size below which a fragment is  
considered a salt. That is, when you give the argument 2, all  
fragments that contain less than 2 atoms are removed.

Kind regards,
Fredrik
6 okt 2009 kl. 11.17 skrev Dastard:

>
> Hi,
>
> I'm new to OpenBabel and have been trying to use it via pybel. I  
> have 2
> problems with StripSalts.
>
> First with python 2.5/OpenBabel 2.1.1 using with 1 argument - eg.
> StripSalts(3) - gives the error:-
>
>   def StripSalts(*args): return _openbabel.OBMol_StripSalts(*args)
> TypeError: OBMol_StripSalts expected 1 arguments, got 2
>
> StripSalts() works ok and all salts are stripped. Is this a bug  
> fixed in
> later release?
>
> Using python 2.6.2/OpenBabel 2.2.0 the behavour is reversed - no  
> argument
> gives an error. I don't understand exactly what effect the argument  
> has
> though. Here's an example:-
>
>>>> mol=pybel.readstring("smi","NCCNCCN.Cl.Cl.Cl")
>>>> mol.OBMol.StripSalts(0)
> True
>>>> print mol.write("smi")
> NCCNCCN.Cl.Cl.Cl
>
>>>> mol.OBMol.StripSalts(1)
> True
>>>> print mol.write("smi")
> NCCNCCN.Cl.Cl.Cl
>
>>>> mol.OBMol.StripSalts(2)
> True
>>>> print mol.write("smi")
> NCCNCCN
>
>>>> mol=pybel.readstring("smi","NCCNCCN.Cl.Cl.Cl")
>>>> mol.OBMol.StripSalts(7)
> True
>>>> print mol.write("smi")
> NCCNCCN
>
>>>> mol=pybel.readstring("smi","NCCNCCN.Cl.Cl.Cl")
>>>> mol.OBMol.StripSalts(8)
> True
>>>> print mol.write("smi")
>
>
>>>>
>
> Can someone explain this. Nothing is stripped with argument 0 or 1  
> then with
> 2-7 all salts are stripped. Above this everything goes!
>
> Thanks,
> Dave
>
> -- 
> View this message in context: 
> http://www.nabble.com/StripSalts-argument-tp25765316p25765316.html
> Sent from the openbabel-discuss mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart  
> your
> developing skills, take BlackBerry mobile applications to market and  
> stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> OpenBabel-discuss mailing list
> OpenBabel-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to