This is a test version of Biostars. For the public version, visit https://www.biostars.org.
filter 0,1,2 genotype matrix for LD

Hi all, I am trying to filter my 0,1,2 genotype matrix for LD to proceed with my association study. I am using SNPrelate package but I am going crazy, does not work .... This is how my matrix looks like

Chr00c0001     68062 NA NA NA NA 0 0 NA NA NA NA NA NA 0 NA NA NA NA NA 1 0 NA NA NA NA 0 NA NA 1 NA NA NA NA NA NA NA NA NA NA NA 1 NA
Chr00c0001     68080 NA NA NA NA 0 0 NA NA NA NA NA 0 0 NA NA NA NA NA 0 0 0 NA NA NA 0 NA NA 0 NA NA NA NA NA NA 0 NA NA NA NA 0 NA NA

Is there any other convenient approach that I could do this filtering job ? thanks a lot for any suggestion or link that can help me.

genotype matrix ld

1 answer

So, SNPrelate NA should be replaced with 3 , is this your purpose ?

IN R

yourMatrix=read.table('yourFile.txt')
head(yourMatrix)
yourMatrix[is.na(yourMatrix)=3]

oh no, I meant is there any other way that I could filter my genotype matrix for ld ?

Log in to answer this question.