Search
Question: ConsensusClusterPlus matrix error
0
gravatar for kyn
9 months ago by
kyn10
kyn10 wrote:

Hi All, 

I am new to ConsensusClusterPlus. I followed its tutorial in Bioconductor:

d = read.table("data.txt",header=T)

# Choose the top 5000 most variable genes

mads=apply(d,1,mad)
d=d[rev(order(mads))[1:5000],]

# Normalize the data
d = sweep(d,1, apply(d,1,median,na.rm=T))

# Do clustering

results = ConsensusClusterPlus(d,maxK=6,reps=50,pItem=0.8,pFeature=1,
                               clusterAlg="hc",distance="pearson", 
                              writeTable = T, seed=seed,plot="pdf")

I got an error:

Error in ConsensusClusterPlus(d, maxK = maxK, reps = 50, pItem = 0.8,  : 
  d must be a matrix, distance object or ExpressionSet (eset object)

I then checked 

d[1:5,1:5]

           X011453b6  X0120b5b1   X01234d47   X01d4c289  X02334a5d
KLK3   39297.272 -376296.10 -222358.676 -139770.162  41272.738
ACPP  -63803.954  -84514.79  -78520.053  -52781.560 -14151.932
KLK2  -26682.169 -126980.85  -38054.406  -27969.737 -62030.083
MYH11 108555.886  104602.45  -13819.642   -3358.701 106187.125
EEF2    8784.966  -38319.96   -1088.419    2986.275  -9114.912

It looks like d is a matrix. Am I missing something so the error pops up?

Thanks!

 

 

 

 

 

 

ADD COMMENTlink modified 9 months ago • written 9 months ago by kyn10
1
gravatar for kyn
9 months ago by
kyn10
kyn10 wrote:

d = as.matrix(read.table("data.txt",header=T)) fixed the problem!

ADD COMMENTlink written 9 months ago by kyn10
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 315 users visited in the last hour