I used the R pgm in the following link to find the N50 from the velvet output. I want to use it for Meta-velvet output. I wonder which file I have to use:
meta-velvetg.Graph2-stats.txt or meta-velvetg.LastGraph-stats.txt
In the manual they used meta-velvetg.Graph2-stats.txt for finding -exp_cov peaks. What are these two files actually?
I believe that as velvet (and metavelvet by extension) progresses it makes a few 'graph' files that represent your data. Initially it makes a graph file containing information about nodes and edges after the reads are hashed but before the cleaning operations. It can also make a graph2 file that contains some extra information about where the reads belong in the graph. The lastgraph file is, as the name implies, the final graph after all cleaning operations have taken place. Metavelvet uses the graph2 file from velvetg and not the lastgraph file because it is in those cleaning operations where excessive breaks and errors can occur with a metagenomic assembly.
So to answer your initial question, use the lastgraph file to calculate N50.