New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow PDBWriter (and similar) to write record_types #1753

Open
xiki-tempula opened this Issue Jan 11, 2018 · 5 comments

Comments

Projects
None yet
4 participants
@xiki-tempula
Contributor

xiki-tempula commented Jan 11, 2018

(@richardjgowers edit:) Following #1762 we now read the record type (ATOM/HETATM) of each atom. Now we need to make the PDBWriter (and PQR/PDBQT) write these records when found, otherwise defaulting to a sensible value.

Original Issue:

I have a gro file which contains a ligand and I want to write it out as a pdb file. In the new pdb file can the ligand has a Record type of HETATOM instead of ATOM?

Like

import MDAnalysis as mda
u = mda.Universe(grofile)
u.atoms.recordtype = 'HETATOM'
u.atoms.write('ligand.pdb')
@kain88-de

This comment has been minimized.

Show comment
Hide comment
@kain88-de

kain88-de Jan 11, 2018

Member

Our PDB writer currently doesn't support writing HETATM records. I'm not sure we track this information in the topology either.

Member

kain88-de commented Jan 11, 2018

Our PDB writer currently doesn't support writing HETATM records. I'm not sure we track this information in the topology either.

@xiki-tempula

This comment has been minimized.

Show comment
Hide comment
@xiki-tempula

xiki-tempula Jan 11, 2018

Contributor

@kain88-de It seems not.
I have loaded a PDB file where the record type is HETATOM and write it into another pdb. It seems that the HETATOM information is lost.

import MDAnalysis as mda
u = mda.Universe('old.pdb')
u.atoms.write('new.pdb')

old pdb
HETATM 1 N LEU 1 32.310 13.778 14.372 1.00 0.00 SYST N 0
new.pdb
ATOM 1 N LEU 1 32.310 13.778 14.372 1.00 0.00 SYST N 0

Contributor

xiki-tempula commented Jan 11, 2018

@kain88-de It seems not.
I have loaded a PDB file where the record type is HETATOM and write it into another pdb. It seems that the HETATOM information is lost.

import MDAnalysis as mda
u = mda.Universe('old.pdb')
u.atoms.write('new.pdb')

old pdb
HETATM 1 N LEU 1 32.310 13.778 14.372 1.00 0.00 SYST N 0
new.pdb
ATOM 1 N LEU 1 32.310 13.778 14.372 1.00 0.00 SYST N 0

@kain88-de

This comment has been minimized.

Show comment
Hide comment
@kain88-de

kain88-de Jan 11, 2018

Member

Well yeah for the writing it is lost. Like I said we do not write HETATM records at all. This doesn't mean the topology isn't keeping track of this information internally.

Member

kain88-de commented Jan 11, 2018

Well yeah for the writing it is lost. Like I said we do not write HETATM records at all. This doesn't mean the topology isn't keeping track of this information internally.

@xiki-tempula

This comment has been minimized.

Show comment
Hide comment
@xiki-tempula

xiki-tempula Jan 11, 2018

Contributor

@kain88-de Thank you for the help. I guess I will do some string manipulation at the end of my script to solve this problem.

Contributor

xiki-tempula commented Jan 11, 2018

@kain88-de Thank you for the help. I guess I will do some string manipulation at the end of my script to solve this problem.

@richardjgowers

This comment has been minimized.

Show comment
Hide comment
@richardjgowers

richardjgowers Jan 11, 2018

Member
Member

richardjgowers commented Jan 11, 2018

@kain88-de kain88-de reopened this Jan 11, 2018

@xiki-tempula xiki-tempula changed the title from changing ATOM to HETATOM in writing PDB file. to changing ATOM to HETATM in writing PDB file. Jan 17, 2018

@richardjgowers richardjgowers referenced this issue Jan 25, 2018

Merged

added reading of record types #1762

4 of 4 tasks complete

@richardjgowers richardjgowers changed the title from changing ATOM to HETATM in writing PDB file. to Allow PDBWriter (and similar) to write record_types Jan 30, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment