I believe if you shift the Na and Cl atom names one step to the left, (column 
14 to 13), andinsert a space after the atom name, as in:
from:
123456789012345678901234567890123456789012345678901234567890
ATOM      1  Na    Na    1      0.000  0.000  0.000  1.00  0.00          NaATOM 
     2  Cl    Cl    2      2.820  0.000  0.000  1.00  0.00          Cl
to:
123456789012345678901234567890123456789012345678901234567890
ATOM      1 Na     Na    1      0.000  0.000  0.000  1.00  0.00          NaATOM 
     2 Cl     Cl    2      2.820  0.000  0.000  1.00  0.00          Cl
it might work, a simple sed command should do the trick, something like:
sed -i 's/ Na   /Na    /' *pdb





    On Friday, March 24, 2023 at 10:25:42 AM GMT+1, David van der Spoel 
<david.vandersp...@icm.uu.se> wrote:  
 
 Hi, I think I have a correct pdb file here, containing Sodium Chloride
----

TITLE    MOL processed by ACT - The Alexandria Chemistry Tookit

REMARK    THIS IS A SIMULATION BOX

CRYST1  28.200  28.200  28.200  90.00  90.00  90.00 P 1          1

MODEL        1

ATOM      1  Na    Na    1      0.000  0.000  0.000  1.00
0.00          Na

ATOM      2  Cl    Cl    2      2.820  0.000  0.000  1.00
0.00          Cl

ATOM      3  Na    Na    3      2.820  0.000  2.820  1.00
0.00          Na

ATOM      4  Cl    Cl    4      0.000  0.000  2.820  1.00
0.00          Cl

TER

ENDMDL

----
If I try to convert it to an sdf file using
obabel -ipdb MX_4.pdb -osdf -O mx4.sdf
I get:
----

MX_4.pdb

  OpenBabel03242309183D

  4  0  0  0  0  0  0  0  0  0999 V2000

    0.0000    0.0000    0.0000 N  0  0  0  0  0  0  0  0  0  0  0  0

    2.8200    0.0000    0.0000 C  0  0  0  0  0  0  0  0  0  0  0  0

    2.8200    0.0000    2.8200 N  0  0  0  0  0  0  0  0  0  0  0  0

    0.0000    0.0000    2.8200 C  0  0  0  0  0  0  0  0  0  0  0  0

M  END

 >  <TITLE>

    MOL processed by ACT - The Alexandria Chemistry Tookit

 >  <REMARK>

    THIS IS A SIMULATION BOX

 >  <MODEL>

        1

$$$$

----
Sodium is converted to Nitrogen and Chloride to Carbon. I tried meddling
with the atomtyp.txt file but to no avail. Any suggestions to make this
work as it should?

Thanks,

--
David van der Spoel, Ph.D.,
Professor of Computational Molecular Biophysics
Uppsala University.
http://virtualchemistry.org









När du har kontakt med oss på Uppsala universitet med e-post så innebär det att 
vi behandlar dina personuppgifter. För att läsa mer om hur vi gör det kan du 
läsa här: http://www.uu.se/om-uu/dataskydd-personuppgifter/

E-mailing Uppsala University means that we will process your personal data. For 
more information on how this is performed, please read here: 
http://www.uu.se/en/about-uu/data-protection-policy


_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
  
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to