BioJulia / BioSequences.jl

Biological sequences for the julia language
http://biojulia.dev/BioSequences.jl
MIT License
150 stars 47 forks source link

add predicate method and tests #297

Closed camilogarciabotero closed 11 months ago

camilogarciabotero commented 11 months ago

Adds the new hasprematurestop method

Hi,

This is a simple new method that looks into a BioSequence{<:NucleicAcidAlphabet} and check if there is a premature stop codon. It only happens to run when there is an actual stop codon in the sequence, otherwise throws a MethodError with the corresponding message that no stop codon at the end. It has three test cases, I think they could cover all the instances.

I'm open to comments. This is my first PR in this GH organization and hope the actual method is useful. I have used in one of my packages, but I think it could actually be nice if others get this functionality out from the BioSequences package.

Types of changes

This PR implements the following changes: (Please tick any or all of the following that are applicable)

:clipboard: Additional detail

:ballot_box_with_check: Checklist

jakobnissen commented 11 months ago

Thank you for your contribution.

I think the functionality in this PR is too application-specific and somewhat too idiosyncratic to belong in BioSequences. What I mean is that this function allows you to do a very specific query, that is probably not of broad usefulness. The implementation had be asking questions like:

Me having these questions doesn't mean it's bad functionality. But it does probably mean that there is some more generic functionality that could be exposed to users, that would allow the users to build the functionality in this PR, plus address all my questions.

Maybe this functionalitiy should be something like

This could also be useful to search for other motifs in sequences such as TATA boxes. I'm not sure what this API could look like, but it might be worth thinking about.

I'm closing this PR now, but I'll make an issue to discuss this.