cc:'ing bioc-list:
> dim(mymatrix)
> [1] 1009 9
Why is the original matrix 1009x9?
It should be 1000x9, yes?
> dim(cor.matrix)
> [1] 9 9
As far as why you are getting a 9x9 correlation matrix, you need to
transpose it prior to estimating the correlation. Eg
cor.matrix <- cor.shrink(t(mymatrix), lambda=0,verbose=TRUE)
Also, you probably want to vary lambda (perhaps by cross validation)
to get
a reasonably useful estimate. If you don't shrink the estimate will be
too
dense, if you shrink too much it will be overly sparse. I can't
remember
off the top of my head whether cor.shrink() handles this or whether
you
need to, so check the help page.
*He that would live in peace and at ease, *
*Must not speak all he knows, nor judge all he sees.*
Benjamin Franklin, Poor Richard's
Almanack<http: archive.org="" details="" poorrichardsalma00franrich="">
On Fri, Nov 1, 2013 at 4:51 PM, PARTH PATEL <parth1415@gmail.com>
wrote:
> Hi Tim,
>
> I am trying to calculate co-relation matrix of 1000 genes X 9
timepoints
> and this is my code
>
> mymatrix <- as.matrix(read.table("FinalData_Parth.csv", header=TRUE,
> sep=",",row.names=1,as.is=TRUE))##
> dim(mymatrix)
> cor.matrix <- cor.shrink(mymatrix, lambda=0,verbose=TRUE)mymatrix <-
> as.matrix(read.table("FinalData_Parth.csv", header=TRUE,
> sep=",",row.names=1,as.is=TRUE))##
> dim(mymatrix)
> cor.matrix <- cor.shrink(mymatrix, lambda=0,verbose=TRUE)
>
> But the resulting cor.matrix dimension is different from original
input
> matrix (mymatrix):
>
> dim(mymatrix)
>
> [1] 1009 9
>
> dim(cor.matrix)
>
> [1] 9 9
>
>
> Could you please tell me what I am doing wrong? Once I get co-
relation
> matrix I can easily perform clustering.
>
>
> Thank you,
> Parth Patel.
>
>
> On Nov 1, 2013, at 4:29 PM, "Tim Triche, Jr." <tim.triche@gmail.com>
> wrote:
>
> how about directly estimating the correlation matrix via shrinkage
(e.g.
>
http://cran.r-project.org/web/packages/corpcor/index.html ) followed
by
> hierarchical clustering? The direct estimate of [anti]correlation
is given
> by the former (i.e., the negative entries in the estimated
correlation
> matrix after shrinkage); if you want to proceed with clustering, you
can do
> the latter.
>
> Other approaches exist that are better for specific problems, but
taken at
> face value, this would seem like the most straightforward for yours
as
> stated.
>
>
>
> *He that would live in peace and at ease, *
> *Must not speak all he knows, nor judge all he sees.*
>
> Benjamin Franklin, Poor Richard's
Almanack<http: archive.org="" details="" poorrichardsalma00franrich="">
>
>
> On Fri, Nov 1, 2013 at 7:52 AM, Parth Patel <parth1415@gmail.com>
wrote:
>
>> Hi all,
>>
>>
>>
>> I have list of 1000 genes, and I am trying to perform anti-
correlated
>> clustering using R. Basically, I am trying to find genes that are
>> anti-correlated out of 1000.
>>
>> Can you tell me what type of package should I use for doing
>> anti-correlated
>> clustering?
>>
>>
>>
>> Thanks in advance,
>>
>> Parth.
>>
>>
>> [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> Bioconductor mailing list
>> Bioconductor@r-project.org
>>
https://stat.ethz.ch/mailman/listinfo/bioconductor
>> Search the archives:
>>
http://news.gmane.org/gmane.science.biology.informatics.conductor
>>
>
>
[[alternative HTML version deleted]]