For those Pythonistas out there, translating Rolf's command line command to one to be executed in the Jmol download folder using `1crn` that comes in the `data` folder would be: cat ./jsmol/data/1crn.pdb | python -c "import sys; print 'load DATA \"mydata\"\n';[sys.stdout.write(line) for line in sys.stdin]; print 'END \"mydata\"\n'" | java -jar Jmol.jar -s - I posted a gist of it at https://gist.github.com/fomightez/7692b540ff3c5d817bf5. It uses Python 2; most computers still have Python 2 installed by default.
Wayne ------------------------------ Message: 12 Date: Fri, 2 Oct 2015 17:12:25 +0200 From: Rolf Huehne <rhue...@fli-leibniz.de> Subject: Re: [Jmol-users] Jmol reads a structure file from a pipe or system input To: jmol-users@lists.sourceforge.net Message-ID: <560e9ed9.4000...@fli-leibniz.de> Content-Type: text/plain; charset=windows-1252; format=flowed On 10/02/2015 04:51 PM, Robert Hanson wrote: > Ah, OK. That's it. Thanks, Rolf. > > > Dwey, try wrapping your structure data with > > load DATA "mydata" > ... > end "mydata" > > and then use the Jmol -s - option. > > -s indicates to read a script file, and "-" indicates that we are using > System.in for that file data. > >>From jmol -h: > > -s,--script <arg> script file to execute or '-' for > System.in > > That is sure to work. > > > My perl is quite rusty, but it may be as simple as: > > cat pdb1deh.ent | perl -ne 'BEGIN { print "load DATA \"mydata\"\n";} END { > print "END \"mydata\"\n";}' | java -jar Jmol.jar -s - > Between the 'BEGIN {}' and 'END {}' section there is missing what to do for each line of the file ('print $_;') but if it is added it works for me: cat /scratch/pdb/pdb/pdb1deh.ent | perl -ne 'BEGIN { print "load DATA \"mydata\"\n";} print $_; END { print "END \"mydata\"\n"; }' | java -jar Jmol.jar -s - Regards, Rolf -- Rolf Huehne Postdoc Leibniz Institute for Age Research - Fritz Lipmann Institute (FLI) Beutenbergstrasse 11 07745 Jena, Germany
------------------------------------------------------------------------------
_______________________________________________ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users