bergmanlab / TELR

TELR is a fast non-reference transposable element detector from long read sequencing data.
https://github.com/bergmanlab/TELR
BSD 2-Clause "Simplified" License
31 stars 11 forks source link

ValueError: start out of range (-878) #33

Closed UrsulaOggenfuss closed 1 year ago

UrsulaOggenfuss commented 1 year ago

Hi, thank you for providing this amazing tool! I successfully run it with two sequences, yet encountered problems with a third. It seems that RepeatMasker annotates TEs in stage3, but then I get this error message:

File "/panfs/jay/groups/29/selmecki/uoggenfu/.conda/envs/TELR/bin/telr", line 10, in sys.exit(main()) File "/home/selmecki/uoggenfu/.conda/envs/TELR/lib/python3.6/site-packages/telr/telr.py", line 129, in main args.thread, File "/home/selmecki/uoggenfu/.conda/envs/TELR/lib/python3.6/site-packages/telr/TELR_te.py", line 588, in get_af vcf_parsed, out, sample_name, bam, raw_reads, telr_reads_dir, read_type="all" File "/home/selmecki/uoggenfu/.conda/envs/TELR/lib/python3.6/site-packages/telr/TELR_assembly.py", line 405, in prep_assembly_inputs for read in samfile.fetch(ins_chr, start, end): File "pysam/libcalignmentfile.pyx", line 1091, in pysam.libcalignmentfile.AlignmentFile.fetch File "pysam/libchtslib.pyx", line 690, in pysam.libchtslib.HTSFile.parse_region ValueError: start out of range (-878)

Is there a way to fix this? I wonder if this is rather a problem with the sequence. Thank you very much!

cbergman commented 1 year ago

Hi @UrsulaOggenfuss

Thanks for reporting this issue. It appears to be related to another issue report that we have been working on fixing here: https://github.com/bergmanlab/TELR/issues/21. To start, can you tell us what version of TELR (git revision or conda version) you are using?

Thanks, Casey

UrsulaOggenfuss commented 1 year ago

Hi @cbergman, thank you for the quick answer! I installed the newest version of TELR with conda, following the instructions in 01_Installation.md, conda version 4.10.1. I also tried it with a newer conda version on a virtual machine, giving me the same error message. TELR run successfully for two isolates, but not for the 3rd. Thank you so much! I appreciate the help, and I really like the tool!

cbergman commented 1 year ago

Hi @UrsulaOggenfuss

Just to clarify, when you said you installed TELR via conda, did you install the TELR bioconda package using conda using e.g.

mamba create -n TELR --channel bioconda telr

If so, it is possible that the bug fix we have been working on may not have gotten propagated to bioconda yet. If you haven't done so already, you could try installing TELR directly from the git repository as follows:

git clone git@github.com:bergmanlab/TELR.git
cd TELR
mamba env create -f envs/telr.yml
conda activate TELR
pip install .

If this doesn't solve your problem, would you possibly be willing to share datasets (one that worked, one that didn't) to help us trouble shoot this issue?

UrsulaOggenfuss commented 1 year ago

Hi @cbergman this did the trick, thank you so much! I had to upgrade pip, but now the pipeline works for all my sequences! I really like this tool, because the quality is high and allele frequency is reported as well. Thank you very much and all the best!!

cbergman commented 1 year ago

Thanks for the quick feedback and good news that TELR is working for all your samples now. We are in the process of updating the bioconda recipe with this new bug fix (https://github.com/bioconda/bioconda-recipes/pull/40630), so hopefully the installation of TELR v1.1 should be more smooth in the near future. Thanks again!

cbergman commented 1 year ago

Hi @UrsulaOggenfuss

The updated TELR recipe I previously referred to has now been merged into bioconda: https://github.com/bioconda/bioconda-recipes/pull/40630. I understand you currently have a working installation of TELR on your machine, but for the future you should be able to install TELR v1.1 (which includes the fix to the repeatmasker sorting problem) via bioconda as follows:

mamba create -n TELR --channel bioconda telr=1.1

Best regards, Casey

UrsulaOggenfuss commented 1 year ago

Hi @cbergman, thank you so much for this additional information! I'm really happy that I can use TELR for my current and future projects with long reads, it is an amazing tool! All the best, Ursula