crtahlin / medplot

Functions for drawing graphs in R visualizing medical information.
4 stars 2 forks source link

Clustering - error management at symptoms selection #30

Closed crtahlin closed 10 years ago

crtahlin commented 10 years ago

Add appropriate errors for:

E.g.: "Please select at least two symptoms to generate ...."

Se warning, error and message functions. Also try and tryCatch.

llaarraa commented 10 years ago

Bug from the function that we use to get the heatmap: missing values are coded with different colors in the legend and annotation - should not worry too much about it but it displays the wrong colors :(

llaarraa commented 10 years ago

(WHITE in the annotation above the graph - makes sense , other color in the legend)

llaarraa commented 10 years ago

For binary variables: we could still show the clustering results in this case it would make more sense to apply euclidean distance instead of a distance based on spearman's correlation

plot(hclust(dist(t(dataFiltered.yn)))) also the fancy heatmap should be feasible, would not exclude it

llaarraa commented 10 years ago

Can you try to add this graph to the clustering tab

pheatmap(cor(my.data,method="s", use="c" ), display_numbers=TRUE))

should be straightforward, displays the correlation among outcomes (with colors and displays the numbers) my.data would be the data frame with the intensity of the symptoms.

I am attaching an example from a different application clustering

llaarraa commented 10 years ago

image our data (selected Measurement==0)

llaarraa commented 10 years ago

possible bug: when selecting Sex, or Culture as annotation variable I get the error: Undefined column selected - can happen also for other variables

crtahlin commented 10 years ago
  1. Fixed bug
  2. For binary variables, the first graph (dendrogram) is plotted as in provided code plot(hclust(dist(t(dataFiltered.yn))))
  3. Corrected legend for binary vars (two levels instead of many)
  4. Implemented the correlations graph!