Mercurial > repos > lecorguille > hca
comparison abims_hclustering.r @ 1:36fc0a87d7fb draft default tip
planemo upload
| author | lecorguille |
|---|---|
| date | Fri, 13 Nov 2015 08:43:11 -0500 |
| parents | 2f7381ee5235 |
| children |
comparison
equal
deleted
inserted
replaced
| 0:2f7381ee5235 | 1:36fc0a87d7fb |
|---|---|
| 19 data=read.table(file, header = TRUE, row.names=1, sep = sep, quote="\"", dec = dec, | 19 data=read.table(file, header = TRUE, row.names=1, sep = sep, quote="\"", dec = dec, |
| 20 fill = TRUE, comment.char="",na.strings = "NA") | 20 fill = TRUE, comment.char="",na.strings = "NA") |
| 21 | 21 |
| 22 # -- Normalization: logratio -- | 22 # -- Normalization: logratio -- |
| 23 if (normalization) { | 23 if (normalization) { |
| 24 #meandata = apply(data,1,mean, na.rm=T) | 24 #meandata = apply(data,1,mean, na.rm=T) |
| 25 #data = log2(data/meandata) | 25 #data = log2(data/meandata) |
| 26 data=t(scale(t(data))) | 26 data=t(scale(t(data))) |
| 27 | |
| 28 #AMAP: Unable to compute Hierarchical Clustering: missing values in distance matrix | |
| 29 #Erreur dans hcluster(x, method = method, link = link) : | |
| 30 # Missing values in distance Matrix | |
| 31 #Calls: do.call -> <Anonymous> -> hclust2treeview -> hcluster | |
| 32 #Exécution arrêtée | |
| 33 data[is.nan(data)] = 0 | |
| 27 } | 34 } |
| 35 | |
| 36 #Erreur dans `[.default`(xj, i) : | |
| 37 # les indices négatifs ne peuvent être mélangés qu'à des 0 | |
| 38 #Calls: do.call ... r2cdt -> [ -> [.data.frame -> [ -> [.factor -> NextMethod | |
| 39 #Exécution arrêtée | |
| 40 data = data[!apply(data,1,sum)==0,] | |
| 28 | 41 |
| 29 # -- hclust / output files for TreeView -- | 42 # -- hclust / output files for TreeView -- |
| 30 file="hclust.cdt" | 43 file="hclust.cdt" |
| 31 hclust2treeview(data,file=file, method = method, link = link, keep.hclust= keep.hclust) | 44 hclust2treeview(data,file=file, method = method, link = link, keep.hclust= keep.hclust) |
| 32 | 45 |
