Loading...
Use
Create
Develop
FAQ
Troubleshooting
History: Profile_r_heatmaps_template
View page
Source of version: 7
(current)
{if $smarty.get.itemId gt 0} {wikiplugin _name=rr loadandsave=1 wikisyntax=0 svg=1 pdf=1} ## if you still can't get through the proxy, double-check that the previous command worked with: #Sys.getenv("http_proxy") ############################## ### 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|regex_replace:'/(tiki-index.php|tiki-index_raw.php)/':''}tiki-download_item_attachment.php?itemId={$f_itemId}&fieldId=$profileobject:field_10$&display=inline" expresFileNameTmp <- read.csv(fileurl1, sep=","); # Convert decimal separator value in the form for its equivalent character in R if ( length(grep("dot", "{$f_$profileobject:field_24$}") )==1) {literal} { {/literal} # case for dot . decChar <- "."; {literal} } {/literal} else if ( length(grep("comma", "{$f_$profileobject:field_24$}") )==1) {literal} { {/literal} # case for comma , decChar <- ","; {literal} } {/literal} else {literal} { {/literal} # case for comma , cat("\nWe could not identify your choice of decimal separator for the expressions file. Using dot '.' by default, then.\n"); decChar <- "."; {literal} } {/literal} # Start case for semicolon ; (csv2) if ( length(grep("csv2", "{$f_$profileobject:field_11$}") )==1) {literal} { {/literal} expresFileNameTmp <- read.csv(fileurl1, sep=";", dec=decChar, row.names=1); # cat("Semicolons\n") # XXX {literal} } {/literal} # end of case for semicolon # Start case for comma , (csv) if ( length(grep("csv -", "{$f_$profileobject:field_11$}") )==1) {literal} { {/literal} expresFileNameTmp <- read.csv(fileurl1, sep=",", dec=decChar, row.names=1); # cat("Commas\n") # XXX {literal} } {/literal} # end of case for semicolon # Start case for tabs \t (txt) if ( length(grep("txt", "{$f_$profileobject:field_11$}") )==1) {literal} { {/literal} expresFileNameTmp <- read.csv(fileurl1, sep="\t", dec=decChar, row.names=1); # cat("Tabs\n") # XXX {literal} } {/literal} # end of case for semicolon # Remove extra symbol column if present (coming from the Basic Pipe for Microarrays results) if ( length(expresFileNameTmp$symbol) > 0) {literal} { {/literal} # case when column symbol is found in the expressions file ncolsymbol <- grep("symbol",colnames(expresFileNameTmp)) expresFileNameTmp <- expresFileNameTmp[-ncolsymbol] cat("\nWe noted that you didn't remove the column with symbols. We removed it for you.\n"); cat("\n"); {literal} } {/literal} # convert to matrix (needed for the R package to create the HeatMap. expresNum <- as.matrix(expresFileNameTmp) write.table(expresNum, sep="\t", row.names=TRUE, quote=FALSE, file="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|regex_replace:'/(tiki-index.php|tiki-index_raw.php)/':''}tiki-download_item_attachment.php?itemId={$f_itemId}&fieldId=$profileobject:field_20$&display=inline" # Start case for semicolon ; (csv2) if ( length(grep("csv2", "{$f_$profileobject:field_25$}") )==1) {literal} { {/literal} colorsForColumnsTmp <- read.csv(fileurl2, sep=";"); # end of case for semicolon {literal} } {/literal} else if ( length(grep("csv -", "{$f_$profileobject:field_25$}") )==1) {literal} { {/literal} # Start case for comma , (csv) colorsForColumnsTmp <- read.csv(fileurl2, sep=","); # end of case for commas {literal} } {/literal} else if ( length(grep("txt", "{$f_$profileobject:field_25$}") )==1) {literal} { {/literal} # Start case for tabs \t (txt) colorsForColumnsTmp <- read.csv(fileurl2, sep="\t"); # end of case for tabs {literal} } {/literal} else {literal} { {/literal} # end of case for semicolon cat("We could not find any value for the parameter 'Type of file with Color names for columns' \n") # XXX {literal} } {/literal} write.table(colorsForColumnsTmp, sep="\t", row.names=FALSE, col.names=c("Column", "Group"), quote=FALSE, file="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, ) 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}
Menu
Featured profiles
Profiles in Wizard
Profiles Todos
Handlers
Profiles Tester
Admin
of this site
Current Profiles
Tiki version
21.x
24.x
26.x
27.x
28.x
Deprecated
25.x
state
Not fully functional yet
alpha
beta
release
type
Available in the Profiles Wizard (12+)
Featured profiles
Full profile (out of the box & ready to go)
Learning profile (to show off feature)
Long tail
Mini-profile (can be included in other)
Profile-snippet (optional but needs another "parent" profile)
Security
Tests
Latest Changes
Voting_System
test_profile_change
Test_all_tracker_field_types_profile
Scheduler_Presets_20
Tracker_as_Calendar_09
Tracker_as_Calendar_10
Hide Fixed Top Nav Bar on Scroll 19
Easy_GeoBlog
Profiles_in_Wizard
Random_header_images_14
Hide Fixed Top Nav Bar on Scroll 19
How to Create Profiles
Test_All_Plugins
JonnyBs_Luxury_Tiki_Setup
...more
Like almost all *.tiki.org sites, you can log in with your login from
https://tiki.org
(register over there)
Search
Find
Most Popular Tags
admin
agenda
alias
antibot
antibot captcha
app
archive
articles
banning
batch
blogs
calculations
calendars
cart
categories
cluster
codemirror
comments
computation
contact us
datachannel
debug
debug console
dropdown with other
error messages
features
file galleries
forums
geo
geocms
geolocation
group homepages
group watches
header
i18n
images
item link
items list
jquery
languages
location
map
maps
maths
menu
menupage
multilingual
ol3
ol5
openlayers
paypal
plugin
plugin alias
plugin datachannel
plugin fade
plugin tabs
plugin trackerlist
pretty trackers
print
project management
r
r project
realnames
rss
static
static text
statistics
stats
structures
syntax highlighter
tablesorter
template
trackers
user watches
visualization
watches
webservice
wiki
wiki argument variables
wiki structures
Tiki Newsletter
Subscribe to the Tiki newsletter.
Don't miss major announcements and other news!