R/get.recomb.R

### GetLinkage

setGeneric("get.recomb", function(object) standardGeneric("get.recomb"))
 setMethod("get.recomb", "GENOME",
 
 function(object){

if(!object@Pop_Recomb$calculated){stop("Statistics have to be calculated first !")}

 res  <- matrix(,object@genelength,1)

  pops <- vector("list",length(object@Pop_Recomb$Populations))
  
  for(xx in 1:length(object@Pop_Recomb$Populations)){
     res[,1]       <- object@RM[,xx]
     
     colnames(res) <- c("Hudson.Kaplan.RM")
     rownames(res) <- object@region.names
     pops[[xx]] <- res 
  }
 
 pops <- as.matrix(pops)
 rownames(pops)  <- paste("pop",1:length(object@Pop_Recomb$Populations))
 colnames(pops)  <- "Recombination"
 
 return(pops)
 
 
 return(res)
 }) 
 

Try the PopGenome package in your browser

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

PopGenome documentation built on Feb. 1, 2020, 1:07 a.m.