frederic-mahe / mumu

C++ implementation of lulu, a R package for post-clustering curation of metabarcoding data
GNU General Public License v3.0
7 stars 0 forks source link

Error: variable number of columns in OTU table #3

Closed CristinaZb closed 2 years ago

CristinaZb commented 2 years ago

I get an error while running mumu: Error: variable number of columns in OTU table

My OTU table looks like this: image I've check the file and the number of columns is the same in all the rows, what are the requirements for the OTU table? Thank you

CristinaZb commented 2 years ago

I've solved the problem by opening the tsv file in Excel and exporting it as .txt Also, I've removed the first column header and the file looks like: image

I leave the issue opened because actually I don't know how I fixed the problem, and maybe Frederic can explain the OTU_table requirements.

frederic-mahe commented 2 years ago

hi @CristinaZb

I have been working on your issue this morning, specifically I am adding tests to cover the case of decimal abundance values.

The man page describes the expected OTU table format:

       -o, --otu_table filename
                Input file containing the contingency table. One OTU per line,
                one sample per column, columns are separated  by  tabulations.
                The  first  line  contains  sample names, and the first column
                contains OTU names. All OTU names must  be  unique.  Abundance
                values  are  positive  integers. Here is a simple example with
                three samples and two OTUs:
                                   │
                              OTUs │ sample1   sample2   sample3
                              ─────┼─────────────────────────────
                               A   │   12         9        24
                               B   │    3         0         6

The name in the first cell is not relevant, so it can be empty.

I think that the issue in your case might be that your initial file was not really a Linux/Unix text file, or that the file was in DOS format (try the command dos2unix myfile.tsv on linux to fix that).

frederic-mahe commented 2 years ago

[...] or that the file was in DOS format (try the command dos2unix myfile.tsv on linux to fix that).

I wrote additional tests for that, and DOS format should not be an issue (mumu silently ignores CR chars).

CristinaZb commented 2 years ago

Thank you for your help, Mumu is working perfectly.

frederic-mahe commented 2 years ago

Thank you for trying my software!