How to combine .rma6 file


#1

Hi there,

I’m working with the MEGAN command line mode.
I want to know how to combine multiple .rma6 files created by blast2rma script.
When I simplly concatenate .rma6 files (using bash cat command) it doesn’t work because .rma6 files contain binary.

Here is my commands

./blast2rma -i ~ -o out1.rma6 -a2kegg ~ -f ~ -bm ~ -c false
./blast2rma -i ~ -o out2.rma6 -a2kegg ~ -f ~ -bm ~ -c false

cat out1.rma6 out2.rma6 > out_concat.rma6

then I open out_concat.rma6 using MEGAN, the error below occurs.

Thanks a lot for your help!
Best,
Marina


#2

Hi Marina.

rma files can’t be concatenated. You can open two or more .rma files and then use menu items of the Sample Viewer to combined into a “total biome” file that represents the union of all the files


#3

Thank you for your reply, Daniel.

I want to use commandFile option, how can I do that using command line mode?

$ ./MEGAN -g -c

Best,
Marina


#4

Do something like this:

-g -c ~/script -E

However, please note that this is only available in MEGAN UE

If you are using MEGAN CE, then use one of the command line programs in the tools directory


#5

I tried writing script like this,

open file=~/filenameA
open file=~/filenameB
open file=~/filenameC
show window=samplesViewer

but it cause Error like this,

Command: show window=samplesViewer
Executing: show window=samplesViewer;
null
Command usage: show window=samplesViewer; - Opens the Samples Viewer
Error: Command failed: null

What I can do to solve this problem?

Sincerely,


#6

I have looked into this. I am sorry to say that there is no easy way to fix this problem (for complicated internal reasons that have to do with the fact that the sample viewer uses JavaFX, while the rest of the program uses Swing and the command line mode runs in Swing but would have to wait for the JavaFX window to open, which in turn requires some initialization in Swing…)

What were you hoping to do with the SamplesViewer in command line mode?


#7

Thank you for your reply,

I want to use Samples Viewer as seeing total biome instead of concatenating several rma files (which were originally from a sample and divided).
(Like open several rma files -> compare mode -> samples viewer -> total biome -> save as megan file)

Why I am using command line mode is I want to create an rma file by just executing a job script.
(The job script includes these process: divide a fasta file -> alignment tool (parallel execution) -> blast2rma (parallel execution) -> megan command line mode using commandFile option (this megan process is what I described above))

Sincerely,


#8

To address this, I have just written a command-line tool for extracting the total, core or rare biome from a comparison file and will upload it later this week (both CE and UE)
For UE, I have also written a command-line comparison tool that will create a comparison file from a list of RMA, meganized DAA and megan files.


#9

Please try 6.12.3 and let me know whether the new tools/extract-biome command-line program addresses you needs.


#10

Thank you very much for your quick response and update.
I tried to use compute-comparison tool, but it causes java exception.

Command:
./compute-comparison -i sampleA.rma6 sampleB.rma6 sampleC.rma6 -o compared_ABC –v true

Exception message:

Caught:
java.awt.HeadlessException
at sun.awt.HeadlessToolkit.createCustomCursor(HeadlessToolkit.java:251)
at jloda.util.Cursors.A(Unknown Source)
at jloda.util.Cursors.getOpenHand(Unknown Source)
at jloda.graphview.GraphView.resetCursor(Unknown Source)
at jloda.graphview.GraphView.(Unknown Source)
at jloda.graphview.GraphView.(Unknown Source)
at jloda.phylo.PhyloTreeView.(Unknown Source)
at jloda.phylo.PhyloTreeView.(Unknown Source)
at megan.viewer.J.(Unknown Source)
at megan.viewer.G.(Unknown Source)
at megan.viewer.A.(Unknown Source)
at megan.core.G.A(Unknown Source)
at megan.core.G.g(Unknown Source)
at megan.core.G.Ų(Unknown Source)
at megan6u.tools.ComputeComparison.run(Unknown Source)
at megan6u.tools.ComputeComparison.main(Unknown Source)
Caught:
java.lang.NullPointerException
at megan6u.tools.ComputeComparison.run(Unknown Source)
at megan6u.tools.ComputeComparison.main(Unknown Source)

Does this error occur because my update failed?

Sincerely,


#11

The problem is that this version of the program tries to open a window during processing.
For this to work, you will have to use the linux xvfb-run command (as described fro MEGAN in other posts).

In the mean time, I will look into fixing this.


#13

I got xvfb-run and tried to use it, but still the same error occurs.

xvfb-run --auto-servernum --server-num=1 ./compute-comparison --out comparison.out --normalize true --ignoreUnassignedReads false --readAssignmentMode readCount --keepOne false --verbose false --in 1.rma6 2.rma6

Caught:
java.awt.HeadlessException
at sun.awt.HeadlessToolkit.createCustomCursor(HeadlessToolkit.java:251)
at jloda.util.Cursors.A(Unknown Source)
at jloda.util.Cursors.getOpenHand(Unknown Source)
at jloda.graphview.GraphView.resetCursor(Unknown Source)
at jloda.graphview.GraphView.(Unknown Source)
at jloda.graphview.GraphView.(Unknown Source)
at jloda.phylo.PhyloTreeView.(Unknown Source)
at jloda.phylo.PhyloTreeView.(Unknown Source)
at megan.viewer.J.(Unknown Source)
at megan.viewer.G.(Unknown Source)
at megan.viewer.A.(Unknown Source)
at megan.core.G.A(Unknown Source)
at megan.core.G.g(Unknown Source)
at megan6u.tools.ComputeComparison.run(Unknown Source)
at megan6u.tools.ComputeComparison.main(Unknown Source)
Caught:
java.lang.NullPointerException
at megan6u.tools.ComputeComparison.run(Unknown Source)
at megan6u.tools.ComputeComparison.main(Unknown Source)