View Single Post
Old 03-17-2014, 03:04 PM   #32
sindrle
Senior Member
 
Location: Norway

Join Date: Aug 2013
Posts: 266
Default

Couldnt get gnCnt to work, I read in HTseq files instead like this:

fls <- list.files(path="~/RNAseq/02_MG-myocytes/MG_Myocytes_HTSeq/A1A2pT2D",pattern="*.txt", full.names =T)

#tab separated values with a header
datalist = lapply(fls, function(x)read.table(x, header=F, colClasses=c("NULL", "numeric"), nrow = nrow(read.table(x, header = F)) - 5))

#same header/columns for all files
datafr = do.call("cbind", datalist)

#column names
colnames(datafr) <- c("D102-A1","D102-A2","D104-A1","D104-A2","D117-A1","D117-A2","D121-A1","D121-A2","D153-A1","D153-A2","D155-A1","D155-A2","D161-A1","D161-A2","D162-A1","D162-A2","D167-A1","D167-A2","D173-A1","D173-A2","D176-A1","D176-A2","D177-A1","D177-A2","D179-A1","D179-A2")

#row names
x <- read.table(file = "~/RNAseq/02_MG-myocytes/MG_Myocytes_HTSeq/A1A2pT2D/D102-A1.txt", header=F, colClasses=c( "character", "NULL"), nrow = nrow(read.table(file = "~/RNAseq/02_MG-myocytes/MG_Myocytes_HTSeq/A1A2pT2D/D102-A1.txt", header = F)) - 5)

rownames(datafr) <- x$V1

hnrnp.cnts <- datafr

Last edited by sindrle; 03-18-2014 at 05:52 AM. Reason: Did an alternative route
sindrle is offline   Reply With Quote