On 12/03/2014 10:38 AM, Marc Chakiachvili wrote:
> Hi,
>
>
> Newbie question about using the command "data", I currently set new
> properties for atoms, a sequence number generated for my project, and
> properties about alignements values returned by BLAST.
>
> As I have many file to process, I currently load BLAST aligned models, set
> my propreties, then load append another one, but as I said, I have many
> files, which obliged me to load many models. I saw that the "data" command
> could help to save my new properties to a file. Unfortunatly I didn't find
> any way to save these data into a file.
>
> Example :
>
> file = Load a 'script file' with data retrieved from BLAST
>
> // select my atoms according to my parameters
> for (my atoms in pdb files) {
>
> x = {resno = XXX && chainID = yy && modelId = zz}
>
> x.property_seqresno = [my number]
>
> x.property_qsimil = [another value]
>
> }
>
> After this process, I would like to save into BLAST_property_XXX.dat the
> properties values, in order to retrieve them afterward easily.
>
> Is it possible ?
>
Marc, I don't think the 'data' command would be appropriate here.
I would suggest to write the data in TSV format (Tab Separated Values)
into a text file.
For this you will need to prepare a header line, where the columns are
separated by a tabulator (added as '\t' in Jmol; shown below as '[TAB]')
and data lines organized identically.
In your example this would look like this:
resno[TAB]chainID[TAB]modelId[TAB]seqresno[TAB]qsimil
XXX[TAB]yy[TAB]zz[TAB]my number[TAB]another value
To prepare the data for the currently selected atoms and write the data
into a file in a flexible way you could do it like this:
# ------Jmol Script ----------------------
var property_list =
["resno","chainID","modelId","property_seqresno","property_qsimil"];
var tsv_data = property_list.join("\t") + "\n";
for (var current_atom IN {selected}) {
var data_line = "";
for (var property IN property_list) {
data_line = data_line + "\t" + eval("{current_atom}." + property);
}
tsv_data = tsv_data + data_line + "\n";
}
write VAR tsv_data "atom_properties.txt";
# ----------------------------------------
In order to change the properties you want to store you just would have
to adapt the 'property_list' array.
The script is adapted from a more complex one of me so it is not tested
directly. But generally it should work if you make sure that all
properties in your 'property_list' are actually defined.
In the email the script lines might not be shown properly as single
lines but wrapped into multiple lines. Before you run the script you
should restore the original lines. Each line should either end with a
semicolon (';') or a brace ('{' or '}'). If this is not the case for a
line you see you must combine it with the next line.
If you need further explanations or if it doesn't work don't hesitate to
ask.
Regards,
Rolf
--
Rolf Huehne
Postdoc
Leibniz Institute for Age Research - Fritz Lipmann Institute (FLI)
Beutenbergstrasse 11
07745 Jena, Germany
Phone: +49 3641 65 6205
Fax: +49 3641 65 6210
E-Mail: [email protected]
Website: http://www.fli-leibniz.de
Scientific Director: Prof. Dr. K. Lenhard Rudolph
Head of Administration: Dr. Daniele Barthel
Chairman of Board of Trustees: Dennys Klein
VAT No: DE 153 925 464
Register of Associations: No. 230296, Amtsgericht Jena
Tax Number: 162/141/08228
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users