I wish to create textual output of the number of read assignments to each taxonomic group, in this case Phyla. In the GUI I do this by opening the rma6 file, collapsing on rank “Phylum”, opening a barchart, and then, in the File menu, choosing Export Data.
This produces a file with the following contents:
#Series: noMap.500.fasta-vs-nt.1e-5
Firmicutes 69.0
Ascomycota 18.0
Arthropoda 4.0
Streptophyta 212.0
To script this, I copied the commands executed by Megan in the Message Window into a file (cmd_file) and run it from the command line like so:
~/MEGAN6/MEGAN -g -c cmd_file
cmd_file contents:
open file=’/project/MA_contamination/work/data/julies/noMap.500.fasta-vs-nt.1e-5.rma6’;
update;
collapse rank=‘Phylum’;
select rank=‘Phylum’;
show chart drawer=BarChart data=‘Taxonomy’;
export what=chartData file=’/project/MA_contamination/work/data/julies/noMap.500.fasta-vs-n-chart’;
This produces the following output and error.
Opening startup files
Open startup files:
Loading ncbi.map
Loading ncbi.map: 2,031,704
Loading ncbi.tre
Loading ncbi.tre: 2,031,708
updating viewer
Induced tree has 2,031,708 of 2,031,708 nodes
Command: open file=’/project/MA_contamination/work/data/julies/noMap.500.fasta-vs-nt.1e-5.rma6’;
Executing: open file=’/project/MA_contamination/work/data/julies/noMap.500.fasta-vs-nt.1e-5.rma6’;
Info: Opened file ‘/project/MA_contamination/work/data/julies/noMap.500.fasta-vs-nt.1e-5.rma6’ with 500 reads
Executing: update;
updating viewer…
Induced tree has 121 of 2,031,708 nodes
Induced tree has 121 of 2,031,708 nodes
Command: update;
Executing: update;
updating viewer…
Induced tree has 121 of 2,031,708 nodes
Induced tree has 121 of 2,031,708 nodes
Command: collapse rank=‘Phylum’;
Executing: collapse rank=‘Phylum’;
Induced tree has 121 of 2,031,708 nodes
Induced tree has 121 of 2,031,708 nodes
Command: select rank=‘Phylum’;
Executing: select rank=‘Phylum’;
Command: show chart drawer=BarChart data=‘Taxonomy’;
Executing: show chart drawer=BarChart data=‘Taxonomy’;
Command: export what=chartData file=’/project/MA_contamination/work/data/julies/noMap.500.fasta-vs-n-chart’;
Executing: export what=chartData file=’/project/MA_contamination/work/data/julies/noMap.500.fasta-vs-n-chart’;
Failed to parse command: export what = chartData file = /project/MA_contamination/work/data/julies/noMap.500.fasta-vs-n-chart
Similar commands:
etc
What am I doing wrong? Am I incorrect in trying to use Message Window information to create scripts. I see no mention of “chartData” in the online megan manual.