aboutsummaryrefslogtreecommitdiff
path: root/bh20sequploader/qc_fasta.py
diff options
context:
space:
mode:
authorPjotr Prins2020-11-06 11:19:28 +0000
committerPjotr Prins2020-11-06 11:19:28 +0000
commit5fdfece97fb2d50a10eab5004a6467ec0097ece8 (patch)
tree022eff03421416c082cd09e7c4d391b9527501e9 /bh20sequploader/qc_fasta.py
parent951ebe949d88cdbfed028e0a2a420ce7921c3919 (diff)
downloadbh20-seq-resource-5fdfece97fb2d50a10eab5004a6467ec0097ece8.tar.gz
bh20-seq-resource-5fdfece97fb2d50a10eab5004a6467ec0097ece8.tar.lz
bh20-seq-resource-5fdfece97fb2d50a10eab5004a6467ec0097ece8.zip
Uploader script improvements
Diffstat (limited to 'bh20sequploader/qc_fasta.py')
-rw-r--r--bh20sequploader/qc_fasta.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/bh20sequploader/qc_fasta.py b/bh20sequploader/qc_fasta.py
index f567f0a..814fb3e 100644
--- a/bh20sequploader/qc_fasta.py
+++ b/bh20sequploader/qc_fasta.py
@@ -66,7 +66,8 @@ def qc_fasta(arg_sequence, check_with_mimimap2=True):
similarity = 0
try:
- cmd = ["minimap2", "-c -x asm20", tmp1.name, tmp2.name]
+ log.debug("Trying to run minimap2")
+ cmd = ["minimap2", "-c", "-x", "asm20", tmp1.name, tmp2.name]
logging.info("QC checking similarity to reference")
logging.info(" ".join(cmd))
result = subprocess.run(cmd, stdout=subprocess.PIPE)
@@ -83,9 +84,7 @@ def qc_fasta(arg_sequence, check_with_mimimap2=True):
if similarity < 70.0:
raise ValueError(
- "QC fail for {}: alignment to reference was less than 70%% (was %2.2f%%)".format(
- seqlabel, similarity
- ))
+ f"QC fail for {seqlabel}: alignment to reference was less than 70% (was {similarity})")
return "sequence.fasta" + gz, seqlabel, seq_type
elif seq_type == "text/fastq":
@@ -93,4 +92,6 @@ def qc_fasta(arg_sequence, check_with_mimimap2=True):
sequence.detach()
return "reads.fastq" + gz, seqlabel, seq_type
else:
+ log.debug(seqlabel)
+ log.debug(seq_type)
raise ValueError("Sequence file ({}) does not look like a DNA FASTA or FASTQ".format(arg_sequence))