MadsAlbertsen / mmgenome

Please use mmgenome2 instead. Tools for extracting individual genomes from metagenomes
https://kasperskytte.github.io/mmgenome2/
27 stars 8 forks source link

Attempt to set 'colnames' on an object with less than two dimensions #16

Closed dburkhardt closed 9 years ago

dburkhardt commented 10 years ago

There error occurs when I call mmload with the "other" parameter set to a tab delimited file containing scaffolds and gc contents as generated by the calc.gc.pl script in the multi-metagenome R.data.generation here: http://madsalbertsen.github.io/multi-metagenome/docs/step5.html. My GC file looks like this:

contig gc scaffold00001 61.59 scaffold00002 59.92 scaffold00003 63.19 scaffold00004 59.11 scaffold00005 63.08

In R, this file is loaded using read.table. It's str() is: 'data.frame': 1421152 obs. of 2 variables: $ contig: Factor w/ 1421152 levels "scaffold00001",..: 1 2 3 4 5 6 7 8 9 10 ... $ gc : num 61.6 59.9 63.2 59.1 63.1 ...'

The full error is: Error in colnames<-(*tmp*, value = "scaffold") : attempt to set 'colnames' on an object with less than two dimensions

I haven't had the opportunity to look through the source code to find where this error is coming from. If I try mmload without adding this file, it works.

Kirk3gaard commented 10 years ago

Hi

I think you are referring to the old "multi-metagenome" package. The guide for the new "mmgenome" package is fouind at http://madsalbertsen.github.io/mmgenome/

The GC content is calculated automatically with the mmgenome package so you do not need to supply it with your own file: "The assembly is used to extract scaffold length, GC content and tetranucleotide frequencies (used for a very simple PCA)."

Hope this helps.