Confusing error message while importing TSV

While trying to import a SampleData[Mislabeled] artifact, I was not adding all the columns required by this kind of artifact and got this error:

There was a problem importing 
tmp21ifastc.txt is not a(n) TSVFormat file

which IMOO is misleading because the file is a valid TSV but not a valid SampleData[Mislabeled].

My suggestion is to change the error message to say: this is a valid TSV but not a valid SampleData[Mislabeled] or something like that.

To further tests this behavior:

  • This file works:
with open(sample_data_fp, 'w') as f:
    text = [
        '#SampleID\tspec\talleged_probability\tMislabeled\t'
        'corrected_label\tSourceSink\tmin_proportion\tContaminated',
        '1788.mck201Pre.3Osse.9\tOsse\t0.91\tFalse\t'
        'Osse\tsource\t0.7818181818181819\tFalse',
        '1788.mck201Pre.3Osse.9\tBubo\t0.91\tFalse\t'
        'Bubo\tsource\t0.8775510204081632\tFalse',
    ]
    f.write('\n'.join(text))
  • but this one doesn't (only difference is alleged_probability -> allexxged_probability:
with open(sample_data_fp, 'w') as f:
    text = [
        '#SampleID\tspec\tallexxged_probability\tMislabeled\t'
        'corrected_label\tSourceSink\tmin_proportion\tContaminated',
        '1788.mck201Pre.3Osse.9\tOsse\t0.91\tFalse\t'
        'Osse\tsource\t0.7818181818181819\tFalse',
        '1788.mck201Pre.3Osse.9\tBubo\t0.91\tFalse\t'
        'Bubo\tsource\t0.8775510204081632\tFalse',
    ]
    f.write('\n'.join(text))

The basic QIIME 2 command is:
$ qiime tools import --input-path file.txt --output-path file.qza --type "SampleData[Mislabeled]"

Running on:

$ qiime info 
System versions
Python version: 3.8.15
QIIME 2 release: 2022.11
QIIME 2 version: 2022.11.1
q2cli version: 2022.11.1

Installed plugins
alignment: 2022.11.1
composition: 2022.11.2
cutadapt: 2022.11.1
dada2: 2022.11.2
deblur: 2022.11.1
demux: 2022.11.1
diversity: 2022.11.1
diversity-lib: 2022.11.1
emperor: 2022.11.1
feature-classifier: 2022.11.1
feature-table: 2022.11.1
fragment-insertion: 2022.11.1
gneiss: 2022.11.1
longitudinal: 2022.11.1
metadata: 2022.11.1
mislabeled: 0+unknown
phylogeny: 2022.11.1
quality-control: 2022.11.1
quality-filter: 2022.11.1
sample-classifier: 2022.11.1
sourcetracker2: 2.0.1-dev
taxa: 2022.11.1
types: 2022.11.1
umap: 0.1.1
vsearch: 2022.11.1

Application config directory
/Users/antoniog/miniconda3/envs/qiime2-2022.11/var/q2cli

Getting help
To get help with QIIME 2, visit https://qiime2.org

cc: @wasade

2 Likes

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.