How to use my own taxonomic or functional classification in MEGAN?

In 2014, Dumont published LCA method classify pmoa gene with MEGAN (http://journal.frontiersin.org/article/10.3389/fmicb.2014.00034/abstract). I want to create my own classification in a similar manor. The authors of that paper describe two
mysterious files pmoa.megan.2013.map and pmoa.megan.2013.tre. I don’t know how to generate such files.

MEGAN allows your to define your own classification. In old versions of MEGAN, you could only replace the NCBI classification by your own. Now, MEGAN6 Ultimate Edition allows one to add a new classification in addition to existing ones.
MEGAN6 UE will generate a new window, extend the import blast dialog etc…

For this to work, you need to specify three files. Say you want to call your new classification amoa, then you need:

  1. amoa.map - this contains a mapping of Amoa names to numbers- these names will appear as labels on the tree in MEGAN

  2. amoa.tre - this contains a definition of the classification of the tree in Newick format, in which all nodes (including internal ones, not just leaves), are labeled by numbers present in amoa.map. Each node should have a unique number, except leaves, where the same number can appear multiple times (for example, in a KEGG tree, the same KO may appear in multiple pathways).

  3. a file that maps GI numbers or strings in the header lines of your reference sequences to numbers in your amoa.map file.
    For example, a file called gi2amoa.map or a file synonym2amoa.map.

Let me explain this using a mini example:

mini.map:
1 Root
2 Fruit
3 Apple
4 Banana
5 Veg
6 Carrot
7 Tomato
8 Potato

mini.tre:
((3,4)2,(6,7,8)5)1;

synonyms2min.map

Apple 3
Jonagold 3
Granny Smith 3
Banana 4

Reference sequences:

Apple June 2015
ACGTT…
Jonagold Germany
CCCGCTGC…
Granny Smith
CGCTGCTGCTGC…
Golden Banana
GCTGCTGCTGC…

For MEGAN6 UE to incorporate your new classification, you simply need to place the mini.map and mini.tre files into the class/resources/files directory in your MEGAN6 UE installation and then (re)-start the program. You will see a new icon in the tool bar representing your new viewer and the Import from Blast dialog will show a new tab for you to setup import. Also, programs such as blast2rma, blast2lca and daa-meganizer will know about the new classification and will offer command line options to work with it.

2 Likes

Hello,

Do you also put the third file, the mappings from reference sequence to nodes in the tree in the class/resources/files directory?

No, you supply that as a synonyms file in the Import from Blast dialog.