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

Ignoring 'N', '-', and '*' in logos #17

Open
shahpr opened this issue Jun 6, 2020 · 1 comment
Open

Ignoring 'N', '-', and '*' in logos #17

shahpr opened this issue Jun 6, 2020 · 1 comment

Comments

@shahpr
Copy link

shahpr commented Jun 6, 2020

Is there a way to ignore certain characters or missing data when calculating EDLogos? Right now, any N in a DNA alignment shows up as a separate character in the Logos.

@kkdey
Copy link
Owner

kkdey commented Jun 14, 2020

I suggest you convert the input string vector into a matrix (PWM) format first and then run logomaker. Here is a demo, for dropping "A" from DNA sequence representation

library(Logolas)
sequence <- c("CTATTGT", "CTCTTAT", "CTATTAA", "CTATTTA", "CTATTAT",
"CTTGAAT", "CTTAGAT", "CTATTAA", "CTATTTA", "CTATTAT",
"CTTTTAT", "CTATAGT", "CTATTTT", "CTTATAT", "CTATATT",
"CTCATTT", "CTTATTT", "CAATAGT", "CATTTGA", "CTCTTAT",
"CTATTAT", "CTTTTAT", "CTATAAT", "CTTAGGT",
"CTATTGT", "CTCATGT", "CTATAGT", "CTCGTTA",
"CTAGAAT", "CAATGGT")
temp= Biostrings::consensusMatrix(sequence)
temp = temp[!(rownames(temp) %in% "A"),]
logomaker(temp, type = "EDLogo",
color_type = "per_row", colors = c("#ABDDA4","#FDAE61", "#2B83BA", "#D7191C"))

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