How to combine .rma6 file

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

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

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

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

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,

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?

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,

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.

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

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,

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.

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)

Hello there, I’m also trying, without success, to use the compute-comparison tool, and I’m getting the same problem here, both with or without the xvfb-run command:

[lztassi@service0 tools]$ /home/lztassi/usr/bin/xvfb-run --auto-servernum --server-num=1
./compute-comparison -i /home/lztassi/global/testdb/1.INF.daa /home/lztassi/global/testdb/2.INF.daa
Version MEGAN Ultimate Edition (version 6.16.4, built 24 Jun 2019)
Copyright (C) 2019 Daniel H. Huson. This program comes with ABSOLUTELY NO WARRANTY.
Caught:
java.awt.HeadlessException
at java.desktop/sun.awt.HeadlessToolkit.createCustomCursor(HeadlessToolkit.java:159)
at jloda/jloda.swing.util.Cursors.init(Cursors.java:119)
at jloda/jloda.swing.util.Cursors.getOpenHand(Cursors.java:41)
at jloda/jloda.swing.graphview.GraphView.resetCursor(GraphView.java:3190)
at jloda/jloda.swing.graphview.GraphView.(GraphView.java:226)
at jloda/jloda.swing.graphview.GraphView.(GraphView.java:145)
at jloda/jloda.swing.graphview.PhyloTreeView.(PhyloTreeView.java:76)
at jloda/jloda.swing.graphview.PhyloTreeView.(PhyloTreeView.java:52)
at megan/megan.viewer.ViewerBase.(ViewerBase.java:91)
at megan/megan.viewer.ClassificationViewer.(ClassificationViewer.java:112)
at megan/megan.viewer.MainViewer.(MainViewer.java:72)
at megan/megan.core.Director.newProject(Director.java:673)
at megan/megan.core.Director.newProject(Director.java:656)
at megan/megan.tools.ComputeComparison.run(ComputeComparison.java:94)
at megan/megan.tools.ComputeComparison.main(ComputeComparison.java:55)
at megan6u/megan6u.tools.ComputeComparison.main(Unknown Source)
Caught:
java.lang.NullPointerException
at megan/megan.tools.ComputeComparison.run(ComputeComparison.java:95)
at megan/megan.tools.ComputeComparison.main(ComputeComparison.java:55)
at megan6u/megan6u.tools.ComputeComparison.main(Unknown Source)
/home/lztassi/usr/bin/xvfb-run: line 186: kill: (5376) - No such process

I just tried this on a linux server (running 16.04.1-Ubuntu) and it ran through. However, I was using version MEGAN 6.17.0 (both community edition and ultimate edition), so please try using that version. If the problem persists