jdidion / atropos

An NGS read trimming tool that is specific, sensitive, and speedy. (production)
Other
120 stars 15 forks source link

Error with long reads #37

Closed dleopold closed 7 years ago

dleopold commented 7 years ago

I am getting an error that seems to be related to calculating a large factorial (see overflow error in output below) probably due to the long inserts in the 2X300 bp data I am testing. This only occurs when I use the --aligner insert method, which also suggests it is a problem with calculating the probability for the long overlaps. In addition, if I trim 150 off each read (for example, using u -150 -U 150) the program runs. The untrimmed reads do not cause a problem when I use SeqPurge. I will include an example of some paired read files causing this problem.

drl@rhombus ~/Projects/MAT_dada2/fungi $ atropos --aligner insert -a GATCTCTTGGYTCTBGCATCGATGAAGAACG -A GGAAACCTTGTTACGACTTTTACTTCCTCTAAATGACCAA -pe1 Test_R1_001.fastq.gz -pe2 Test_R2_001.fastq.gz -o Test.out.R1.fastq.gz -p Test.out.R2.fastq.gz 
2017-09-08 09:29:25,492 INFO: This is Atropos 1.1.12 with Python 3.6.1
2017-09-08 09:29:25,497 INFO: Trimming 2 adapters with at most 10.0% errors in paired-end mode ...
2017-09-08 09:29:25,510 ERROR: Atropos error
Traceback (most recent call last):
  File "/home/drl/miniconda3/lib/python3.6/site-packages/atropos/commands/base.py", line 74, in handle_records
    self.handle_record(context, record)
  File "/home/drl/miniconda3/lib/python3.6/site-packages/atropos/commands/base.py", line 127, in handle_record
    return self.handle_reads(context, read1, read2)
  File "/home/drl/miniconda3/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 "/home/drl/miniconda3/lib/python3.6/site-packages/atropos/commands/trim/__init__.py", line 70, in handle_record
    reads = self.modifiers.modify(read1, read2)
  File "/home/drl/miniconda3/lib/python3.6/site-packages/atropos/commands/trim/modifiers.py", line 1054, in modify
    read1, read2 = mods(read1, read2)
  File "/home/drl/miniconda3/lib/python3.6/site-packages/atropos/commands/trim/modifiers.py", line 363, in __call__
    match = self.aligner.match_insert(read1.sequence, read2.sequence)
  File "/home/drl/miniconda3/lib/python3.6/site-packages/atropos/align/__init__.py", line 362, in match_insert
    prob = self.match_probability(insert_match[4], insert_match_size, **self.base_probs)
  File "/home/drl/miniconda3/lib/python3.6/site-packages/atropos/util/__init__.py", line 95, in __call__
    self.factorial(i) /
OverflowError: int too large to convert to float

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

Traceback (most recent call last):
  File "/home/drl/miniconda3/lib/python3.6/site-packages/atropos/util/__init__.py", line 673, in run_interruptible
    func(*args, **kwargs)
  File "/home/drl/miniconda3/lib/python3.6/site-packages/atropos/commands/base.py", line 23, in __call__
    self.process_batch(batch)
  File "/home/drl/miniconda3/lib/python3.6/site-packages/atropos/commands/base.py", line 58, in process_batch
    self.handle_records(context, records)
  File "/home/drl/miniconda3/lib/python3.6/site-packages/atropos/commands/trim/__init__.py", line 48, in handle_records
    super().handle_records(context, records)
  File "/home/drl/miniconda3/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 6 of batch 1

Test_R1_001.fastq.gz Test_R2_001.fastq.gz

jdidion commented 7 years ago

Thanks for this report. I'm a bit confused right now as I can run the following code without error:

from atropos.util import RandomMatchProbability
f = RandomMatchProbability()
f.factorial(10000)

I will try out your test files to see if I can reproduce the error. In the meantime, can you provide details on your computer and OS?

jdidion commented 7 years ago

Also please provide the full command you used to run atropos. Thanks

dleopold commented 7 years ago

The full command should be at the top of my first post and I am running Linux Mint 18.2 on a Dell Precision 5510.

dleopold commented 7 years ago

FYI - I tried this out on a clean install of linux mint on a new hard drive in this same laptop and I get the same error message.

jdidion commented 7 years ago

Thanks for following up on this. I'll get it figured out tomorrow.

On Tue, Sep 12, 2017 at 5:20 PM, dleopold notifications@github.com wrote:

FYI - I tried this out on a clean install of linux mint on a new hard drive in this same laptop and I get the same error message.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jdidion/atropos/issues/37#issuecomment-328987725, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHrnu7RWyNt08vGfMWg2IJnnTIbTFGWks5shvWcgaJpZM4PRaqB .