jdidion / atropos

An NGS read trimming tool that is specific, sensitive, and speedy. (production)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Encountering assertion error when using --error-rate and --insert-match-error-rate

countdigi opened this issue · comments

Looks like this is failing assert here: https://github.com/jdidion/atropos/blob/master/atropos/align/__init__.py#L86-L90

I can provide more context if needed - any pointers in debugging appreciated!

Stack Trace:

atropos -T 8 \
  --error-rate 0.20 \
  --insert-match-error-rate 0.30 \
  --minimum-length 20 \
  --aligner insert \
  --adapter-cache-file /mnt/work/atropos_e_values/0.20/TST02.adapters \
  -a AGATCGGAAGAGCACACGTCTGAACTCCAGTCAC \
  -A AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGTAGATCTCGGTGGTCGCCGTATCATT \
  -pe1 /mnt/data/bioinfo/data/test/human-wgs-mini/TST02_R1.fastq.gz \
  -pe2 /mnt/data/bioinfo/data/test/human-wgs-mini/TST02_R2.fastq.gz \
  -o /mnt/work/atropos_e_values/0.20/TST02_R1.fastq.gz \
  -p /mnt/work/atropos_e_values/0.20/TST02_R2.fastq.gz

2018-04-17 22:49:27,108 INFO: This is Atropos 1.1.17 with Python 3.6.4
2018-04-17 22:49:27,113 INFO: Loading list of known contaminants from https://raw.githubusercontent.com/jdidion/atropos/master/atropos/adapters/sequencing_adapters.fa
2018-04-17 22:49:27,211 INFO: Trimming 2 adapters with at most 20.0% errors in paired-end mode ...
2018-04-17 22:49:27,231 INFO: Starting 7 worker processes
2018-04-17 22:50:09,732 INFO: Starting 1 worker processes
2018-04-17 22:50:58,478 ERROR: Unexpected error in Worker process 1

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/atropos/commands/base.py", line 74, in handle_records
    self.handle_record(context, record)
  File "/usr/local/lib/python3.6/site-packages/atropos/commands/base.py", line 127, in handle_record
    return self.handle_reads(context, read1, read2)
  File "/usr/local/lib/python3.6/site-packages/atropos/commands/trim/__init__.py", line 52, in handle_reads
    return self.record_handler.handle_record(context, read1, read2)
  File "/usr/local/lib/python3.6/site-packages/atropos/commands/trim/__init__.py", line 70, in handle_record
    reads = self.modifiers.modify(read1, read2)
  File "/usr/local/lib/python3.6/site-packages/atropos/commands/trim/modifiers.py", line 1098, in modify
    read1, read2 = mods(read1, read2)
  File "/usr/local/lib/python3.6/site-packages/atropos/commands/trim/modifiers.py", line 395, in __call__
    match = self.aligner.match_insert(read1.sequence, read2.sequence)
  File "/usr/local/lib/python3.6/site-packages/atropos/align/__init__.py", line 384, in match_insert
    match = _match(*match_args)
  File "/usr/local/lib/python3.6/site-packages/atropos/align/__init__.py", line 328, in _match
    best_adapter_matches, best_adapter_mismatches),
  File "/usr/local/lib/python3.6/site-packages/atropos/align/__init__.py", line 86, in __init__
    assert self.length - self.errors > 0
AssertionError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/atropos/commands/multicore.py", line 210, in run
    self.pipeline.process_batch(batch)
  File "/usr/local/lib/python3.6/site-packages/atropos/commands/multicore.py", line 146, in process_batch
    super().process_batch(batch)
  File "/usr/local/lib/python3.6/site-packages/atropos/commands/base.py", line 58, in process_batch
    self.handle_records(context, records)
  File "/usr/local/lib/python3.6/site-packages/atropos/commands/trim/__init__.py", line 48, in handle_records
    super().handle_records(context, records)
  File "/usr/local/lib/python3.6/site-packages/atropos/commands/base.py", line 78, in handle_records
    idx, context['index'])) from err
atropos.AtroposError: An error occurred at record 767 of batch 1866

Apologies for the delay in addressing this. Can you provide a minimal fastq that reproduces this error? Thanks

Thanks. This should be fixed in 1.1.19.

Confirmation it is fixed after testing - thank you so much. KC