fethalen / Patchwork

Alignment-based retrieval and concatenation of phylogenetic markers from whole genome sequence (WGS) data
GNU General Public License v3.0
33 stars 3 forks source link

BoundsError when merging overlapping hits #37

Closed etkayapar closed 2 years ago

etkayapar commented 2 years ago

Hi! First of all thank you for this interesting pipeline.

Today I tried to run patchwork for the first time to see if it will improve my yield when used on genomes that I had back luck using BUSCO for extracting gene sequences. I pulled the docker container from dockerhub. I made a trial run with an assembled genome as the --contigs and the BUSCO lepidoptera dataset's aminoacid fasta file as the --reference input for the program. It goes fine until it starts to merge overlapping hits. I tried twice with the same inputs and parameters and both times the program exits with error after having one query's files outputted in alignments.txt and queries_out/ . Below is the logged output of the program in detail.


   ◣
  ◢◤  P A T C H W O R K
◢◤
◥  ◣  Developers: Felix Thalén & Clara G. Köhne
  ◢◤  Contact   : <felix.thalen@uni-goettingen.de>
◢◤    Wiki      : github.com/fethalen/patchwork/wiki
◥  ◣  Cite      : In prep.
  ◢◤  DIAMOND v.: 2.0.11
◢◤    Threads   : 16
◥     Output    : ./Memphis_output2

Building DIAMOND database
Aligning query sequences against reference database
Merging overlapping hits
ERROR: BoundsError: attempt to access BioSequences.LongAminoAcidSeq at index [0:0]
Stacktrace:
  [1] checkbounds
    @ /home/patchwork/.julia/packages/BioSequences/k4j4J/src/biosequence/indexing.jl:138 [inlined]
  [2] LongSequence
    @ /home/patchwork/.julia/packages/BioSequences/k4j4J/src/longsequences/constructors.jl:54 [inlined]
  [3] getindex(seq::BioSequences.LongAminoAcidSeq, part::UnitRange{Int64})
    @ BioSequences /home/patchwork/.julia/packages/BioSequences/k4j4J/src/longsequences/indexing.jl:14
  [4] realign(region::Patchwork.AlignedRegion, interval::UnitRange{Int64})
    @ Patchwork /home/patchwork/Patchwork-0.1.2-pre-alpha/src/alignment.jl:86
  [5] order(a::Patchwork.AlignedRegion, b::Patchwork.AlignedRegion, interval::UnitRange{Int64})
    @ Patchwork /home/patchwork/Patchwork-0.1.2-pre-alpha/src/alignment.jl:54
  [6] merge(a::Patchwork.AlignedRegion, b::Patchwork.AlignedRegion, skipcheck::Bool)
    @ Patchwork /home/patchwork/Patchwork-0.1.2-pre-alpha/src/alignedregion.jl:411
  [7] merge
    @ /home/patchwork/Patchwork-0.1.2-pre-alpha/src/alignedregion.jl:408 [inlined]
  [8] mergeoverlaps(regions::Patchwork.AlignedRegionCollection, sorted::Bool, iteration::Int64, maxiterate::Int64)
    @ Patchwork /home/patchwork/Patchwork-0.1.2-pre-alpha/src/alignedregioncollection.jl:212
  [9] mergeoverlaps(regions::Patchwork.AlignedRegionCollection, sorted::Bool, iteration::Int64)
    @ Patchwork /home/patchwork/Patchwork-0.1.2-pre-alpha/src/alignedregioncollection.jl:199
 [10] mergeoverlaps(regions::Patchwork.AlignedRegionCollection, sorted::Bool, iteration::Int64, maxiterate::Int64)
    @ Patchwork /home/patchwork/Patchwork-0.1.2-pre-alpha/src/alignedregioncollection.jl:220
 [11] mergeoverlaps
    @ /home/patchwork/Patchwork-0.1.2-pre-alpha/src/alignedregioncollection.jl:199 [inlined]
 [12] main()
    @ Patchwork /home/patchwork/Patchwork-0.1.2-pre-alpha/src/Patchwork.jl:250
 [13] julia_main()
    @ Patchwork /home/patchwork/Patchwork-0.1.2-pre-alpha/src/Patchwork.jl:292
 [14] julia_main()
    @ Main ./none:148
fethalen commented 2 years ago

Hi there! First, could I please ask you to use the stand-alone version for the time being? We're just in the moment of updating the Docker version to the latest version and I'm not sure how far behind it is at the moment of writing.

We've had a similar issue before and concluded that the error was due to gaps ('-') in the input file. Can you verify that none of your inputs contain gaps (i.e., they have not been aligned)?

etkayapar commented 2 years ago

Hi again! Thank you for your response. I can confirm that after using the stand-alone version my problem is resolved. In summary I downloaded julia with conda, diamond using the precompiled binaries provided, and running patchwork with julia interpreter. I also checked my input files for gaps but none had gaps.

fethalen commented 2 years ago

Good to hear, I hope we can provide an up-to-date Docker version soon!