Last data update: 2014.03.03

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

Converts the output from the simulation to a format which can be used by segmentation schemes available within R

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

convert.output(input)

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

## 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
  }

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(snapCGH)
Loading required package: limma
Loading required package: DNAcopy
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/snapCGH/convert.output.Rd_%03d_medium.png", width=480, height=480)
> ### Name: convert.output
> ### Title: Converts the output from the simulation to a format which can be
> ###   used by segmentation schemes available within R
> ### Aliases: convert.output
> ### Keywords: datasets
> 
> ### ** Examples
> 
> ## 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
+   }
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
}
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>