Loading...
 

History: Profile_r_heatmaps_template

Preview of version: 4

{if $smarty.get.itemId gt 0}

{wikiplugin _name=rr loadandsave=1 wikisyntax=0}

      1. 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}

      1. 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,
)

  1. 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 />")

  1. 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}


History

Advanced
Information Version
Mon 03 of Jun, 2013 12:46 GMT-0000 Xavier de Pedro added missing bit 7
Mon 03 of Jun, 2013 11:02 GMT-0000 Xavier de Pedro updated with new fields 6
Sat 27 of Aug, 2011 12:28 GMT-0000 Xavier de Pedro removed dendrogram in columns as hardcoded 5
Mon 22 of Aug, 2011 09:51 GMT-0000 Xavier de Pedro typos 4
Sat 20 of Aug, 2011 23:09 GMT-0000 Xavier de Pedro fixed field references 3
Sat 20 of Aug, 2011 22:43 GMT-0000 Xavier de Pedro hardcoded content 2
Fri 19 of Aug, 2011 16:28 GMT-0000 Xavier de Pedro info added 1