samirelanduk / atomium

Python macromolecular parsing (with .pdb/.cif/.mmtf parsing and production)
https://atomium.bio
MIT License
102 stars 19 forks source link

Converting PDB/mmft with a specific dict #22

Closed chaconlab closed 3 years ago

chaconlab commented 5 years ago

I would like to convert mmft/PDB (and back) following exactly the https://mmtf.rcsb.org/v1.0 conventions/dictionaries. As a stupid test I download mmtf file from RCSB and re-formated but the output is almost 2 times larger (I am guessing is related to the bit encoding). I need to convert PDB into mmft and also mmft to PDB but exactly conforming RCSB dictionary. Is it possible with your nice tool?

Thanks for your help

Pablo

Here at http://chaconlab.org are my coordinates just in case you want to contact me...

Proposed Example Code

python3.6 converter.py 2fxm.mmtf temp.mmtf

import sys import atomium

print ('Converting', sys.argv[1], sys.argv[2]) pdb = atomium.open(sys.argv[1]) print(" ", pdb.model) pdb.model.save(sys.argv[2])

samirelanduk commented 5 years ago

Hi - thanks for trying out atomium!

I'm not sure I quite understand the task to be performed. If you want to convert a PDB to MMTF you can indeed do as you suggest in the example code:

import atomium
pdb = atomium.open('1xxx.pdb')
pdb.model.save('1xxx.mmtf')

This will create a MMTF version of the PDB that should be perfectly valid. Perhaps I have misunderstood your Issue?

Sam

chaconlab commented 5 years ago

Hi Sam,

Sorry my problem was originated because I want to use a NGL RCSB script and it requires that mmtf have concrete mmtf fields. Now I reduce the problem to transform a raw pdb (just the coordinates) to mmtf and then transform back this mmtf into pdb. Is it possible? In addition, I will love to transform a raw multiple pdb model (a trajectory in pdb format) into mmtf, are you planning to incorporate this feature to atomium.

Thanks for your help,

Pablo

El jue., 15 ago. 2019 a las 15:58, Sam Ireland (notifications@github.com) escribió:

Hi - thanks for trying out atomium!

I'm not sure I quite understand the task to be performed. If you want to convert a PDB to MMTF you can indeed do as you suggest in the example code:

import atomium pdb = atomium.open('1xxx.pdb') pdb.model.save('1xxx.mmtf')

This will create a MMTF version of the PDB that should be perfectly valid. Perhaps I have misunderstood your Issue?

Sam

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/samirelanduk/atomium/issues/22?email_source=notifications&email_token=AETALRJGX4UNWJPKMTZIXN3QEVOJZA5CNFSM4IHCIWGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4L4FTQ#issuecomment-521650894, or mute the thread https://github.com/notifications/unsubscribe-auth/AETALRJQJ6BNOWWSTF3UPFDQEVOJZANCNFSM4IHCIWGA .

--

Structural Bioinformatics Group http://chaconlab.org

Biological Chemical Physics Department

Rocasolano Physical Chemistry Institute (IQFR)

Spanish National Research Council (CSIC)

Serrano 119. Madrid. E-28006. Spain

Phone: +34 91 561 94 00 # 961366