The minor allele frequency
0
0
Entering edit mode
2.6 years ago
Negatyvna • 0

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 • 730 views
ADD COMMENT
0
Entering edit mode

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?

ADD REPLY
0
Entering edit mode

Yes, I would like to do the second option

ADD REPLY

Login before adding your answer.

Traffic: 1427 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6