Angel,
Thanks. For the record, Jmol rejects the file as output by Tinker (no cut ad
paste involved). Quite oddly, based on your recount of the pdb spec, simply
removing the SOURCE line does make it partially digestible; although this is
without proper identification of atom types.
As Bob laments later in this thread, it is frustrating when standards are not
followed. Of course, restructuring the base code to meet each non-standard
implementation isn't a fruitful endeavor. For anyone that might find this
discussion and want to follow my solution, here is a script that I cobbled
together to read the Tinker xyz or arc output files:
======================
zap
arcfile=load(_arguments[1])
arcsplit=arcfile.lines
arclines=arcsplit.length
firstline=arcsplit[1].trim(" ")
atomcnt=0+firstline.split(" ")[1]
filecnt=arclines/(1+atomcnt)
moldata=""
for (var i=0;i<filecnt;i++) {
moldata=moldata + " " + atomcnt + "\n\n"
for (var j=2;j<atomcnt+1;j++) {
atomline=arcsplit[i*(atomcnt+1)+j].trim(" ")
atomline=atomline.replace(" "," ")
atomline=atomline.replace(" "," ")
atomline=atomline.replace(" "," ")
atomline=atomline.replace(" "," ")
atomdata=atomline.split(" ")
moldata=moldata+ atomdata[2]+" "+(atomdata[3])+" "+atomdata[4]+"
"+(atomdata[5]) + "\n"
}
moldata=moldata + "\n"
}
print moldata
load "@moldata"
======================
There is probably a cleaner way to grapple with the inconsistent spacing in the
files than my series of .replace() statements, but this works for me.
Equal to the remarkable quality and versatility of Jmol itself is the Jmol
community. Thanks to all of you who make it work.
George
________________________________________
From: Angel Herráez [[email protected]]
Sent: Wednesday, January 22, 2014 3:42 AM
To: [email protected]
Subject: Re: [Jmol-users] Tinker xyz files as Jmol input
Hi George,
The problem in loading pdb file may be due to column positions. The
PDB spec assigns columns to the fields but I have seen other software
producing misaligned columns. Your example may have lost the spacing
while you pasted it, or instead it has single spaces and so no
correct columns.
I do not think that the SOURCE tag would create any problems --but I
don't know the details of Jmol import parser.
PDB spec does have a SOURCE line, and indeed is said "mandatory",
http://www.wwpdb.org/documentation/format32/sect1.html#Order
For column positions:
http://www.wwpdb.org/documentation/format32/sect9.html#ATOM
http://www.wwpdb.org/documentation/format32/sect9.html#HETATM
(All those links may not point to the latest version of the PDB spec,
but it should be the same for our purposes here)
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users