This is a test version of Biostars. For the public version, visit https://www.biostars.org.
The minor allele frequency

Hi,

this is example data frame of my project:

SNP <- data.frame(SNP = c(-1,0,1,-1,1,1,0,-1), SNP1 = c(-1,-1,-1,1,-1,0,1,-1), SNP2 = c(0,0,0,1,-1,-1,-1,1))

Appoint a frequency of the A allele for each of the markers, if it is <0.5 then we leave it.

I need to drop out markers which that have MAF <5%.

Is there any function that computes this or another way?

snp r maf

Is this what you need?

SNP_MAF <- SNP[ which(SNP$SNP < '0.5' & SNP$SNP1 < '0.5' & SNP$SNP2 < '0.5'), ]

This will give you

   SNP SNP1 SNP2
1  -1   -1    0
2   0   -1    0

But this will give you rows that match all combinations... Perhaps you want to run it separately for each column and then merge the results?

Yes, I would like to do the second option

0 answers

No answers yet.

Log in to answer this question.