Skip to content

Commit

Permalink
Add findermethod parameter to get_orfs_dna and get_orfs_aa functions
Browse files Browse the repository at this point in the history
  • Loading branch information
camilogarciabotero committed Mar 29, 2024
1 parent 80a8918 commit 92b0e22
Show file tree
Hide file tree
Showing 2 changed files with 165 additions and 149 deletions.
6 changes: 4 additions & 2 deletions src/getorfs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ This function takes a `NucleicSeqOrView{DNAAlphabet{N}}` sequence and identifies
"""
function get_orfs_dna(
sequence::NucleicSeqOrView{DNAAlphabet{N}};
findermethod::Function = naivefinder,
alternative_start::Bool = false,
min_len::Int64 = 6
) where {N}
orfs = findorfs(sequence; alternative_start, min_len)
orfs = findorfs(sequence; findermethod, alternative_start, min_len)
seqs = Vector{LongSubSeq{DNAAlphabet{N}}}(undef, length(orfs)) #Vector{}(undef, length(orfs)) # todo correct the output type
@inbounds for (i, orf) in enumerate(orfs)
seqs[i] = sequence[orf]
Expand All @@ -47,11 +48,12 @@ This function takes a `NucleicSeqOrView{DNAAlphabet{N}}` sequence and identifies
"""
function get_orfs_aa(
sequence::NucleicSeqOrView{DNAAlphabet{N}};
findermethod::Function = naivefinder,
alternative_start::Bool = false,
code::GeneticCode = ncbi_trans_table[1],
min_len::Int64 = 6
) where {N}
orfs = findorfs(sequence; alternative_start, min_len)
orfs = findorfs(sequence; findermethod, alternative_start, min_len)
aas = Vector{LongSubSeq{AminoAcidAlphabet}}(undef, length(orfs))
@inbounds for (i, orf) in enumerate(orfs)
aas[i] = translate(sequence[orf]; code)
Expand Down
Loading

0 comments on commit 92b0e22

Please sign in to comment.