Skip to content

Commit

Permalink
Update asm_merge.R
Browse files Browse the repository at this point in the history
  • Loading branch information
fanyue322 authored May 10, 2019
1 parent b09ad70 commit f20b6c7
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion Realdata/asm_merge.R
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,40 @@ SNPlist=SNPlist[-idx]
chr=chr[-idx]
N=nrow(genotypem)


geno<-list()
geno[[1]]<-matrix(0,ncol=N,nrow=67)
geno[[2]]<-matrix(0,ncol=N,nrow=67)
for(i in 1:N)
{
for(j in 1:67)
{
if(is.na(genotypem[i,j]))
{
geno[[2]][j,i]=0/0
geno[[1]][j,i]=0/0
}else if(genotypem[i,j]==1){
geno[[2]][j,i]=1
}else if(genotypem[i,j]==2){
geno[[2]][j,i]=1
geno[[1]][j,i]=1
}
}
}
names(geno) <- c('hap1', 'hap2')
data<-list()
data[[1]]<-matrix(0,ncol=N,nrow=67)
data[[2]]<-matrix(0,ncol=N,nrow=67)
data[[3]]<-matrix(0,ncol=N,nrow=67)
data[[4]]<-matrix(0,ncol=N,nrow=67)
data[[5]]<-matrix(0,ncol=N,nrow=67)
data[[6]]<-matrix(0,ncol=N,nrow=67)
data[[1]]<-t(rm)
data[[2]]<-t(ym)
data[[3]]<-t(r1m)
data[[4]]<-t(r2m)
data[[5]]<-t(y1m)
data[[6]]<-t(y2m)
names(data) <- c('r', 'y', 'r1', 'r2', 'y1', 'y2')



Expand Down

0 comments on commit f20b6c7

Please sign in to comment.