Skip to content

Commit

Permalink
fixes an issue where stop codons were not properly deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
fethalen committed Apr 18, 2024
1 parent 82f60d6 commit efd5617
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
8 changes: 5 additions & 3 deletions src/Patchwork.jl
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,14 @@ const MIN_DIAMONDVERSION = "2.0.10" # for --iterate option
const MATRIX = "BLOSUM62"
const ALIGNMENTOUTPUT = "untrimmed_alignments.txt"
const TRIMMEDALIGNMENT_OUTPUT = "trimmed_alignments.txt"
const FASTAOUTPUT = "query_sequences"
const DNAFASTAOUTPUT = "dna_query_sequences"
const FASTAOUTPUT = "protein_query_sequences"
const DNAFASTAOUTPUT = "nucleotide_query_sequences"
const DEFAULT_FASTA_EXT = ".fas"
const DIAMONDOUTPUT = "diamond_out"
const STATSOUTPUT = "sequence_stats"
const PLOTSOUTPUT = "plots"
const RULER = repeat('', 74)
const VERSION = "0.6.1"
const VERSION = "0.6.2"
# Default scoremodel taken from DIAMOND's defaults for BLOSUM62
const DEFAULT_SCOREMODEL = BioAlignments.AffineGapScoreModel(BioAlignments.BLOSUM62,
gap_open = -11, gap_extend = -1)
Expand Down Expand Up @@ -514,9 +514,11 @@ function main()

# Mask inserts
maskedalignment, maskeddna = maskgaps(concatenation, dna_concatenation)

# Mask stop codons and ambiguous characters
maskedalignment, finaldna = maskalignment(maskedalignment.aln, maskeddna, DEFAULT_SCOREMODEL,
args["retain-stops"], args["retain-ambiguous"])

finalalignment = maskedalignment.aln
write_alignmentfile(alignmentoutput, referenceid, length(mergedregions), finalalignment, index)

Expand Down
5 changes: 3 additions & 2 deletions src/alignmentconcatenation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,9 @@ function maskalignment(
(!retainambiguous && isambiguous(queryletter)) ||
(refletter == AA_Gap)
)
push!(flagged, position)
push!(dnaflagged, 3*(position-1)+1:3*position...)
querypos = first(aln2seq(alignment, position))
push!(flagged, querypos)
push!(dnaflagged, 3 * (querypos - 1) + 1:3 * querypos...)
end
end
# We reverse the list of indices as deleting from left shifts the next deletion
Expand Down

0 comments on commit efd5617

Please sign in to comment.