What packages needed for anti-correlated clustering?
3
0
Entering edit mode
Parth Patel ▴ 10
@parth-patel-6216
Last seen 9.6 years ago
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]]
• 1.0k views
ADD COMMENT
0
Entering edit mode
Tim Triche ★ 4.2k
@tim-triche-3561
Last seen 3.6 years ago
United States
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]]
ADD COMMENT
0
Entering edit mode
@peter-langfelder-4469
Last seen 4 weeks ago
United States
I'm not sure what you mean by anti-correlated clustering. There cannot really be clusters of anti-correlated genes, since if variable A is (strongly) anti-correlated with B and B is (strongly) anticorrelated with C, then A and C are (most likely) positively correlated. This is very different from positive correlation which can be loosely though of as being transitive. If you still want to try, yes, you can use the correlation as a dissimilarity matrix (which is equivalent to using minus the correlation as a similarity matrix) and input it to your favourite clustering procedure (for example, hclust) but the results may not be meaningful. Peter On Fri, Nov 1, 2013 at 7:52 AM, Parth Patel <parth1415 at="" 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 at r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
ADD COMMENT
0
Entering edit mode
Tim Triche ★ 4.2k
@tim-triche-3561
Last seen 3.6 years ago
United States
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]]
ADD COMMENT

Login before adding your answer.

Traffic: 975 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