ConsensusClusterPlus matrix error
1
0
Entering edit mode
kyn ▴ 10
@kyn-12310
Last seen 7.3 years ago

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!

 

 

 

 

 

 

bioconductor clustering consensusclusterplus • 2.3k views
ADD COMMENT
1
Entering edit mode
kyn ▴ 10
@kyn-12310
Last seen 7.3 years ago

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

ADD COMMENT

Login before adding your answer.

Traffic: 280 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6