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

Patchwork error after alignment trimming. #35

Closed ngroberts closed 2 years ago

ngroberts commented 2 years ago

Hello,

I am doing a test of patchwork using a genome assembled in SPades as a query with a large ortholog set as a reference. Patchwork shoots me an error after the alignment trimming step I cannot diagnose.

Building DIAMOND database... Aligning query sequences against reference database... Merging overlapping hits... Trimming alignments... ERROR: BoundsError: attempt to access 27×27 Matrix{Int64} at index [7, 28] Stacktrace: [1] getindex @ ./array.jl:862 [inlined] [2] getindex @ ~/miniconda3/share/julia/packages/BioAlignments/t4D8A/src/submat.jl:82 [inlined] [3] run!(nw::BioAlignments.NeedlemanWunsch{Int64}, a::BioSequences.LongAminoAcidSeq, b::BioSequences.LongAminoAcidSeq, submat::BioAlignments.SubstitutionMatrix{BioSymbols.AminoAcid, Int64}, start_gap_open_a::Int64, start_gap_extend_a::Int64, middle_gap_open_a::Int64, middle_gap_extend_a::Int64, end_gap_open_a::Int64, end_gap_extend_a::Int64, start_gap_open_b::Int64, start_gap_extend_b::Int64, middle_gap_open_b::Int64, middle_gap_extend_b::Int64, end_gap_open_b::Int64, end_gap_extend_b::Int64) @ BioAlignments ~/miniconda3/share/julia/packages/BioAlignments/t4D8A/src/pairwise/algorithms/needleman_wunsch.jl:41 [4] run!(nw::BioAlignments.NeedlemanWunsch{Int64}, a::BioSequences.LongAminoAcidSeq, b::BioSequences.LongAminoAcidSeq, submat::BioAlignments.SubstitutionMatrix{BioSymbols.AminoAcid, Int64}, gap_open::Int64, gap_extend::Int64) @ BioAlignments ~/miniconda3/share/julia/packages/BioAlignments/t4D8A/src/pairwise/algorithms/needleman_wunsch.jl:184 [5] pairalign(::BioAlignments.GlobalAlignment, a::BioSequences.LongAminoAcidSeq, b::BioSequences.LongAminoAcidSeq, score::BioAlignments.AffineGapScoreModel{Int64}; score_only::Bool, banded::Bool, lower_offset::Int64, upper_offset::Int64) @ BioAlignments ~/miniconda3/share/julia/packages/BioAlignments/t4D8A/src/pairwise/pairalign.jl:103 [6] pairalign @ ~/miniconda3/share/julia/packages/BioAlignments/t4D8A/src/pairwise/pairalign.jl:83 [inlined] [7] pairalign_global (repeats 2 times) @ ~/bin/patchwork/src/alignment.jl:29 [inlined] [8] maskgaps(alignment::BioAlignments.PairwiseAlignment{BioSequences.LongAminoAcidSeq, BioSequences.LongAminoAcidSeq}) @ Main.Patchwork ~/bin/patchwork/src/alignmentconcatenation.jl:272 [9] main() @ Main.Patchwork ~/bin/patchwork/src/Patchwork.jl:406 [10] julia_main() @ Main.Patchwork ~/bin/patchwork/src/Patchwork.jl:459 [11] top-level scope @ ~/bin/patchwork/src/Patchwork.jl:469

My reference is formatted as:

>OTU@comp270431_c0_seq1.m.51409 ----FR----------------------------STEDMSSEFMDSSKNTDVEQDQTNLTPDDISKDKTQSRFKVVKIETHEPFRRGRWLCHDFLDESHSGNSSAGSSIHYTDDPAKNPSAA....

My query is formatted as:

>Query@NODE_243_length_18612_cov_21.129065 AACTTGCTGCTTGGGATACACACTCAGGAGGAAATTGCCTACTGAGTGCATCAGCATTGC TGTGGTTCCATCCTGGCCTGTGTTCAACAGTGAACTGGTAGGCCTGTAGAGTCTCCTGCC

Any help would be appreciated.

Cheers, Nick

fethalen commented 2 years ago

Hi Nick! I see you have gaps in your alignment. Could you re-run the query with the gaps removed? I'll send you a script for dealigning sequences via email.

ngroberts commented 2 years ago

Hey Felix! I can use unaligned sequences! And I can remove gaps. I will update you how it shakes out.

Cheers,

Get Outlook for iOShttps://aka.ms/o0ukef


From: Felix Thalén @.> Sent: Friday, June 10, 2022 12:03:32 PM To: fethalen/Patchwork @.> Cc: Nick Roberts @.>; Author @.> Subject: [EXTERNAL] Re: [fethalen/Patchwork] Patchwork error after alignment trimming. (Issue #35)

Hi Nick! I see you have gaps in your alignment. Could you re-run the query with the gaps removed? I'll send you a script for dealigning sequences via email.

— Reply to this email directly, view it on GitHubhttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ffethalen%2FPatchwork%2Fissues%2F35%23issuecomment-1152562870&data=05%7C01%7Cngroberts%40crimson.ua.edu%7C34515e70bc7c4814532208da4b032622%7C2a00728ef0d040b4a4e8ce433f3fbca7%7C0%7C0%7C637904774145544359%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=L0jp86UJIokiC7Al7kFiN9iZhKE0dpKmdIUfuRIg%2Bqs%3D&reserved=0, or unsubscribehttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FANFHEERUZ4GPJQV4LSSP7ATVONYOJANCNFSM5YOH43JA&data=05%7C01%7Cngroberts%40crimson.ua.edu%7C34515e70bc7c4814532208da4b032622%7C2a00728ef0d040b4a4e8ce433f3fbca7%7C0%7C0%7C637904774145544359%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=oBOcz9MTdd9Of7qZafT3MuFKfUq3dnyYHKf%2BG3yyH7s%3D&reserved=0. You are receiving this because you authored the thread.Message ID: @.***>

fethalen commented 2 years ago

For future reference, gaps in the alignment was indeed the problem. In the future, I will try to implement gap-removal and or a warning message for this issue. Until then, please remove your gaps!