Question: Hierarchial Clustering
1
gravatar for Sanju
8.0 years ago by
Sanju90
Sanju90 wrote:

Hi all

I have protein sequences dataset which are in fasta format. I have to find non redundant sequences from this data set. That is my aim. I have found the pairwise sequence similarity percentage and stored the result in excel sheet. My professor told me to use R programming for doing hierarchical clustering (single linkage method). I don’t want to use any software for this. I have to create a dendogram also. How can I do hierarchical clustering of protein sequences using R programming? Could you give R script for this?

I would like to get the R script for

             1) Reading excel file

             2) Hierarchial clustering (single linkage)

             3) Phylogenetic analysis                                      

             4) Creating dendogram.

Please help me.

R tree clustering programming • 3.9k views
ADD COMMENTlink modified 8.0 years ago by Steve Moss2.3k • written 8.0 years ago by Sanju90

Is this not the same question you already asked once? http://biostar.stackexchange.com/questions/10553/hierarchial-clustering

ADD REPLYlink written 8.0 years ago by Lars Juhl Jensen11k
4
gravatar for Philippe
8.0 years ago by
Philippe1.9k
Barcelona, Spain.
Philippe1.9k wrote:

Hi,

to answer more precisely to your question you can use the following functions:

  1. You can read any file with the read.table() function. If your input file is a csv file you can use an alias like read.csv() or read.csv2() whose default parameters might be those you need.

  2. Once your data is loaded into R you can cluster them using the hclust() function. It implements single linkage clustering (you can select it through the method argument).

  3. Phylogenetic analysis is a broad description. Depending on what you want to do the package ape might be helpful.

  4. To create a dendogram you can directly give the output of the hclust() function as an argument to the function plot. For example: h <- hclust(data); plot(h) # Will plot a dendogram

In general, if you need more information about one of the function you have to use you can read the associated help file using the help or ? command. Example for hclust(): ?hclust; help(hclust) # Two different ways to read the help files for the hclust function

ADD COMMENTlink written 8.0 years ago by Philippe1.9k

Thank you very much for your answer.

ADD REPLYlink written 8.0 years ago by Sanju90

Dear friend,

Could you please provide a sample script for me? Because I am a beginner in programming. Please help me.

ADD REPLYlink written 8.0 years ago by Sanju90

I'm sorry but I don't think that providing a full script will help you. The things you ask can be done at least at 90% with the functions I gave you. Looking at these functions, trying by yourself and looking at the help file as I mentioned will allow you to achieve your goal and improve your programming skills. If you are really stuck with one precise point then you can ask help for it. Also, if your profesor asked you to use R maybe he can help you with some special needs you might have.

ADD REPLYlink written 8.0 years ago by Philippe1.9k

Dear friend,

I am really sorry for the trouble. I will try.

ADD REPLYlink written 8.0 years ago by Sanju90
1
gravatar for Assa Yeroslaviz
8.0 years ago by
Assa Yeroslaviz1.2k
Munich
Assa Yeroslaviz1.2k wrote:

Have a look here:

hierarchial-clustering

Aleksandr Levchuk has already wrote a script for blasting and constructing a hierarchical clustering with R. (Using the search option would have save you time.)

ADD COMMENTlink written 8.0 years ago by Assa Yeroslaviz1.2k
0
gravatar for Steve Moss
8.0 years ago by
Steve Moss2.3k
United Kingdom
Steve Moss2.3k wrote:

MCL clustering is also a very popular solution (http://micans.org/mcl/), but works with graphs/networks instead of the more traditional dendrograms. See the manual here http://micans.org/mcl/man/mclcm.html.

The algorithm author (Stijn van Dongen) has also provided an R script here http://www.bigre.ulb.ac.be/Users/jvanheld/BMOL-F-501/practicals/r_scripts/mcl.R

Not sure if this is useful in this context, but something to consider for future work perhaps?

ADD COMMENTlink written 8.0 years ago by Steve Moss2.3k

Thank you very much

ADD REPLYlink written 8.0 years ago by Sanju90
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.3.0
Traffic: 1287 users visited in the last hour