{if $smarty.get.itemId gt 0}
{wikiplugin _name=rr loadandsave=1 wikisyntax=0}
-
- Check and get File 1
-
if (file_type "text/csv" | file_type "text/comma-separated-values" | file_type == "text/plain") {literal} { {/literal}
fileurl1 <- "http://{$smarty.server.SERVER_NAME}{$smarty.server.PHP_SELF|replace:'/tiki-index.php':'/'}tiki-download_item_attachment.php?itemId={$f_itemId}&fieldId=$profileobject:field_10$&display=inline"
expresFileNameTmp <- read.csv(fileurl1, sep=",");
if ( length(expresFileNameTmp) == 1) {literal} { {/literal}
if ( length(unlist(strsplit(as.character(expresFileNameTmp[[1]]), ";") ) ) > length(unlist(strsplit(as.character(expresFileNameTmp[[1]]), "\t") ) ) ) {literal} { {/literal}
expresFileNameTmp <- read.csv(fileurl1, sep = ";") {literal} } {/literal} else {literal} { {/literal} # end of case for semicolon
expresFileNameTmp <- read.csv(fileurl1, sep = "\t")
{literal} } {/literal} # end of case for "tabs"
{literal} } {/literal} # end of if length(file) == 1
download.file(fileurl1, "expres.filtered.ALL.txt")
{literal} } {/literal}
-
- Check and get File 2
-
if (file_type "text/csv" | file_type "text/comma-separated-values" | file_type == "text/plain") {literal} { {/literal}
fileurl2 <- "http://{$smarty.server.SERVER_NAME}{$smarty.server.PHP_SELF|replace:'/tiki-index.php':'/'}tiki-download_item_attachment.php?itemId={$f_itemId}&fieldId=$profileobject:field_20$&display=inline"
colorsForColumnsTmp <- read.csv(fileurl2, sep=",");
if ( length(colorsForColumnsTmp) == 2) {literal} { {/literal}
if ( length(unlist(strsplit(as.character(colorsForColumnsTmp[[1]]), ";") ) ) > length(unlist(strsplit(as.character(colorsForColumnsTmp[[1]]), "\t") ) ) ) {literal} { {/literal}
colorsForColumnsTmp <- read.csv(fileurl2, sep = ";") {literal} } {/literal} else {literal} { {/literal} # end of case for semicolon
colorsForColumnsTmp <- read.csv(fileurl2, sep = "\t")
{literal} } {/literal} # end of case for "tabs"
{literal} } {/literal} # end of if length(file) == 1
download.file(fileurl2, "colorsForColumns.txt")
-
require(easyHeatMap)
clustPar<-newClustPar(expres = NULL , # We'll give it a file attached to the tracker item
expresFileName ="expres.filtered.ALL", # For a file "foo.txt", you have to indicate here "foo" (without extension)
fileType = "txt",
comparisonName = "ALL",
Title = "{$f_$profileobject:field_13$}",
numClusters = 0, # Confirm that with zero nothing is done
plotProfiles=FALSE,
rowDistance = "{$f_$profileobject:field_14$}",
colDistance = "{$f_$profileobject:field_15$}",
RowVals = {$f_$profileobject:field_16$},
ColVals = {$f_$profileobject:field_17$},
escala = "{$f_$profileobject:field_18$}",
colorsSet = {$f_$profileobject:field_19$}, #colors,
colsForGroups = NULL,
colsForGroupsFileName="colorsForColumns",
densityInfo = '{$f_$profileobject:field_21$}',
cexForColumns = {$f_$profileobject:field_22$},
cexForRows = {$f_$profileobject:field_23$},
outputDir=getwd(),
toPDF = FALSE,
)
- We can add the dendrogram to the columns
clustPar$ColVals<-TRUE # Can be set to FALSE if that upper dendrogram is not desired
cat("<b>{$f_$profileobject:field_7$}</b>: "); cat("{$f_$profileobject:field_8$} <hr />")
- HeatMap generation
hm.ALL <- doHMAnalysis(clustPar)
{literal} } {/literal} else {literal} { {/literal}
cat("There are no data files attached for this HeatMap yet, or that file is not a file with tab or comma separated values. \n\nPlease, upload a tab or csv file through the box above (using comma or semicolon to separate values, and point to indicate decimals (if any).");
{literal} } {/literal}
{/wikiplugin}
{/if}