diff options
author | AndreaGuarracino | 2020-10-01 22:36:44 +0200 |
---|---|---|
committer | AndreaGuarracino | 2020-10-01 22:36:44 +0200 |
commit | cc9aff0931aa1579c47c01dfa74022807548b40f (patch) | |
tree | bac5a04d0da4c9bc08be745b997a957eacfc38ae /bh20sequploader/qc_fasta.py | |
parent | b3a671f04743dc2bf48049b413d7d1f20d31bbcf (diff) | |
download | bh20-seq-resource-cc9aff0931aa1579c47c01dfa74022807548b40f.tar.gz bh20-seq-resource-cc9aff0931aa1579c47c01dfa74022807548b40f.tar.lz bh20-seq-resource-cc9aff0931aa1579c47c01dfa74022807548b40f.zip |
show more information in the error messages
Diffstat (limited to 'bh20sequploader/qc_fasta.py')
-rw-r--r-- | bh20sequploader/qc_fasta.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/bh20sequploader/qc_fasta.py b/bh20sequploader/qc_fasta.py index 215d6fd..58ca22e 100644 --- a/bh20sequploader/qc_fasta.py +++ b/bh20sequploader/qc_fasta.py @@ -82,12 +82,15 @@ def qc_fasta(arg_sequence, check_with_mimimap2=True): logging.warn("QC against reference sequence using 'minimap2': %s", e, exc_info=e) if similarity < 70.0: - raise ValueError("QC fail: alignment to reference was less than 70%% (was %2.2f%%)" % (similarity)) + raise ValueError( + "QC fail for {}: alignment to reference was less than 70%% (was %2.2f%%)".format( + seqlabel, similarity + )) - return ("sequence.fasta"+gz, seqlabel, seq_type) + return "sequence.fasta" + gz, seqlabel, seq_type elif seq_type == "text/fastq": sequence.seek(0) sequence.detach() - return ("reads.fastq"+gz, seqlabel, seq_type) + return "reads.fastq" + gz, seqlabel, seq_type else: - raise ValueError("Sequence file does not look like a DNA FASTA or FASTQ") + raise ValueError("Sequence file ({}) does not look like a DNA FASTA or FASTQ".format(arg_sequence)) |