R/MtkCalc.R

Defines functions MtkCalc

Documented in MtkCalc

MtkCalc <-
function(genos,subset,power=10){
  genos<-as.matrix(genos)
  mode(genos)<-"numeric"
  genos[genos==0]<-NA
  n.genos<-ncol(genos)
  mat<-Mat(genos)
  mat<-(2*(mat-min(mat))/(max(mat)-min(mat)))^power
  for(i in 1:n.genos){
    mat[i,i]<-0
  }
  return(sum(mat[subset,subset])/(n.genos^2))
}

Try the GeneticSubsetter package in your browser

Any scripts or data that you put into this service are public.

GeneticSubsetter documentation built on May 2, 2019, 3:56 a.m.