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

Request: IUPAC with treshold #15

Open
spilsberg opened this issue Oct 31, 2024 · 3 comments
Open

Request: IUPAC with treshold #15

spilsberg opened this issue Oct 31, 2024 · 3 comments

Comments

@spilsberg
Copy link

spilsberg commented Oct 31, 2024

Dear seqinr team

I have a request.

I am designing PCRs for different phylogenetic levels based on a few hundred sequences. For that purpose it had been handy to have a consensus sequence with IUPAC codes generated with a threshold I have chosen.

Test data:

seq1
ATGGCTAGACATTTAAAAT
seq2
ATGGCTAGAGATTTAAAAT
seq3
ATGGCTAGAGATTTAAAAT
seq4
ATGGCTAGAGATTTAAAAT

This is the result I wish for:

consensus(test, method = "IUPAC", threshold = 0.8, warn.non.IUPAC = FALSE, type = "DNA")
atggctagaSatttaaaat
consensus(test, method = "IUPAC", threshold = 0.7, warn.non.IUPAC = FALSE, type = "DNA")
atggctagaGatttaaaat

@simonpenel
Copy link
Collaborator

Dear user,

if I understand correctly you want to display as consensus the nucleotide whith the higher frequency if its frequency is above the threshold, and display the IUPAC code representing the different nucleotides at the site otherwise, am I wright?

best,

Simon

@spilsberg
Copy link
Author

spilsberg commented Nov 5, 2024 via email

@simonpenel
Copy link
Collaborator

Dear Bjorn

I updated a new version of seqinr.

There is a new optional argument in the consensus function, with the threshold method: "threshold.IUPAC"
For example

phylip <- read.alignment(file = system.file("sequences/test.phylip",
    package = "seqinr"), format = "phylip")
res.thr <- consensus(phylip, method = "threshold",threshold.IUPAC =TRUE )

To use the new version of seqinr:

require("devtools")
install_github("lbbe-software/seqinr")

Let me know if this is convenient for you

Best,

Simon

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

No branches or pull requests

2 participants