convert.output: Converts the output from the simulation to a format which can...

Description Usage Arguments Details Value Author(s) Examples

Description

This function converts the output obtained by applying our simulation scheme into a format that can be used (either directly or indirectly) as the input to various segmentation schemes available within R. Additionally, we are in the process of submitting a library to CRAN which will enable the user to apply a number of the segmentation schemes available within R to datasets which have the same structure as that generated by this function.

Usage

1

Arguments

input

The output obtained upon applying the sim.structure function

Details

This function outputs an object which is similar in structure/format to an RG or MA object used in Limma.

Value

This function outputs a list with entries

M

A matrix containing the \log_2 ratios

genes

A matrix containing the simulated midpoints and the chromosome which forms the template upon which the simulation is based.

Author(s)

Michael Smith, John Marioni

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## The function is currently defined as
function(input){
  holder <- list()
  for (i in 1:length(input)){
  holder[[i]] <- list()}
  for(i in 1:length(input)){
    holder[[i]]$genes <- matrix(NA, nrow = length(input[[i]]$clones$mid.point),
                                ncol = 2)
  }
  for(i in 1:length(input)){
    holder[[i]]$M <- as.matrix(input[[i]]$datamatrix)
    holder[[i]]$genes[,1] <- input[[i]]$clones$mid.point
    holder[[i]]$genes[,2] <- rep(input[[i]]$chrom,length(input[[i]]$clones$mid.point))
    colnames(holder[[i]]$genes) <- c("kb", "Chrom")
    holder[[i]] <- new("aCGHList", holder[[i]])
  }
  holder
  }

Example output

function (input) 
{
    holder <- list()
    for (i in 1:length(input)) {
        holder[[i]] <- list()
    }
    for (i in 1:length(input)) {
        holder[[i]]$genes <- matrix(NA, nrow = length(input[[i]]$clones$mid.point), 
            ncol = 2)
    }
    for (i in 1:length(input)) {
        holder[[i]]$M <- as.matrix(input[[i]]$datamatrix)
        holder[[i]]$genes[, 1] <- input[[i]]$clones$mid.point
        holder[[i]]$genes[, 2] <- rep(input[[i]]$chrom, length(input[[i]]$clones$mid.point))
        colnames(holder[[i]]$genes) <- c("kb", "Chrom")
        holder[[i]] <- new("aCGHList", holder[[i]])
    }
    holder
}

snapCGH documentation built on Nov. 8, 2020, 5:31 p.m.