This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to select panlindromic SNPs in R
setwd("C:\\XXX")
data <- read.table("XXX.csv", head = TRUE, sep = ",")

library("dplyr")

data <- data %>% mutate ("Alleles" = paste0(data$effectallele,"/", data$NonEA))

data$panlindromic<-sapply(data$Alleles, function(x){x %in% c("(A/T)","(T/A)","(C/G)","(G/C)")}) & sapply(data$EAF, function(x){x >0.42})

data <- data[which(data$panlindromic==F),]

The aboved lines are my code. I merge the effect alleles and non-effect alleles into a column named Alleles, and I want to select panlidromic alleles among column Alleles. But the results show all FALSE, without filtering. I want to see what the wrong is. Thank you very much!

snp panlindromic

Can you give examples of what you are looking for? By "palindromic" do you mean as in here? Can you give samples of your data, what format is it in ("CSV" doesn't suggest a standard)? What preprocessing have you done? Are you sure that (A/T) is what your data looks like?

Thanks, my data is like this format. enter image description here

Yes, "palindromic" is the same as the definition you mentioned in the link.

Thanks and look forward to your help.

0 answers

No answers yet.

Log in to answer this question.