countsToMatrix: countsToMatrix merges in a matrix the information in the...

Description Usage Arguments Value Examples

View source: R/countsToMatrix.R

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

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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")

KnowSeq documentation built on April 16, 2021, 6:01 p.m.