diff options
author | AndreaGuarracino | 2020-08-28 11:16:24 +0200 |
---|---|---|
committer | AndreaGuarracino | 2020-08-28 11:16:24 +0200 |
commit | 3165a31e321cbf4641f9afdcbea511ee66f673bb (patch) | |
tree | 7140a760be5903c6f5e63a38da7e0f76493530a8 /bh20seqanalyzer/main.py | |
parent | cc8f99d50236b7d0c365990398785ecc319323ea (diff) | |
download | bh20-seq-resource-3165a31e321cbf4641f9afdcbea511ee66f673bb.tar.gz bh20-seq-resource-3165a31e321cbf4641f9afdcbea511ee66f673bb.tar.lz bh20-seq-resource-3165a31e321cbf4641f9afdcbea511ee66f673bb.zip |
added control (locally and in the validation) that sample_id has to be the same in the metadata and in the FASTA header #103
Diffstat (limited to 'bh20seqanalyzer/main.py')
-rw-r--r-- | bh20seqanalyzer/main.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/bh20seqanalyzer/main.py b/bh20seqanalyzer/main.py index 11349e5..5f00080 100644 --- a/bh20seqanalyzer/main.py +++ b/bh20seqanalyzer/main.py @@ -83,12 +83,16 @@ class SeqAnalyzer: if n not in col: continue with col.open(n, 'rb') as qf: - tgt = qc_fasta(qf)[0] + tgt, seqlabel, seq_type = qc_fasta(qf) if tgt != n and tgt != paired.get(n): errors.append("Expected %s but magic says it should be %s", n, tgt) elif tgt in ("reads.fastq", "reads.fastq.gz", "reads_1.fastq", "reads_1.fastq.gz"): self.start_fastq_to_fasta(collection, n, sample_id) return False + + # If it is a FASTA + if sample_id != seqlabel: + errors.append("Expected sample_id == seqlabel, but %s != %s" % (sample_id, seqlabel)) if tgt is None: errors.append("Upload '%s' does not contain sequence.fasta, reads.fastq or reads_1.fastq", collection["name"]) except Exception as v: |