given table of peptide protein assigments generate matrix

Share:

Description

given table of peptide protein assigments generate matrix

Usage

1
prepareMatrix(data, weight = "count")

Arguments

data

generated by annotatePeptides

weight

weight type to use options are "count", "AA" "coverage"

Value

sparse matrix

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
data(protpepmetashort)
library(Matrix)
colnames(protpepmetashort)
dim(protpepmetashort)
xx = prepareMatrix(protpepmetashort, weight= "count")
#xx = prepareMatrix(protpepmetashort, weight = "AA")
#xx = prepareMatrix(protpepmetashort, weight = "coverage")
image(as.matrix(xx))
corProt = cor(as.matrix(xx))
par(mfrow =c(2,1))
image(corProt)
rownames(corProt)

# penalise peptides matching many proteins
xxn = t(apply(xx, 1, function(x){x/sum(x)}))
dim(xxn)
corProtn = cor(as.matrix(xxn))
image(corProtn)
rownames(corProtn)