Compare two RMA datasets using the command-line - Internal error: document already used

Hi,

I’m using MEGAN UE (version 6.11.6). I am trying to generate two comparison files based on rma files contained in two different directories.

For instance,

$ ls tmp/*
tmp/dir_ChitinaseEC32114:
PH12_ChitinaseEC32114_tmp.rma  PH6_ChitinaseEC32114_tmp.rma

tmp/dir_Glucose1dehydrogenaseEC11147:
PH12_Glucose1dehydrogenaseEC11147_tmp.rma  PH6_Glucose1dehydrogenaseEC11147_tmp.rma

Based on this and this as reference, I used the following command-line.

$ xvfb-run --auto-servernum --server-num=1 MEGAN -g -E -c rma2comparison.cmegan

where $ cat rma2comparison.cmegan,

compare mode=ABSOLUTE readAssignmentMode=readCount keep1=true ignoreUnassigned=true meganFile='tmp/dir_ChitinaseEC32114';
save file='ChitinaseEC32114_comparison.megan';
update;

compare mode=ABSOLUTE readAssignmentMode=readCount keep1=true ignoreUnassigned=true meganFile='tmp/dir_Glucose1dehydrogenaseEC11147';
save file='Glucose1dehydrogenaseEC11147_comparison.megan';

quit;

The above resulted on the following error when executing the second “compare mode”.

    Error: Command failed: Internal error: document already used
    Quit on exception

I tried also “new;” on line 3 from rma2comparison.cmegan, with no luck. This is most likely a naive situation. However, I will appreciate any help!

Thanks.

To compare multiple files, say three files /local/dir1/x.rma, /local/dir2/y.rma and /local/dir3/z.rma, and to save to a file called /local/dir4/comparison.megan, say, you can use a script like this (probably safest to put single-quotes around file paths):

compare mode=ABSOLUTE readAssignmentMode=readCount meganFile=/local/dir1/x.rma /local/dir2/y.rma /local/dir3/z.rma;
save file=/local/dir4/comparison.megan;
quit;