ctc/ 0000755 0001750 0001750 00000000000 14147405150 011156 5 ustar nilesh nilesh ctc/exec/ 0000755 0001750 0001750 00000000000 14136046747 012115 5 ustar nilesh nilesh ctc/exec/ctc.php 0000644 0001750 0001750 00000010576 14136046747 013410 0 ustar nilesh nilesh
This demo makes hierarchical clustering on your data
Upload your data (text-tabulated file)
$MAX_FILE) exit("File size: $taillefichier; max allowed: $MAX_FILE"); } /* ================================== */ /* We write R code in file $ID/prog.R */ /* ================================== */ $fp=fopen("$ID/prog.R",'w'); fwrite($fp,"library(ctc)\n"); /* Read Data */ fwrite($fp,"data <- read.delim('$ID/data.txt',header=$HEADER,row.names=$ROWNAMES) \n" ); fwrite($fp,"data \n"); /* Hierarchical clustering */ fwrite($fp,"hr <- hclust(dist(data)) \n"); fwrite($fp,"hc <- hclust(dist(t(data))) \n"); fwrite($fp,"dr <- as.dendrogram(hr) \n"); fwrite($fp,"dc <- as.dendrogram(hc) \n"); /* A pdf file */ fwrite($fp,"pdf(file='$ID/Rplots.pdf') \n"); fwrite($fp,"heatmap(as.matrix(data),Colv=dc,Rowv=dr) \n"); fwrite($fp,"dev.off() \n"); /* Some png images */ fwrite($fp,"bitmap(file='$ID/heatmap.png') \n"); fwrite($fp,"heatmap(as.matrix(data),Colv=dc,Rowv=dr) \n"); fwrite($fp,"dev.off() \n"); fwrite($fp,"r2atr(hc,file='$ID/cluster.atr') \n"); fwrite($fp,"r2gtr(hr,file='$ID/cluster.gtr') \n"); fwrite($fp,"r2cdt(hr,hc,data ,file='$ID/cluster.cdt') \n"); fclose($fp); /* ===================== */ /* Send command (R batch)*/ /* ===================== */ system("$R_BIN --no-save < $ID/prog.R > $ID/prog.R.out 2> $ID/prog.R.warnings"); /* ===================================== */ /* We create html page including results */ /* ===================================== */ echo ""; echo "3 files for Freeview"; echo " or Treeview: "; echo "cdt "; echo "atr "; echo "gtr "; echo "
";
echo "
"; /* Signature */ echo "
This results made by ctc package. Code use: prog.R, Out: prog.R.out, Warnings: prog.R.warnings."; } ?>