How to use scripts with MEGAN5 in commandLineMode
2
1
Entering edit mode
7.9 years ago
JV ▴ 470

Hello,

I need help using the CommandLine mode of MEGAN5.

I want to process a large set of Blast_comparisons using MEGAN5 under Linux. I use Megan5 routinely and am happy with it, but for my large number of samples I don't want to repeatedly click on the import options every time manually. Instead, I want to use the commandline options of MEGAN to automize this.

However I am having great trouble figuring out exactly how to do this. My data is in tabular BLAST format with GI numbers as sequence-IDs. I do not need to import/embed the actual sequences in my MEGAN-file. I use the mapping files provided by the MEGAN developers to map the GI numbers in my Blast-data to Taxon-information

I tried this set of commands in a scriptfile ('MEGAN_COMMANDS.txt') for simply importing my blast_data into MEGAN5:

load taxGIFile='/usr/local/share/db/MEGAN5_mapping/gi_taxid_nucl.bin'
set taxUseGIMap=true
import blastFile='/home/me/MYBLAST.tab.out' meganFile='/home/me/MYBLAST.tab.out.rma' maxMatches=100 minScore=1.0 maxExpected=0.01 topPercent=10.0 minSupport=1 minComplexity=0.0 useSeed=false useCOG=false useKegg=false usePfam=false paired=false useIdentityFilter=false textStoragePolicy=Embed blastFormat=BlastTAB mapping='Taxonomy:BUILT_IN=true,Taxonomy:GI_MAP=true,SEED:GI_MAP=false,KEGG:GI_MAP=false'

I tried supplying these commands to MEGAN5 like this:

MEGAN -g -v -E < MEGAN_COMMANDS.txt

And like this:

MEGAN -v -c MEGAN_COMMANDS.txt

But in both cases MEGAN just opens a blank screen and then just hangs (I have to abort it using the "kill" command in a new shell). If I import the data by clicking manually it imports the data correctly in a matter of only a few seconds

What am I doing wrong here?

Megan Megan5 Metagenomics • 4.3k views
ADD COMMENT
2
Entering edit mode
7.9 years ago
JV ▴ 470

Finding this thread on SeqAnswers finally helped me find the problem! In fact my problem was rather more simpler (and stupid) than in the mentioned thread: Each command line in the command-file ("MEGAN_COMMANDS.txt" in my case) has to end with a semicolon. After appending semicolons to each line it worked!

Now I can finally automize my MEGAN analyses (GUI's may be nice sometimes, but just not practical for repetitive tasks)

ADD COMMENT
0
Entering edit mode
7.9 years ago
natasha.sernova ★ 4.0k

Try to look again at their manual:

http://ab.inf.uni-tuebingen.de/data/software/megan5/download/manual.pdf

See also this post:

MEGAN5 - input blast -m8 option problem

You said, you used a tabular Blast format. How does your table look like?

As @Istvan said in the post above, "you need to use the default tabular format".

for blast+, for example, "-outfmt 6 or 7 format is needed".

The table-format may be a source of your problem.

As far as I have understood you didn't use multiple data before -

what did you change when you come to tabular format?

This post is also about tabular format, it's really important.

Convert BlastX -m 6 output to -m 7 output for MEGAN

ADD COMMENT
0
Entering edit mode

Thanks for the reply, but the table format is not the problem and how to import BLAST files to MEGAN is not my question. My Blast files are in standard tabular blast format ("-outfmt 6"). And I can import my tables without problem using the graphical user interface. Importing the same tables (or actually doing anything) via the commandline interface is the problem, though.

My question is not how to import blast data into MEGAN, but how to import BLAST data into MEGAN using the CommandLine-interface of MEGAN

I've always used and compared multiple datasets. It is just that you have to : start megan --> click on "import from BLAST" --> navigate through the folders --> choose your blast-file --> adjust your parameters --> click on "ok" --> do the analyses of choice --> export your results (and do all this over and over again for each dataset) This is possible but just not feasible for a large number of datasets.

The CommandLine interface is meant as a method to automize such tasks, and I need help figuring out how

ADD REPLY

Login before adding your answer.

Traffic: 2689 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6