Open sbhakat opened 2 years ago
@sbhakat can you confirm which version of MDAnalysis you are using? This part of the PDBWriter has changed a lot in recent iterations, so it's worth asking.
@IAlibay using version 1.1.1
Thanks @sbhakat
So technically it's possible to get around this, but we should also have the option to not add in segments to PDB files - if it's not in the standard, it shouldn't be done by default.
Getting around the issue:
In 2.0.0 the PDBWriter was changed to used chainID instead of segID for setting chains.
You would have to upgrade to 2.0.0, but in your above case, if you did:
# if you have any segments then set them to an empty string to avoid writing them
u.atoms.segements.segids = ''
# now add a chainIDs attribute for your chains (if you don't have one already)
u.add_TopologyAttr('chainIDs')
# set chain for atoms 0 through to 2409
u.atoms[:2410].chainIDs = 'A'
instead of:
newseg = U.add_Segment(segid='A')
It should fix the issue? (at least it does in the test case I'm looking at).
@IAlibay thanks a lot. Worked :D
I think I'm going to re-open this and change the issue title to "don't write segment by default".
As far as I'm aware it's not in the PDBv3 format: http://www.wwpdb.org/documentation/file-format-content/format33/sect9.html#ATOM So we shouldn't be enforcing a non-existing standard. Worth having a discussion imho.
Well even if I add the chain ID correctly I still can't upload the PDB in CHARMM GUI. Seems like some formatting problem. Any inputs. Attaching the PDB for convenience. https://www.dropbox.com/s/hn30mr4w6lr1sfk/prot-mass-newchain.pdb?dl=0 #
Well. I solved this issue by using mdconvert (mdconvert test.pdb -o test-format.pdb
) on top of the output of mdanalysis
. Output here: https://www.dropbox.com/s/bpeno8t8oan4auk/test.pdb?dl=0 CHARMM GUI can capture this
I want to add only chain ID to my PDB but couldn't manage to add chain ID without adding segment ID. Is there anyway to add only chain? My script looks like following
The output looks like
The reason being that CHARMM GUI doesn't accept segment ID as a part of RCSB PDB format. Any help will be highly appreciated.