Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using score to filter what getorfs delivers #33

Closed
camilogarciabotero opened this issue May 13, 2024 · 2 comments · Fixed by #34
Closed

Using score to filter what getorfs delivers #33

camilogarciabotero opened this issue May 13, 2024 · 2 comments · Fixed by #34

Comments

@camilogarciabotero
Copy link
Owner

After #26 and #32 we can now have a more flexible way to use the findorfs with multiple ORF finder methods with or without scoring scheme. Now, we can levearege on that to make getorfs more complex by adding a scoring filter to get only the sequences that actually are above a scoring threshold. For instance the argmax to the orf.score field will help.

orfs[argmax([orf.score for orf in orfs])]

We can also use a combination of sorting and filtering:

sortedorfs = sort(orfs, by = orf -> -orf.score)
sortedorfs[1:min(10, end)]

The function will gain a min_score kwarg:

function getorfs(
    sequence::NucleicSeqOrView{DNAAlphabet{N}},
    ::DNAAlphabet{N},
    method::M;
    kwargs...
    min_score=0
) where {N,M<:GeneFinderMethod}
 ...
end

Still to define...

@camilogarciabotero
Copy link
Owner Author

Other experiments:

sort!(orfs; by = orf -> getproperty(orf, :score), rev=true, alg=QuickSort, kwargs...)
sort!(orfs; by = orf -> getproperty(orf, :score), rev=true, alg=PartialQuickSort(k), kwargs...) # not stable

@camilogarciabotero
Copy link
Owner Author

Maybe using the iscoding method:

function findorfs(..., encoding::Bool = false,...)
return encoding ? [i for i in orfs if iscoding(sequence[i]; kwargs...)] : orfs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant