RiToJo has been launched using a new media format called TiddlyWiki! The transfer process is somewhat laborious as I want to ensure that all tags and wikiWords are correct throughout the page. Download area is also active! To contribute, edit, or make changes, simply enter your username tag for signing your edits and enter a password of your choice at UploadOptions. Enjoy!
Since many people are colorblind (red/green), it's probably good to choose a blue black yellow scheme for images, HeatMaps, etc. Here's how to specify such a color range in R:\n\n{{{\n> mycol<-c("blue1","blue2","blue3","blue4","black","yellow4","yellow3","yellow2","yellow1")\n}}}\nYou probably want to specify breaks for your image range:\n{{{\n> breaks<-c(0,0.5,1,1.5,2,2.5,3,4,5,6)\n}}}\nHere's how to use it in an image:\n{{{\n> image(x,col=mycol)\n}}}\nHere's a HeatMap without clustering (a false color map, simply by transposing the rows and columns of an image):\n{{{\n> image(t(x),col=mycol)\n}}}\n\n\n
A boxplot (also known as a box-and-whiskers plot, or a Tukey Plot) is a graph that displays the trends \nof a continuous sample and concerns the minimum, the first quartile, the median, the third quartile, and the maximum. Outliers are\nidentified visually and a sense of the distribution of the data is gained from the graph. The first\nand third quartiles form a box with one quartile on each end. The median is represented with a\nline that splits the box. The smallest point that lies within the interquartile range is denoted with\na small tick. A line is then connected from this small dash to the box. The same illustrations are\ndone for the largest point within the interquartile range. The outliers, the data points that lie\nabove or below the interquartile range, are denoted with small dots.\n\n[img[RiToJoBoxplot.jpg]]
\n// //''Name:'' Calendar Plugin\n// //''Version:'' <<getversion calendar>> (<<getversiondate calendar "DD MMM YYYY">>)\n// //''Author:'' Tiago\n// //''Syntax:'' \n// //{{{<<calendar [year [month [day]]]>>}}} or {{{<<calendar 'thismonth'>>}}}\n// //Parameters between [] are optional.\n\n// //''Description:'' \n// // Create a calendar view for a specific month.\n// // * {{{<<calendar>>}}} creates a calendar displaying the current month and current day selected.\n// // * {{{<<calendar 'thismonth'>>}}} creates a calendar displaying the current month.\n// // * {{{<<calendar year month>>}}} creates a calendar displaying a specific month.\n// // * {{{<<calendar year month day>>}}} creates a calendar displaying a specific month with the day highlighted.\n// // All calendars will also show associated tiddlers with a different color (configurable in CSS).\n\n// //''Code section:''\n// (you should not need to alter anything below here)//\n\n{{{\nversion.extensions.calendar = { major: 1, minor: 1, revision: 0, date: new Date(2005, 10, 02)};\n\n// --------------------------------------------------------------------\n// Calendar\n// --------------------------------------------------------------------\nconfig.messages.dates.days_short = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];\n\nconfig.macros.calendar = {\n\n // months as they appear in the calendar's title\n /*\n calendarMonths: [\n "January", "February", "March", "April", "May", "June",\n "July", "August", "September", "October", "November", "December"\n ],\n // week day titles as they appear on the calendar\n calendarWeekDays: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],\n */\n\n // override\n calendarMonths: config.messages.dates.months,\n calendarWeekDays: config.messages.dates.days_short,\n\n // day week starts from (normally 0-Su or 1-Mo)\n calendarWeekStart: 0\n};\n\nconfig.macros.calendar.createLink = function(theParent,theText,theAction) {\n var link = createTiddlyElement(theParent,"span",null,"calendarCell",theText);\n if (theAction != null) {\n link.onclick = theAction;\n }\n return link;\n}\n\n/***************************************************************************\n** Internal functions\n***************************************************************************/\n\nconfig.macros.calendar.findCalendar = function(child) {\n var parent;\n while (child && child.parentNode) {\n parent = child.parentNode;\n if (parent.id == "calendarWrapper") {\n return parent;\n }\n child = parent;\n }\n return null;\n}\n\nconfig.macros.calendar.selectDate = function(e) {\n if (!e) var e = window.event;\n var cm = config.macros.calendar;\n\n var calendar = cm.findCalendar(this);\n if (calendar) {\n var d = this.getAttribute("date");\n if (d != null) {\n cm.makeCalendar(calendar, new Date(new Number(d)));\n }\n }\n\n e.cancelBubble = true;\n if (e.stopPropagation) e.stopPropagation();\n return false;\n}\n\nconfig.macros.calendar.dateTiddler = function(date) {\n var cm = config.macros.calendar;\n var y = date.getFullYear();\n var m = date.getMonth()+1;\n var d = date.getDate();\n var title = y + "/" + (m < 10 ? "0" : "") + m + "/" + (d < 10 ? "0" : "") + d;\n return title;\n}\n\nconfig.macros.calendar.makeCalendar = function(calendar, dt_current) {\n var cm = config.macros.calendar;\n var dt_today = new Date(new Number(calendar.getAttribute("today")));\n var select_today = calendar.getAttribute("selectToday") == "yes";\n calendar.setAttribute("date", dt_current.valueOf());\n\n while (calendar.hasChildNodes())\n calendar.removeChild(calendar.firstChild);\n\n // get same date in the previous year\n var dt_prev_year = new Date(dt_current);\n dt_prev_year.setFullYear(dt_prev_year.getFullYear() - 1);\n if (dt_prev_year.getDate() != dt_current.getDate())\n dt_prev_year.setDate(0);\n\n // get same date in the next year\n var dt_next_year = new Date(dt_current);\n dt_next_year.setFullYear(dt_next_year.getFullYear() + 1);\n if (dt_next_year.getDate() != dt_current.getDate())\n dt_next_year.setDate(0);\n\n // get same date in the previous month\n var dt_prev_month = new Date(dt_current);\n dt_prev_month.setMonth(dt_prev_month.getMonth() - 1);\n if (dt_prev_month.getDate() != dt_current.getDate())\n dt_prev_month.setDate(0);\n\n // get same date in the next month\n var dt_next_month = new Date(dt_current);\n dt_next_month.setMonth(dt_next_month.getMonth() + 1);\n if (dt_next_month.getDate() != dt_current.getDate())\n dt_next_month.setDate(0);\n\n // get first day to display in the grid for current month\n var dt_firstday = new Date(dt_current);\n dt_firstday.setDate(1);\n dt_firstday.setDate(1 - (7 + dt_firstday.getDay() - cm.calendarWeekStart) % 7);\n\n var area, header, table;\n var line, cell, i;\n\n // 1 - calendar header table\n // 2 - calendar days table\n area = createTiddlyElement(calendar, "table", "calendarArea");\n area.cellPadding = 0;\n area.cellSpacing = 0;\n area = createTiddlyElement(area, "tbody");\n\n // 1 - calendar header table\n header = createTiddlyElement(\n createTiddlyElement(\n createTiddlyElement(\n area,\n "tr"\n ),\n "td"\n ),\n "table",\n "calendarHeader"\n );\n header.cellPadding = 0;\n header.cellSpacing = 0;\n header = createTiddlyElement(header, "tbody");\n line = createTiddlyElement(header, "tr", null, null, null);\n\n var headerValues = [\n [ "<<", "selectYear", dt_prev_year.valueOf() ],\n [ "<", "selectMonth", dt_prev_month.valueOf() ],\n [ cm.calendarMonths[dt_current.getMonth()] + ' ' + dt_current.getFullYear(),\n "selectToday", dt_today.valueOf() ],\n [ ">", "selectMonth", dt_next_month.valueOf() ],\n [ ">>", "selectYear", dt_next_year.valueOf() ]\n ];\n\n for (i = 0; i < headerValues.length; ++i) {\n cm.createLink(\n createTiddlyElement(\n line,\n "td",\n null,\n headerValues[i][1]\n ),\n headerValues[i][0],\n cm.selectDate\n ).setAttribute("date", headerValues[i][2]);\n }\n\n // 2 - calendar days table\n table = createTiddlyElement(\n createTiddlyElement(\n createTiddlyElement(\n area,\n "tr"\n ),\n "td"\n ),\n "table",\n "calendarTable"\n );\n table.cellPadding = 0;\n table.cellSpacing = 0;\n table = createTiddlyElement(table, "tbody");\n\n // print weekdays titles\n line = createTiddlyElement(table, "tr", "calendarLine", "weekNames", null);\n for (var n = 0; n < 7; ++n) {\n createTiddlyElement(line, "td", null, null, cm.calendarWeekDays[(cm.calendarWeekStart + n)%7]);\n }\n\n // print calendar table\n var dt_current_day = new Date(dt_firstday);\n var day_class;\n var title;\n while (dt_current_day.getMonth() == dt_current.getMonth() ||\n dt_current_day.getMonth() == dt_firstday.getMonth()) {\n\n // print row heder\n line = createTiddlyElement(table, "tr", "calendarLine", null, null);\n for (var n_current_wday = 0; n_current_wday < 7; ++n_current_wday) {\n title = cm.dateTiddler(dt_current_day);\n if (store.tiddlerExists(title)) {\n // day has a tiddler associated with it\n day_class = "scheduledDay";\n } else if (select_today && dt_current_day.valueOf() == dt_today.valueOf()) {\n // print current date\n day_class = "currentDay";\n } else if (dt_current_day.getDay() == 0 || dt_current_day.getDay() == 6) {\n // weekend days\n day_class = "weekDay";\n } else {\n // print working days of current month\n day_class = "workingDay";\n }\n\n // extra formatting for days of previous or next month\n if (dt_current_day.getMonth() != dt_current.getMonth()) {\n day_class += " otherMonthDay";\n }\n\n var text = dt_current_day.getDate();\n var cell = createTiddlyElement(line, "td", null, day_class, null);\n\n var link = cm.createLink(cell, text, onClickTiddlerLink);\n link.setAttribute("date", dt_current_day.valueOf());\n link.setAttribute("tiddlyLink", title);\n\n dt_current_day.setDate(dt_current_day.getDate()+1);\n }\n }\n}\n\nconfig.macros.calendar.handler = function(place, macroName, params) {\n var date = null;\n var sel = "yes";\n if (params.length == 2) {\n date = new Date(\n params[0],\n params[1]-1,\n 1\n );\n sel = "no";\n }\n else if (params.length == 3) {\n date = new Date(\n params[0],\n params[1]-1,\n params[2]\n );\n }\n else if (params.length == 1 && params[0] == "thismonth") {\n date = new Date();\n date = new Date(date.getFullYear(), date.getMonth(), 1);\n sel = "no";\n }\n else {\n date = new Date();\n // filter time values off\n date = new Date(date.getFullYear(), date.getMonth(), date.getDate());\n }\n\n var cm = config.macros.calendar;\n calendar = createTiddlyElement(place, "span", "calendarWrapper");\n calendar.setAttribute("name", "calendarWrapper");\n calendar.setAttribute("today", date.valueOf());\n calendar.setAttribute("selectToday", sel);\n\n cm.makeCalendar(calendar, date);\n}\n\n\nfunction refreshCalendars(hint) {\n var calendars = document.getElementsByName("calendarWrapper");\n var cm = config.macros.calendar;\n var i, c;\n for (i = 0; i < calendars.length; ++i) {\n c = calendars.item(i);\n if (c.id == "calendarWrapper") {\n cm.makeCalendar(c, new Date(new Number(c.getAttribute("date"))));\n }\n }\n}\n\nstore.addNotification(null, refreshCalendars);\n\n}}}
[img[RiToJoCircuitSwitchedNet.gif]]
The Coefficient of Dispersion (COD) is a measurement of variability. A lower\nCoefficient of Dispersion implies a less amount of variability. The COD measures the average\npercentage deviation of the ratios from the median ratio and is calculated from the following\nsteps:\n{{{\n1. Calculate the deviation by subtracting the median from each ratio.\n2. Find the absolute value of the deviations.\n3. Sum the absolute deviations.\n4. Divide by the number of ratios to obtain the โ€œaverage absolute deviation.โ€\n5. Divide by the median.\n6. Multiply by 100.\n}}}
One giant drawback to the standard deviation metric is that it should not be compared to\nstandard deviations from other samples. Acceptance of basic inferences cannot be made strictly\nfrom the comparison of the standard deviations. For example, a distribution with a large\nstandard deviation with a sample mean x centered near the population mean ฮผ may be more\naccurate than a distribution with a smaller standard deviation. The coefficient of variation is a\nsingle metric that permits comparison of distributions while accounting for samplesโ€™ standard\ndeviations and means. A small coefficient of variation is preferred. However, the coefficient of\nvariation is not a good test statistic, and anyone who uses this metric for comparison purposes\nbetween data samples should do so with extreme caution.\n\nThe formula for the coefficient of variation is the quotient of the standard deviation and\nthe mean, multiplied by one hundred. (Please note: The Coefficient of Variation is different\nfrom the covariance, which is also often denoted by the abbreviation CoV.)
The R-project has a library for colors called RColorBrewer from from [[ColorBrewer|http://colorbrewer.org]]. There are 3 types of palettes, sequential, diverging, and qualitative:\n\n* Sequential palettes are suited to ordered data that progress from low to high. Lightness steps dominate the look of these schemes, with light colors for low data values to dark colors for high data values. All the sequential palettes are available in variations from 3 different values up to 9 different values.\nThe sequential palettes names are:\n{{{\nBlues \nBuGn\nBuPu\nGnBu\nGreens\nGreys\nOranges\nOrRd\nPuBu\nPuBuGn \nPuRd\nPurples\nRdPu\nReds\nYlGn\nYlGnBu\nYlOrBr\nYlOrRd\n}}}\nYou would use this as follows:\n{{{\n> mypalette<-brewer.pal(7,"Greens")\n> image(1:7,1,as.matrix(1:7),col=mypalette,xlab="Greens (sequential)", ylab="",xaxt="n",yaxt="n",bty="n")\n}}}\nWhich yields the following image:\n[img[RiToJogreensSequential.jpg]]\n* Diverging palettes put equal emphasis on mid-range critical values and extremes at both ends of the data range. The critical class or break in the middle of the legend is emphasized with light colors and low and high extremes are emphasized with dark colors that have contrasting hues. All the diverging palettes are available in variations from 3 different values up to 11 different values.\nThe diverging palettes are:\n{{{\nBrBG\nPiYG\nPRGn\nPuOr\nRdBu\nRdGy\nRdYlBu\nRdYlGn\nSpectral\n}}}\n* Qualitative palettes do not imply magnitude differences between legend classes, and hues are used to create the primary visual differences between classes. Qualitative schemes are best suited to representing nominal or categorical data.\n\n<!--{{{-->\n'brewer.pal' makes the color palettes from ColorBrewer available\nas R palettes.\n\n'display.brewer.pal' displays the selected palette in a graphics\nwindow.\n\n'display.brewer.all' displays the a few palettes simultanueously\nin a graphics window.\n\n'brewer.all.info' returns information about the available palettes\nas a dataframe.\n<!--}}}-->\n\n
Most graphing / statistical visualization tools use terrible colors. Since many people are colorblind (red/green), it's probably good to choose a blue black yellow scheme for images, HeatMaps, etc.\n\n[[colorsR]]
A confidence interval is a range in which the true mean of the population, ฮผ, is expected\nto lie based on a predetermined percent of accuracy. For example, a 95% confidence interval\ngives a range of values. These values predict that the true mean of the population from which\nthe sample was taken lies within the interval. As the confidence level decreases from 95%, the\nrange becomes smaller. Similarly, if the confidence level increases from 95%, the range\nbecomes larger.\n\nUnlike the confidence interval about the mean, the median confidence interval is not\nbased on the assumption of a normal distribution. It is found by ranking the data: sorting the\ndata in increasing order and assigning each data point a number based on the value in relation to\nthe others. If two or more data points are tied for the same rank, the rank assigned to these\nvalues is averaged.\nTo determine the upper and lower limits of the confidence interval, first calculate the position of\nthe limits. If the number of samples in the array is even, use:\n{{{\nj=1.96 x (sqrt(n)) / 2\n}}}\nIf the number of observations is odd, use:\n{{{\nj=(1.96 x (sqrt(n)) / 2) + 0.5\n}}}\nAfter determining the value of j, round the value up to the highest integer. From the\nvalues that are ranked, find the median, and count up and down j data points to find the limits of\nthe confidence interval.
From the [[Cygwin|http://www.cygwin.com/]] website:\n\n# Cygwin is a Linux-like environment for Windows. It consists of two parts: A DLL (cygwin1.dll) which acts as a Linux API emulation layer providing substantial Linux API functionality.\n# A collection of tools which provide Linux look and feel.\nMost of Cygwin is pretty sefl-explainatory, however there are some provisioning issues that you should be aware of:\nCygwinInstallMySQL-DBD\nCygwinInstallMySQL\nCygwinTerminal
I had some issues installing MySQL on Cygwin. Here's my ProblemCygwinMySQL. Below is the solution that worked:\n\n{{{\n> In file included from dbdimp.c:20:\n> dbdimp.h:23:45: mysqld_error.h: No such file or directory\n}}}\nI seem to recall this is a bug in the MySQL configury where it neglects to install this header if you only build the client libs. A workaround would be to configure and install MySQL with \n{{{\n--enable-server\n}}}\n(even if you plan to use the native Win32 server and not the Cygwin server), and you should have the header installed.\n\n---\n\nAnother suggestion that did NOT work was to use cygport. For the time being it seems quite unstable.\n\n
f you are a user of Cygwin (the Redhat distribution) you already know, it contains a nicely running perl 5.6.1, installation of additional modules usually works as a charme via the standard procedure of\n{{{\n perl makefile.PL\n make\n make test\n make install\n}}}\nThe Windows binary distribution of MySQL runs smoothly under Cygwin. You can start/stop the server and use all Windows clients without problem. But to install DBD::mysql you have to take a little special action.\n\nDon't attempt to build DBD::mysql against either the MySQL Windows or Linux/Unix BINARY distributions: neither will work!\n\nYou MUST compile the MySQL clients yourself under Cygwin, to get a 'libmysqlclient.a' compiled under Cygwin. Really! You'll only need that library and the header files, you don't need any other client parts. Continue to use the Windows binaries. And don't attempt (currently) to build the MySQL Server part, it is unneccessary, as MySQL AB does an excellent job to deliver optimized binaries for the mainstream operating systems, and it is told, that the server compiled under Cygwin is unstable.\n\n# Install MySQL (if you havn't already)\n# download the MySQL Windows Binaries from http://www.mysql.com/downloads/index.html\n# unzip mysql-<version>-win.zip into some temporary location\n# start the setup.exe there and follow the instructions\n# start the server\n# alternatively download, install and start the server on a remote server, on what supported OS ever\n\nBuild MySQL clients under Cygwin:\n\n# download the MySQL LINUX source from http://www.mysql.com/downloads/index.html\n# unpack mysql-<version>.tar.gz into some tmp location\n# cd into the unpacked dir mysql-<version>\n{{{\n ./configure --prefix=/usr/local/mysql --without-server\n}}}\n This prepares the Makefile with the installed Cygwin features. It takes some time, but should finish without error. The 'prefix', as given, installs the whole Cygwin/MySQL thingy into a location not normally in your PATH, so that you continue to use already installed Windows binaries. The \n{{{\n--without-server\n}}}\nparameter tells configure to only build the clients.\n{{{\n make\n}}}\n This builds all MySQL client parts ... be patient. It should finish finally without any error.\n{{{\n make install\n}}}\n This installs the compiled client files under /usr/local/mysql/. Remember, you don't need anything except the library under /usr/local/mysql/lib and the headers under /usr/local/mysql/include!\n\n Essentially you are now done with this part. If you want, you may try your compiled binaries shortly; for that, do:\n{{{\n cd /usr/local/mysql/bin\n ./mysql -h 127.0.0.1\n}}}\n The host \n{{{\n(-h)\n}}}\nparameter 127.0.0.1 targets the local host, but forces the mysql client to use a TCP/IP connection. The default would be a pipe/socket connection (even if you say '-h localhost') and this doesn't work between Cygwin and Windows (as far as I know).\n\n If you have your MySQL server running on some other box, then please substitute '127.0.0.1' with the name or IP-number of that box.\n\nPlease note, in my environment the 'mysql' client did not accept a simple RETURN, I had to use CTRL-RETURN to send commands ... strange, but I didn't attempt to fix that, as we are only interested in the built lib and headers.\n\nAt the 'mysql>' prompt do a quick check:\n{{{\n mysql> use mysql\n mysql> show tables;\n mysql> select * from db;\n mysql> exit\n}}}\n--------\nYou are now ready to build DBD::mysql!\n\nBuild DBD::mysql:\n\n# download DBD-mysql-<version>.tar.gz from CPAN\n# unpack DBD-mysql-<version>.tar.gz\n# cd into unpacked dir DBD-mysql-<version> you probably did that already, if you are reading this!\n{{{\ncp /usr/local/mysql/bin/mysql_config .\n}}}\n This copies the executable script mentioned in the DBD::mysql docs from your just built Cywin/MySQL client directory; it knows about your Cygwin installation, especially about the right libraries to link with.\n{{{\nperl Makefile.PL --testhost=127.0.0.1\n}}}\n The --testhost=127.0.0.1 parameter again forces a TCP/IP connection to the MySQL server on the local host instead of a pipe/socket connection for the 'make test' phase.\n{{{\nmake\n}}}\n This should run without error\n{{{\n make test\n}}}\n with DBD-mysql-2.1022 or earlier you will see several errors in dbdadmin.t, mysql.t and mysql2.t; with later versions you should not get errors (except possibly one, indicating, that some tables could not be dropped. I'm hunting for a solution to that problem, but have none yet).\n{{{\n make install\n}}}\n This installs DBD::mysql into the Perl hierarchy.\n\nNotes:\n\nThis was tested with MySQL version 3.23.54a and DBD::mysql version 2.1022. I patched the above mentioned test scripts and sent the patches to the author of DBD::mysql Jochen Wiedman.
ImportDelimitedFiles\nTab and comma delimited files are often the easiest way to analyze data.\n\nImportFromTextEditors\n\nImportFastaFiles\n\nImportGenBankFiles\n\nImportGFFFiles\n\nImportBinaryFiles
Common data structures:\n\n[[Vectors]]\n\n----\n[[Strings]]\n\n----\n[[Matrix]]\nMatrices are n-dimensional data (the most recognizable being the 2-dimensional [[Matrix]] of an XL spreadsheet: [[Columns]] and [[Rows]]). In many cases, a matrix can be orthogonal [[Vectors]]. [[Matrices[[ may have [[Labels]], and individual [[Vectors]] may be of the same or different [[length]]. If the [[Matrix]] has [[Vectors]] of the same [[length]], some [[languages]] have special handling capabilities.\n\n----\n[[Objects]]
[[Variables]]\n[[Classes]]\n[[Objects]]
<<newReminder>>\n\n<<showReminders leadtime:30 format:"|DIFF|TITLE|TIDDLER|" >>
\nHere is an example flowchart of a [[government regulatory flowchart|http://www.stc.mo.gov/pdf/RatioStudyDecisionModel11172006.pdf]] for housing appraisals.\n[img[RiToJoDecisionPathway.jpg]]
[[Welcome to the RiToJo project!]]\nDateLine
Here's a simple function to ImportFastaFiles using [[Perl]]: (You might also be interested in ImportFastaPerlOOP)\n{{{\n#!/usr/bin/perl -w\n\nuse strict;\n\n# the use of -w (for warnings) and strict is \n# highly encouraged! It will make your programs\n# easier to understand and debug\n\n\n#//////////////////////////////////////////////////////////////////////#\n# #\n# readFasta.pl #\n# Michael Janis, UCLA Bioinformatics #\n# Aug. 30, 2005 #\n# Rev 1 - no dependencies #\n# Data Sources: http://www.chem.ucla.edu/~mjanis/biohackers2005.html #\n# #\n# #\n# A (very) simplified example program for reading #\n# a series of Fasta files into a Perl hash. #\n# #\n#//////////////////////////////////////////////////////////////////////#\n\nmy %fastaSeqs; # declaration of the minor hash to (re)used to hold the fasta data files\nmy $header; # declaration of scalar to hold the fasta header for each instance\nmy %chrList; # declaration of master hash, a hash of hashes, for every file\n # (here, it could be each chromosome, for example if you did\n # >wget ftp://genome-ftp.stanford.edu/pub/yeast/data_download/sequence/NCBI_genome_source/*fsa\n\nmy @chrFiles=`ls -1 *.fsa`; # a way to use wildcards to load all fasta files in the CWD\n\nforeach my $file(@chrFiles) { # process each file in turn; here we populate each minor hash,\n # then pass that hash to the master hash\n chomp($file); # get rid of metacharacters, newlines from filenames\n %fastaSeqs=(); # clear out the minor hash from the last instance\n $header=''; # clear out the header scalar\n\n open (IN,"$file"); # create a file handle for the file being processed\n $file=~s/\s.fsa//; # we've used the filename to create the filehandle;\n # we don't need the filename any longer, so we'll\n # remove the .fsa extension and use the filename as \n # the major hash key \n\n while (<IN>) { # use a while loop to go through the file one line at a time\n chomp; # remove newlines/metacharacters\n if ($_=~/^\ss*$/) { # let's ignore blank lines in the file that may exist\n next;\n }\n elsif ($_=~/^>/) { # here we grad the header; note that the key - value pair\n # is empty at this point in the minor hash\n $header=$_; # just take the whole header\n $header=~s/>//; # strip out the leading > from the header\n }\n else { # here's where we grab the sequence;\n # (if it's not a header, it's sequence in our fasta files)\n $fastaSeqs{$header} .= $_; # we simply concatenate all the sequence lines together into \n # a cohesive sequence.\n }\n }\n close IN; # close that file, filehandle! we'll need to use it for the\n # next file\n $chrList{$file}={%fastaSeqs}; # finally, for each minor hash created, we append it to the \n # major hash (called chrList). Note that we even hold the \n # training data in this major hash.\n}\n\n}}}
Here is a (very) simplified example program for genefinding based upon codon bias, start and stop codons using log odd scores from model likelihoods:\n\n{{{\n#!/usr/bin/perl -w\n\nuse strict;\n\n# the use of -w (for warnings) and strict is \n# highly encouraged! It will make your programs\n# easier to understand and debug\n\n\n#//////////////////////////////////////////////////////////////////////#\n# #\n# geneFinder_subroutines.pl #\n# Michael Janis, UCLA Bioinformatics #\n# Aug. 30, 2005 #\n# Rev 1 - no dependencies #\n# Data Sources: http://www.chem.ucla.edu/~mjanis/biohackers2005.html #\n# #\n# #\n# A (very) simplified example program for genefinding #\n# based upon codon bias, start and stop codons #\n# using log odd scores from model likelihoods. #\n# #\n# note that this example uses subroutines; #\n# a better implementation would incorporate #\n# libraries for functions (we'll see that soon...) #\n# #\n#//////////////////////////////////////////////////////////////////////#\n\n\n\n###################################################\n# #\n# Some useful data (in the form of mappings) : #\n# #\n###################################################\n# this is straight out of your reading:\n# a simple hash to map codons to their \n# corresponding amino acids\n\nmy %geneticCode = (\n 'TCA'=>'S', # Serine\n 'TCC'=>'S',\n 'TCG'=>'S',\n 'TCT'=>'S',\n\n 'TTC'=>'F', # Phenylalanine\n 'TTT'=>'F',\n\n 'TTA'=>'L', # Leucine\n 'TTG'=>'L',\n\n 'TAC'=>'Y', # Tyrosine\n 'TAT'=>'Y',\n\n 'TAA'=>'-', # STOP CODON\n 'TAG'=>'-', # STOP CODON\n 'TGA'=>'-', # STOP CODON\n\n 'TGC'=>'C', # Cysteine\n 'TGT'=>'C',\n\n 'TGG'=>'W', # Tryptophan\n\n 'CTA'=>'L', # Leucine\n 'CTC'=>'L',\n 'CTG'=>'L',\n 'CTT'=>'L',\n\n 'CCA'=>'P', # Proline\n 'CCC'=>'P',\n 'CCG'=>'P',\n 'CCT'=>'P',\n\n 'CAC'=>'H', # Histidine\n 'CAT'=>'H',\n\n 'CAA'=>'Q', # Glutamine\n 'CAG'=>'Q',\n\n 'CGA'=>'R', # Arginine\n 'CGC'=>'R',\n 'CGG'=>'R',\n 'CGT'=>'R',\n\n 'ATA'=>'I', # Isoleucine\n 'ATC'=>'I',\n 'ATT'=>'I',\n \n 'ATG'=>'M', # Methionine (START CODON)\n\n 'ACA'=>'T', # Threonine\n 'ACC'=>'T',\n 'ACG'=>'T',\n 'ACT'=>'T',\n \n 'AAC'=>'N', # Asparagine\n 'AAT'=>'N',\n \n 'AAA'=>'K', # Lysine\n 'AAG'=>'K',\n\n 'AGC'=>'S', # Serine\n 'AGT'=>'S',\n\n 'AGA'=>'R', # Argenine\n 'AGG'=>'R',\n\n 'GTA'=>'V', # Valine\n 'GTC'=>'V',\n 'GTG'=>'V',\n 'GTT'=>'V',\n\n 'GCA'=>'A', # Alanine\n 'GCC'=>'A',\n 'GCG'=>'A',\n 'GCT'=>'A',\n\n 'GAC'=>'D', # Aspartic Acid\n 'GAT'=>'D',\n\n 'GAA'=>'E', # Glutamic Acid\n 'GAG'=>'E',\n \n 'GGA'=>'G', # Glycine\n 'GGC'=>'G',\n 'GGG'=>'G',\n 'GGT'=>'G',\n );\n\n\nmy %fastaSeqs; # declaration of the minor hash to (re)used to hold the fasta data files\nmy $header; # declaration of scalar to hold the fasta header for each instance\nmy %chrList; # declaration of master hash, a hash of hashes, for every file\n # (here, it could be each chromosome, for example if you did\n # >wget ftp://genome-ftp.stanford.edu/pub/yeast/data_download/sequence/NCBI_genome_source/*fsa\n\nmy @chrFiles=`ls -1 *.fsa`; # a way to use wildcards to load all fasta files in the CWD\n\nforeach my $file(@chrFiles) { # process each file in turn; here we populate each minor hash,\n # then pass that hash to the master hash\n chomp($file); # get rid of metacharacters, newlines from filenames\n %fastaSeqs=(); # clear out the minor hash from the last instance\n $header=''; # clear out the header scalar\n\n open (IN,"$file"); # create a file handle for the file being processed\n $file=~s/\s.fsa//; # we've used the filename to create the filehandle;\n # we don't need the filename any longer, so we'll\n # remove the .fsa extension and use the filename as \n # the major hash key \n\n while (<IN>) { # use a while loop to go through the file one line at a time\n chomp; # remove newlines/metacharacters\n if ($_=~/^\ss*$/) { # let's ignore blank lines in the file that may exist\n next;\n }\n elsif ($_=~/^>/) { # here we grad the header; note that the key - value pair\n # is empty at this point in the minor hash\n $header=$_; # just take the whole header\n $header=~s/>//; # strip out the leading > from the header\n }\n else { # here's where we grab the sequence;\n # (if it's not a header, it's sequence in our fasta files)\n $fastaSeqs{$header} .= $_; # we simply concatenate all the sequence lines together into \n # a cohesive sequence.\n }\n }\n close IN; # close that file, filehandle! we'll need to use it for the\n # next file\n $chrList{$file}={%fastaSeqs}; # finally, for each minor hash created, we append it to the \n # major hash (called chrList). Note that we even hold the \n # training data in this major hash.\n}\n\nmy @trainingSet=values %{$chrList{'orf_coding'}}; # here we get all of the sequences from the major/minor\n # hash which holds the training data (orf sequences)\n # (we cheated a bit; these exist at \n # ftp://genome-ftp.stanford.edu/pub/yeast/data_download/sequence/genomic_sequence/orf_dna/orf_coding.fasta.gz)\n\nmy %codonFrequencies = (); # we created and initialize an empty hash to hold our codon Frequencies / lod scores\nmy $totalCodonCounter=0; # we need to hold the total number of codons processed in a counter variable;\n # this will become our denominator in our probability calculation for our likelihoods and lods\n\nforeach my $seq (@trainingSet) { # here we loop through each sequence in the training set array we created\n for (my $i=0; $i<(length $seq)-3; $i+=3) { # here we loop through each codon in each of the sequences of the training set\n # (incrementing by 3 nucleotides each time) - note that we "KNOW" the reading frame \n # here since we downloaded the ORFs, and without introns as well\n my $triNucleotide=substr($seq,$i,3); # grabbing each codon in turn as a substring\n $codonFrequencies{$triNucleotide}++; # and using our newly created hash to count how many times we see each codon\n $totalCodonCounter++; # and of course incrementing our codon counter, regardless of which codon we see\n }\n}\n\nmy @red=keys %codonFrequencies; # here we'll grab all of the codons that we collected above\nforeach my $blue(@red) { # and process them in turn; we need to get the lod scores for each\n # codon where the lod (codon)=log((pr(codon|coding region))/((pr(codon|random model))))\n $codonFrequencies{$blue}=log(($codonFrequencies{$blue}/$totalCodonCounter)/(1/64)); # the random model is simply a uniform (1/64) dist.\n# print "$blue\st$geneticCode{$blue}\st$codonFrequencies{$blue}\sn"; # we could print this out to see if it's working if we'd like to\n}\n\nmy @accs=keys %{$chrList{'chrT'}}; # for this exercise, all we really care about is the training set fasta file and the chrT.fsa file,\n # ( >wget http://www.chem.ucla.edu/~mjanis/chrT.fsa )\n # which contains the sequences we're going to try to do some genefinding in. We've already loaded\n # the files, and created a useful hash for both. Now we'll traverse the chrT (TEST) sequences and\n # using the lod scores from our training set see what lod scores come out of putative coding regions\nmy $putativeStart; my $putativeStop; # here we declare variables to hold putative start and stop codon indeces from our sequence\nmy $putativeD;\nforeach my $r(@accs) { # we're going to take each entry in our fasta file in turn\n print "$r\sn"; # we'll print it out to keep track of which one we're working on\n my $s=$chrList{'chrT'}{$r}; # and grab the sequence from the major/minor hash combination\n print "ORIGINAL SEQUENCE:\sn$s\sn";\n my @return=counts($s); # here we call to our subroutine called counts (defined below)\n print "@return\sn";\n my @rr=frequencies(@return); # here we call to our subroutine called frequencies (defined below)\n print "@rr\sn";\n my $randSeq=randomize($s); # here we call to our subroutine called randomize (defined below)\n print "RANDOMIZED SEQUENCE:\sn$randSeq\sn";\n my @rrr=counts($randSeq); # another call to subroutine called counts to verify that the randomized\n # sequence has preserved the nucleotide frequencies of the original sequence\n print "@rrr\sn";\n my $rrddnnaa=revcom($s); # a call to subroutine revcom for reverse complimentation of the sequence\n print "REVERSE COMPLIMENT:\sn$rrddnnaa\sn";\n my $pro=translate($s); # a call to subroutine translate for amino acid translation of the reading frame\n print "TRANSLATED SEQ:\sn$pro\sn";\n\n print "SCORE:\sn".evaluateLOD($s,0,1)."\sn";\n\n}\n\n\n###################################################\n# #\n# Subroutines defined here : #\n# #\n###################################################\n\n\n\n\nsub evaluateLOD {\n my $xdna=shift(@_);\n my $startStart=shift(@_);\n my $stopStop=shift(@_);\n \n $putativeStart=index($xdna,"ATG",$startStart); # a way to grab the first start codon and pass it's location to a variable as a \n # putative start location of the gene\n my $putativeStop=$stopStop; # we set the stop location very low, and then check each possible stop codon\n # in turn below. The one that is closest to the start becomes our first\n # stop codon to be considered, and defines the outer range of the sequence\n # to be evaluated as a coding region by lod scores;\n # note that we need to ensure that the stop codon is in frame with our \n # putative start codon: this is the function of the three nested blocks\n # which follow.\n my $mark=0;\n\n if ((index($xdna,"TAA",$putativeStart))>$putativeStop) {\n $putativeD=(index($xdna,"TAA",$putativeStart)-$putativeStart);\n if ($putativeD%3==0) {\n $putativeStop=index($xdna,"TAA",$putativeStart);\n $mark=1;\n }\n }\n if ((index($xdna,"TAG",$putativeStart))>$putativeStop) {\n $putativeD=(index($xdna,"TAG",$putativeStart)-$putativeStart);\n if ($putativeD%3==0) {\n $putativeStop=index($xdna,"TAG",$putativeStart);\n $mark=1;\n }\n }\n if ((index($xdna,"TGA",$putativeStart))>$putativeStop) {\n $putativeD=(index($xdna,"TGA",$putativeStart)-$putativeStart);\n if ($putativeD%3==0) {\n $putativeStop=index($xdna,"TGA",$putativeStart);\n $mark=1;\n }\n }\n\n \n my $substringLength=$putativeStop-$putativeStart;\n my $evalSequence=substr($xdna,$putativeStart,($substringLength+3));\n\n my $score=0;\n for (my $i=0; $i<=(length $evalSequence)-3; $i+=3) {\n $score+=$codonFrequencies{substr($evalSequence,$i,3)};\n\n }\n print "EVAL:\sn$evalSequence\sn";\n\n return $score;\n}\n\n\n## a subroutine to translate the DNA sequence into amino acids with the\n## hash that holds the mappings\nsub translate {\n my $dna= shift @_;\n my $proteinChain="";\n while ($dna=~s/(...)//) {\n $proteinChain .= $geneticCode{$1};\n }\n return $proteinChain;\n}\n\n## a subroutine to reverse complement a DNA sequence\nsub revcom {\n my $dna=shift @_;\n my $rdna=reverse($dna);\n $rdna=~tr/ACGT/TGCA/;\n return $rdna;\n}\n\nsub counts {\n my $sdna=shift @_;\n my @dna=split(//,$sdna);\n my $ldna=scalar(@dna);\n my $countA=0; my $countC=0; my $countG=0; my $countT=0;\n\n for (my $i=0; $i<$ldna; $i++) {\n if ($dna[$i] eq 'A' || $dna[$i] eq 'a') {\n $countA++;\n }\n if ($dna[$i] eq 'C' || $dna[$i] eq 'c') {\n $countC++;\n }\n if ($dna[$i] eq 'G' || $dna[$i] eq 'g') {\n $countG++;\n }\n if ($dna[$i] eq 'T' || $dna[$i] eq 't') {\n $countT++;\n }\n }\n return($ldna,$countA,$countC,$countG,$countT);\n}\n\nsub frequencies {\n my $size=shift(@_);\n my $nA=shift(@_);\n my $nC=shift(@_);\n my $nG=shift(@_);\n my $nT=shift(@_);\n return((($nA/$size)*100),(($nC/$size)*100),(($nG/$size)*100),(($nT/$size)*100));\n}\n \n\n\nsub randomize {\n my $sdna=shift @_;\n my @counters=counts($sdna);\n my $size=shift(@counters);\n my $nA=shift(@counters);\n my $nC=shift(@counters);\n my $nG=shift(@counters);\n my $nT=shift(@counters);\n my $randomString='';\n \n while ($size>0) {\n \n srand();\n my $r=rand(1);\n \n if ($r<=0.25) {\n if ($nA>0) {\n $randomString .= "A";\n $nA--; $size--;\n }\n }\n elsif($r<=0.5) {\n if ($nC>0) {\n $randomString .= "C";\n $nC--; $size--;\n }\n }\n elsif($r<=0.75) {\n if ($nG>0) {\n $randomString .= "G";\n $nG--; $size--;\n }\n }\n elsif($r<=1.0) {\n if ($nT>0) {\n $randomString .= "T";\n $nT--; $size--;\n }\n }\n }\n return($randomString);\n\n}\n\n}}}
HeatMaps are false color images - useful for microarray clustering [[Visualization]].\n\nHeatMapGenerationR
A heatmap is basically a false color map of your data matrix (an example might look like this):\n[img[RiToJoHeatmap.jpg]]\n\nTo create a data matrix from fields from a data frame (necessary for most math operations):\n<!--{{{-->\ny<-as.matrix(cbind(xx$exon1medScore,xx$intron1medScore,xx$exon2medScore))\n<!--}}}-->\nTo add column names to a matrix (expecially for visualization purposes, labelling a graph for example):\n<!--{{{-->\ncolnames(y)<-c("exon1","intron1","exon2")\n<!--}}}-->\nTo add row names for a matrix:\n<!--{{{-->\nrownames(yy)<-datay$name\n<!--}}}-->\nTo load the heatmap.2 library:\n<!--{{{-->\nlibrary("gplots")\n<!--}}}-->\nTo load the nice looking color libraries:\n<!--{{{-->\nlibrary("RColorBrewer")\n<!--}}}-->\nTo generate a heatmap using the color library:\n<!--{{{-->\nsupercolor=brewer.pal(7,BrBG)\nhv<-heatmap.2(yy,col=supercolor,dendrogram="row",margin=c(10,10),Rowv=FALSE,trace="none",sepcolor="white",sepwidth=c(1,1),cexRow=0.5,cexCol=0.5)\n<!--}}}-->\nIf you don't want to cluster in Columns, then set the following in HeatMap:\n{{{\n> hv<-heatmap(x,Colv=FALSE)\n> hv<-heatmap.2(x,Colv=NA)\n}}}\nTo change the size of the axis label text,\n{{{\n> hv<-heatmap(xxx,col=mycol,Colv=FALSE,cexRow=0.2,cexCol=0.9,margin=c(8,8),main="TitleText")\n}}}
HeatMaps are false color images - useful for microarray clustering [[Visualization]].\n\nHeatMapGenerationR
A histogram is a graph that is often referred to as the โ€œbar graph.โ€ The histogram is best\nwhen used with discrete or categorical data. Continuous data must first be placed into bin ranges\nwith counts before it can be plotted on a graph. The advantages of a histogram include the ease\nof interpretation and visualization of the data when compared to counts.
TabDelimitedFiles\n\nTo get data into R-project:\n<!--{{{-->\nx<-read.table("upf14R.txt",header=TRUE,sep="\st")\n<!--}}}-->\nTo get the column headings for a data.frame (created by default when importing data with header=TRUE):\n<!--{{{-->\nnames(x)\n<!--}}}-->\nTo see the first part of a large dataset:\n<!--{{{-->\nhead(x)\n<!--}}}-->\nTo get a subset of a large dataset by a value or text field:\n<!--{{{-->\ndatay<-subset(datax,datax$anno=="Ribosome/Translation")\n<!--}}}-->\nTo get all values for a particular column:\n<!--{{{-->\nlevels(x$anno)\n<!--}}}-->\nTo create a data matrix from fields from a data frame (necessary for most math operations):\n<!--{{{-->\ny<-as.matrix(cbind(xx$exon1medScore,xx$intron1medScore,xx$exon2medScore))\n<!--}}}-->
FastaImportPerl
Here's how to import a Fasta file into perl using OOP:\n\n{{{\npackage readFasta;\n\nuse strict;\nuse warnings;\n\n# the use of -w (for warnings) and strict is \n# highly encouraged! It will make your programs\n# easier to understand and debug\n\n\n#//////////////////////////////////////////////////////////////////////#\n# #\n# geneFinder_subroutines.pm #\n# Michael Janis, UCLA Bioinformatics #\n# Aug. 31, 2005 #\n# Rev 1 - no dependencies #\n# Data Sources: http://www.chem.ucla.edu/~mjanis/biohackers2005.html #\n# #\n# #\n# A (very) simplified example class for fasta file reading #\n# and resultant gene finding, based upon codon bias, start and stop #\n# codons using log odd scores from model likelihoods. #\n# #\n# #\n#//////////////////////////////////////////////////////////////////////#\n\n\n\n# YOUR ASSIGNMENT IS :\n\n# 1. MAKE COMMENTS THROUGHOUT THE CODE (LIKE I DID\n# FOR THE PREVIOUS LECTURE'S CODE EXAMPLE)\n# FOR *EVERY* LINE (EXCEPT THE LINES FOR THE \n# %geneticCode HASH) - EXPLAINING WHAT EACH LINE\n# IS DOING.\n\n# 2. THIS CLASS ONLY READS *ONE* KEY-VALUE PAIR\n# (ONE ATTRIBUTE SET) FROM A GIVEN FASTA FILE.\n# MODIFY THIS FILE TO ITERATE THROUGH ALL \n# POSSIBLE ENTRIES IN A FASTA FILE. \n\n\n\n###################################################\n# #\n# Some useful data (in the form of mappings) : #\n# #\n###################################################\n# this is straight out of your reading:\n# a simple hash to map codons to their \n# corresponding amino acids\n# note that this will be globally available to \n# all methods within this class:\n\nmy %geneticCode = (\n 'TCA'=>'S', # Serine\n 'TCC'=>'S',\n 'TCG'=>'S',\n 'TCT'=>'S',\n\n 'TTC'=>'F', # Phenylalanine\n 'TTT'=>'F',\n\n 'TTA'=>'L', # Leucine\n 'TTG'=>'L',\n\n 'TAC'=>'Y', # Tyrosine\n 'TAT'=>'Y',\n\n 'TAA'=>'-', # STOP CODON\n 'TAG'=>'-', # STOP CODON\n 'TGA'=>'-', # STOP CODON\n\n 'TGC'=>'C', # Cysteine\n 'TGT'=>'C',\n\n 'TGG'=>'W', # Tryptophan\n\n 'CTA'=>'L', # Leucine\n 'CTC'=>'L',\n 'CTG'=>'L',\n 'CTT'=>'L',\n\n 'CCA'=>'P', # Proline\n 'CCC'=>'P',\n 'CCG'=>'P',\n 'CCT'=>'P',\n\n 'CAC'=>'H', # Histidine\n 'CAT'=>'H',\n\n 'CAA'=>'Q', # Glutamine\n 'CAG'=>'Q',\n\n 'CGA'=>'R', # Arginine\n 'CGC'=>'R',\n 'CGG'=>'R',\n 'CGT'=>'R',\n\n 'ATA'=>'I', # Isoleucine\n 'ATC'=>'I',\n 'ATT'=>'I',\n \n 'ATG'=>'M', # Methionine (START CODON)\n\n 'ACA'=>'T', # Threonine\n 'ACC'=>'T',\n 'ACG'=>'T',\n 'ACT'=>'T',\n \n 'AAC'=>'N', # Asparagine\n 'AAT'=>'N',\n \n 'AAA'=>'K', # Lysine\n 'AAG'=>'K',\n\n 'AGC'=>'S', # Serine\n 'AGT'=>'S',\n\n 'AGA'=>'R', # Argenine\n 'AGG'=>'R',\n\n 'GTA'=>'V', # Valine\n 'GTC'=>'V',\n 'GTG'=>'V',\n 'GTT'=>'V',\n\n 'GCA'=>'A', # Alanine\n 'GCC'=>'A',\n 'GCG'=>'A',\n 'GCT'=>'A',\n\n 'GAC'=>'D', # Aspartic Acid\n 'GAT'=>'D',\n\n 'GAA'=>'E', # Glutamic Acid\n 'GAG'=>'E',\n \n 'GGA'=>'G', # Glycine\n 'GGC'=>'G',\n 'GGG'=>'G',\n 'GGT'=>'G',\n );\n\n#########################\n# Class data and methods#\n#########################\n{\n\n my %_attributes=(\n _filename => 'emptyForNow',\n _filedata => 'emptyForNow',\n _header => 'emptyForNow',\n _sequence => 'emptyForNow',\n );\n my $_count=0;\n my $seqChain={};\n sub _all_attributes {\n keys %_attributes;\n }\n}\n\n########################\n# Class methods follow #\n########################\n\n\n### the constructor for the class ###\nsub new {\n my ($class,%arg)=@_;\n# return bless { \n# _filename => $arg{'file'} || die ("no file"),\n# },$class;\n my $self=bless { }, $class;\n return $self;\n}\n\n##########################################\n### the parser (without an iterator!!! ###\n### (you must write the iterator) ###\n##########################################\nsub read {\n my ($self,%arg)=@_;\n my $head;\n my $seq;\n\n foreach my $attribute($self->_all_attributes()) {\n my($argument)=($attribute=~/^_(.*)/);\n if (exists $arg{$argument}) {\n $self->{$attribute}=$arg{$argument};\n }\n }\n\n unless(open(FILE,$self->{_filename})) {\n die("Cannot open file ");\n }\n $self->{'_filedata'}=[<FILE>];\n close(FILE);\n# print @{$self->{'_filedata'} };\n for (@{$self->{'_filedata'} }) {\n chomp;\n if (/^>/) {\n $head=$_;\n $head=~s/>//;\n $seq='';\n }\n else {\n $seq .=$_;\n }\n }\n $self->{_header}=$head;\n $self->{_sequence}=$seq;\n\n}\n\n######################################\n#### accessor methods for the data ###\n######################################\nsub get_name { $_[0]->{_header} }\nsub get_seq { $_[0]->{_sequence} }\n\n#####################################\n### reverse complement a sequence ###\n#####################################\nsub revCom {\n my $dna=$_[0]->{_sequence};\n my $rdna=reverse($dna);\n $rdna=~tr/ACGT/TGCA/;\n return $rdna;\n}\n\n#########################################\n### translate sequence to amino acids ###\n#########################################\nsub translate {\n my $dna=$_[0]->{_sequence};\n my $proteinChain="";\n while ($dna=~s/(...)//) {\n $proteinChain .= $geneticCode{$1};\n }\n return $proteinChain;\n}\n\n### NOTE: ###\n# You ALWAYS have to end a module with 1 as the module\n# is evaluated when used in a program. Evauation to 0 means\n# that the module is not loaded correctly.\n\n1;\n}}}\n\nHere's how to use this class:\n\n#!/usr/bin/perl\n\nuse strict;\nuse warnings;\nuse lib"/home/mako/22";\n\nuse readFasta;\n\nmy $obj=readFasta->new();\n\n$obj->read(filename=>'chrT.fsa');\nprint "This is the header from the class:\sn";\nprint $obj->get_name;\nprint "\snThis is the sequence from the class:\sn";\nmy $sss=$obj->get_seq;\nprint "$sss\snThis is the reverse complement of the sequence from the class:\sn";\nprint $obj->revCom;\nprint "\snThis is the amino acid translation from the class:\sn";\nprint $obj->translate;\nprint "\sn";\n\n}}}
Hold down the Alt key (or the option key in Macs) when making a verticalSelection in text editors such as [[Word]]. In Vim you can use the Ctrl-v combination and then HJKL (or arrow) keys to adjust your selection.\n
IterationsXL
You can very easily iterate operations (calculations) in XL as part of StochasticOptimizationXL. From Excel help pages:\n\nAllow or correct a circular reference\nWhen a formula refers back to its own cell, either directly or indirectly, it is called a circular reference. \nMicrosoft Excel cannot automatically calculate all open workbooks when one of them contains a circular reference. \nYou can remove a circular reference, or you can have Excel calculate each cell involved in the circular reference once by using \nthe results of the previous iteration (iteration: Repeated calculation of a worksheet until a specific numeric condition is met.). \nUnless you change the default settings for iteration, \nExcel stops calculating after 100 iterations or after all values in the circular reference change by less than 0.001 between iterations, whichever comes first.\n\nLocate and remove a circular reference\n{{{\nIf the Circular Reference toolbar is not displayed, click Customize on the Tools menu, \nclick the Toolbars tab, and then select the Circular Reference check box. \nOn the Circular Reference toolbar, click the first cell in the Navigate Circular Reference box. \nReview the formula in the cell. If you cannot determine whether the cell is the cause of the circular reference, \nclick the next cell in the Navigate Circular Reference box. \nNote The status bar displays the word "Circular," followed by a reference to one of the cells contained in the circular reference. \nIf the word "Circular" appears without a cell reference, the active worksheet does not contain the circular reference.\n\nContinue to review and correct the circular reference until the status bar no longer displays the word "Circular." \nTips\n\nWhen the Circular Reference toolbar appears, tracer arrows appear that point out the cells that depend on the formula.\n}}}\nYou can move between cells in a circular reference by double-clicking the tracer arrows.\nMake a circular reference work by changing the number of times Microsoft Excel iterates formulas\n{{{\nOn the Tools menu, click Options, and then click the Calculation tab. \nSelect the Iteration check box. \nTo set the maximum number of times Microsoft Excel will recalculate, type the number of iterations in the Maximum iterations box. \nThe higher the number of iterations, the more time Excel needs to calculate a worksheet. \nTo set the maximum amount of change you will accept between calculation results, type the amount in the Maximum change box. \nThe smaller the number, the more accurate the result and the more time Excel needs to calculate a worksheet. \n}}}
\n\nSequenceBias
<<calendar 'thismonth'>>\n[[Provisioning]]\n[[SystemAdministration]]\nRemoteAccess\nDataImport\nDataTypes\nDataStructures\nSetTheory\n[[Permutations]]\n[[Annotation]]\n[[Iterations]]\n[[Optimization]]\n[[Visualization]]\nStatisticalInference\nGettingStarted
MatrixDefinitionR\nMatrixOperationR\n\nMatrixDefinitionPerl\nMatrixOperationPerl
There are good online references: [[Gene Heatmap Creation|http://www2.warwick.ac.uk/fac/sci/moac/currentstudents/peter_cock/r/heatmap/]] and [[zen|http://www.bioinformaticszen.com/]]\n\nHere is how to replace values in a matrix:\n\n 1. if col5 < 100 replace col5 & col6 & col7 & col8 by 0: \n<!--{{{-->\n X[X[,5] < 1000, 5:8] <- 0\n<!--}}}-->\n2) if col5 < 100 replace col5 by 0, if col6 < 100 replace col6 by 0, ...:\n<!--{{{-->\nfor(i in 5:8)\n X[X[,i] < 1000, i] <- 0 \n<!--}}}-->\n\nHere is how to replace zeros with NaN, often helpful:\n<!--{{{-->\nyy[yy[,1]==0,1]<-NaN\n<!--}}}-->\n\nTo get the column headings for a data.frame (created by default when importing data with header=TRUE):\n<!--{{{-->\nnames(x)\n<!--}}}-->\nTo see the first part of a large dataset:\n<!--{{{-->\nheat(x)\n<!--}}}-->\nTo get a subset of a large dataset by a value or text field:\n<!--{{{-->\ndatay<-subset(datax,datax$anno=="Ribosome/Translation")\n<!--}}}-->\nTo get all values for a particular column:\n<!--{{{-->\nlevels(x$anno)\n<!--}}}-->\nTo create a data matrix from fields from a data frame (necessary for most math operations):\n<!--{{{-->\ny<-as.matrix(cbind(xx$exon1medScore,xx$intron1medScore,xx$exon2medScore))\n<!--}}}-->\nTo add column names to a matrix (expecially for visualization purposes, labelling a graph for example):\n<!--{{{-->\ncolnames(y)<-c("exon1","intron1","exon2")\n<!--}}}-->\nTo add row names for a matrix:\n<!--{{{-->\nrownames(yy)<-datay$name\n<!--}}}-->\n\n\n\n\n\n\n\n
The mean, also known as the arithmetic average, is created by adding together all\nindividual samples and dividing by the number of samples.
The mean ratio is a helpful statistic. Some advantages of using the mean ratio include the\nease in understanding the concept, the value of every ratio is considered, and further statistical\napplications can be used that are based around the value of the mean.\n\nFor the mean ratio from the data provided, one would add all of the ratio\nvalues together and divide by the number of samples.
The median, , ~x is the middle observation when the values of the data are arrayed (listed\nfrom smallest to largest or largest to smallest).\n\nIf the number of observations is odd, the middle observation of the arrayed data is\nthe median. When the number of observations is even, the average of the two middle-most\nordered observations is the median.
The median ratio is an ordered statistic that concerns itself only with the middlemost\nvalue(s). It is determined by listing the ratios in order and finding the one in the middle.
The mode of a numerical data set is the value or values that occur most frequently. A\nsample can have more than one mode.\n* Unimodal โ€“ One mode\n* Bimodal โ€“ Two modes\n* Multimodal โ€“ Two or more modes
[img[RiToJomultinet.gif]]
Optical Carrier level 3 - Concatenated (single channel for 155.52 Mbps leased line)
ImportFastaPerlOOP
OOPPerl
ObjectOrientedProgramming
Often times you will need to optimize scoring methods or parameters.\n\nStochasticOptimization\n\nParameterEstimation
Often used in economics (such as the housing market), the PRD, or Price Related Differential (PRD) is found by dividing the mean by the weighted\nmean. The statistic has a slight bias upward. Price related differentials above 1.03 tend to\nindicate assessment regressivity (an appraisal bias such that high-value properties are appraised\nlower than low-valued properties); PRDโ€™s less than 0.98 tend to indicate assessment\nprogressivity (an appraisal bias such that high-valued properties are appraised higher than low valued\nproperties).
[img[RiToJoPacketSwitchedNet.gif]]
PermutationsPrimer\n\nPermutationsNucleotidePerl
* Permutations\n\nConsider Groups of Ordered arrangements of things\nHow many 3 letter permutations of the letters a, b, & c are there?\n{{{\nabc, acb, bac, bca, cba, cab\n}}}\n(6 total)\n\nTo arrive at this number, we can use Basic Principle of Counting:\n{{{\n3*2*1 = 6\n}}}\n\nThe general formula for\nn = total number of things\nk = size of the groups your taking\n(such that k<=n)\nis given by:\n{{{\nn! / (n-k)!\nso that:\n3!/(3-3)! = 6\n}}}\n\nWhat if some of the things are identical?\nHow many permutations of the letters a, a, b, c, c & c are there?\n{{{\nn! / n1! n2! ... nr!\nWhere n1, n2, โ€ฆ nr are\nthe number of objects\nthat are alike\nfor a,a,b,c,c,c this gives:\n6! / (3!2!) = 60\n}}}\n\n\n* Combinations\n\nConsider Groups of things (Order doesnโ€™t matter)\nHow many 3 letter combinations of the letters a, b, & c are there? 1: abc\nHow many 2 letter combinations of the letters a, b, & c are there? 3: ab, ac, bc\n{{{\nab = ba; ac = ca; bc = cb *Order doesnโ€™t matter\n}}}\nThe general formula for\nn = total number of things\nk = size of the groups your taking\n(such that k<=n)\nis given by "n choose k":\n{{{\nChoose(n,k)=n! / k! (n-k)!\n}}}\n\n
/***\n|Name|HoverMenuPlugin|\n|Created by|SaqImtiaz|\n|Location|http://lewcid.googlepages.com/lewcid.html#HoverMenuPlugin|\n|Version|1.11|\n|Requires|~TW2.x|\n!Description:\nProvides a hovering menu on the edge of the screen for commonly used commands, that scrolls with the page.\n\n!Demo:\nObserve the hovering menu on the right edge of the screen.\n\n!Installation:\nCopy the contents of this tiddler to your TW, tag with systemConfig, save and reload your TW.\nTo customize your HoverMenu, edit the HoverMenu shadow tiddler.\n\nTo customize whether the menu sticks to the right or left edge of the screen, and its start position, edit the HoverMenu configuration settings part of the code below. It's well documented, so don't be scared!\n\nThe menu has an id of hoverMenu, in case you want to style the buttons in it using css.\n\n!Notes:\nSince the default HoverMenu contains buttons for toggling the side bar and jumping to the top of the screen and to open tiddlers, the ToggleSideBarMacro, JumpMacro and the JumpToTopMacro are included in this tiddler, so you dont need to install them separately. Having them installed separately as well could lead to complications.\n\nIf you dont intend to use these three macros at all, feel free to remove those sections of code in this tiddler.\n\n!To Do:\n* rework code to allow multiple hovering menus in different positions, horizontal etc.\n* incorporate code for keyboard shortcuts that correspond to the buttons in the hovermenu\n\n!History:\n*03-08-06, ver 1.11: fixed error with button tooltips\n*27-07-06, ver 1.1 : added JumpMacro to hoverMenu\n*23-07-06\n\n!Code\n***/\n\n/***\nstart HoverMenu plugin code\n***/\n//{{{\nconfig.hoverMenu={};\n//}}}\n\n/***\nHoverMenu configuration settings\n***/\n//{{{\nconfig.hoverMenu.settings={\n align: 'right', //align menu to right or left side of screen, possible values are 'right' and 'left' \n x: 1, // horizontal distance of menu from side of screen, increase to your liking.\n y: 158 //vertical distance of menu from top of screen at start, increase or decrease to your liking\n };\n//}}}\n\n//{{{\n//continue HoverMenu plugin code\nconfig.hoverMenu.handler=function()\n{\n var theMenu = createTiddlyElement(document.getElementById("contentWrapper"), "div","hoverMenu");\n theMenu.setAttribute("refresh","content");\n theMenu.setAttribute("tiddler","HoverMenu");\n var menuContent = store.getTiddlerText("HoverMenu");\n wikify(menuContent,theMenu);\n\n var Xloc = this.settings.x;\n Yloc =this.settings.y;\n var ns = (navigator.appName.indexOf("Netscape") != -1);\n function SetMenu(id)\n {\n var GetElements=document.getElementById?document.getElementById(id):document.all?document.all[id]:document.layers[id];\n if(document.layers)GetElements.style=GetElements;\n GetElements.sP=function(x,y){this.style[config.hoverMenu.settings.align]=x +"px";this.style.top=y +"px";};\n GetElements.x = Xloc;\n GetElements.y = findScrollY();\n GetElements.y += Yloc;\n return GetElements;\n }\n window.LoCate_XY=function()\n {\n var pY = findScrollY();\n ftlObj.y += (pY + Yloc - ftlObj.y)/15;\n ftlObj.sP(ftlObj.x, ftlObj.y);\n setTimeout("LoCate_XY()", 10);\n }\n ftlObj = SetMenu("hoverMenu");\n LoCate_XY();\n};\n\nwindow.old_lewcid_hovermenu_restart = restart;\nrestart = function()\n{\n window.old_lewcid_hovermenu_restart();\n config.hoverMenu.handler();\n};\n\nsetStylesheet(\n"#hoverMenu .button, #hoverMenu .tiddlyLink {border:none; font-weight:bold; background:#18f; color:#FFF; padding:0 5px; float:right; margin-bottom:4px;}\sn"+\n"#hoverMenu .button:hover, #hoverMenu .tiddlyLink:hover {font-weight:bold; border:none; color:#fff; background:#000; padding:0 5px; float:right; margin-bottom:4px;}\sn"+\n"#hoverMenu .button {width:100%; text-align:center}"+\n"#hoverMenu { position:absolute; width:7px;}\sn"+\n"\sn","hoverMenuStyles");\n\n\nconfig.macros.renameButton={};\nconfig.macros.renameButton.handler = function(place,macroName,params,wikifier,paramString,tiddler)\n{\n\n if (place.lastChild.tagName!="BR")\n {\n place.lastChild.firstChild.data = params[0];\n if (params[1]) {place.lastChild.title = params[1];}\n }\n};\n\nconfig.shadowTiddlers["HoverMenu"]="<<top>>\sn<<toggleSideBar>><<renameButton '>' >>\sn<<jump j '' top>>\sn<<saveChanges>><<renameButton s 'Save TiddlyWiki'>>\sn<<newTiddler>><<renameButton n>>\sn";\n//}}}\n//end HoverMenu plugin code\n\n//Start ToggleSideBarMacro code\n//{{{\nconfig.macros.toggleSideBar={};\n\nconfig.macros.toggleSideBar.settings={\n styleHide : "#sidebar { display: none;}\sn"+"#contentWrapper #displayArea { margin-right: 1em;}\sn"+"",\n styleShow : " ",\n arrow1: "ยซ",\n arrow2: "ยป"\n};\n\nconfig.macros.toggleSideBar.handler=function (place,macroName,params,wikifier,paramString,tiddler)\n{\n var tooltip= params[1]||'toggle sidebar';\n var mode = (params[2] && params[2]=="hide")? "hide":"show";\n var arrow = (mode == "hide")? this.settings.arrow1:this.settings.arrow2;\n var label= (params[0]&&params[0]!='.')?params[0]+" "+arrow:arrow;\n var theBtn = createTiddlyButton(place,label,tooltip,this.onToggleSideBar,"button HideSideBarButton");\n if (mode == "hide")\n { \n (document.getElementById("sidebar")).setAttribute("toggle","hide");\n setStylesheet(this.settings.styleHide,"ToggleSideBarStyles");\n }\n};\n\nconfig.macros.toggleSideBar.onToggleSideBar = function(){\n var sidebar = document.getElementById("sidebar");\n var settings = config.macros.toggleSideBar.settings;\n if (sidebar.getAttribute("toggle")=='hide')\n {\n setStylesheet(settings.styleShow,"ToggleSideBarStyles");\n sidebar.setAttribute("toggle","show");\n this.firstChild.data= (this.firstChild.data).replace(settings.arrow1,settings.arrow2);\n }\n else\n { \n setStylesheet(settings.styleHide,"ToggleSideBarStyles");\n sidebar.setAttribute("toggle","hide");\n this.firstChild.data= (this.firstChild.data).replace(settings.arrow2,settings.arrow1);\n }\n\n return false;\n}\n\nsetStylesheet(".HideSideBarButton .button {font-weight:bold; padding: 0 5px;}\sn","ToggleSideBarButtonStyles");\n//}}}\n//end ToggleSideBarMacro code\n\n//start JumpToTopMacro code\n//{{{\nconfig.macros.top={};\nconfig.macros.top.handler=function(place,macroName)\n{\n createTiddlyButton(place,"^","jump to top",this.onclick);\n}\nconfig.macros.top.onclick=function()\n{\n window.scrollTo(0,0);\n};\n\nconfig.commands.top =\n{\n text:" ^ ",\n tooltip:"jump to top"\n};\n\nconfig.commands.top.handler = function(event,src,title)\n{\n window.scrollTo(0,0);\n}\n//}}}\n//end JumpToStartMacro code\n\n//start JumpMacro code\n//{{{\nconfig.macros.jump= {};\nconfig.macros.jump.handler = function (place,macroName,params,wikifier,paramString,tiddler)\n{\n var label = (params[0] && params[0]!=".")? params[0]: 'jump';\n var tooltip = (params[1] && params[1]!=".")? params[1]: 'jump to an open tiddler';\n var top = (params[2] && params[2]=='top') ? true: false; \n\n var btn =createTiddlyButton(place,label,tooltip,this.onclick);\n if (top==true)\n btn.setAttribute("top","true")\n}\n\nconfig.macros.jump.onclick = function(e)\n{\n if (!e) var e = window.event;\n var theTarget = resolveTarget(e);\n var top = theTarget.getAttribute("top");\n var popup = Popup.create(this);\n if(popup)\n {\n if(top=="true")\n {createTiddlyButton(createTiddlyElement(popup,"li"),'Top โ†‘','Top of TW',config.macros.jump.top);\n createTiddlyElement(popup,"hr");}\n \n story.forEachTiddler(function(title,element) {\n createTiddlyLink(createTiddlyElement(popup,"li"),title,true);\n });\n }\n Popup.show(popup,false);\n e.cancelBubble = true;\n if (e.stopPropagation) e.stopPropagation();\n return false;\n}\n\nconfig.macros.jump.top = function()\n{\n window.scrollTo(0,0);\n}\n//}}}\n//end JumpMacro code\n\n//utility functions\n//{{{\nPopup.show = function(unused,slowly)\n{\n var curr = Popup.stack[Popup.stack.length-1];\n var rootLeft = findPosX(curr.root);\n var rootTop = findPosY(curr.root);\n var rootHeight = curr.root.offsetHeight;\n var popupLeft = rootLeft;\n var popupTop = rootTop + rootHeight;\n var popupWidth = curr.popup.offsetWidth;\n var winWidth = findWindowWidth();\n if (isChild(curr.root,'hoverMenu'))\n var x = config.hoverMenu.settings.x;\n else\n var x = 0;\n if(popupLeft + popupWidth+x > winWidth)\n popupLeft = winWidth - popupWidth -x;\n if (isChild(curr.root,'hoverMenu'))\n {curr.popup.style.right = x + "px";}\n else\n curr.popup.style.left = popupLeft + "px";\n curr.popup.style.top = popupTop + "px";\n curr.popup.style.display = "block";\n addClass(curr.root,"highlight");\n if(config.options.chkAnimate)\n anim.startAnimating(new Scroller(curr.popup,slowly));\n else\n window.scrollTo(0,ensureVisible(curr.popup));\n}\n\nwindow.isChild = function(e,parentId) {\n while (e != null) {\n var parent = document.getElementById(parentId);\n if (parent == e) return true;\n e = e.parentNode;\n }\n return false;\n};\n//}}}
/***\n''SearchOptionsPlugin for TiddlyWiki version 2.0''\n^^author: Eric Shulman - ELS Design Studios\nsource: http://www.TiddlyTools.com/#SearchOptionsPlugin\nlicense: [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]^^\n\nThe TiddlyWiki search function normally looks in both tiddler titles and tiddler body content ('text'). However, narrowing the search so that it examines only titles or only text, or expanding the search to include text contained in tiddler tags can be very helpful, especially when searching on common words or phrases. In addition, it is often useful for the search results to show tiddlers with matching titles before tiddlers that contain matching text or tags.\n\n!!!!!Usage\n<<<\nThis plugin adds checkboxes (see below and in AdvancedOptions) to let you selectively configure the TiddlyWiki search function to just examine any combination of tiddler titles, text, or tags. It also provides an option to switch the search results order between 'titles mixed in' (default) and 'titles shown first', as well as an option display the search results as a list of links (in an auto-generated "SearchResults" tiddler), rather than actually displaying all matching tiddlers. You can also enable/disable the "incremental search" (key-by-key searching), so that a search is only initiated when you press the ENTER key or click on the "search:" prompt text.\n<<<\n!!!!!Configuration\n<<<\nIn additional to the checkboxes in AdvancedOptions, a self-contained control panel is included here for your convenience:\n<<option chkSearchTitles>> Search tiddler titles\n<<option chkSearchText>> Search tiddler text\n<<option chkSearchTags>> Search in tiddler tags\n<<option chkSearchTitlesFirst>> Show title matches first\n<<option chkSearchList>> Show list of matching tiddlers\n<<option chkSearchIncremental>> Incremental searching\n<<<\n!!!!!Installation\n<<<\nimport (or copy/paste) the following tiddlers into your document:\n''SearchOptionsPlugin'' (tagged with <<tag systemConfig>>)\n^^documentation and javascript for SearchOptionsPlugin handling^^\n\nWhen installed, this plugin automatically adds checkboxes in the AdvancedOptions shadow tiddler so you can enable/disable the extended search behavior. However, if you have customized your AdvancedOptions, you will need to manually add {{{<<option chkSearchTitles>>}}}, {{{<<option chkSearchText>>}}} and {{{<<option chkSearchTitlesFirst>>}}} (with suitable prompt text) to your customized tiddler.\n<<<\n!!!!!Revision History\n<<<\n''2006.02.03 [2.2.1]''\nrewrite timeout clearing code and blank search text handling to match 2.0.4 core release changes. note that core no longer permits "blank=all" searches, so neither does this plugin. To search for all, use "." with text patterns enabled.\n''2006.02.02 [2.2.0]''\nin search.handler(), KeyHandler() function clears 'left over' timeout when search input is < 3 chars. Prevents searching on shorter text when shortened by rapid backspaces (<500msec)\n''2006.02.01 [2.1.9]''\nin Story.prototype.search(), correct inverted logic for using/not using regular expressions when searching\nalso, blank search text now presents "No search text. Continue anyway?" confirm() message box, so search on blank can still be processed if desired by user.\n''2006.02.01 [2.1.8]''\nin doSearch(), added alert/return if search text is blank\n''2006.01.20 [2.1.7]''\nfixed setting of config.macros.search.reportTitle so that Tweaks can override it.\n''2006.01.19 [2.1.6]''\nimproved SearchResults formatting, added a "search again" form to the report (based on a suggestion from MorrisGray)\ndefine results report title using config.macros.search.reportTitle instead of hard-coding the tiddler title\n''2006.01.18 [2.1.5]''\nCreated separate functions for reportSearchResults(text,matches) and discardSearchResults(), so that other developers can create alternative report generators.\n''2006.01.17 [2.1.4]''\nUse regExp.search() instead of regExp.test() to scan for matches. Correctd the problem where only half the matching tiddlers (the odd-numbered ones) were being reported.\n''2006.01.15 [2.1.3]''\nAdded information (date/time, username, search options used) to SearchResults output\n''2006.01.10 [2.1.2]''\nuse displayTiddlers() to render matched tiddlers. This lets you display multiple matching tiddlers, even if SinglePageModePlugin is enabled.\n''2006.01.08 [2.1.1]''\ncorrected invalid variable reference, "txt.value" to "text" in story.search()\n''2006.01.08 [2.1.0]''\nre-write to match new store.search(), store.search.handler() and story.search() functions.\n''2005.12.30 [2.0.0]''\nUpgraded to TW2.0\nwhen rendering SearchResults tiddler, closeTiddler() first to ensure display is refreshed.\n''2005.12.26 [1.4.0]''\nadded option to search for matching text in tiddler tags\n''2005.12.21 [1.3.7]''\nuse \s\s to 'escape' single quotes in tiddler titles when generating "Open all matching tiddlers" link. Also, added access key: "O", to trigger "open all" link.\nBased on a suggestion by UdoBorkowski.\n''2005.12.18 [1.3.6]''\ncall displayMessage() AFTER showing matching tiddlers so message is not cleared too soon\n''2005.12.17 [1.3.5]''\nif no matches found, just display message and delete any existing SearchResults tiddler.\n''2005.12.17 [1.3.4]''\nuse """{{{""" and """}}}""" to 'escape' display text in SearchResults tiddler to ensure that formatting contained in search string is not rendered \nBased on a suggestion by UdoBorkowski.\n''2005.12.14 [1.3.3]''\ntag SearchResults tiddler with 'excludeSearch' so it won't list itself in subsequent searches\nBased on a suggestion by UdoBorkowski.\n''2005.12.14 [1.3.2]''\nadded "open all matching tiddlers..." link to search results output.\nBased on a suggestion by UdoBorkowski.\n''2005.12.10 [1.3.1]''\nadded "discard search results" link to end of search list tiddler output for quick self-removal of 'SearchResults' tiddler.\n''2005.12.01 [1.3.0]''\nadded chkSearchIncremental to enable/disable 'incremental' searching (i.e., search after each keystroke) (default is ENABLED).\nadded handling for Enter key so it can be used to start a search.\nBased on a suggestion by LyallPearce\n''2005.11.25 [1.2.1]''\nrenamed from SearchTitleOrTextPlugin to SearchOptionsPlugin\n''2005.11.25 [1.2.0]''\nadded chkSearchList option\nBased on a suggestion by RodneyGomes\n''2005.10.19 [1.1.0]''\nadded chkSearchTitlesFirst option.\nBased on a suggestion by ChristianHauck\n''2005.10.18 [1.0.0]''\nInitial Release\n<<<\n!!!!!Credits\n<<<\nThis feature was developed by EricShulman from [[ELS Design Studios|http:/www.elsdesign.com]].\nBased on a suggestion by LyallPearce.\n<<<\n!!!!!Code\n***/\n//{{{\nversion.extensions.SearchTitleOrText = {major: 2, minor: 2, revision: 1, date: new Date(2006,2,3)};\n//}}}\n\n//{{{\nif (config.options.chkSearchTitles==undefined) config.options.chkSearchTitles=true;\nif (config.options.chkSearchText==undefined) config.options.chkSearchText=true;\nif (config.options.chkSearchTags==undefined) config.options.chkSearchTags=true;\nif (config.options.chkSearchTitlesFirst==undefined) config.options.chkSearchTitlesFirst=false;\nif (config.options.chkSearchList==undefined) config.options.chkSearchList=false;\nif (config.options.chkSearchIncremental==undefined) config.options.chkSearchIncremental=true;\n\nconfig.shadowTiddlers.AdvancedOptions += "\sn<<option chkSearchTitles>> Search in tiddler titles";\nconfig.shadowTiddlers.AdvancedOptions += "\sn<<option chkSearchText>> Search in tiddler text";\nconfig.shadowTiddlers.AdvancedOptions += "\sn<<option chkSearchTags>> Search in tiddler tags";\nconfig.shadowTiddlers.AdvancedOptions += "\sn<<option chkSearchTitlesFirst>> Search results show title matches first";\nconfig.shadowTiddlers.AdvancedOptions += "\sn<<option chkSearchList>> Search results show list of matching tiddlers";\nconfig.shadowTiddlers.AdvancedOptions += "\sn<<option chkSearchIncremental>> Incremental searching";\n//}}}\n\n//{{{\nif (config.macros.search.reportTitle==undefined)\n config.macros.search.reportTitle="SearchResults";\n//}}}\n\n//{{{\nconfig.macros.search.handler = function(place,macroName,params)\n{\n var lastSearchText = "";\n var searchTimeout = null;\n var doSearch = function(txt)\n {\n if (txt.value.length>0)\n {\n story.search(txt.value,config.options.chkCaseSensitiveSearch,config.options.chkRegExpSearch);\n lastSearchText = txt.value;\n }\n };\n var clickHandler = function(e)\n {\n doSearch(this.nextSibling);\n return false;\n };\n var keyHandler = function(e)\n {\n if (!e) var e = window.event;\n switch(e.keyCode)\n {\n case 13: // ELS: handle enter key\n doSearch(this);\n break;\n case 27:\n this.value = "";\n clearMessage();\n break;\n }\n if (config.options.chkSearchIncremental)\n {\n if(this.value.length > 2)\n {\n if(this.value != lastSearchText)\n {\n if(searchTimeout) clearTimeout(searchTimeout);\n var txt = this;\n searchTimeout = setTimeout(function() {doSearch(txt);},500);\n }\n }\n else\n if(searchTimeout) clearTimeout(searchTimeout);\n }\n };\n var focusHandler = function(e)\n {\n this.select();\n };\n var btn = createTiddlyButton(place,this.label,this.prompt,clickHandler);\n var txt = createTiddlyElement(place,"input",null,null,null);\n if(params[0])\n txt.value = params[0];\n txt.onkeyup = keyHandler;\n txt.onfocus = focusHandler;\n txt.setAttribute("size",this.sizeTextbox);\n txt.setAttribute("accessKey",this.accessKey);\n txt.setAttribute("autocomplete","off");\n if(config.browser.isSafari)\n {\n txt.setAttribute("type","search");\n txt.setAttribute("results","5");\n }\n else\n txt.setAttribute("type","text");\n}\n//}}}\n\n//{{{\nStory.prototype.search = function(text,useCaseSensitive,useRegExp)\n{\n highlightHack = new RegExp(useRegExp ? text : text.escapeRegExp(),useCaseSensitive ? "mg" : "img");\n var matches = store.search(highlightHack,"title","excludeSearch");\n var q = useRegExp ? "/" : "'";\n clearMessage();\n if (!matches.length) {\n if (config.options.chkSearchList) discardSearchResults();\n displayMessage(config.macros.search.failureMsg.format([q+text+q]));\n } else {\n if (config.options.chkSearchList) \n reportSearchResults(text,matches);\n else {\n var titles = []; for(var t=0; t<matches.length; t++) titles.push(matches[t].title);\n this.closeAllTiddlers(); story.displayTiddlers(null,titles);\n displayMessage(config.macros.search.successMsg.format([matches.length, q+text+q]));\n }\n }\n highlightHack = null;\n}\n//}}}\n\n//{{{\nTiddlyWiki.prototype.search = function(searchRegExp,sortField,excludeTag)\n{\n var candidates = this.reverseLookup("tags",excludeTag,false,sortField);\n\n // scan for matching titles\n var title_results = [];\n if (config.options.chkSearchTitles)\n for(var t=0; t<candidates.length; t++)\n if(candidates[t].title.search(searchRegExp)!=-1)\n title_results.push(candidates[t]);\n\n // scan for matching text\n var text_results = [];\n if (config.options.chkSearchText)\n for(var t=0; t<candidates.length; t++)\n if(candidates[t].text.search(searchRegExp)!=-1)\n text_results.push(candidates[t]);\n\n // scan for matching tags\n var tag_results = [];\n if (config.options.chkSearchTags)\n for(var t=0; t<candidates.length; t++)\n if(candidates[t].tags.join(" ").search(searchRegExp)!=-1)\n tag_results.push(candidates[t]);\n\n // merge the results, eliminating redundant matches\n var results = [];\n for(var t=0; t<title_results.length; t++) results.pushUnique(title_results[t]);\n for(var t=0; t<text_results.length; t++) results.pushUnique(text_results[t]);\n for(var t=0; t<tag_results.length; t++) results.pushUnique(tag_results[t]);\n\n // if not 'titles first', re-sort results to so titles, text and tag matches are mixed together\n if(!sortField) sortField = "title";\n var bySortField=function (a,b) {if(a[sortField] == b[sortField]) return(0); else return (a[sortField] < b[sortField]) ? -1 : +1; }\n if (!config.options.chkSearchTitlesFirst) results.sort(bySortField);\n return results;\n}\n//}}}\n\n// // ''REPORT GENERATOR''\n//{{{\nif (!window.reportSearchResults) window.reportSearchResults=function(text,matches)\n{\n var title=config.macros.search.reportTitle\n var q = config.options.chkRegExpSearch ? "/" : "'";\n var body="";\n\n // summary: nn tiddlers found matching '...', options used\n body+="''"+config.macros.search.successMsg.format([matches.length,q+"{{{"+text+"}}}"+q])+"''\sn";\n body+="^^//searched in:// ";\n body+=(config.options.chkSearchTitles?"''titles'' ":"");\n body+=(config.options.chkSearchText?"''text'' ":"");\n body+=(config.options.chkSearchTags?"''tags'' ":"");\n if (config.options.chkCaseSensitiveSearch||config.options.chkRegExpSearch) {\n body+=" //with options:// ";\n body+=(config.options.chkCaseSensitiveSearch?"''case sensitive'' ":"");\n body+=(config.options.chkRegExpSearch?"''text patterns'' ":"");\n }\n body+="^^";\n\n // numbered list of links to matching tiddlers\n body+="\sn<<<";\n for(var t=0;t<matches.length;t++) body+="\sn# [["+matches[t].title+"]]";\n body+="\sn<<<\sn";\n\n // open all matches button\n body+="<html><input type=\s"button\s" href=\s"javascript:;\s" ";\n body+="onclick=\s"story.displayTiddlers(null,["\n for(var t=0;t<matches.length;t++)\n body+="'"+matches[t].title.replace(/\s'/mg,"\s\s'")+"'"+((t<matches.length-1)?", ":"");\n body+="],1);\s" ";\n body+="accesskey=\s"O\s" ";\n body+="value=\s"open all matching tiddlers\s"></html> ";\n\n // discard search results button\n body+="<html><input type=\s"button\s" href=\s"javascript:;\s" ";\n body+="onclick=\s"story.closeTiddler('"+title+"'); store.deleteTiddler('"+title+"');\s" ";\n body+="value=\s"discard "+title+"\s"></html>";\n\n // search again\n body+="\sn\sn----\sn";\n body+="<<search \s""+text+"\s">> ";\n body+="<<option chkSearchTitles>>titles ";\n body+="<<option chkSearchText>>text ";\n body+="<<option chkSearchTags>>tags";\n body+="<<option chkCaseSensitiveSearch>>case-sensitive ";\n body+="<<option chkRegExpSearch>>text patterns";\n\n // create/update the tiddler\n var tiddler=store.getTiddler(title); if (!tiddler) tiddler=new Tiddler();\n tiddler.set(title,body,config.options.txtUserName,(new Date()),"excludeLists excludeSearch");\n store.addTiddler(tiddler); story.closeTiddler(title);\n\n // use alternate "search again" label in <<search>> macro\n var oldprompt=config.macros.search.label;\n config.macros.search.label="search again";\n\n // render tiddler\n story.displayTiddler(null,title,1); // force refresh\n\n // restore standard search label\n config.macros.search.label=oldprompt;\n\n}\n\nif (!window.discardSearchResults) window.discardSearchResults=function()\n{\n // remove the tiddler\n story.closeTiddler(config.macros.search.reportTitle);\n store.deleteTiddler(config.macros.search.reportTitle);\n}\n//}}}\n\n\n
After closely followed the [[Instructions for Installation|http://search.cpan.org/dist/DBD-mysql/lib/DBD/mysql/INSTALL.pod#Windows%2FCygWin]] CygwinInstallMySQL-DBD via cygwin. During the build MySQL clients under Cygwin process I had to use make โ€“j1 in order to avoid fork errors (this is a dual core system, see below).\n\nThe output of build DBD::mysql:\n{{{\nuser@compName ~/mysqlsource/DBD-mysql-4.001\n$ cp /usr/local/mysql/bin/mysql_config . \n$ perl Makefile.PL --testhost=127.0.0.1 --testuser=xxxxx --testpassword=xxxxx\nI will use the following settings for compiling and testing:\n\n cflags (mysql_config ) = -I/usr/local/mysql/include/mysql\n embedded (mysql_config ) = \n libs (mysql_config ) = -L/usr/local/mysql/lib/mysql -lmysqlclient -lz -lcrypt -lm\n mysql_config (guessed ) = mysql_config\n nocatchstderr (default ) = 0\n nofoundrows (default ) = 0\n ssl (guessed ) = 0\n testdb (default ) = test\n testhost (User's choice) = 127.0.0.1\n testpassword (User's choice) = xxxxx\n testsocket (default ) = \n testuser (User's choice) = xxxxx\n\nTo change these settings, see 'perl Makefile.PL --help' and\n'perldoc INSTALL'.\n\nUsing DBI 1.53 (for perl 5.008007 on cygwin-thread-multi-64int) installed in /usr/lib/perl5/site_perl/5.8/cygwin/auto/DBI/\nWriting Makefile for DBD::mysql\n}}}\n{{{\n$ make \ngcc -c -I/usr/lib/perl5/site_perl/5.8/cygwin/auto/DBI -I/usr/local/mysql/include/mysql -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -pipe -I/usr/local/include -DUSEIMPORTLIB -O3 -DVERSION=\s"4.001\s" -DXS_VERSION=\s"4.001\s" "-I/usr/lib/perl5/5.8/cygwin/CORE" dbdimp.c\n\nIn file included from dbdimp.c:20:\ndbdimp.h:23:45: mysqld_error.h: No such file or directory\ndbdimp.c: In function `mysql_db_FETCH_attrib':\ndbdimp.c:2319: warning: cast from pointer to integer of different size\ndbdimp.c: In function `mysql_st_prepare':\ndbdimp.c:2531: error: `ER_UNSUPPORTED_PS' undeclared (first use in this function)\ndbdimp.c:2531: error: (Each undeclared identifier is reported only once\ndbdimp.c:2531: error: for each function it appears in.)\ndbdimp.c: In function `mysql_st_FETCH_attrib':\ndbdimp.c:4148: warning: cast from pointer to integer of different size\nmake: *** [dbdimp.o] Error 1\n}}}\n \n\nMy system information is as follows:\n\nArchitecture: Core 2 Duo MacBookPro\nOS: Windows XP SP2 (via BootCamp)\nCygwin uname: CYGWIN_NT-5.1 compName 1.5.24(0.156/4/2) 2007-01-31 10:57 i686 Cygwin\nPerl v.5.8.7 built for cygwin-thread-multi-64int\nDBI 1.53 (for perl 5.008007 on cygwin-thread-mutli-64int)\nPotential conflict: mingw/msys, installed in separate path\nMySQL: Windows binary server version 5.0.27-community-nt\nDBD-mysql: 4.001\n\n{{{\n$ make --version\nGNU Make 3.81\nCopyright (C) 2006 Free Software Foundation, Inc.\nThis is free software; see the source for copying conditions.\nThere is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\nPARTICULAR PURPOSE.\n\nThis program built for i686-pc-cygwin\n}}}\n\n
You need to InstallSoftware or create a DevelopmentEnvironment. Here's how.\n\n[[Windows]]\n[[OSX]]\n[[GNU/Linux]]\n[[BSD]]\n[[Unix]]
There are good online references: [[Gene Heatmap Creation|http://www2.warwick.ac.uk/fac/sci/moac/currentstudents/peter_cock/r/heatmap/]] and [[zen|http://www.bioinformaticszen.com/]]\n\nHere is how to replace values in a matrix:\n\n 1. if col5 < 100 replace col5 & col6 & col7 & col8 by 0: \n<!--{{{-->\n X[X[,5] < 1000, 5:8] <- 0\n<!--}}}-->\n2) if col5 < 100 replace col5 by 0, if col6 < 100 replace col6 by 0, ...:\n<!--{{{-->\nfor(i in 5:8)\n X[X[,i] < 1000, i] <- 0 \n<!--}}}-->\n\nHere is how to replace zeros with NaN, often helpful:\n<!--{{{-->\nyy[yy[,1]==0,1]<-NaN\n<!--}}}-->\n\nHeatmaps are fairly easy in R-project. Here are some commands for munging data and getting a good looking heatmap in R.\nTo get data into R:\n<!--{{{-->\nx<-read.table("upf14R.txt",header=TRUE,sep="\st")\n<!--}}}-->\nTo get the column headings for a data.frame (created by default when importing data with header=TRUE):\n<!--{{{-->\nnames(x)\n<!--}}}-->\nTo see the first part of a large dataset:\n<!--{{{-->\nheat(x)\n<!--}}}-->\nTo get a subset of a large dataset by a value or text field:\n<!--{{{-->\ndatay<-subset(datax,datax$anno=="Ribosome/Translation")\n<!--}}}-->\nTo get all values for a particular column:\n<!--{{{-->\nlevels(x$anno)\n<!--}}}-->\nTo create a data matrix from fields from a data frame (necessary for most math operations):\n<!--{{{-->\ny<-as.matrix(cbind(xx$exon1medScore,xx$intron1medScore,xx$exon2medScore))\n<!--}}}-->\nTo add column names to a matrix (expecially for visualization purposes, labelling a graph for example):\n<!--{{{-->\ncolnames(y)<-c("exon1","intron1","exon2")\n<!--}}}-->\nTo add row names for a matrix:\n<!--{{{-->\nrownames(yy)<-datay$name\n<!--}}}-->\nTo load the heatmap.2 library:\n<!--{{{-->\nlibrary("gplots")\n<!--}}}-->\nTo load the nice looking color libraries:\n<!--{{{-->\nlibrary("RColorBrewer")\n<!--}}}-->\nTo generate a heatmap using the color library:\n<!--{{{-->\nsupercolor=brewer.pal(7,BrBG)\nhv<-heatmap.2(yy,col=supercolor,dendrogram="row",margin=c(10,10),Rowv=FALSE,trace="none",sepcolor="white",sepwidth=c(1,1),cexRow=0.5,cexCol=0.5)\n<!--}}}-->\n\n\n\n\n\n\n
/***\n|''Name:''|ReminderPlugin|\n|''Version:''|2.3.9 (Apr 26, 2007)|\n|''Source:''|http://remindermacros.tiddlyspot.com|\n|''Author:''|Jeremy Sheeley(pop1280 [at] excite [dot] com)<<br>>Maintainer: simon.baird@gmail.com|\n|''Licence:''|[[BSD open source license]]|\n|''Macros:''|reminder, showreminders, displayTiddlersWithReminders, newReminder|\n|''TiddlyWiki:''|2.0+|\n|''Browser:''|Firefox 1.0.4+; InternetExplorer 6.0|\n\n!Description\nThis plugin provides macros for tagging a date with a reminder. Use the {{{reminder}}} macro to do this. The {{{showReminders}}} and {{{displayTiddlersWithReminder}}} macros automatically search through all available tiddlers looking for upcoming reminders.\n\n!Installation\n* Create a new tiddler in your tiddlywiki titled ReminderPlugin and give it the {{{systemConfig}}} tag. The tag is important because it tells TW that this is executable code.\n* Double click this tiddler, and copy all the text from the tiddler's body.\n* Paste the text into the body of the new tiddler in your TW.\n* Save and reload your TW.\n* You can copy some examples into your TW as well. See [[Simple examples]], [[Holidays]], [[showReminders]] and [[Personal Reminders]]\n\n!Syntax:\n|>|See [[ReminderSyntax]] and [[showRemindersSyntax]]|\n\n!Revision history\n* v2.3.9 (Apr 26, 2007)\n** allow bracketed list format in tags param lets you use tags with spaces\n* v2.3.8 (Mar 9, 2006)\n**Bug fix: A global variable had snuck in, which was killing FF 1.5.0.1\n**Feature: You can now use TIDDLER and TIDDLERNAME in a regular reminder format\n* v2.3.6 (Mar 1, 2006)\n**Bug fix: Reminders for today weren't being matched sometimes.\n**Feature: Solidified integration with DatePlugin and CalendarPlugin\n**Feature: Recurring reminders will now return multiple hits in showReminders and the calendar.\n**Feature: Added TIDDLERNAME to the replacements for showReminders format, for plugins that need the title without brackets.\n* v2.3.5 (Feb 8, 2006)\n**Bug fix: Sped up reminders lots. Added a caching mechanism for reminders that have already been matched.\n* v2.3.4 (Feb 7, 2006)\n**Bug fix: Cleaned up code to hopefully prevent the Firefox 1.5.0.1 crash that was causing lots of plugins \nto crash Firefox. Thanks to http://www.jslint.com\n* v2.3.3 (Feb 2, 2006)\n**Feature: newReminder now has drop down lists instead of text boxes.\n**Bug fix: A trailing space in a title would trigger an infinite loop.\n**Bug fix: using tag:"birthday !reminder" would filter differently than tag:"!reminder birthday"\n* v2.3.2 (Jan 21, 2006)\n**Feature: newReminder macro, which will let you easily add a reminder to a tiddler. Thanks to Eric Shulman (http://www.elsdesign.com) for the code to do this.\n** Bug fix: offsetday was not working sometimes\n** Bug fix: when upgrading to 2.0, I included a bit to exclude tiddlers tagged with excludeSearch. I've reverted back to searching through all tiddlers\n* v2.3.1 (Jan 7, 2006)\n**Feature: 2.0 compatibility\n**Feature AlanH sent some code to make sure that showReminders prints a message if no reminders are found.\n* v2.3.0 (Jan 3, 2006)\n** Bug Fix: Using "Last Sunday (-0)" as a offsetdayofweek wasn't working.\n** Bug Fix: Daylight Savings time broke offset based reminders (for example year:2005 month:8 day:23 recurdays:7 would match Monday instead of Tuesday during DST.\n\n!Code\n***/\n//{{{\n\n//============================================================================\n//============================================================================\n// ReminderPlugin\n//============================================================================\n//============================================================================\n\nversion.extensions.ReminderPlugin = {major: 2, minor: 3, revision: 8, date: new Date(2006,3,9), source: "http://remindermacros.tiddlyspot.com/"};\n\n//============================================================================\n// Configuration\n// Modify this section to change the defaults for \n// leadtime and display strings\n//============================================================================\n\nconfig.macros.reminders = {};\nconfig.macros["reminder"] = {};\nconfig.macros["newReminder"] = {};\nconfig.macros["showReminders"] = {};\nconfig.macros["displayTiddlersWithReminders"] = {};\n\nconfig.macros.reminders["defaultLeadTime"] = [0,6000];\nconfig.macros.reminders["defaultReminderMessage"] = "DIFF: TITLE on DATE ANNIVERSARY";\nconfig.macros.reminders["defaultShowReminderMessage"] = "DIFF: TITLE on DATE ANNIVERSARY -- TIDDLER";\nconfig.macros.reminders["defaultAnniversaryMessage"] = "(DIFF)";\nconfig.macros.reminders["untitledReminder"] = "Untitled Reminder";\nconfig.macros.reminders["noReminderFound"] = "Couldn't find a match for TITLE in the next LEADTIMEUPPER days."\nconfig.macros.reminders["todayString"] = "Today";\nconfig.macros.reminders["tomorrowString"] = "Tomorrow";\nconfig.macros.reminders["ndaysString"] = "DIFF days";\nconfig.macros.reminders["emtpyShowRemindersString"] = "There are no upcoming events";\n\n\n//============================================================================\n// Code\n// You should not need to edit anything \n// below this. Make sure to edit this tiddler and copy \n// the code from the text box, to make sure that \n// tiddler rendering doesn't interfere with the copy \n// and paste.\n//============================================================================\n\n// This line is to preserve 1.2 compatibility\n if (!story) var story=window; \n//this object will hold the cache of reminders, so that we don't\n//recompute the same reminder over again.\nvar reminderCache = {};\n\nconfig.macros.showReminders.handler = function showReminders(place,macroName,params)\n{\n var now = new Date().getMidnight();\n var paramHash = {};\n var leadtime = [0,14];\n paramHash = getParamsForReminder(params);\n var bProvidedDate = (paramHash["year"] != null) || \n (paramHash["month"] != null) || \n (paramHash["day"] != null) || \n (paramHash["dayofweek"] != null);\n if (paramHash["leadtime"] != null)\n {\n leadtime = paramHash["leadtime"];\n if (bProvidedDate)\n {\n //If they've entered a day, we need to make \n //sure to find it. We'll reset the \n //leadtime a few lines down.\n paramHash["leadtime"] = [-10000, 10000];\n }\n }\n var matchedDate = now;\n if (bProvidedDate)\n {\n var leadTimeLowerBound = new Date().getMidnight().addDays(paramHash["leadtime"][0]);\n var leadTimeUpperBound = new Date().getMidnight().addDays(paramHash["leadtime"][1]);\n matchedDate = findDateForReminder(paramHash, new Date().getMidnight(), leadTimeLowerBound, leadTimeUpperBound); \n }\n\n var arr = findTiddlersWithReminders(matchedDate, leadtime, paramHash["tag"], paramHash["limit"]);\n var elem = createTiddlyElement(place,"span",null,null, null);\n var mess = "";\n if (arr.length == 0)\n {\n mess += config.macros.reminders.emtpyShowRemindersString; \n }\n for (var j = 0; j < arr.length; j++)\n {\n if (paramHash["format"] != null)\n {\n arr[j]["params"]["format"] = paramHash["format"];\n }\n else\n {\n arr[j]["params"]["format"] = config.macros.reminders["defaultShowReminderMessage"];\n }\n mess += getReminderMessageForDisplay(arr[j]["diff"], arr[j]["params"], arr[j]["matchedDate"], arr[j]["tiddler"]);\n mess += "\sn";\n }\n wikify(mess, elem, null, null);\n};\n\n\nconfig.macros.displayTiddlersWithReminders.handler = function displayTiddlersWithReminders(place,macroName,params)\n{\n var now = new Date().getMidnight();\n var paramHash = {};\n var leadtime = [0,14];\n paramHash = getParamsForReminder(params);\n var bProvidedDate = (paramHash["year"] != null) || \n (paramHash["month"] != null) || \n (paramHash["day"] != null) || \n (paramHash["dayofweek"] != null);\n if (paramHash["leadtime"] != null)\n {\n leadtime = paramHash["leadtime"];\n if (bProvidedDate)\n {\n //If they've entered a day, we need to make \n //sure to find it. We'll reset the leadtime \n //a few lines down.\n paramHash["leadtime"] = [-10000,10000];\n }\n }\n var matchedDate = now;\n if (bProvidedDate)\n {\n var leadTimeLowerBound = new Date().getMidnight().addDays(paramHash["leadtime"][0]);\n var leadTimeUpperBound = new Date().getMidnight().addDays(paramHash["leadtime"][1]);\n matchedDate = findDateForReminder(paramHash, new Date().getMidnight(), leadTimeLowerBound, leadTimeUpperBound); \n }\n var arr = findTiddlersWithReminders(matchedDate, leadtime, paramHash["tag"], paramHash["limit"]);\n for (var j = 0; j < arr.length; j++)\n {\n displayTiddler(null, arr[j]["tiddler"], 0, null, false, false, false);\n }\n};\n\nconfig.macros.reminder.handler = function reminder(place,macroName,params)\n{\n var dateHash = getParamsForReminder(params);\n if (dateHash["hidden"] != null)\n {\n return;\n }\n var leadTime = dateHash["leadtime"];\n if (leadTime == null)\n {\n leadTime = config.macros.reminders["defaultLeadTime"]; \n }\n var leadTimeLowerBound = new Date().getMidnight().addDays(leadTime[0]);\n var leadTimeUpperBound = new Date().getMidnight().addDays(leadTime[1]);\n var matchedDate = findDateForReminder(dateHash, new Date().getMidnight(), leadTimeLowerBound, leadTimeUpperBound);\n if (!window.story) \n {\n window.story=window; \n }\n if (!store.getTiddler) \n {\n store.getTiddler=function(title) {return this.tiddlers[title];};\n }\n var title = window.story.findContainingTiddler(place).id.substr(7);\n if (matchedDate != null)\n {\n var diff = matchedDate.getDifferenceInDays(new Date().getMidnight());\n var elem = createTiddlyElement(place,"span",null,null, null);\n var mess = getReminderMessageForDisplay(diff, dateHash, matchedDate, title);\n wikify(mess, elem, null, null);\n }\n else\n {\n createTiddlyElement(place,"span",null,null, config.macros.reminders["noReminderFound"].replace("TITLE", dateHash["title"]).replace("LEADTIMEUPPER", leadTime[1]).replace("LEADTIMELOWER", leadTime[0]).replace("TIDDLERNAME", title).replace("TIDDLER", "[[" + title + "]]") );\n }\n};\n\nconfig.macros.newReminder.handler = function newReminder(place,macroName,params)\n{\n var today=new Date().getMidnight();\n var formstring = '<html><form>Year: <select name="year"><option value="">Every year</option>';\n for (var i = 0; i < 5; i++)\n {\n formstring += '<option' + ((i == 0) ? ' selected' : '') + ' value="' + (today.getFullYear() +i) + '">' + (today.getFullYear() + i) + '</option>';\n }\n formstring += '</select>&nbsp;&nbsp;Month:<select name="month"><option value="">Every month</option>';\n for (i = 0; i < 12; i++)\n {\n formstring += '<option' + ((i == today.getMonth()) ? ' selected' : '') + ' value="' + (i+1) + '">' + config.messages.dates.months[i] + '</option>';\n }\n formstring += '</select>&nbsp;&nbsp;Day:<select name="day"><option value="">Every day</option>';\n for (i = 1; i < 32; i++)\n {\n formstring += '<option' + ((i == (today.getDate() )) ? ' selected' : '') + ' value="' + i + '">' + i + '</option>';\n }\n\nformstring += '</select>&nbsp;&nbsp;Reminder Title:<input type="text" size="40" name="title" value="please enter a title" onfocus="this.select();"><input type="button" value="ok" onclick="addReminderToTiddler(this.form)"></form></html>';\n\n var panel = config.macros.slider.createSlider(place,null,"New Reminder","Open a form to add a new reminder to this tiddler");\n wikify(formstring ,panel,null,store.getTiddler(params[1]));\n};\n\n// onclick: process input and insert reminder at 'marker'\nwindow.addReminderToTiddler = function(form) {\n if (!window.story) \n {\n window.story=window; \n }\n if (!store.getTiddler) \n {\n store.getTiddler=function(title) {return this.tiddlers[title];};\n }\n var title = window.story.findContainingTiddler(form).id.substr(7);\n var tiddler=store.getTiddler(title);\n var txt='\sn<<reminder ';\n if (form.year.value != "")\n txt += 'year:'+form.year.value + ' ';\n if (form.month.value != "")\n txt += 'month:'+form.month.value + ' ';\n if (form.day.value != "")\n txt += 'day:'+form.day.value + ' ';\n txt += 'title:"'+form.title.value+'" ';\n txt +='>>';\n tiddler.set(null,tiddler.text + txt);\n window.story.refreshTiddler(title,1,true);\n store.setDirty(true);\n};\n\nfunction hasTag(tiddlerTags, tagFilters)\n{\n //Make sure we respond well to empty tiddlerTaglists or tagFilterlists\n if (tagFilters.length==0 || tiddlerTags.length==0)\n {\n return true;\n }\n\n var bHasTag = false;\n \n /*bNoPos says: "'till now there has been no check using a positive filter"\n Imagine a filterlist consisting of 1 negative filter:\n If the filter isn't matched, we want hasTag to be true.\n Yet bHasTag is still false ('cause only positive filters cause bHasTag to change)\n \n If no positive filters are present bNoPos is true, and no negative filters are matched so we have not returned false\n Thus: hasTag returns true.\n \n If at any time a positive filter is encountered, we want at least one of the tags to match it, so we turn bNoPos to false, which\n means bHasTag must be true for hasTag to return true*/\n var bNoPos=true;\n \nfor (var t3 = 0; t3 < tagFilters.length; t3++)\n {\n for(var t2=0; t2<tiddlerTags.length; t2++)\n {\n if (tagFilters[t3].length > 1 && tagFilters[t3].charAt(0) == '!') \n {\n if (tiddlerTags[t2] == tagFilters[t3].substring(1))\n {\n //If at any time a negative filter is matched, we return false\n return false;\n }\n }\n else \n {\n if (bNoPos)\n {\n //We encountered the first positive filter\n bNoPos=false;\n }\n if (tiddlerTags[t2] == tagFilters[t3])\n {\n //A positive filter is matched. As long as no negative filter is matched, hasTag will return true\n bHasTag=true;\n }\n }\n }\n }\n return (bNoPos || bHasTag);\n};\n\n//This function searches all tiddlers for the reminder //macro. It is intended that other plugins (like //calendar) will use this function to query for \n//upcoming reminders.\n//The arguments to this function filter out reminders //based on when they will fire.\n//\n//ARGUMENTS:\n//baseDate is the date that is used as "now". \n//leadtime is a two element int array, with leadtime[0] \n// as the lower bound and leadtime[1] as the\n// upper bound. A reasonable default is [0,14]\n//tags is a space-separated list of tags to use to filter \n// tiddlers. If a tag name begins with an !, then \n// only tiddlers which do not have that tag will \n// be considered. For example "examples holidays" \n// will search for reminders in any tiddlers that \n// are tagged with examples or holidays and \n// "!examples !holidays" will search for reminders \n// in any tiddlers that are not tagged with \n// examples or holidays. Pass in null to search \n// all tiddlers.\n//limit. If limit is null, individual reminders can \n// override the leadtime specified earlier. \n// Pass in 1 in order to override that behavior.\n\nwindow.findTiddlersWithReminders = function findTiddlersWithReminders(baseDate, leadtime, tags, limit)\n{\n//function(searchRegExp,sortField,excludeTag)\n// var macroPattern = "<<([^>\s\s]+)(?:\s\s*)([^>]*)>>";\n var macroPattern = "<<(reminder)(.*)>>";\n var macroRegExp = new RegExp(macroPattern,"mg");\n var matches = store.search(macroRegExp,"title","");\n var arr = [];\n var tagsArray = null;\n if (tags != null)\n {\n // tagsArray = tags.split(" ");\n tagsArray = tags.readBracketedList(); // allows tags with spaces. thanks Robin Summerhill, 4-Oct-06.\n }\n for(var t=matches.length-1; t>=0; t--)\n {\n if (tagsArray != null)\n {\n //If they specified tags to filter on, and this tiddler doesn't \n //match, skip it entirely.\n if ( ! hasTag(matches[t].tags, tagsArray))\n {\n continue;\n }\n }\n\n var targetText = matches[t].text;\n do {\n // Get the next formatting match\n var formatMatch = macroRegExp.exec(targetText);\n if(formatMatch && formatMatch[1] != null && formatMatch[1].toLowerCase() == "reminder")\n {\n //Find the matching date.\n \n var params = formatMatch[2] != null ? formatMatch[2].readMacroParams() : {};\n var dateHash = getParamsForReminder(params);\n if (limit != null || dateHash["leadtime"] == null)\n {\n if (leadtime == null)\n dateHash["leadtime"] = leadtime;\n else\n {\n dateHash["leadtime"] = [];\n dateHash["leadtime"][0] = leadtime[0];\n dateHash["leadtime"][1] = leadtime[1];\n }\n }\n if (dateHash["leadtime"] == null)\n dateHash["leadtime"] = config.macros.reminders["defaultLeadTime"]; \n var leadTimeLowerBound = baseDate.addDays(dateHash["leadtime"][0]);\n var leadTimeUpperBound = baseDate.addDays(dateHash["leadtime"][1]);\n var matchedDate = findDateForReminder(dateHash, baseDate, leadTimeLowerBound, leadTimeUpperBound);\n while (matchedDate != null)\n {\n var hash = {};\n hash["diff"] = matchedDate.getDifferenceInDays(baseDate);\n hash["matchedDate"] = new Date(matchedDate.getFullYear(), matchedDate.getMonth(), matchedDate.getDate(), 0, 0);\n hash["params"] = cloneParams(dateHash);\n hash["tiddler"] = matches[t].title;\n hash["tags"] = matches[t].tags;\n arr.pushUnique(hash);\n if (dateHash["recurdays"] != null || (dateHash["year"] == null))\n {\n leadTimeLowerBound = leadTimeLowerBound.addDays(matchedDate.getDifferenceInDays(leadTimeLowerBound)+ 1);\n matchedDate = findDateForReminder(dateHash, baseDate, leadTimeLowerBound, leadTimeUpperBound);\n }\n else matchedDate = null;\n }\n }\n }while(formatMatch);\n }\n if(arr.length > 1) //Sort the array by number of days remaining.\n {\n arr.sort(function (a,b) {if(a["diff"] == b["diff"]) {return(0);} else {return (a["diff"] < b["diff"]) ? -1 : +1; } });\n }\n return arr;\n};\n\n//This function takes the reminder macro parameters and\n//generates the string that is used for display.\n//This function is not intended to be called by \n//other plugins.\n window.getReminderMessageForDisplay= function getReminderMessageForDisplay(diff, params, matchedDate, tiddlerTitle)\n{\n var anniversaryString = "";\n var reminderTitle = params["title"];\n if (reminderTitle == null)\n {\n reminderTitle = config.macros.reminders["untitledReminder"];\n }\n if (params["firstyear"] != null)\n {\n anniversaryString = config.macros.reminders["defaultAnniversaryMessage"].replace("DIFF", (matchedDate.getFullYear() - params["firstyear"]));\n }\n var mess = "";\n var diffString = "";\n if (diff == 0)\n {\n diffString = config.macros.reminders["todayString"];\n }\n else if (diff == 1)\n {\n diffString = config.macros.reminders["tomorrowString"];\n }\n else\n {\n diffString = config.macros.reminders["ndaysString"].replace("DIFF", diff);\n }\n var format = config.macros.reminders["defaultReminderMessage"];\n if (params["format"] != null)\n {\n format = params["format"];\n }\n mess = format;\n//HACK! -- Avoid replacing DD in TIDDLER with the date\n mess = mess.replace(/TIDDLER/g, "TIDELER");\n mess = matchedDate.formatStringDateOnly(mess);\n mess = mess.replace(/TIDELER/g, "TIDDLER");\n if (tiddlerTitle != null)\n {\n mess = mess.replace(/TIDDLERNAME/g, tiddlerTitle);\n mess = mess.replace(/TIDDLER/g, "[[" + tiddlerTitle + "]]");\n }\n \n mess = mess.replace("DIFF", diffString).replace("TITLE", reminderTitle).replace("DATE", matchedDate.formatString("DDD MMM DD, YYYY")).replace("ANNIVERSARY", anniversaryString);\n return mess;\n};\n\n// Parse out the macro parameters into a hashtable. This\n// handles the arguments for reminder, showReminders and \n// displayTiddlersWithReminders.\nwindow.getParamsForReminder = function getParamsForReminder(params)\n{\n var dateHash = {};\n var type = "";\n var num = 0;\n var title = "";\n for(var t=0; t<params.length; t++)\n {\n var split = params[t].split(":");\n type = split[0].toLowerCase();\n var value = split[1];\n for (var i=2; i < split.length; i++)\n {\n value += ":" + split[i];\n }\n if (type == "nolinks" || type == "limit" || type == "hidden")\n {\n num = 1;\n }\n else if (type == "leadtime")\n {\n var leads = value.split("...");\n if (leads.length == 1)\n {\n leads[1]= leads[0];\n leads[0] = 0;\n }\n leads[0] = parseInt(leads[0], 10);\n leads[1] = parseInt(leads[1], 10);\n num = leads;\n }\n else if (type == "offsetdayofweek")\n {\n if (value.substr(0,1) == "-")\n {\n dateHash["negativeOffsetDayOfWeek"] = 1;\n value = value.substr(1);\n }\n num = parseInt(value, 10);\n }\n else if (type != "title" && type != "tag" && type != "format")\n {\n num = parseInt(value, 10);\n }\n else\n {\n title = value;\n t++;\n while (title.substr(0,1) == '"' && title.substr(title.length - 1,1) != '"' && params[t] != undefined)\n {\n title += " " + params[t++];\n }\n //Trim off the leading and trailing quotes\n if (title.substr(0,1) == "\s"" && title.substr(title.length - 1,1)== "\s"")\n {\n title = title.substr(1, title.length - 2);\n t--;\n }\n num = title;\n }\n dateHash[type] = num;\n }\n //date is synonymous with day\n if (dateHash["day"] == null)\n {\n dateHash["day"] = dateHash["date"];\n }\n return dateHash;\n};\n\n//This function finds the date specified in the reminder \n//parameters. It will return null if no match can be\n//found. This function is not intended to be used by\n//other plugins.\nwindow.findDateForReminder= function findDateForReminder( dateHash, baseDate, leadTimeLowerBound, leadTimeUpperBound)\n{\n if (baseDate == null)\n {\n baseDate = new Date().getMidnight();\n }\n var hashKey = baseDate.convertToYYYYMMDDHHMM();\n for (var k in dateHash)\n {\n hashKey += "," + k + "|" + dateHash[k];\n }\n hashKey += "," + leadTimeLowerBound.convertToYYYYMMDDHHMM();\n hashKey += "," + leadTimeUpperBound.convertToYYYYMMDDHHMM();\n if (reminderCache[hashKey] == null)\n {\n //If we don't find a match in this run, then we will\n //cache that the reminder can't be matched.\n reminderCache[hashKey] = false;\n }\n else if (reminderCache[hashKey] == false)\n {\n //We've already tried this date and failed\n return null;\n }\n else\n {\n return reminderCache[hashKey];\n }\n \n var bOffsetSpecified = dateHash["offsetyear"] != null || \n dateHash["offsetmonth"] != null || \n dateHash["offsetday"] != null || \n dateHash["offsetdayofweek"] != null || \n dateHash["recurdays"] != null;\n \n // If we are matching the base date for a dayofweek offset, look for the base date a \n //little further back.\n var tmp1leadTimeLowerBound = leadTimeLowerBound; \n if ( dateHash["offsetdayofweek"] != null)\n {\n tmp1leadTimeLowerBound = leadTimeLowerBound.addDays(-6); \n }\n var matchedDate = baseDate.findMatch(dateHash, tmp1leadTimeLowerBound, leadTimeUpperBound);\n if (matchedDate != null)\n {\n var newMatchedDate = matchedDate;\n if (dateHash["recurdays"] != null)\n {\n while (newMatchedDate.getTime() < leadTimeLowerBound.getTime())\n {\n newMatchedDate = newMatchedDate.addDays(dateHash["recurdays"]);\n }\n }\n else if (dateHash["offsetyear"] != null || \n dateHash["offsetmonth"] != null || \n dateHash["offsetday"] != null || \n dateHash["offsetdayofweek"] != null)\n {\n var tmpdateHash = cloneParams(dateHash);\n tmpdateHash["year"] = dateHash["offsetyear"];\n tmpdateHash["month"] = dateHash["offsetmonth"];\n tmpdateHash["day"] = dateHash["offsetday"];\n tmpdateHash["dayofweek"] = dateHash["offsetdayofweek"];\n var tmpleadTimeLowerBound = leadTimeLowerBound;\n var tmpleadTimeUpperBound = leadTimeUpperBound;\n if (tmpdateHash["offsetdayofweek"] != null)\n {\n if (tmpdateHash["negativeOffsetDayOfWeek"] == 1)\n {\n tmpleadTimeLowerBound = matchedDate.addDays(-6);\n tmpleadTimeUpperBound = matchedDate;\n\n }\n else\n {\n tmpleadTimeLowerBound = matchedDate;\n tmpleadTimeUpperBound = matchedDate.addDays(6);\n }\n\n }\n newMatchedDate = matchedDate.findMatch(tmpdateHash, tmpleadTimeLowerBound, tmpleadTimeUpperBound);\n //The offset couldn't be matched. return null.\n if (newMatchedDate == null)\n {\n return null;\n }\n }\n if (newMatchedDate.isBetween(leadTimeLowerBound, leadTimeUpperBound))\n {\n reminderCache[hashKey] = newMatchedDate;\n return newMatchedDate;\n }\n }\n return null;\n};\n\n//This does much the same job as findDateForReminder, but\n//this one doesn't deal with offsets or recurring \n//reminders.\nDate.prototype.findMatch = function findMatch(dateHash, leadTimeLowerBound, leadTimeUpperBound)\n{\n\n var bSpecifiedYear = (dateHash["year"] != null);\n var bSpecifiedMonth = (dateHash["month"] != null);\n var bSpecifiedDay = (dateHash["day"] != null);\n var bSpecifiedDayOfWeek = (dateHash["dayofweek"] != null);\n if (bSpecifiedYear && bSpecifiedMonth && bSpecifiedDay)\n {\n return new Date(dateHash["year"], dateHash["month"]-1, dateHash["day"], 0, 0);\n }\n var bMatchedYear = !bSpecifiedYear;\n var bMatchedMonth = !bSpecifiedMonth;\n var bMatchedDay = !bSpecifiedDay;\n var bMatchedDayOfWeek = !bSpecifiedDayOfWeek;\n if (bSpecifiedDay && bSpecifiedMonth && !bSpecifiedYear && !bSpecifiedDayOfWeek)\n {\n\n //Shortcut -- First try this year. If it's too small, try next year.\n var tmpMidnight = this.getMidnight();\n var tmpDate = new Date(this.getFullYear(), dateHash["month"]-1, dateHash["day"], 0,0);\n if (tmpDate.getTime() < leadTimeLowerBound.getTime())\n {\n tmpDate = new Date((this.getFullYear() + 1), dateHash["month"]-1, dateHash["day"], 0,0);\n }\n if ( tmpDate.isBetween(leadTimeLowerBound, leadTimeUpperBound))\n {\n return tmpDate;\n }\n else\n {\n return null;\n }\n }\n\n var newDate = leadTimeLowerBound; \n while (newDate.isBetween(leadTimeLowerBound, leadTimeUpperBound))\n {\n var tmp = testDate(newDate, dateHash, bSpecifiedYear, bSpecifiedMonth, bSpecifiedDay, bSpecifiedDayOfWeek);\n if (tmp != null)\n return tmp;\n newDate = newDate.addDays(1);\n }\n};\n\nfunction testDate(testMe, dateHash, bSpecifiedYear, bSpecifiedMonth, bSpecifiedDay, bSpecifiedDayOfWeek)\n{\n var bMatchedYear = !bSpecifiedYear;\n var bMatchedMonth = !bSpecifiedMonth;\n var bMatchedDay = !bSpecifiedDay;\n var bMatchedDayOfWeek = !bSpecifiedDayOfWeek;\n if (bSpecifiedYear)\n {\n bMatchedYear = (dateHash["year"] == testMe.getFullYear());\n }\n if (bSpecifiedMonth)\n {\n bMatchedMonth = ((dateHash["month"] - 1) == testMe.getMonth() );\n }\n if (bSpecifiedDay)\n {\n bMatchedDay = (dateHash["day"] == testMe.getDate());\n }\n if (bSpecifiedDayOfWeek)\n {\n bMatchedDayOfWeek = (dateHash["dayofweek"] == testMe.getDay());\n }\n\n if (bMatchedYear && bMatchedMonth && bMatchedDay && bMatchedDayOfWeek)\n {\n return testMe;\n }\n};\n\n//Returns true if the date is in between two given dates\nDate.prototype.isBetween = function isBetween(lowerBound, upperBound)\n{\n return (this.getTime() >= lowerBound.getTime() && this.getTime() <= upperBound.getTime());\n}\n//Return a new date, with the time set to midnight (0000)\nDate.prototype.getMidnight = function getMidnight()\n{\n return new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0);\n};\n// Add the specified number of days to a date.\nDate.prototype.addDays = function addDays(numberOfDays)\n{\n return new Date(this.getFullYear(), this.getMonth(), this.getDate() + numberOfDays, 0, 0);\n};\n//Return the number of days between two dates.\nDate.prototype.getDifferenceInDays = function getDifferenceInDays(otherDate)\n{\n//I have to do it this way, because this way ignores daylight savings\n var tmpDate = this.addDays(0);\n if (this.getTime() > otherDate.getTime())\n {\n var i = 0;\n for (i = 0; tmpDate.getTime() > otherDate.getTime(); i++)\n {\n tmpDate = tmpDate.addDays(-1);\n }\n return i;\n }\n else\n {\n var i = 0;\n for (i = 0; tmpDate.getTime() < otherDate.getTime(); i++)\n {\n tmpDate = tmpDate.addDays(1);\n }\n return i * -1;\n }\n return 0;\n};\nfunction cloneParams(what) {\n var tmp = {};\n for (var i in what) {\n tmp[i] = what[i];\n }\n return tmp;\n}\n// Substitute date components into a string\nDate.prototype.formatStringDateOnly = function formatStringDateOnly(template)\n{\n template = template.replace("YYYY",this.getFullYear());\n template = template.replace("YY",String.zeroPad(this.getFullYear()-2000,2));\n template = template.replace("MMM",config.messages.dates.months[this.getMonth()]);\n template = template.replace("0MM",String.zeroPad(this.getMonth()+1,2));\n template = template.replace("MM",this.getMonth()+1);\n template = template.replace("DDD",config.messages.dates.days[this.getDay()]);\n template = template.replace("0DD",String.zeroPad(this.getDate(),2));\n template = template.replace("DD",this.getDate());\n return template;\n};\n\n//}}}
TransferSpeeds explained with example.
Bioinformatics "Right Tools for the Job".
A scatterplot is a graph that compares two sets of continuous data. It is advantageous as it\ncompares the cluster and spread of the data for the two sampled sets. Trends can be seen that\nshow the relationship between these groups. It can be disadvantageous, however, as categorical\nvariables with discrete data cannot be displayed.
HeatMapGenerationR\n\nHeatMapGenerationJava
''10 tiddlers found matching '{{{heat}}}'''\n^^//searched in:// ''titles'' ''text'' ''tags'' ^^\n<<<\n# [[BlueYellowColorCode]]\n# [[Colors]]\n# [[GeneFindingPerl]]\n# [[HeatMap]]\n# [[HeatMapGenerationR]]\n# [[HeatMaps]]\n# [[MatrixOperationR]]\n# [[R-project]]\n# [[ScoreDistributionVisualization]]\n# [[colorsR]]\n<<<\n<html><input type="button" href="javascript:;" onclick="story.displayTiddlers(null,['BlueYellowColorCode', 'Colors', 'GeneFindingPerl', 'HeatMap', 'HeatMapGenerationR', 'HeatMaps', 'MatrixOperationR', 'R-project', 'ScoreDistributionVisualization', 'colorsR'],1);" accesskey="O" value="open all matching tiddlers"></html> <html><input type="button" href="javascript:;" onclick="story.closeTiddler('SearchResults'); store.deleteTiddler('SearchResults');" value="discard SearchResults"></html>\n\n----\n<<search "heat">> <<option chkSearchTitles>>titles <<option chkSearchText>>text <<option chkSearchTags>>tags<<option chkCaseSensitiveSearch>>case-sensitive <<option chkRegExpSearch>>text patterns
GeneFindingPerl
Sample Space of an experiment is the set of all possible values/outcomes of the experiment\n\nS = {a, b, c, d, e, f, g, h, i, j} S = {Heads, Tails}\nS = {1, 2, 3, 4, 5, 6}\n\nE = {a, b, c, d} F = {b, c, d, e, f, g} \n E S F S\nEc = {e, f, g, h, i, j} Fc = {a, h, i, j}\n\n E [[Union]] F = {a, b, c, d, e, f, g}\n E [[Intersect]] F = EF = {b, c, d}\n\nLogical operations can be accomplished through relational databases (such as MySQL) with SQL queries such as:\n{{{\nselect * from table where condition1 like '%some wildcard condition%'.\n}}}\nOften times you need [[Visualization]] of such operations such as with a VennDiagram such as below:\n\n[img[RiToJoVennDiagram.jpg]]
\n<<search>><<closeAll>><<permaview>><<newTiddler>><<newJournal 'YYYY/0MM/0DD'>><<upload>><<saveChanges>><<slider chkSliderOptionsPanel OptionsPanel 'options ยป' 'Change TiddlyWiki advanced options'>>
RiToJo Project
Statistics is the branch of applied mathematics that concerns itself with the collection of\nquantitative data, testing inferential hypotheses, and estimating population parameters using\nprobability theory.\n\n* Descriptive Statistics\n\nThe statistics used in bioinformatics often begins with a defined\npopulation. A [[Population]] is the set of all entities the study finds of interest. \nA simple random sample ([[SRS]]) is a representative subset of the population. A study is said\nto be [[Random]] if each individual from the [[Population]] has an equal chance of entering the set of\nsample selections. Samples are [[Independent]] if the value or results of one individual does not\naffect another.\n\n[[Data]], the collection of factual information, is drawn from the study of each [[Individual]]\nfrom the [[Sample]]. Both qualitative and quantitative values are used to form StatisticalInferences that justify\n[[Hypotheses]]. An [[Inference]] is the deductive and inductive logical reasoning involved in forming a\nconclusion or premise. A statistic is the arithmetic metric that is derived from an inference to\ndescribe a sample. Statistics are often considered to be estimates that describe the populationโ€™s\ntrue distribution and attributes. Examples of statistics include the sample [[Mean]], x, the MeanRatio, the [[Median]], \nthe MedianRatio, the [[Mode]], the WeightedMean, the WeightedMeanRatio, the [[PRD]], the [[IQR]], the MedianAbsoluteDeviation ([[MAD]]),\nsample [[Variance]], [[s2]], and the CoefficientOfVariation, . A [[Parameter]] is an estimate of the population metrics. Such examples of a\nparameter would be the population mean, ฮผ, and the population variance, ฯƒ2. A census occurs\nwhen the entire population is included in the sample. It should also be known that statistics used\nto describe a sample are denoted with English letters whereas parameters are symbolized with\nthe Greek alphabet.\n\nDescriptive statistics summarize the distribution of the collected data. Knowing such\ninformation permits statisticians the ability to analyze and interpret characteristics that will be\nimportant for the study. Often a DecisionPathway is employed using several statistical determinants.\n\nConfidenceInterval\nCoefficientOfVariation\nCoefficientOfDispersion\n[[MAD]]\n\n* Probability\n[[Likelihood]]\n[[Enrichment]]
StochasticOptimizationXL
Random number generation in XL is very easy:\n{{{\n=rand()\n}}}\n\nnow with this information you can create any number of parameters and optimize accordingly with the IF statement. A nice feature of XL is that the random numbers are automatically recreated (resampled) every time there is a change to a cell in XL. This update of random values is also reflected in any chart created from the data. You can cycle through long lists of random numbers very quickly by pressing and holding F9. If you have a chart open you will see the changes take place on the graphed data. Sometimes this is extremely useful, for example you may wish to judge a scoring function by simulating output using a series of random numbers within your expected range.\n\nFor example, consider the following information:\n\n{{{\nPopulation1 Population1zeroCentered Population2\n=rand() =IF((rand()>0.5),rand(),(-1*(rand()))) =(rand()+1)\n...\n}}}\nYou could set up various scores (like a Z-score) or t-tests with differences in population size, etc. very easily by extending this list (copy/paste), graphing the populations, and pressing F9 (repeat) for any number of simulations. Many times you will need to perform IterationsXL in order to perform Iterations to [[Converge]] in your XL table.
/*{{{*/\n/*Mako TiddlyWiki Theme*/\n/*Version 1.0*/\n/*Design and CSS originally by mako.*/\n/*Added styles for calendar & tagCloud plugins - Michael Janis*/\n/*}}}*/\n/*{{{*/\n\n.tiddler {\n padding-bottom: 40px;\n border-bottom: 1px solid #DDDDDD; \n}\n\n.title {color:#CC6633;}\n\n.shadow .title {color:#948979;}\n\n\n/* the following is the style sheet for the calendar */\n#mainMenu #calendarWrapper {\n margin-top: 3em;\n display: block;\n}\n\n.viewer #calendarWrapper #calendarArea {\n width: 220px;\n}\n\n#calendarWrapper {\n background-color: #4682B4;\n border: none;\n font-size: 8pt;\n cursor: pointer;\n}\n\n#calendarWrapper table {\n width: 100%;\n background-color: #4682B4;\n border: none;\n margin: 0px;\n padding: 0px;\n border-collapse: separate;\n}\n\n#calendarWrapper td, #calendarWrapper td {\n border: none;\n padding: 0px;\n margin: 0px;\n}\n\n#calendarWrapper #calendarTable {\n border: 1px solid #4682b4;\n}\n\n#calendarWrapper #calendarTable .calendarCell {\n display: block;\n width: 100%;\n text-align: inherit;\n}\n\n#calendarWrapper #calendarHeader {\n font-weight: normal;\n width: 100%;\n text-align: center;\n font-size: 8pt;\n color: #ffffff;\n}\n\n#calendarWrapper #calendarHeader .selectYear {\n padding: 1px 2px 1px 2px;\n}\n\n#calendarWrapper #calendarHeader .selectMonth {\n padding: 1px 2px 1px 2px;\n}\n\n#calendarWrapper #calendarHeader .selectToday {\n width: 100%;\n}\n\n#calendarWrapper #calendarTable {\n width: 100%;\n text-align: center;\n color: #000000;\n background-color: #ffffff;\n font-size: 8pt;\n}\n\n#calendarWrapper #calendarTable td {\n width: 14%;\n}\n\n#calendarWrapper #calendarTable .weekNames {\n color: #ffffff;\n background-color: #87cefa;\n}\n\n#calendarWrapper #calendarTable .weekDay {\n background-color: #dbeaf5;\n}\n\n#calendarWrapper #calendarTable .currentDay {\n border: 1px solid #CC6714;\n}\n\n#calendarWrapper #calendarTable .workingDay {\n background-color: #ffffff;\n}\n\n#calendarWrapper #calendarTable .scheduledDay {\n /*background-color: #444444;*/\n /*color: #ffffff;*/\n text-decoration:underline;\n}\n\n#calendarWrapper #calendarTable .otherMonthDay {\n color: #999999;\n}\n/*}}}*/
NetworkProtocols\nCircuitSwitchedNetworks\nPacketSwitchedNetworks\nTransferSpeeds
TiddlyWiki is a free MicroContent WikiWikiWeb created by JeremyRuston and a busy [[Community]] of independent developers. It's written in HTML, CSS and JavaScript to run on any modern browser without needing any ServerSide logic. It allows anyone to create personal SelfContained hypertext documents that can be posted to a WebServer, sent by email or kept on a USB thumb drive to make a WikiOnAStick. Because it doesn't need to be installed and configured it makes a great GuerillaWiki. This is revision <<version>> of TiddlyWiki (see [[recent changes|http://trac.tiddlywiki.org/wiki/History]]), and is published under an OpenSourceLicense.
Consider the following questions:\n* Estimate how many bytes it takes to represent a 5 minute-long movie (uncompressed) running at 30 frames per second (fps) on a megapixel display with 256 colors. \n* How quickly can this digital movie be transferred over a fast modem connection, an Ethernet segment, an ATM network?\nFirst we calculate the size of the file in bytes:\n\n(5 min) (60 sec/min) (30 frames/sec) (106 pixels/frame) (8 bits) = 7 x 10^^10^^ bits or about 10^^10^^ bytes\n\nThen we simply backcalculate given standard network speeds:\n\n(7 x 10^^10^^ bits) / (50 x 10^^3^^ bits/sec) = 10^^6^^ sec or about 300 hours over modem\n(7 x 10^^10^^ bits) / (10 x 10^^6^^ bits/sec) = 7,000 sec or about 2 hours over Ethernet\n(7 x 10^^10^^ bits) / (155 x 10^^6^^ bits/sec) = 500 sec or about 1/6 hours over OC3c ATM connection\n
| !date | !user | !location | !storeUrl | !uploadDir | !toFilename | !backupdir | !origin |\n| 31/5/2007 19:43:51 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 31/5/2007 19:46:12 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 31/5/2007 19:49:20 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 31/5/2007 19:50:29 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | | Ok |\n| 31/5/2007 19:51:16 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 31/5/2007 20:6:19 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 31/5/2007 20:8:56 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 31/5/2007 20:12:13 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 31/5/2007 20:12:24 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 31/5/2007 20:25:30 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 31/5/2007 20:26:28 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 31/5/2007 20:27:4 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 31/5/2007 20:49:2 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 31/5/2007 20:50:54 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 1/6/2007 11:57:7 | mako | [[ritojo|http://subi.chem.ucla.edu/~mako/ritojo]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo | |\n| 1/6/2007 11:59:19 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 1/6/2007 12:3:11 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 1/6/2007 12:3:29 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | | Ok |\n| 1/6/2007 12:4:29 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 1/6/2007 12:5:16 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 1/6/2007 12:7:2 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 1/6/2007 12:8:18 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 1/6/2007 12:9:10 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 1/6/2007 12:11:24 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 1/6/2007 12:30:26 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | | Ok |\n| 1/6/2007 13:38:46 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 1/6/2007 13:45:8 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 1/6/2007 13:46:26 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 1/6/2007 13:50:26 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | | Ok |\n| 1/6/2007 13:53:53 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 1/6/2007 13:54:23 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | | Ok |\n| 1/6/2007 13:57:19 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | | Ok |\n| 1/6/2007 13:58:36 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | | Ok |\n| 1/6/2007 13:59:5 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | | Ok |\n| 1/6/2007 13:59:34 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 1/6/2007 14:3:26 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 1/6/2007 14:4:4 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | | Ok |\n| 1/6/2007 14:5:36 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 1/6/2007 14:6:36 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 1/6/2007 14:17:4 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 1/6/2007 15:27:6 | mako | [[ritojo.html|http://subi.chem.ucla.edu/%7Emako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/%7Emako/store.php]] | | ritojo.html | | Ok |\n| 1/6/2007 15:28:31 | mako | [[ritojo.html|http://subi.chem.ucla.edu/%7Emako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/%7Emako/store.php]] | | ritojo.html | | Ok |\n| 1/6/2007 15:29:3 | mako | [[ritojo.html|http://subi.chem.ucla.edu/%7Emako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/%7Emako/store.php]] | | ritojo.html | | Ok |\n| 1/6/2007 15:40:5 | mako | [[ritojo.html|http://subi.chem.ucla.edu/%7Emako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/%7Emako/store.php]] | | ritojo.html | |\n| 7/6/2007 17:30:16 | YourName | [[ritojo.html|http://subi.chem.ucla.edu/%7Emako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/%7Emako/store.php]] | | ritojo.html | |\n| 7/6/2007 17:50:14 | YourName | [[ritojo.html|http://subi.chem.ucla.edu/%7Emako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/%7Emako/store.php]] | | ritojo.html | | Ok |\n| 7/6/2007 17:50:21 | YourName | [[ritojo.html|http://subi.chem.ucla.edu/%7Emako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/%7Emako/store.php]] | | ritojo.html | |\n| 7/6/2007 17:51:7 | mako | [[ritojo.html|http://subi.chem.ucla.edu/%7Emako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/%7Emako/store.php]] | | ritojo.html | |\n| 7/6/2007 17:51:58 | mako | [[ritojo.html|http://subi.chem.ucla.edu/%7Emako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/%7Emako/store.php]] | | ritojo.html | | Ok |\n| 7/6/2007 17:57:5 | mako | [[ritojo.html|http://subi.chem.ucla.edu/%7Emako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/%7Emako/store.php]] | | ritojo.html | |\n| 7/6/2007 18:5:41 | mako | [[ritojo.html|http://subi.chem.ucla.edu/%7Emako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/%7Emako/store.php]] | | ritojo.html | | Ok |\n| 7/6/2007 18:8:21 | mako | [[ritojo.html|http://subi.chem.ucla.edu/%7Emako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/%7Emako/store.php]] | | ritojo.html | |\n| 7/6/2007 18:10:6 | mako | [[ritojo.html|http://subi.chem.ucla.edu/%7Emako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/%7Emako/store.php]] | | ritojo.html | |\n| 7/6/2007 18:10:47 | mako | [[ritojo.html|http://subi.chem.ucla.edu/%7Emako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/%7Emako/store.php]] | | ritojo.html | | Ok |\n| 7/6/2007 18:17:0 | mako | [[ritojo.html|http://subi.chem.ucla.edu/%7Emako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/%7Emako/store.php]] | | ritojo.html | |\n| 7/6/2007 18:26:17 | mako | [[ritojo.html|http://subi.chem.ucla.edu/%7Emako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/%7Emako/store.php]] | | ritojo.html | | Ok |\n| 7/6/2007 18:30:16 | mako | [[ritojo.html|http://subi.chem.ucla.edu/%7Emako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/%7Emako/store.php]] | | ritojo.html | |\n| 7/6/2007 18:31:21 | mako | [[ritojo.html|http://subi.chem.ucla.edu/%7Emako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/%7Emako/store.php]] | | ritojo.html | |\n| 7/6/2007 18:36:1 | mako | [[ritojo.html|http://subi.chem.ucla.edu/%7Emako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/%7Emako/store.php]] | | ritojo.html | |\n| 7/6/2007 18:36:44 | mako | [[ritojo.html|http://subi.chem.ucla.edu/%7Emako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/%7Emako/store.php]] | | ritojo.html | |\n| 8/6/2007 13:42:38 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 8/6/2007 13:46:5 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 8/6/2007 13:47:9 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 8/6/2007 13:51:25 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 8/6/2007 13:53:37 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 8/6/2007 14:7:53 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 8/6/2007 14:10:3 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 8/6/2007 14:41:19 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | | Ok |\n| 8/6/2007 14:44:4 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 8/6/2007 14:47:30 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 8/6/2007 14:51:24 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 8/6/2007 14:54:22 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 8/6/2007 14:54:59 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 8/6/2007 14:55:58 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 8/6/2007 16:54:37 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | | Ok |\n| 8/6/2007 17:3:27 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | | Ok |\n| 8/6/2007 17:5:4 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | | Ok |\n| 8/6/2007 17:8:16 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | | Ok |\n| 8/6/2007 17:9:39 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 8/6/2007 17:11:12 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | | Ok |\n| 8/6/2007 17:11:34 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 8/6/2007 17:23:3 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | | Ok |\n| 8/6/2007 17:26:4 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 8/6/2007 17:26:34 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 8/6/2007 17:27:39 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 8/6/2007 17:28:28 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 8/6/2007 20:12:7 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 8/6/2007 20:13:13 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 8/6/2007 20:13:27 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | | Ok |\n| 8/6/2007 20:13:40 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 8/6/2007 20:14:35 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | | Ok |\n| 8/6/2007 20:15:12 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 8/6/2007 20:15:39 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 8/6/2007 20:16:20 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 8/6/2007 20:16:48 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 8/6/2007 20:18:17 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | | Ok |\n| 8/6/2007 20:19:9 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | | Ok |\n| 8/6/2007 20:19:27 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | | Ok |\n| 8/6/2007 20:19:45 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 8/6/2007 20:20:9 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 8/6/2007 20:20:57 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | | Ok |\n| 8/6/2007 20:21:57 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 8/6/2007 20:25:42 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 25/6/2007 2:12:2 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | | Ok |\n| 25/6/2007 2:14:3 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |\n| 25/6/2007 2:23:14 | mako | [[ritojo.html|http://subi.chem.ucla.edu/~mako/ritojo.html]] | [[store.php|http://subi.chem.ucla.edu/~mako/store.php]] | | ritojo.html | |
!Options used by UploadPlugin\nUsername: <<option txtUploadUserName>>\nPassword: <<option pasUploadPassword>>\n\n<<upload>> with these options.\n\n!Upload Macro parameters\n{{{\n<<upload [store.php [ritojo.html [backupDir [uploadDir [username]]]]]>>\n Optional positional parameters can be passed to overwrite \n UploadOptions. \n}}}
/***\n|''Name:''|UploadPlugin|\n|''Description:''|Save to web a TiddlyWiki|\n|''Version:''|3.4.5|\n|''Date:''|Oct 15, 2006|\n|''Source:''|http://tiddlywiki.bidix.info/#UploadPlugin|\n|''Documentation:''|http://tiddlywiki.bidix.info/#UploadDoc|\n|''Author:''|BidiX (BidiX (at) bidix (dot) info)|\n|''License:''|[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D ]]|\n|''~CoreVersion:''|2.0.0|\n|''Browser:''|Firefox 1.5; InternetExplorer 6.0; Safari|\n|''Include:''|config.lib.file; config.lib.log; config.lib.options; PasswordTweak|\n|''Require:''|[[UploadService|http://tiddlywiki.bidix.info/#UploadService]]|\n***/\n//{{{\nversion.extensions.UploadPlugin = {\n major: 3, minor: 4, revision: 5, \n date: new Date(2006,9,15),\n source: 'http://tiddlywiki.bidix.info/#UploadPlugin',\n documentation: 'http://tiddlywiki.bidix.info/#UploadDoc',\n author: 'BidiX (BidiX (at) bidix (dot) info',\n license: '[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D]]',\n coreVersion: '2.0.0',\n browser: 'Firefox 1.5; InternetExplorer 6.0; Safari'\n};\n//}}}\n\n////+++!![config.lib.file]\n\n//{{{\nif (!config.lib) config.lib = {};\nif (!config.lib.file) config.lib.file= {\n author: 'BidiX',\n version: {major: 0, minor: 1, revision: 0}, \n date: new Date(2006,3,9)\n};\nconfig.lib.file.dirname = function (filePath) {\n var lastpos;\n if ((lastpos = filePath.lastIndexOf("/")) != -1) {\n return filePath.substring(0, lastpos);\n } else {\n return filePath.substring(0, filePath.lastIndexOf("\s\s"));\n }\n};\nconfig.lib.file.basename = function (filePath) {\n var lastpos;\n if ((lastpos = filePath.lastIndexOf("#")) != -1) \n filePath = filePath.substring(0, lastpos);\n if ((lastpos = filePath.lastIndexOf("/")) != -1) {\n return filePath.substring(lastpos + 1);\n } else\n return filePath.substring(filePath.lastIndexOf("\s\s")+1);\n};\nwindow.basename = function() {return "@@deprecated@@";};\n//}}}\n////===\n\n////+++!![config.lib.log]\n\n//{{{\nif (!config.lib) config.lib = {};\nif (!config.lib.log) config.lib.log= {\n author: 'BidiX',\n version: {major: 0, minor: 1, revision: 1}, \n date: new Date(2006,8,19)\n};\nconfig.lib.Log = function(tiddlerTitle, logHeader) {\n if (version.major < 2)\n this.tiddler = store.tiddlers[tiddlerTitle];\n else\n this.tiddler = store.getTiddler(tiddlerTitle);\n if (!this.tiddler) {\n this.tiddler = new Tiddler();\n this.tiddler.title = tiddlerTitle;\n this.tiddler.text = "| !date | !user | !location |" + logHeader;\n this.tiddler.created = new Date();\n this.tiddler.modifier = config.options.txtUserName;\n this.tiddler.modified = new Date();\n if (version.major < 2)\n store.tiddlers[tiddlerTitle] = this.tiddler;\n else\n store.addTiddler(this.tiddler);\n }\n return this;\n};\n\nconfig.lib.Log.prototype.newLine = function (line) {\n var now = new Date();\n var newText = "| ";\n newText += now.getDate()+"/"+(now.getMonth()+1)+"/"+now.getFullYear() + " ";\n newText += now.getHours()+":"+now.getMinutes()+":"+now.getSeconds()+" | ";\n newText += config.options.txtUserName + " | ";\n var location = document.location.toString();\n var filename = config.lib.file.basename(location);\n if (!filename) filename = '/';\n newText += "[["+filename+"|"+location + "]] |";\n this.tiddler.text = this.tiddler.text + "\sn" + newText;\n this.addToLine(line);\n};\n\nconfig.lib.Log.prototype.addToLine = function (text) {\n this.tiddler.text = this.tiddler.text + text;\n this.tiddler.modifier = config.options.txtUserName;\n this.tiddler.modified = new Date();\n if (version.major < 2)\n store.tiddlers[this.tiddler.tittle] = this.tiddler;\n else {\n store.addTiddler(this.tiddler);\n story.refreshTiddler(this.tiddler.title);\n store.notify(this.tiddler.title, true);\n }\n if (version.major < 2)\n store.notifyAll(); \n};\n//}}}\n////===\n\n////+++!![config.lib.options]\n\n//{{{\nif (!config.lib) config.lib = {};\nif (!config.lib.options) config.lib.options = {\n author: 'BidiX',\n version: {major: 0, minor: 1, revision: 0}, \n date: new Date(2006,3,9)\n};\n\nconfig.lib.options.init = function (name, defaultValue) {\n if (!config.options[name]) {\n config.options[name] = defaultValue;\n saveOptionCookie(name);\n }\n};\n//}}}\n////===\n\n////+++!![PasswordTweak]\n\n//{{{\nversion.extensions.PasswordTweak = {\n major: 1, minor: 0, revision: 3, date: new Date(2006,8,30),\n type: 'tweak',\n source: 'http://tiddlywiki.bidix.info/#PasswordTweak'\n};\n//}}}\n/***\n!!config.macros.option\n***/\n//{{{\nconfig.macros.option.passwordCheckboxLabel = "Save this password on this computer";\nconfig.macros.option.passwordType = "password"; // password | text\n\nconfig.macros.option.onChangeOption = function(e)\n{\n var opt = this.getAttribute("option");\n var elementType,valueField;\n if(opt) {\n switch(opt.substr(0,3)) {\n case "txt":\n elementType = "input";\n valueField = "value";\n break;\n case "pas":\n elementType = "input";\n valueField = "value";\n break;\n case "chk":\n elementType = "input";\n valueField = "checked";\n break;\n }\n config.options[opt] = this[valueField];\n saveOptionCookie(opt);\n var nodes = document.getElementsByTagName(elementType);\n for(var t=0; t<nodes.length; t++) \n {\n var optNode = nodes[t].getAttribute("option");\n if (opt == optNode) \n nodes[t][valueField] = this[valueField];\n }\n }\n return(true);\n};\n\nconfig.macros.option.handler = function(place,macroName,params)\n{\n var opt = params[0];\n if(config.options[opt] === undefined) {\n return;}\n var c;\n switch(opt.substr(0,3)) {\n case "txt":\n c = document.createElement("input");\n c.onkeyup = this.onChangeOption;\n c.setAttribute ("option",opt);\n c.className = "txtOptionInput "+opt;\n place.appendChild(c);\n c.value = config.options[opt];\n break;\n case "pas":\n // input password\n c = document.createElement ("input");\n c.setAttribute("type",config.macros.option.passwordType);\n c.onkeyup = this.onChangeOption;\n c.setAttribute("option",opt);\n c.className = "pasOptionInput "+opt;\n place.appendChild(c);\n c.value = config.options[opt];\n // checkbox link with this password "save this password on this computer"\n c = document.createElement("input");\n c.setAttribute("type","checkbox");\n c.onclick = this.onChangeOption;\n c.setAttribute("option","chk"+opt);\n c.className = "chkOptionInput "+opt;\n place.appendChild(c);\n c.checked = config.options["chk"+opt];\n // text savePasswordCheckboxLabel\n place.appendChild(document.createTextNode(config.macros.option.passwordCheckboxLabel));\n break;\n case "chk":\n c = document.createElement("input");\n c.setAttribute("type","checkbox");\n c.onclick = this.onChangeOption;\n c.setAttribute("option",opt);\n c.className = "chkOptionInput "+opt;\n place.appendChild(c);\n c.checked = config.options[opt];\n break;\n }\n};\n//}}}\n/***\n!! Option cookie stuff\n***/\n//{{{\nwindow.loadOptionsCookie_orig_PasswordTweak = window.loadOptionsCookie;\nwindow.loadOptionsCookie = function()\n{\n var cookies = document.cookie.split(";");\n for(var c=0; c<cookies.length; c++) {\n var p = cookies[c].indexOf("=");\n if(p != -1) {\n var name = cookies[c].substr(0,p).trim();\n var value = cookies[c].substr(p+1).trim();\n switch(name.substr(0,3)) {\n case "txt":\n config.options[name] = unescape(value);\n break;\n case "pas":\n config.options[name] = unescape(value);\n break;\n case "chk":\n config.options[name] = value == "true";\n break;\n }\n }\n }\n};\n\nwindow.saveOptionCookie_orig_PasswordTweak = window.saveOptionCookie;\nwindow.saveOptionCookie = function(name)\n{\n var c = name + "=";\n switch(name.substr(0,3)) {\n case "txt":\n c += escape(config.options[name].toString());\n break;\n case "chk":\n c += config.options[name] ? "true" : "false";\n // is there an option link with this chk ?\n if (config.options[name.substr(3)]) {\n saveOptionCookie(name.substr(3));\n }\n break;\n case "pas":\n if (config.options["chk"+name]) {\n c += escape(config.options[name].toString());\n } else {\n c += "";\n }\n break;\n }\n c += "; expires=Fri, 1 Jan 2038 12:00:00 UTC; path=/";\n document.cookie = c;\n};\n//}}}\n/***\n!! Initializations\n***/\n//{{{\n// define config.options.pasPassword\nif (!config.options.pasPassword) {\n config.options.pasPassword = 'defaultPassword';\n window.saveOptionCookie('pasPassword');\n}\n// since loadCookies is first called befor password definition\n// we need to reload cookies\nwindow.loadOptionsCookie();\n//}}}\n////===\n\n////+++!![config.macros.upload]\n\n//{{{\nconfig.macros.upload = {\n accessKey: "U",\n formName: "UploadPlugin",\n contentType: "text/html;charset=UTF-8",\n defaultStoreScript: "store.php"\n};\n\n// only this two configs need to be translated\nconfig.macros.upload.messages = {\n aboutToUpload: "About to upload TiddlyWiki to %0",\n backupFileStored: "Previous file backuped in %0",\n crossDomain: "Certainly a cross-domain isue: access to an other site isn't allowed",\n errorDownloading: "Error downloading",\n errorUploadingContent: "Error uploading content",\n fileLocked: "Files is locked: You are not allowed to Upload",\n fileNotFound: "file to upload not found",\n fileNotUploaded: "File %0 NOT uploaded",\n mainFileUploaded: "Main TiddlyWiki file uploaded to %0",\n passwordEmpty: "Unable to upload, your password is empty",\n urlParamMissing: "url param missing",\n rssFileNotUploaded: "RssFile %0 NOT uploaded",\n rssFileUploaded: "Rss File uploaded to %0"\n};\n\nconfig.macros.upload.label = {\n promptOption: "Save and Upload this TiddlyWiki with UploadOptions",\n promptParamMacro: "Save and Upload this TiddlyWiki in %0",\n saveLabel: "save to web", \n saveToDisk: "save to disk",\n uploadLabel: "upload" \n};\n\nconfig.macros.upload.handler = function(place,macroName,params){\n // parameters initialization\n var storeUrl = params[0];\n var toFilename = params[1];\n var backupDir = params[2];\n var uploadDir = params[3];\n var username = params[4];\n var password; // for security reason no password as macro parameter\n var label;\n if (document.location.toString().substr(0,4) == "http")\n label = this.label.saveLabel;\n else\n label = this.label.uploadLabel;\n var prompt;\n if (storeUrl) {\n prompt = this.label.promptParamMacro.toString().format([this.toDirUrl(storeUrl, uploadDir, username)]);\n }\n else {\n prompt = this.label.promptOption;\n }\n createTiddlyButton(place, label, prompt, \n function () {\n config.macros.upload.upload(storeUrl, toFilename, uploadDir, backupDir, username, password); \n return false;}, \n null, null, this.accessKey);\n};\nconfig.macros.upload.UploadLog = function() {\n return new config.lib.Log('UploadLog', " !storeUrl | !uploadDir | !toFilename | !backupdir | !origin |" );\n};\nconfig.macros.upload.UploadLog.prototype = config.lib.Log.prototype;\nconfig.macros.upload.UploadLog.prototype.startUpload = function(storeUrl, toFilename, uploadDir, backupDir) {\n var line = " [[" + config.lib.file.basename(storeUrl) + "|" + storeUrl + "]] | ";\n line += uploadDir + " | " + toFilename + " | " + backupDir + " |";\n this.newLine(line);\n};\nconfig.macros.upload.UploadLog.prototype.endUpload = function() {\n this.addToLine(" Ok |");\n};\nconfig.macros.upload.basename = config.lib.file.basename;\nconfig.macros.upload.dirname = config.lib.file.dirname;\nconfig.macros.upload.toRootUrl = function (storeUrl, username)\n{\n return root = (this.dirname(storeUrl)?this.dirname(storeUrl):this.dirname(document.location.toString()));\n}\nconfig.macros.upload.toDirUrl = function (storeUrl, uploadDir, username)\n{\n var root = this.toRootUrl(storeUrl, username);\n if (uploadDir && uploadDir != '.')\n root = root + '/' + uploadDir;\n return root;\n}\nconfig.macros.upload.toFileUrl = function (storeUrl, toFilename, uploadDir, username)\n{\n return this.toDirUrl(storeUrl, uploadDir, username) + '/' + toFilename;\n}\nconfig.macros.upload.upload = function(storeUrl, toFilename, uploadDir, backupDir, username, password)\n{\n // parameters initialization\n storeUrl = (storeUrl ? storeUrl : config.options.txtUploadStoreUrl);\n toFilename = (toFilename ? toFilename : config.options.txtUploadFilename);\n backupDir = (backupDir ? backupDir : config.options.txtUploadBackupDir);\n uploadDir = (uploadDir ? uploadDir : config.options.txtUploadDir);\n username = (username ? username : config.options.txtUploadUserName);\n password = config.options.pasUploadPassword; // for security reason no password as macro parameter\n if (!password || password === '') {\n alert(config.macros.upload.messages.passwordEmpty);\n return;\n }\n if (storeUrl === '') {\n storeUrl = config.macros.upload.defaultStoreScript;\n }\n if (config.lib.file.dirname(storeUrl) === '') {\n storeUrl = config.lib.file.dirname(document.location.toString())+'/'+storeUrl;\n }\n if (toFilename === '') {\n toFilename = config.lib.file.basename(document.location.toString());\n }\n\n clearMessage();\n // only for forcing the message to display\n if (version.major < 2)\n store.notifyAll();\n if (!storeUrl) {\n alert(config.macros.upload.messages.urlParamMissing);\n return;\n }\n // Check that file is not locked\n if (window.BidiX && BidiX.GroupAuthoring && BidiX.GroupAuthoring.lock) {\n if (BidiX.GroupAuthoring.lock.isLocked() && !BidiX.GroupAuthoring.lock.isMyLock()) {\n alert(config.macros.upload.messages.fileLocked);\n return;\n }\n }\n \n var log = new this.UploadLog();\n log.startUpload(storeUrl, toFilename, uploadDir, backupDir);\n if (document.location.toString().substr(0,5) == "file:") {\n saveChanges();\n }\n var toDir = config.macros.upload.toDirUrl(storeUrl, toFilename, uploadDir, username);\n displayMessage(config.macros.upload.messages.aboutToUpload.format([toDir]), toDir);\n this.uploadChanges(storeUrl, toFilename, uploadDir, backupDir, username, password);\n if(config.options.chkGenerateAnRssFeed) {\n //var rssContent = convertUnicodeToUTF8(generateRss());\n var rssContent = generateRss();\n var rssPath = toFilename.substr(0,toFilename.lastIndexOf(".")) + ".xml";\n this.uploadContent(rssContent, storeUrl, rssPath, uploadDir, '', username, password, \n function (responseText) {\n if (responseText.substring(0,1) != '0') {\n displayMessage(config.macros.upload.messages.rssFileNotUploaded.format([rssPath]));\n }\n else {\n var toFileUrl = config.macros.upload.toFileUrl(storeUrl, rssPath, uploadDir, username);\n displayMessage(config.macros.upload.messages.rssFileUploaded.format(\n [toFileUrl]), toFileUrl);\n }\n // for debugging store.php uncomment last line\n //DEBUG alert(responseText);\n });\n }\n return;\n};\n\nconfig.macros.upload.uploadChanges = function(storeUrl, toFilename, uploadDir, backupDir, \n username, password) {\n var original;\n if (document.location.toString().substr(0,4) == "http") {\n original = this.download(storeUrl, toFilename, uploadDir, backupDir, username, password);\n return;\n }\n else {\n // standard way : Local file\n \n original = loadFile(getLocalPath(document.location.toString()));\n if(window.Components) {\n // it's a mozilla browser\n try {\n netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");\n var converter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"]\n .createInstance(Components.interfaces.nsIScriptableUnicodeConverter);\n converter.charset = "UTF-8";\n original = converter.ConvertToUnicode(original);\n }\n catch(e) {\n }\n }\n }\n //DEBUG alert(original);\n this.uploadChangesFrom(original, storeUrl, toFilename, uploadDir, backupDir, \n username, password);\n};\n\nconfig.macros.upload.uploadChangesFrom = function(original, storeUrl, toFilename, uploadDir, backupDir, \n username, password) {\n var startSaveArea = '<div id="' + 'storeArea">'; // Split up into two so that indexOf() of this source doesn't find it\n var endSaveArea = '</d' + 'iv>';\n // Locate the storeArea div's\n var posOpeningDiv = original.indexOf(startSaveArea);\n var posClosingDiv = original.lastIndexOf(endSaveArea);\n if((posOpeningDiv == -1) || (posClosingDiv == -1))\n {\n alert(config.messages.invalidFileError.format([document.location.toString()]));\n return;\n }\n var revised = original.substr(0,posOpeningDiv + startSaveArea.length) + \n allTiddlersAsHtml() + "\sn\st\st" +\n original.substr(posClosingDiv);\n var newSiteTitle;\n if(version.major < 2){\n newSiteTitle = (getElementText("siteTitle") + " - " + getElementText("siteSubtitle")).htmlEncode();\n } else {\n newSiteTitle = (wikifyPlain ("SiteTitle") + " - " + wikifyPlain ("SiteSubtitle")).htmlEncode();\n }\n\n revised = revised.replaceChunk("<title"+">","</title"+">"," " + newSiteTitle + " ");\n revised = revised.replaceChunk("<!--PRE-HEAD-START--"+">","<!--PRE-HEAD-END--"+">","\sn" + store.getTiddlerText("MarkupPreHead","") + "\sn");\n revised = revised.replaceChunk("<!--POST-HEAD-START--"+">","<!--POST-HEAD-END--"+">","\sn" + store.getTiddlerText("MarkupPostHead","") + "\sn");\n revised = revised.replaceChunk("<!--PRE-BODY-START--"+">","<!--PRE-BODY-END--"+">","\sn" + store.getTiddlerText("MarkupPreBody","") + "\sn");\n revised = revised.replaceChunk("<!--POST-BODY-START--"+">","<!--POST-BODY-END--"+">","\sn" + store.getTiddlerText("MarkupPostBody","") + "\sn");\n\n var response = this.uploadContent(revised, storeUrl, toFilename, uploadDir, backupDir, \n username, password, function (responseText) {\n if (responseText.substring(0,1) != '0') {\n alert(responseText);\n displayMessage(config.macros.upload.messages.fileNotUploaded.format([getLocalPath(document.location.toString())]));\n }\n else {\n if (uploadDir !== '') {\n toFilename = uploadDir + "/" + config.macros.upload.basename(toFilename);\n } else {\n toFilename = config.macros.upload.basename(toFilename);\n }\n var toFileUrl = config.macros.upload.toFileUrl(storeUrl, toFilename, uploadDir, username);\n if (responseText.indexOf("destfile:") > 0) {\n var destfile = responseText.substring(responseText.indexOf("destfile:")+9, \n responseText.indexOf("\sn", responseText.indexOf("destfile:")));\n toFileUrl = config.macros.upload.toRootUrl(storeUrl, username) + '/' + destfile;\n }\n else {\n toFileUrl = config.macros.upload.toFileUrl(storeUrl, toFilename, uploadDir, username);\n }\n displayMessage(config.macros.upload.messages.mainFileUploaded.format(\n [toFileUrl]), toFileUrl);\n if (backupDir && responseText.indexOf("backupfile:") > 0) {\n var backupFile = responseText.substring(responseText.indexOf("backupfile:")+11, \n responseText.indexOf("\sn", responseText.indexOf("backupfile:")));\n toBackupUrl = config.macros.upload.toRootUrl(storeUrl, username) + '/' + backupFile;\n displayMessage(config.macros.upload.messages.backupFileStored.format(\n [toBackupUrl]), toBackupUrl);\n }\n var log = new config.macros.upload.UploadLog();\n log.endUpload();\n store.setDirty(false);\n // erase local lock\n if (window.BidiX && BidiX.GroupAuthoring && BidiX.GroupAuthoring.lock) {\n BidiX.GroupAuthoring.lock.eraseLock();\n // change mtime with new mtime after upload\n var mtime = responseText.substr(responseText.indexOf("mtime:")+6);\n BidiX.GroupAuthoring.lock.mtime = mtime;\n }\n \n \n }\n // for debugging store.php uncomment last line\n //DEBUG alert(responseText);\n }\n );\n};\n\nconfig.macros.upload.uploadContent = function(content, storeUrl, toFilename, uploadDir, backupDir, \n username, password, callbackFn) {\n var boundary = "---------------------------"+"AaB03x"; \n var request;\n try {\n request = new XMLHttpRequest();\n } \n catch (e) { \n request = new ActiveXObject("Msxml2.XMLHTTP"); \n }\n if (window.netscape){\n try {\n if (document.location.toString().substr(0,4) != "http") {\n netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserRead');}\n }\n catch (e) {}\n } \n //DEBUG alert("user["+config.options.txtUploadUserName+"] password[" + config.options.pasUploadPassword + "]");\n // compose headers data\n var sheader = "";\n sheader += "--" + boundary + "\sr\snContent-disposition: form-data; name=\s"";\n sheader += config.macros.upload.formName +"\s"\sr\sn\sr\sn";\n sheader += "backupDir="+backupDir\n +";user=" + username \n +";password=" + password\n +";uploaddir=" + uploadDir;\n // add lock attributes to sheader\n if (window.BidiX && BidiX.GroupAuthoring && BidiX.GroupAuthoring.lock) {\n var l = BidiX.GroupAuthoring.lock.myLock;\n sheader += ";lockuser=" + l.user\n + ";mtime=" + l.mtime\n + ";locktime=" + l.locktime;\n }\n sheader += ";;\sr\sn"; \n sheader += "\sr\sn" + "--" + boundary + "\sr\sn";\n sheader += "Content-disposition: form-data; name=\s"userfile\s"; filename=\s""+toFilename+"\s"\sr\sn";\n sheader += "Content-Type: " + config.macros.upload.contentType + "\sr\sn";\n sheader += "Content-Length: " + content.length + "\sr\sn\sr\sn";\n // compose trailer data\n var strailer = new String();\n strailer = "\sr\sn--" + boundary + "--\sr\sn";\n //strailer = "--" + boundary + "--\sr\sn";\n var data;\n data = sheader + content + strailer;\n //request.open("POST", storeUrl, true, username, password);\n try {\n request.open("POST", storeUrl, true); \n }\n catch(e) {\n alert(config.macros.upload.messages.crossDomain + "\snError:" +e);\n exit;\n }\n request.onreadystatechange = function () {\n if (request.readyState == 4) {\n if (request.status == 200)\n callbackFn(request.responseText);\n else\n alert(config.macros.upload.messages.errorUploadingContent + "\snStatus: "+request.status.statusText);\n }\n };\n request.setRequestHeader("Content-Length",data.length);\n request.setRequestHeader("Content-Type","multipart/form-data; boundary="+boundary);\n request.send(data); \n};\n\n\nconfig.macros.upload.download = function(uploadUrl, uploadToFilename, uploadDir, uploadBackupDir, \n username, password) {\n var request;\n try {\n request = new XMLHttpRequest();\n } \n catch (e) { \n request = new ActiveXObject("Msxml2.XMLHTTP"); \n }\n try {\n if (uploadUrl.substr(0,4) == "http") {\n netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");\n }\n else {\n netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");\n }\n } catch (e) { }\n //request.open("GET", document.location.toString(), true, username, password);\n try {\n request.open("GET", document.location.toString(), true);\n }\n catch(e) {\n alert(config.macros.upload.messages.crossDomain + "\snError:" +e);\n exit;\n }\n \n request.onreadystatechange = function () {\n if (request.readyState == 4) {\n if(request.status == 200) {\n config.macros.upload.uploadChangesFrom(request.responseText, uploadUrl, \n uploadToFilename, uploadDir, uploadBackupDir, username, password);\n }\n else\n alert(config.macros.upload.messages.errorDownloading.format(\n [document.location.toString()]) + "\snStatus: "+request.status.statusText);\n }\n };\n request.send(null);\n};\n\n//}}}\n////===\n\n////+++!![Initializations]\n\n//{{{\nconfig.lib.options.init('txtUploadStoreUrl','store.php');\nconfig.lib.options.init('txtUploadFilename','');\nconfig.lib.options.init('txtUploadDir','');\nconfig.lib.options.init('txtUploadBackupDir','');\nconfig.lib.options.init('txtUploadUserName',config.options.txtUserName);\nconfig.lib.options.init('pasUploadPassword','');\nsetStylesheet(\n ".pasOptionInput {width: 11em;}\sn"+\n ".txtOptionInput.txtUploadStoreUrl {width: 25em;}\sn"+\n ".txtOptionInput.txtUploadFilename {width: 25em;}\sn"+\n ".txtOptionInput.txtUploadDir {width: 25em;}\sn"+\n ".txtOptionInput.txtUploadBackupDir {width: 25em;}\sn"+\n "",\n "UploadOptionsStyles");\nif (document.location.toString().substr(0,4) == "http") {\n config.options.chkAutoSave = false; \n saveOptionCookie('chkAutoSave');\n}\nconfig.shadowTiddlers.UploadDoc = "[[Full Documentation|http://tiddlywiki.bidix.info/l#UploadDoc ]]\sn"; \n\n//}}}\n////===\n\n////+++!![Core Hijacking]\n\n//{{{\nconfig.macros.saveChanges.label_orig_UploadPlugin = config.macros.saveChanges.label;\nconfig.macros.saveChanges.label = config.macros.upload.label.saveToDisk;\n\nconfig.macros.saveChanges.handler_orig_UploadPlugin = config.macros.saveChanges.handler;\n\nconfig.macros.saveChanges.handler = function(place)\n{\n if ((!readOnly) && (document.location.toString().substr(0,4) != "http"))\n createTiddlyButton(place,this.label,this.prompt,this.onClick,null,null,this.accessKey);\n};\n\n//}}}\n////===\n
A VennDiagram shows the [[Intersect]] and [[Union]] of several lists. A good tool to use is [[GeneVenn|http://131.95.113.157/genevenn/genevenn.htm]]
Visualization is critical global assessment of data and trends. For more information, see literature by Edward Tufte.\n\n[[Boxplot]]\n[[Scatterplot]]\n[[Histogram]]\nVennDiagram\n\nScoreDistributionVisualization\n\nVarianceDistributionVisualization\n\nStochasticOptimization\n\n[[Colors]]
The weighted mean is another descriptive statistic that describes central tendency.\nWeighted means generally are used in physics to describe moments of inertia and the center of\nmass. However, the weighted mean can also be applied to population studies in statistics. It is\ncalculated by summing both the individual sample values and the individual indicators of\nsamples.
The weighted mean ratio reflects the relationship of the value to the total value of each subclass.
RiToJo is a linked list of tools and tips, a dynamic "Rosetta Stone", if you will, for bioinformatics analysis. 'RiToJo' stands for "the Right Tool for the Job" and reflects the fact that a bioinformatics analyst, like no other programmer, is best suited to use a variety of computational languages and environments to deal with biological data from data cleaning through sequence analysis and ultimately statistical inference. This project began in 2005 as a blog-type answer and response webpage that accompanied a series of summer workshops I taught at UCLA entitled [[Biological Sequence Hacking|http://mjanis.bol.ucla.edu/biohackers2005.html]] (you can view the [[slides|http://www.chem.ucla.edu/~mjanis/biohackers2005.html]] ) and has now been repurposed for use by the bioinformatics community. RiToJo uses TiddlyWiki's non-linear documentation approach to link together different ways of performing the same analysis in different languages. Such a listing of different means to a common end is more suitable for biological analysis where the focus, even in documentation, remains upon the biological analysis question at hand.\n\nThe RiToJo TiddlyWiki is available for download as one html file, which means that you can save this page to your hard disk or transportable storage device (thumbdrives, etc.) and access it on virtually any computer or OS that has a browser (preferably firefox) - you don't even need a webserver! Additionally, all images in RiToJo are available as a gz or zip [[archive|http://subi.chem.ucla.edu/~mako/ritojo/downloads/]] for offline use - simply unzip them into the same folder as your ritojo.html file (RiToJo accesses all image files from the current, or ./ directory).\n\nIf you'd like to learn more about TiddlyWiki, [[this|http://www.tiddlywiki.com/]] is an excellent place to begin, and [[Advanced Tips|http://tiddlywikitips.com/]] for when you're ready. Please make sure you understand TiddlyWiki's model for representing information before editing either RiToJo or your downloaded local version of RiToJo; it will make your life much more pleasant! [[TiddlyWikiMacros|http://www.tiddlywiki.org/wiki/WikiMacros]] are also available!\n\nRiToJo is a community effort! Anyone can add or make changes to RiToJo. If you would like to be an editor for RiToJo, please email me mjanis@chem.ucla.edu and I will add you to the adminstration list. Verified archives of RiToJo (verified by the editing board) are available every Friday, 1200 PST (USA) and may include rollbacks if there are any malicious additions or deletions (this is our "QA" for RiToJo, which is done weekly; most wikis allow constant QA but in an effort to keep RiToJo to one downloadable, non-installable file, this approach is necessary, at least for now).
[[Cygwin]]\nWindowsJavaInstall\nWindowsJavaConfigure\nWindowsJavaIDE\nWindowsRegistry\nWindowsAntiVirus\nWindowsSpyware\nWindowsOnMacSolutions\n[[Themes]]
The R-project has a number of different ways to get the color that you need.\n\nBlueYellowColorCode\n\nGreenRedColors\n\nColorBrewerPalettes
Name: Michael Janis\nLocation: Ph.D. Student, Biochemistry, Mol. Bio., Bioinformatics, UCLA\nAlias: mako\nemail: mjanis@chem.ucla.edu
/***\n|''Name:''|ReminderPlugin|\n|''Version:''|2.3.9 (Apr 26, 2007)|\n|''Source:''|http://remindermacros.tiddlyspot.com|\n|''Author:''|Jeremy Sheeley(pop1280 [at] excite [dot] com)<<br>>Maintainer: simon.baird@gmail.com|\n|''Licence:''|[[BSD open source license]]|\n|''Macros:''|reminder, showreminders, displayTiddlersWithReminders, newReminder|\n|''TiddlyWiki:''|2.0+|\n|''Browser:''|Firefox 1.0.4+; InternetExplorer 6.0|\n\n!Description\nThis plugin provides macros for tagging a date with a reminder. Use the {{{reminder}}} macro to do this. The {{{showReminders}}} and {{{displayTiddlersWithReminder}}} macros automatically search through all available tiddlers looking for upcoming reminders.\n\n!Installation\n* Create a new tiddler in your tiddlywiki titled ReminderPlugin and give it the {{{systemConfig}}} tag. The tag is important because it tells TW that this is executable code.\n* Double click this tiddler, and copy all the text from the tiddler's body.\n* Paste the text into the body of the new tiddler in your TW.\n* Save and reload your TW.\n* You can copy some examples into your TW as well. See [[Simple examples]], [[Holidays]], [[showReminders]] and [[Personal Reminders]]\n\n!Syntax:\n|>|See [[ReminderSyntax]] and [[showRemindersSyntax]]|\n\n!Revision history\n* v2.3.9 (Apr 26, 2007)\n** allow bracketed list format in tags param lets you use tags with spaces\n* v2.3.8 (Mar 9, 2006)\n**Bug fix: A global variable had snuck in, which was killing FF 1.5.0.1\n**Feature: You can now use TIDDLER and TIDDLERNAME in a regular reminder format\n* v2.3.6 (Mar 1, 2006)\n**Bug fix: Reminders for today weren't being matched sometimes.\n**Feature: Solidified integration with DatePlugin and CalendarPlugin\n**Feature: Recurring reminders will now return multiple hits in showReminders and the calendar.\n**Feature: Added TIDDLERNAME to the replacements for showReminders format, for plugins that need the title without brackets.\n* v2.3.5 (Feb 8, 2006)\n**Bug fix: Sped up reminders lots. Added a caching mechanism for reminders that have already been matched.\n* v2.3.4 (Feb 7, 2006)\n**Bug fix: Cleaned up code to hopefully prevent the Firefox 1.5.0.1 crash that was causing lots of plugins \nto crash Firefox. Thanks to http://www.jslint.com\n* v2.3.3 (Feb 2, 2006)\n**Feature: newReminder now has drop down lists instead of text boxes.\n**Bug fix: A trailing space in a title would trigger an infinite loop.\n**Bug fix: using tag:"birthday !reminder" would filter differently than tag:"!reminder birthday"\n* v2.3.2 (Jan 21, 2006)\n**Feature: newReminder macro, which will let you easily add a reminder to a tiddler. Thanks to Eric Shulman (http://www.elsdesign.com) for the code to do this.\n** Bug fix: offsetday was not working sometimes\n** Bug fix: when upgrading to 2.0, I included a bit to exclude tiddlers tagged with excludeSearch. I've reverted back to searching through all tiddlers\n* v2.3.1 (Jan 7, 2006)\n**Feature: 2.0 compatibility\n**Feature AlanH sent some code to make sure that showReminders prints a message if no reminders are found.\n* v2.3.0 (Jan 3, 2006)\n** Bug Fix: Using "Last Sunday (-0)" as a offsetdayofweek wasn't working.\n** Bug Fix: Daylight Savings time broke offset based reminders (for example year:2005 month:8 day:23 recurdays:7 would match Monday instead of Tuesday during DST.\n\n!Code\n***/\n//{{{\n\n//============================================================================\n//============================================================================\n// ReminderPlugin\n//============================================================================\n//============================================================================\n\nversion.extensions.ReminderPlugin = {major: 2, minor: 3, revision: 8, date: new Date(2006,3,9), source: "http://remindermacros.tiddlyspot.com/"};\n\n//============================================================================\n// Configuration\n// Modify this section to change the defaults for \n// leadtime and display strings\n//============================================================================\n\nconfig.macros.reminders = {};\nconfig.macros["reminder"] = {};\nconfig.macros["newReminder"] = {};\nconfig.macros["showReminders"] = {};\nconfig.macros["displayTiddlersWithReminders"] = {};\n\nconfig.macros.reminders["defaultLeadTime"] = [0,6000];\nconfig.macros.reminders["defaultReminderMessage"] = "DIFF: TITLE on DATE ANNIVERSARY";\nconfig.macros.reminders["defaultShowReminderMessage"] = "DIFF: TITLE on DATE ANNIVERSARY -- TIDDLER";\nconfig.macros.reminders["defaultAnniversaryMessage"] = "(DIFF)";\nconfig.macros.reminders["untitledReminder"] = "Untitled Reminder";\nconfig.macros.reminders["noReminderFound"] = "Couldn't find a match for TITLE in the next LEADTIMEUPPER days."\nconfig.macros.reminders["todayString"] = "Today";\nconfig.macros.reminders["tomorrowString"] = "Tomorrow";\nconfig.macros.reminders["ndaysString"] = "DIFF days";\nconfig.macros.reminders["emtpyShowRemindersString"] = "There are no upcoming events";\n\n\n//============================================================================\n// Code\n// You should not need to edit anything \n// below this. Make sure to edit this tiddler and copy \n// the code from the text box, to make sure that \n// tiddler rendering doesn't interfere with the copy \n// and paste.\n//============================================================================\n\n// This line is to preserve 1.2 compatibility\n if (!story) var story=window; \n//this object will hold the cache of reminders, so that we don't\n//recompute the same reminder over again.\nvar reminderCache = {};\n\nconfig.macros.showReminders.handler = function showReminders(place,macroName,params)\n{\n var now = new Date().getMidnight();\n var paramHash = {};\n var leadtime = [0,14];\n paramHash = getParamsForReminder(params);\n var bProvidedDate = (paramHash["year"] != null) || \n (paramHash["month"] != null) || \n (paramHash["day"] != null) || \n (paramHash["dayofweek"] != null);\n if (paramHash["leadtime"] != null)\n {\n leadtime = paramHash["leadtime"];\n if (bProvidedDate)\n {\n //If they've entered a day, we need to make \n //sure to find it. We'll reset the \n //leadtime a few lines down.\n paramHash["leadtime"] = [-10000, 10000];\n }\n }\n var matchedDate = now;\n if (bProvidedDate)\n {\n var leadTimeLowerBound = new Date().getMidnight().addDays(paramHash["leadtime"][0]);\n var leadTimeUpperBound = new Date().getMidnight().addDays(paramHash["leadtime"][1]);\n matchedDate = findDateForReminder(paramHash, new Date().getMidnight(), leadTimeLowerBound, leadTimeUpperBound); \n }\n\n var arr = findTiddlersWithReminders(matchedDate, leadtime, paramHash["tag"], paramHash["limit"]);\n var elem = createTiddlyElement(place,"span",null,null, null);\n var mess = "";\n if (arr.length == 0)\n {\n mess += config.macros.reminders.emtpyShowRemindersString; \n }\n for (var j = 0; j < arr.length; j++)\n {\n if (paramHash["format"] != null)\n {\n arr[j]["params"]["format"] = paramHash["format"];\n }\n else\n {\n arr[j]["params"]["format"] = config.macros.reminders["defaultShowReminderMessage"];\n }\n mess += getReminderMessageForDisplay(arr[j]["diff"], arr[j]["params"], arr[j]["matchedDate"], arr[j]["tiddler"]);\n mess += "\sn";\n }\n wikify(mess, elem, null, null);\n};\n\n\nconfig.macros.displayTiddlersWithReminders.handler = function displayTiddlersWithReminders(place,macroName,params)\n{\n var now = new Date().getMidnight();\n var paramHash = {};\n var leadtime = [0,14];\n paramHash = getParamsForReminder(params);\n var bProvidedDate = (paramHash["year"] != null) || \n (paramHash["month"] != null) || \n (paramHash["day"] != null) || \n (paramHash["dayofweek"] != null);\n if (paramHash["leadtime"] != null)\n {\n leadtime = paramHash["leadtime"];\n if (bProvidedDate)\n {\n //If they've entered a day, we need to make \n //sure to find it. We'll reset the leadtime \n //a few lines down.\n paramHash["leadtime"] = [-10000,10000];\n }\n }\n var matchedDate = now;\n if (bProvidedDate)\n {\n var leadTimeLowerBound = new Date().getMidnight().addDays(paramHash["leadtime"][0]);\n var leadTimeUpperBound = new Date().getMidnight().addDays(paramHash["leadtime"][1]);\n matchedDate = findDateForReminder(paramHash, new Date().getMidnight(), leadTimeLowerBound, leadTimeUpperBound); \n }\n var arr = findTiddlersWithReminders(matchedDate, leadtime, paramHash["tag"], paramHash["limit"]);\n for (var j = 0; j < arr.length; j++)\n {\n displayTiddler(null, arr[j]["tiddler"], 0, null, false, false, false);\n }\n};\n\nconfig.macros.reminder.handler = function reminder(place,macroName,params)\n{\n var dateHash = getParamsForReminder(params);\n if (dateHash["hidden"] != null)\n {\n return;\n }\n var leadTime = dateHash["leadtime"];\n if (leadTime == null)\n {\n leadTime = config.macros.reminders["defaultLeadTime"]; \n }\n var leadTimeLowerBound = new Date().getMidnight().addDays(leadTime[0]);\n var leadTimeUpperBound = new Date().getMidnight().addDays(leadTime[1]);\n var matchedDate = findDateForReminder(dateHash, new Date().getMidnight(), leadTimeLowerBound, leadTimeUpperBound);\n if (!window.story) \n {\n window.story=window; \n }\n if (!store.getTiddler) \n {\n store.getTiddler=function(title) {return this.tiddlers[title];};\n }\n var title = window.story.findContainingTiddler(place).id.substr(7);\n if (matchedDate != null)\n {\n var diff = matchedDate.getDifferenceInDays(new Date().getMidnight());\n var elem = createTiddlyElement(place,"span",null,null, null);\n var mess = getReminderMessageForDisplay(diff, dateHash, matchedDate, title);\n wikify(mess, elem, null, null);\n }\n else\n {\n createTiddlyElement(place,"span",null,null, config.macros.reminders["noReminderFound"].replace("TITLE", dateHash["title"]).replace("LEADTIMEUPPER", leadTime[1]).replace("LEADTIMELOWER", leadTime[0]).replace("TIDDLERNAME", title).replace("TIDDLER", "[[" + title + "]]") );\n }\n};\n\nconfig.macros.newReminder.handler = function newReminder(place,macroName,params)\n{\n var today=new Date().getMidnight();\n var formstring = '<html><form>Year: <select name="year"><option value="">Every year</option>';\n for (var i = 0; i < 5; i++)\n {\n formstring += '<option' + ((i == 0) ? ' selected' : '') + ' value="' + (today.getFullYear() +i) + '">' + (today.getFullYear() + i) + '</option>';\n }\n formstring += '</select>&nbsp;&nbsp;Month:<select name="month"><option value="">Every month</option>';\n for (i = 0; i < 12; i++)\n {\n formstring += '<option' + ((i == today.getMonth()) ? ' selected' : '') + ' value="' + (i+1) + '">' + config.messages.dates.months[i] + '</option>';\n }\n formstring += '</select>&nbsp;&nbsp;Day:<select name="day"><option value="">Every day</option>';\n for (i = 1; i < 32; i++)\n {\n formstring += '<option' + ((i == (today.getDate() )) ? ' selected' : '') + ' value="' + i + '">' + i + '</option>';\n }\n\nformstring += '</select>&nbsp;&nbsp;Reminder Title:<input type="text" size="40" name="title" value="please enter a title" onfocus="this.select();"><input type="button" value="ok" onclick="addReminderToTiddler(this.form)"></form></html>';\n\n var panel = config.macros.slider.createSlider(place,null,"New Reminder","Open a form to add a new reminder to this tiddler");\n wikify(formstring ,panel,null,store.getTiddler(params[1]));\n};\n\n// onclick: process input and insert reminder at 'marker'\nwindow.addReminderToTiddler = function(form) {\n if (!window.story) \n {\n window.story=window; \n }\n if (!store.getTiddler) \n {\n store.getTiddler=function(title) {return this.tiddlers[title];};\n }\n var title = window.story.findContainingTiddler(form).id.substr(7);\n var tiddler=store.getTiddler(title);\n var txt='\sn<<reminder ';\n if (form.year.value != "")\n txt += 'year:'+form.year.value + ' ';\n if (form.month.value != "")\n txt += 'month:'+form.month.value + ' ';\n if (form.day.value != "")\n txt += 'day:'+form.day.value + ' ';\n txt += 'title:"'+form.title.value+'" ';\n txt +='>>';\n tiddler.set(null,tiddler.text + txt);\n window.story.refreshTiddler(title,1,true);\n store.setDirty(true);\n};\n\nfunction hasTag(tiddlerTags, tagFilters)\n{\n //Make sure we respond well to empty tiddlerTaglists or tagFilterlists\n if (tagFilters.length==0 || tiddlerTags.length==0)\n {\n return true;\n }\n\n var bHasTag = false;\n \n /*bNoPos says: "'till now there has been no check using a positive filter"\n Imagine a filterlist consisting of 1 negative filter:\n If the filter isn't matched, we want hasTag to be true.\n Yet bHasTag is still false ('cause only positive filters cause bHasTag to change)\n \n If no positive filters are present bNoPos is true, and no negative filters are matched so we have not returned false\n Thus: hasTag returns true.\n \n If at any time a positive filter is encountered, we want at least one of the tags to match it, so we turn bNoPos to false, which\n means bHasTag must be true for hasTag to return true*/\n var bNoPos=true;\n \nfor (var t3 = 0; t3 < tagFilters.length; t3++)\n {\n for(var t2=0; t2<tiddlerTags.length; t2++)\n {\n if (tagFilters[t3].length > 1 && tagFilters[t3].charAt(0) == '!') \n {\n if (tiddlerTags[t2] == tagFilters[t3].substring(1))\n {\n //If at any time a negative filter is matched, we return false\n return false;\n }\n }\n else \n {\n if (bNoPos)\n {\n //We encountered the first positive filter\n bNoPos=false;\n }\n if (tiddlerTags[t2] == tagFilters[t3])\n {\n //A positive filter is matched. As long as no negative filter is matched, hasTag will return true\n bHasTag=true;\n }\n }\n }\n }\n return (bNoPos || bHasTag);\n};\n\n//This function searches all tiddlers for the reminder //macro. It is intended that other plugins (like //calendar) will use this function to query for \n//upcoming reminders.\n//The arguments to this function filter out reminders //based on when they will fire.\n//\n//ARGUMENTS:\n//baseDate is the date that is used as "now". \n//leadtime is a two element int array, with leadtime[0] \n// as the lower bound and leadtime[1] as the\n// upper bound. A reasonable default is [0,14]\n//tags is a space-separated list of tags to use to filter \n// tiddlers. If a tag name begins with an !, then \n// only tiddlers which do not have that tag will \n// be considered. For example "examples holidays" \n// will search for reminders in any tiddlers that \n// are tagged with examples or holidays and \n// "!examples !holidays" will search for reminders \n// in any tiddlers that are not tagged with \n// examples or holidays. Pass in null to search \n// all tiddlers.\n//limit. If limit is null, individual reminders can \n// override the leadtime specified earlier. \n// Pass in 1 in order to override that behavior.\n\nwindow.findTiddlersWithReminders = function findTiddlersWithReminders(baseDate, leadtime, tags, limit)\n{\n//function(searchRegExp,sortField,excludeTag)\n// var macroPattern = "<<([^>\s\s]+)(?:\s\s*)([^>]*)>>";\n var macroPattern = "<<(reminder)(.*)>>";\n var macroRegExp = new RegExp(macroPattern,"mg");\n var matches = store.search(macroRegExp,"title","");\n var arr = [];\n var tagsArray = null;\n if (tags != null)\n {\n // tagsArray = tags.split(" ");\n tagsArray = tags.readBracketedList(); // allows tags with spaces. thanks Robin Summerhill, 4-Oct-06.\n }\n for(var t=matches.length-1; t>=0; t--)\n {\n if (tagsArray != null)\n {\n //If they specified tags to filter on, and this tiddler doesn't \n //match, skip it entirely.\n if ( ! hasTag(matches[t].tags, tagsArray))\n {\n continue;\n }\n }\n\n var targetText = matches[t].text;\n do {\n // Get the next formatting match\n var formatMatch = macroRegExp.exec(targetText);\n if(formatMatch && formatMatch[1] != null && formatMatch[1].toLowerCase() == "reminder")\n {\n //Find the matching date.\n \n var params = formatMatch[2] != null ? formatMatch[2].readMacroParams() : {};\n var dateHash = getParamsForReminder(params);\n if (limit != null || dateHash["leadtime"] == null)\n {\n if (leadtime == null)\n dateHash["leadtime"] = leadtime;\n else\n {\n dateHash["leadtime"] = [];\n dateHash["leadtime"][0] = leadtime[0];\n dateHash["leadtime"][1] = leadtime[1];\n }\n }\n if (dateHash["leadtime"] == null)\n dateHash["leadtime"] = config.macros.reminders["defaultLeadTime"]; \n var leadTimeLowerBound = baseDate.addDays(dateHash["leadtime"][0]);\n var leadTimeUpperBound = baseDate.addDays(dateHash["leadtime"][1]);\n var matchedDate = findDateForReminder(dateHash, baseDate, leadTimeLowerBound, leadTimeUpperBound);\n while (matchedDate != null)\n {\n var hash = {};\n hash["diff"] = matchedDate.getDifferenceInDays(baseDate);\n hash["matchedDate"] = new Date(matchedDate.getFullYear(), matchedDate.getMonth(), matchedDate.getDate(), 0, 0);\n hash["params"] = cloneParams(dateHash);\n hash["tiddler"] = matches[t].title;\n hash["tags"] = matches[t].tags;\n arr.pushUnique(hash);\n if (dateHash["recurdays"] != null || (dateHash["year"] == null))\n {\n leadTimeLowerBound = leadTimeLowerBound.addDays(matchedDate.getDifferenceInDays(leadTimeLowerBound)+ 1);\n matchedDate = findDateForReminder(dateHash, baseDate, leadTimeLowerBound, leadTimeUpperBound);\n }\n else matchedDate = null;\n }\n }\n }while(formatMatch);\n }\n if(arr.length > 1) //Sort the array by number of days remaining.\n {\n arr.sort(function (a,b) {if(a["diff"] == b["diff"]) {return(0);} else {return (a["diff"] < b["diff"]) ? -1 : +1; } });\n }\n return arr;\n};\n\n//This function takes the reminder macro parameters and\n//generates the string that is used for display.\n//This function is not intended to be called by \n//other plugins.\n window.getReminderMessageForDisplay= function getReminderMessageForDisplay(diff, params, matchedDate, tiddlerTitle)\n{\n var anniversaryString = "";\n var reminderTitle = params["title"];\n if (reminderTitle == null)\n {\n reminderTitle = config.macros.reminders["untitledReminder"];\n }\n if (params["firstyear"] != null)\n {\n anniversaryString = config.macros.reminders["defaultAnniversaryMessage"].replace("DIFF", (matchedDate.getFullYear() - params["firstyear"]));\n }\n var mess = "";\n var diffString = "";\n if (diff == 0)\n {\n diffString = config.macros.reminders["todayString"];\n }\n else if (diff == 1)\n {\n diffString = config.macros.reminders["tomorrowString"];\n }\n else\n {\n diffString = config.macros.reminders["ndaysString"].replace("DIFF", diff);\n }\n var format = config.macros.reminders["defaultReminderMessage"];\n if (params["format"] != null)\n {\n format = params["format"];\n }\n mess = format;\n//HACK! -- Avoid replacing DD in TIDDLER with the date\n mess = mess.replace(/TIDDLER/g, "TIDELER");\n mess = matchedDate.formatStringDateOnly(mess);\n mess = mess.replace(/TIDELER/g, "TIDDLER");\n if (tiddlerTitle != null)\n {\n mess = mess.replace(/TIDDLERNAME/g, tiddlerTitle);\n mess = mess.replace(/TIDDLER/g, "[[" + tiddlerTitle + "]]");\n }\n \n mess = mess.replace("DIFF", diffString).replace("TITLE", reminderTitle).replace("DATE", matchedDate.formatString("DDD MMM DD, YYYY")).replace("ANNIVERSARY", anniversaryString);\n return mess;\n};\n\n// Parse out the macro parameters into a hashtable. This\n// handles the arguments for reminder, showReminders and \n// displayTiddlersWithReminders.\nwindow.getParamsForReminder = function getParamsForReminder(params)\n{\n var dateHash = {};\n var type = "";\n var num = 0;\n var title = "";\n for(var t=0; t<params.length; t++)\n {\n var split = params[t].split(":");\n type = split[0].toLowerCase();\n var value = split[1];\n for (var i=2; i < split.length; i++)\n {\n value += ":" + split[i];\n }\n if (type == "nolinks" || type == "limit" || type == "hidden")\n {\n num = 1;\n }\n else if (type == "leadtime")\n {\n var leads = value.split("...");\n if (leads.length == 1)\n {\n leads[1]= leads[0];\n leads[0] = 0;\n }\n leads[0] = parseInt(leads[0], 10);\n leads[1] = parseInt(leads[1], 10);\n num = leads;\n }\n else if (type == "offsetdayofweek")\n {\n if (value.substr(0,1) == "-")\n {\n dateHash["negativeOffsetDayOfWeek"] = 1;\n value = value.substr(1);\n }\n num = parseInt(value, 10);\n }\n else if (type != "title" && type != "tag" && type != "format")\n {\n num = parseInt(value, 10);\n }\n else\n {\n title = value;\n t++;\n while (title.substr(0,1) == '"' && title.substr(title.length - 1,1) != '"' && params[t] != undefined)\n {\n title += " " + params[t++];\n }\n //Trim off the leading and trailing quotes\n if (title.substr(0,1) == "\s"" && title.substr(title.length - 1,1)== "\s"")\n {\n title = title.substr(1, title.length - 2);\n t--;\n }\n num = title;\n }\n dateHash[type] = num;\n }\n //date is synonymous with day\n if (dateHash["day"] == null)\n {\n dateHash["day"] = dateHash["date"];\n }\n return dateHash;\n};\n\n//This function finds the date specified in the reminder \n//parameters. It will return null if no match can be\n//found. This function is not intended to be used by\n//other plugins.\nwindow.findDateForReminder= function findDateForReminder( dateHash, baseDate, leadTimeLowerBound, leadTimeUpperBound)\n{\n if (baseDate == null)\n {\n baseDate = new Date().getMidnight();\n }\n var hashKey = baseDate.convertToYYYYMMDDHHMM();\n for (var k in dateHash)\n {\n hashKey += "," + k + "|" + dateHash[k];\n }\n hashKey += "," + leadTimeLowerBound.convertToYYYYMMDDHHMM();\n hashKey += "," + leadTimeUpperBound.convertToYYYYMMDDHHMM();\n if (reminderCache[hashKey] == null)\n {\n //If we don't find a match in this run, then we will\n //cache that the reminder can't be matched.\n reminderCache[hashKey] = false;\n }\n else if (reminderCache[hashKey] == false)\n {\n //We've already tried this date and failed\n return null;\n }\n else\n {\n return reminderCache[hashKey];\n }\n \n var bOffsetSpecified = dateHash["offsetyear"] != null || \n dateHash["offsetmonth"] != null || \n dateHash["offsetday"] != null || \n dateHash["offsetdayofweek"] != null || \n dateHash["recurdays"] != null;\n \n // If we are matching the base date for a dayofweek offset, look for the base date a \n //little further back.\n var tmp1leadTimeLowerBound = leadTimeLowerBound; \n if ( dateHash["offsetdayofweek"] != null)\n {\n tmp1leadTimeLowerBound = leadTimeLowerBound.addDays(-6); \n }\n var matchedDate = baseDate.findMatch(dateHash, tmp1leadTimeLowerBound, leadTimeUpperBound);\n if (matchedDate != null)\n {\n var newMatchedDate = matchedDate;\n if (dateHash["recurdays"] != null)\n {\n while (newMatchedDate.getTime() < leadTimeLowerBound.getTime())\n {\n newMatchedDate = newMatchedDate.addDays(dateHash["recurdays"]);\n }\n }\n else if (dateHash["offsetyear"] != null || \n dateHash["offsetmonth"] != null || \n dateHash["offsetday"] != null || \n dateHash["offsetdayofweek"] != null)\n {\n var tmpdateHash = cloneParams(dateHash);\n tmpdateHash["year"] = dateHash["offsetyear"];\n tmpdateHash["month"] = dateHash["offsetmonth"];\n tmpdateHash["day"] = dateHash["offsetday"];\n tmpdateHash["dayofweek"] = dateHash["offsetdayofweek"];\n var tmpleadTimeLowerBound = leadTimeLowerBound;\n var tmpleadTimeUpperBound = leadTimeUpperBound;\n if (tmpdateHash["offsetdayofweek"] != null)\n {\n if (tmpdateHash["negativeOffsetDayOfWeek"] == 1)\n {\n tmpleadTimeLowerBound = matchedDate.addDays(-6);\n tmpleadTimeUpperBound = matchedDate;\n\n }\n else\n {\n tmpleadTimeLowerBound = matchedDate;\n tmpleadTimeUpperBound = matchedDate.addDays(6);\n }\n\n }\n newMatchedDate = matchedDate.findMatch(tmpdateHash, tmpleadTimeLowerBound, tmpleadTimeUpperBound);\n //The offset couldn't be matched. return null.\n if (newMatchedDate == null)\n {\n return null;\n }\n }\n if (newMatchedDate.isBetween(leadTimeLowerBound, leadTimeUpperBound))\n {\n reminderCache[hashKey] = newMatchedDate;\n return newMatchedDate;\n }\n }\n return null;\n};\n\n//This does much the same job as findDateForReminder, but\n//this one doesn't deal with offsets or recurring \n//reminders.\nDate.prototype.findMatch = function findMatch(dateHash, leadTimeLowerBound, leadTimeUpperBound)\n{\n\n var bSpecifiedYear = (dateHash["year"] != null);\n var bSpecifiedMonth = (dateHash["month"] != null);\n var bSpecifiedDay = (dateHash["day"] != null);\n var bSpecifiedDayOfWeek = (dateHash["dayofweek"] != null);\n if (bSpecifiedYear && bSpecifiedMonth && bSpecifiedDay)\n {\n return new Date(dateHash["year"], dateHash["month"]-1, dateHash["day"], 0, 0);\n }\n var bMatchedYear = !bSpecifiedYear;\n var bMatchedMonth = !bSpecifiedMonth;\n var bMatchedDay = !bSpecifiedDay;\n var bMatchedDayOfWeek = !bSpecifiedDayOfWeek;\n if (bSpecifiedDay && bSpecifiedMonth && !bSpecifiedYear && !bSpecifiedDayOfWeek)\n {\n\n //Shortcut -- First try this year. If it's too small, try next year.\n var tmpMidnight = this.getMidnight();\n var tmpDate = new Date(this.getFullYear(), dateHash["month"]-1, dateHash["day"], 0,0);\n if (tmpDate.getTime() < leadTimeLowerBound.getTime())\n {\n tmpDate = new Date((this.getFullYear() + 1), dateHash["month"]-1, dateHash["day"], 0,0);\n }\n if ( tmpDate.isBetween(leadTimeLowerBound, leadTimeUpperBound))\n {\n return tmpDate;\n }\n else\n {\n return null;\n }\n }\n\n var newDate = leadTimeLowerBound; \n while (newDate.isBetween(leadTimeLowerBound, leadTimeUpperBound))\n {\n var tmp = testDate(newDate, dateHash, bSpecifiedYear, bSpecifiedMonth, bSpecifiedDay, bSpecifiedDayOfWeek);\n if (tmp != null)\n return tmp;\n newDate = newDate.addDays(1);\n }\n};\n\nfunction testDate(testMe, dateHash, bSpecifiedYear, bSpecifiedMonth, bSpecifiedDay, bSpecifiedDayOfWeek)\n{\n var bMatchedYear = !bSpecifiedYear;\n var bMatchedMonth = !bSpecifiedMonth;\n var bMatchedDay = !bSpecifiedDay;\n var bMatchedDayOfWeek = !bSpecifiedDayOfWeek;\n if (bSpecifiedYear)\n {\n bMatchedYear = (dateHash["year"] == testMe.getFullYear());\n }\n if (bSpecifiedMonth)\n {\n bMatchedMonth = ((dateHash["month"] - 1) == testMe.getMonth() );\n }\n if (bSpecifiedDay)\n {\n bMatchedDay = (dateHash["day"] == testMe.getDate());\n }\n if (bSpecifiedDayOfWeek)\n {\n bMatchedDayOfWeek = (dateHash["dayofweek"] == testMe.getDay());\n }\n\n if (bMatchedYear && bMatchedMonth && bMatchedDay && bMatchedDayOfWeek)\n {\n return testMe;\n }\n};\n\n//Returns true if the date is in between two given dates\nDate.prototype.isBetween = function isBetween(lowerBound, upperBound)\n{\n return (this.getTime() >= lowerBound.getTime() && this.getTime() <= upperBound.getTime());\n}\n//Return a new date, with the time set to midnight (0000)\nDate.prototype.getMidnight = function getMidnight()\n{\n return new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0);\n};\n// Add the specified number of days to a date.\nDate.prototype.addDays = function addDays(numberOfDays)\n{\n return new Date(this.getFullYear(), this.getMonth(), this.getDate() + numberOfDays, 0, 0);\n};\n//Return the number of days between two dates.\nDate.prototype.getDifferenceInDays = function getDifferenceInDays(otherDate)\n{\n//I have to do it this way, because this way ignores daylight savings\n var tmpDate = this.addDays(0);\n if (this.getTime() > otherDate.getTime())\n {\n var i = 0;\n for (i = 0; tmpDate.getTime() > otherDate.getTime(); i++)\n {\n tmpDate = tmpDate.addDays(-1);\n }\n return i;\n }\n else\n {\n var i = 0;\n for (i = 0; tmpDate.getTime() < otherDate.getTime(); i++)\n {\n tmpDate = tmpDate.addDays(1);\n }\n return i * -1;\n }\n return 0;\n};\nfunction cloneParams(what) {\n var tmp = {};\n for (var i in what) {\n tmp[i] = what[i];\n }\n return tmp;\n}\n// Substitute date components into a string\nDate.prototype.formatStringDateOnly = function formatStringDateOnly(template)\n{\n template = template.replace("YYYY",this.getFullYear());\n template = template.replace("YY",String.zeroPad(this.getFullYear()-2000,2));\n template = template.replace("MMM",config.messages.dates.months[this.getMonth()]);\n template = template.replace("0MM",String.zeroPad(this.getMonth()+1,2));\n template = template.replace("MM",this.getMonth()+1);\n template = template.replace("DDD",config.messages.dates.days[this.getDay()]);\n template = template.replace("0DD",String.zeroPad(this.getDate(),2));\n template = template.replace("DD",this.getDate());\n return template;\n};\n\n//}}}