annotate SMART/DiffExpAnal/DESeqTools/raw2counts.R @ 18:94ab73e8a190

Uploaded
author m-zytnicki
date Mon, 29 Apr 2013 03:20:15 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
18
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
1 # raw2counts
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
2 # extract counts only from rawCounts
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
3 # and add rownames to counts
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
4
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
5 # input : rawCounts
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
6 # output : counts
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
7
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
8 # created Feb 6th, 2012
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
9 # modified April 12, 2012
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
10 # Marie-Agnes Dillies
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
11
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
12
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
13 raw2counts <- function( rawCounts, annot=1 ){
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
14
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
15 ex <- 1:annot
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
16 counts <- as.matrix( rawCounts[,-ex] )
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
17 rownames(counts) <- rawCounts[,1]
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
18 infoCounts <- rawCounts[,ex]
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
19 return( list("counts"=counts, "infoCounts"= infoCounts) )
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
20 }