Hi All

I have a symmetric matrix of genes ( 100x100 matrix). I also have a matrix
(100x2) of two columns where column 1 has the gene names and column 2 has
the cluster it belongs to (they are sorted and grouped based on the cluster
no).

I would like to order the rows and columns of the 100x 100 matrix such that
the first n genes correspond to cluster 1 and next n genes correspond to
cluster 2 and so on. The order of genes is taken from the sorted
matrix(100x2).

Can someone tell me how to do this in R.

I tried the grep() but I get a message saying that the length of pattern >1
so only first element will be compared. But i want to check for each gene in
the 100x100 matrix for its cluster number and then group it.

I also tried the order() but it did not help either.

Thanks for the help! :)

Aparna

-- 
Aparna Sampath
Master of Science (Bioinformatics)
Nanyang Technological University
Mob no : +65 91601854

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to