countsToMatrix {KnowSeq} | R Documentation

## countsToMatrix merges in a matrix the information in the count files.

### Description

The function merges in a matrix the information in the count files. It can be used from 1 to N count files. These count files can be created by using the function `rawAlignment` with the raw files of RNA-seq.

### Usage

    countsToMatrix(csvFile, sep = ",", extension = "")

### Arguments

`csvFile` | The csv that contains the name and the path to each of the count files. The column of the name of the file must be named Run and the column that contains the paths must be named Path. Furthermore, to facilitate the posterior steps, a column named Class that contains the classes for the samples must be required.
`sep` | The separator character of the csvFile or tsvFile.
`extension` | The extension of the count file. Set to count by default.

### Value

A matrix with the ensembl ID in the rows and all the samples of each count files in the columns.

### Examples

    dir <- system.file("extdata", package="KnowSeq")
    countsInfo <- read.csv(paste(dir,"/countFiles/mergedCountsInfo.csv",sep = ""))

    countsInfo$Path <- paste(dir,"/countFiles/",countsInfo$Run,sep = "")

    write.csv(countsInfo, file = "countsInfo.csv")

    countsInformation <- countsToMatrix("countsInfo.csv", extension = 'count')

    countsMatrix <- countsInformation$countsMatrix
    labels <- countsInformation$labels

    file.remove("countsInfo.csv")

[Package KnowSeq version 1.1.27 Index]