Background: #fff
Foreground: #000
PrimaryPale: #8cf
PrimaryLight: #18f
PrimaryMid: #04b
PrimaryDark: #014
SecondaryPale: #ffc
SecondaryLight: #fe8
SecondaryMid: #db4
SecondaryDark: #841
TertiaryPale: #eee
TertiaryLight: #ccc
TertiaryMid: #999
TertiaryDark: #666
Error: #f88
/*{{{*/
body {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}

a {color:[[ColorPalette::PrimaryMid]];}
a:hover {background-color:[[ColorPalette::PrimaryMid]]; color:[[ColorPalette::Background]];}
a img {border:0;}

h1,h2,h3,h4,h5,h6 {color:[[ColorPalette::SecondaryDark]]; background:transparent;}
h1 {border-bottom:2px solid [[ColorPalette::TertiaryLight]];}
h2,h3 {border-bottom:1px solid [[ColorPalette::TertiaryLight]];}

.button {color:[[ColorPalette::PrimaryDark]]; border:1px solid [[ColorPalette::Background]];}
.button:hover {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::SecondaryLight]]; border-color:[[ColorPalette::SecondaryMid]];}
.button:active {color:[[ColorPalette::Background]]; background:[[ColorPalette::SecondaryMid]]; border:1px solid [[ColorPalette::SecondaryDark]];}

.header {background:[[ColorPalette::PrimaryMid]];}
.headerShadow {color:[[ColorPalette::Foreground]];}
.headerShadow a {font-weight:normal; color:[[ColorPalette::Foreground]];}
.headerForeground {color:[[ColorPalette::Background]];}
.headerForeground a {font-weight:normal; color:[[ColorPalette::PrimaryPale]];}

.tabSelected{color:[[ColorPalette::PrimaryDark]];
	background:[[ColorPalette::TertiaryPale]];
	border-left:1px solid [[ColorPalette::TertiaryLight]];
	border-top:1px solid [[ColorPalette::TertiaryLight]];
	border-right:1px solid [[ColorPalette::TertiaryLight]];
}
.tabUnselected {color:[[ColorPalette::Background]]; background:[[ColorPalette::TertiaryMid]];}
.tabContents {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::TertiaryPale]]; border:1px solid [[ColorPalette::TertiaryLight]];}
.tabContents .button {border:0;}

#sidebar {}
#sidebarOptions input {border:1px solid [[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel {background:[[ColorPalette::PrimaryPale]];}
#sidebarOptions .sliderPanel a {border:none;color:[[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel a:hover {color:[[ColorPalette::Background]]; background:[[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel a:active {color:[[ColorPalette::PrimaryMid]]; background:[[ColorPalette::Background]];}

.wizard {background:[[ColorPalette::PrimaryPale]]; border:1px solid [[ColorPalette::PrimaryMid]];}
.wizard h1 {color:[[ColorPalette::PrimaryDark]]; border:none;}
.wizard h2 {color:[[ColorPalette::Foreground]]; border:none;}
.wizardStep {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];
	border:1px solid [[ColorPalette::PrimaryMid]];}
.wizardStep.wizardStepDone {background::[[ColorPalette::TertiaryLight]];}
.wizardFooter {background:[[ColorPalette::PrimaryPale]];}
.wizardFooter .status {background:[[ColorPalette::PrimaryDark]]; color:[[ColorPalette::Background]];}
.wizard .button {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::SecondaryLight]]; border: 1px solid;
	border-color:[[ColorPalette::SecondaryPale]] [[ColorPalette::SecondaryDark]] [[ColorPalette::SecondaryDark]] [[ColorPalette::SecondaryPale]];}
.wizard .button:hover {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::Background]];}
.wizard .button:active {color:[[ColorPalette::Background]]; background:[[ColorPalette::Foreground]]; border: 1px solid;
	border-color:[[ColorPalette::PrimaryDark]] [[ColorPalette::PrimaryPale]] [[ColorPalette::PrimaryPale]] [[ColorPalette::PrimaryDark]];}

#messageArea {border:1px solid [[ColorPalette::SecondaryMid]]; background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]];}
#messageArea .button {color:[[ColorPalette::PrimaryMid]]; background:[[ColorPalette::SecondaryPale]]; border:none;}

.popupTiddler {background:[[ColorPalette::TertiaryPale]]; border:2px solid [[ColorPalette::TertiaryMid]];}

.popup {background:[[ColorPalette::TertiaryPale]]; color:[[ColorPalette::TertiaryDark]]; border-left:1px solid [[ColorPalette::TertiaryMid]]; border-top:1px solid [[ColorPalette::TertiaryMid]]; border-right:2px solid [[ColorPalette::TertiaryDark]]; border-bottom:2px solid [[ColorPalette::TertiaryDark]];}
.popup hr {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::PrimaryDark]]; border-bottom:1px;}
.popup li.disabled {color:[[ColorPalette::TertiaryMid]];}
.popup li a, .popup li a:visited {color:[[ColorPalette::Foreground]]; border: none;}
.popup li a:hover {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; border: none;}
.popup li a:active {background:[[ColorPalette::SecondaryPale]]; color:[[ColorPalette::Foreground]]; border: none;}
.popupHighlight {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
.listBreak div {border-bottom:1px solid [[ColorPalette::TertiaryDark]];}

.tiddler .defaultCommand {font-weight:bold;}

.shadow .title {color:[[ColorPalette::TertiaryDark]];}

.title {color:[[ColorPalette::SecondaryDark]];}
.subtitle {color:[[ColorPalette::TertiaryDark]];}

.toolbar {color:[[ColorPalette::PrimaryMid]];}
.toolbar a {color:[[ColorPalette::TertiaryLight]];}
.selected .toolbar a {color:[[ColorPalette::TertiaryMid]];}
.selected .toolbar a:hover {color:[[ColorPalette::Foreground]];}

.tagging, .tagged {border:1px solid [[ColorPalette::TertiaryPale]]; background-color:[[ColorPalette::TertiaryPale]];}
.selected .tagging, .selected .tagged {background-color:[[ColorPalette::TertiaryLight]]; border:1px solid [[ColorPalette::TertiaryMid]];}
.tagging .listTitle, .tagged .listTitle {color:[[ColorPalette::PrimaryDark]];}
.tagging .button, .tagged .button {border:none;}

.footer {color:[[ColorPalette::TertiaryLight]];}
.selected .footer {color:[[ColorPalette::TertiaryMid]];}

.sparkline {background:[[ColorPalette::PrimaryPale]]; border:0;}
.sparktick {background:[[ColorPalette::PrimaryDark]];}

.error, .errorButton {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::Error]];}
.warning {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::SecondaryPale]];}
.lowlight {background:[[ColorPalette::TertiaryLight]];}

.zoomer {background:none; color:[[ColorPalette::TertiaryMid]]; border:3px solid [[ColorPalette::TertiaryMid]];}

.imageLink, #displayArea .imageLink {background:transparent;}

.annotation {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; border:2px solid [[ColorPalette::SecondaryMid]];}

.viewer .listTitle {list-style-type:none; margin-left:-2em;}
.viewer .button {border:1px solid [[ColorPalette::SecondaryMid]];}
.viewer blockquote {border-left:3px solid [[ColorPalette::TertiaryDark]];}

.viewer table, table.twtable {border:2px solid [[ColorPalette::TertiaryDark]];}
.viewer th, .viewer thead td, .twtable th, .twtable thead td {background:[[ColorPalette::SecondaryMid]]; border:1px solid [[ColorPalette::TertiaryDark]]; color:[[ColorPalette::Background]];}
.viewer td, .viewer tr, .twtable td, .twtable tr {border:1px solid [[ColorPalette::TertiaryDark]];}

.viewer pre {border:1px solid [[ColorPalette::SecondaryLight]]; background:[[ColorPalette::SecondaryPale]];}
.viewer code {color:[[ColorPalette::SecondaryDark]];}
.viewer hr {border:0; border-top:dashed 1px [[ColorPalette::TertiaryDark]]; color:[[ColorPalette::TertiaryDark]];}

.highlight, .marked {background:[[ColorPalette::SecondaryLight]];}

.editor input {border:1px solid [[ColorPalette::PrimaryMid]];}
.editor textarea {border:1px solid [[ColorPalette::PrimaryMid]]; width:100%;}
.editorFooter {color:[[ColorPalette::TertiaryMid]];}

#backstageArea {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::TertiaryMid]];}
#backstageArea a {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::Background]]; border:none;}
#backstageArea a:hover {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; }
#backstageArea a.backstageSelTab {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
#backstageButton a {background:none; color:[[ColorPalette::Background]]; border:none;}
#backstageButton a:hover {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::Background]]; border:none;}
#backstagePanel {background:[[ColorPalette::Background]]; border-color: [[ColorPalette::Background]] [[ColorPalette::TertiaryDark]] [[ColorPalette::TertiaryDark]] [[ColorPalette::TertiaryDark]];}
.backstagePanelFooter .button {border:none; color:[[ColorPalette::Background]];}
.backstagePanelFooter .button:hover {color:[[ColorPalette::Foreground]];}
#backstageCloak {background:[[ColorPalette::Foreground]]; opacity:0.6; filter:'alpha(opacity:60)';}
/*}}}*/
/*{{{*/
* html .tiddler {height:1%;}

body {font-size:.75em; font-family:arial,helvetica; margin:0; padding:0;}

h1,h2,h3,h4,h5,h6 {font-weight:bold; text-decoration:none;}
h1,h2,h3 {padding-bottom:1px; margin-top:1.2em;margin-bottom:0.3em;}
h4,h5,h6 {margin-top:1em;}
h1 {font-size:1.35em;}
h2 {font-size:1.25em;}
h3 {font-size:1.1em;}
h4 {font-size:1em;}
h5 {font-size:.9em;}

hr {height:1px;}

a {text-decoration:none;}

dt {font-weight:bold;}

ol {list-style-type:decimal;}
ol ol {list-style-type:lower-alpha;}
ol ol ol {list-style-type:lower-roman;}
ol ol ol ol {list-style-type:decimal;}
ol ol ol ol ol {list-style-type:lower-alpha;}
ol ol ol ol ol ol {list-style-type:lower-roman;}
ol ol ol ol ol ol ol {list-style-type:decimal;}

.txtOptionInput {width:11em;}

#contentWrapper .chkOptionInput {border:0;}

.externalLink {text-decoration:underline;}

.indent {margin-left:3em;}
.outdent {margin-left:3em; text-indent:-3em;}
code.escaped {white-space:nowrap;}

.tiddlyLinkExisting {font-weight:bold;}
.tiddlyLinkNonExisting {font-style:italic;}

/* the 'a' is required for IE, otherwise it renders the whole tiddler in bold */
a.tiddlyLinkNonExisting.shadow {font-weight:bold;}

#mainMenu .tiddlyLinkExisting,
	#mainMenu .tiddlyLinkNonExisting,
	#sidebarTabs .tiddlyLinkNonExisting {font-weight:normal; font-style:normal;}
#sidebarTabs .tiddlyLinkExisting {font-weight:bold; font-style:normal;}

.header {position:relative;}
.header a:hover {background:transparent;}
.headerShadow {position:relative; padding:4.5em 0em 1em 1em; left:-1px; top:-1px;}
.headerForeground {position:absolute; padding:4.5em 0em 1em 1em; left:0px; top:0px;}

.siteTitle {font-size:3em;}
.siteSubtitle {font-size:1.2em;}

#mainMenu {position:absolute; left:0; width:10em; text-align:right; line-height:1.6em; padding:1.5em 0.5em 0.5em 0.5em; font-size:1.1em;}

#sidebar {position:absolute; right:3px; width:16em; font-size:.9em;}
#sidebarOptions {padding-top:0.3em;}
#sidebarOptions a {margin:0em 0.2em; padding:0.2em 0.3em; display:block;}
#sidebarOptions input {margin:0.4em 0.5em;}
#sidebarOptions .sliderPanel {margin-left:1em; padding:0.5em; font-size:.85em;}
#sidebarOptions .sliderPanel a {font-weight:bold; display:inline; padding:0;}
#sidebarOptions .sliderPanel input {margin:0 0 .3em 0;}
#sidebarTabs .tabContents {width:15em; overflow:hidden;}

.wizard {padding:0.1em 1em 0em 2em;}
.wizard h1 {font-size:2em; font-weight:bold; background:none; padding:0em 0em 0em 0em; margin:0.4em 0em 0.2em 0em;}
.wizard h2 {font-size:1.2em; font-weight:bold; background:none; padding:0em 0em 0em 0em; margin:0.4em 0em 0.2em 0em;}
.wizardStep {padding:1em 1em 1em 1em;}
.wizard .button {margin:0.5em 0em 0em 0em; font-size:1.2em;}
.wizardFooter {padding:0.8em 0.4em 0.8em 0em;}
.wizardFooter .status {padding:0em 0.4em 0em 0.4em; margin-left:1em;}
.wizard .button {padding:0.1em 0.2em 0.1em 0.2em;}

#messageArea {position:fixed; top:2em; right:0em; margin:0.5em; padding:0.5em; z-index:2000; _position:absolute;}
.messageToolbar {display:block; text-align:right; padding:0.2em 0.2em 0.2em 0.2em;}
#messageArea a {text-decoration:underline;}

.tiddlerPopupButton {padding:0.2em 0.2em 0.2em 0.2em;}
.popupTiddler {position: absolute; z-index:300; padding:1em 1em 1em 1em; margin:0;}

.popup {position:absolute; z-index:300; font-size:.9em; padding:0; list-style:none; margin:0;}
.popup .popupMessage {padding:0.4em;}
.popup hr {display:block; height:1px; width:auto; padding:0; margin:0.2em 0em;}
.popup li.disabled {padding:0.4em;}
.popup li a {display:block; padding:0.4em; font-weight:normal; cursor:pointer;}
.listBreak {font-size:1px; line-height:1px;}
.listBreak div {margin:2px 0;}

.tabset {padding:1em 0em 0em 0.5em;}
.tab {margin:0em 0em 0em 0.25em; padding:2px;}
.tabContents {padding:0.5em;}
.tabContents ul, .tabContents ol {margin:0; padding:0;}
.txtMainTab .tabContents li {list-style:none;}
.tabContents li.listLink { margin-left:.75em;}

#contentWrapper {display:block;}
#splashScreen {display:none;}

#displayArea {margin:1em 17em 0em 14em;}

.toolbar {text-align:right; font-size:.9em;}

.tiddler {padding:1em 1em 0em 1em;}

.missing .viewer,.missing .title {font-style:italic;}

.title {font-size:1.6em; font-weight:bold;}

.missing .subtitle {display:none;}
.subtitle {font-size:1.1em;}

.tiddler .button {padding:0.2em 0.4em;}

.tagging {margin:0.5em 0.5em 0.5em 0; float:left; display:none;}
.isTag .tagging {display:block;}
.tagged {margin:0.5em; float:right;}
.tagging, .tagged {font-size:0.9em; padding:0.25em;}
.tagging ul, .tagged ul {list-style:none; margin:0.25em; padding:0;}
.tagClear {clear:both;}

.footer {font-size:.9em;}
.footer li {display:inline;}

.annotation {padding:0.5em; margin:0.5em;}

* html .viewer pre {width:99%; padding:0 0 1em 0;}
.viewer {line-height:1.4em; padding-top:0.5em;}
.viewer .button {margin:0em 0.25em; padding:0em 0.25em;}
.viewer blockquote {line-height:1.5em; padding-left:0.8em;margin-left:2.5em;}
.viewer ul, .viewer ol {margin-left:0.5em; padding-left:1.5em;}

.viewer table, table.twtable {border-collapse:collapse; margin:0.8em 1.0em;}
.viewer th, .viewer td, .viewer tr,.viewer caption,.twtable th, .twtable td, .twtable tr,.twtable caption {padding:3px;}
table.listView {font-size:0.85em; margin:0.8em 1.0em;}
table.listView th, table.listView td, table.listView tr {padding:0px 3px 0px 3px;}

.viewer pre {padding:0.5em; margin-left:0.5em; font-size:1.2em; line-height:1.4em; overflow:auto;}
.viewer code {font-size:1.2em; line-height:1.4em;}

.editor {font-size:1.1em;}
.editor input, .editor textarea {display:block; width:100%; font:inherit;}
.editorFooter {padding:0.25em 0em; font-size:.9em;}
.editorFooter .button {padding-top:0px; padding-bottom:0px;}

.fieldsetFix {border:0; padding:0; margin:1px 0px 1px 0px;}

.sparkline {line-height:1em;}
.sparktick {outline:0;}

.zoomer {font-size:1.1em; position:absolute; overflow:hidden;}
.zoomer div {padding:1em;}

* html #backstage {width:99%;}
* html #backstageArea {width:99%;}
#backstageArea {display:none; position:relative; overflow: hidden; z-index:150; padding:0.3em 0.5em 0.3em 0.5em;}
#backstageToolbar {position:relative;}
#backstageArea a {font-weight:bold; margin-left:0.5em; padding:0.3em 0.5em 0.3em 0.5em;}
#backstageButton {display:none; position:absolute; z-index:175; top:0em; right:0em;}
#backstageButton a {padding:0.1em 0.4em 0.1em 0.4em; margin:0.1em 0.1em 0.1em 0.1em;}
#backstage {position:relative; width:100%; z-index:50;}
#backstagePanel {display:none; z-index:100; position:absolute; margin:0em 3em 0em 3em; padding:1em 1em 1em 1em;}
.backstagePanelFooter {padding-top:0.2em; float:right;}
.backstagePanelFooter a {padding:0.2em 0.4em 0.2em 0.4em;}
#backstageCloak {display:none; z-index:20; position:absolute; width:100%; height:100px;}

.whenBackstage {display:none;}
.backstageVisible .whenBackstage {display:block;}
/*}}}*/
/***
StyleSheet for use when a translation requires any css style changes.
This StyleSheet can be used directly by languages such as Chinese, Japanese and Korean which use a logographic writing system and need larger font sizes.
***/

/*{{{*/
body {font-size:0.8em;}

#sidebarOptions {font-size:1.05em;}
#sidebarOptions a {font-style:normal;}
#sidebarOptions .sliderPanel {font-size:0.95em;}

.subtitle {font-size:0.8em;}

.viewer table.listView {font-size:0.95em;}

.htmlarea .toolbarHA table {border:1px solid ButtonFace; margin:0em 0em;}
/*}}}*/
/*{{{*/
@media print {
#mainMenu, #sidebar, #messageArea, .toolbar, #backstageButton {display: none ! important;}
#displayArea {margin: 1em 1em 0em 1em;}
/* Fixes a feature in Firefox 1.5.0.2 where print preview displays the noscript content */
noscript {display:none;}
}
/*}}}*/
<!--{{{-->
<div class='header' macro='gradient vert [[ColorPalette::PrimaryLight]] [[ColorPalette::PrimaryMid]]'>
<div class='headerShadow'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
<div class='headerForeground'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
</div>
<div id='mainMenu' refresh='content' tiddler='MainMenu'></div>
<div id='sidebar'>
<div id='sidebarOptions' refresh='content' tiddler='SideBarOptions'></div>
<div id='sidebarTabs' refresh='content' force='true' tiddler='SideBarTabs'></div>
</div>
<div id='displayArea'>
<div id='messageArea'></div>
<div id='tiddlerDisplay'></div>
</div>
<!--}}}-->
<!--{{{-->
<div class='toolbar' macro='toolbar closeTiddler closeOthers +editTiddler > fields syncing permalink references jump'></div>
<div class='title' macro='view title'></div>
<div class='subtitle'><span macro='view modifier link'></span>, <span macro='view modified date'></span> (<span macro='message views.wikified.createdPrompt'></span> <span macro='view created date'></span>)</div>
<div class='tagging' macro='tagging'></div>
<div class='tagged' macro='tags'></div>
<div class='viewer' macro='view text wikified'></div>
<div class='tagClear'></div>
<!--}}}-->
<!--{{{-->
<div class='toolbar' macro='toolbar +saveTiddler -cancelTiddler deleteTiddler'></div>
<div class='title' macro='view title'></div>
<div class='editor' macro='edit title'></div>
<div macro='annotations'></div>
<div class='editor' macro='edit text'></div>
<div class='editor' macro='edit tags'></div><div class='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser'></span></div>
<!--}}}-->
To get started with this blank TiddlyWiki, you'll need to modify the following tiddlers:
* SiteTitle & SiteSubtitle: The title and subtitle of the site, as shown above (after saving, they will also appear in the browser title bar)
* MainMenu: The menu (usually on the left)
* DefaultTiddlers: Contains the names of the tiddlers that you want to appear when the TiddlyWiki is opened
You'll also need to enter your username for signing your edits: <<option txtUserName>>
These InterfaceOptions for customising TiddlyWiki are saved in your browser

Your username for signing your edits. Write it as a WikiWord (eg JoeBloggs)

<<option txtUserName>>
<<option chkSaveBackups>> SaveBackups
<<option chkAutoSave>> AutoSave
<<option chkRegExpSearch>> RegExpSearch
<<option chkCaseSensitiveSearch>> CaseSensitiveSearch
<<option chkAnimate>> EnableAnimations

----
Also see AdvancedOptions
<<options>>
<!--{{{-->
<div class='header' macro='gradient vert [[ColorPalette::PrimaryLight]] [[ColorPalette::PrimaryMid]]'>
<table width="99%"><tr><td>
<div class='headerShadow'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
<div class='headerForeground'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
</td><td>author mode!
</td><td align="right"><span macro='search "" sizeTextbox:30 buttonAtRight:1'></span></td></tr></table>
</div>
<div id='mainMenu' refresh='content' tiddler='MainMenu'></div>

<div id='sidebar'>
<div id='sidebarOptions' refresh='content' tiddler='SideBarOptions'></div>
<div id='sidebarTabs' refresh='content' force='true' tiddler='SideBarTabs'></div>
</div>

<div id='displayArea'>
<div id='messageArea'></div>
<div id='tiddlerDisplay'></div>
</div>
<!--}}}-->
<!--{{{-->
<div class='toolbar' macro='toolbar closeTiddler closeOthers +editTiddler permalink references jump > fields syncing'></div>
<div class='title' macro='view title'></div>
<div class='subtitle'><span macro='view modifier link'></span>, <span macro='view modified date [[DD MMM YYYY]]'></span> (<span macro='message views.wikified.createdPrompt'></span> <span macro='view created date [[DD MMM YYYY]]'></span>)</div>
<div class='tagging' macro='tagging'></div>
<div class='tagged' macro='tags'></div>
<div class='viewer'> <span macro='navigation "" "" tutorial'></span></div> <div class='viewer'><br/> <span macro='view text wikified'></span> <span macro='navigation "" "" tutorial'></span> </div>
<div class='tagClear'></div>
<!--}}}-->
!~Mini-Howto for module installation via CPAN
First, start perl CPAN interactive shell from command line prompt:
{{codeblock{
$ perl -MCPAN -we 'shell'}}}
To install perl modules in a non-standard location (e.g. as a non-root user, here "~/myperl"), type the following:
{{codeblock{
cpan$ o conf makepl_arg "PREFIX=~/myperl" o conf make_install_arg UNINST=0 o conf commit}}}
Then proceed with module installation:
{{codeblock{
cpan$ install GD
cpan$ install DBI
cpan$ install DBD::mysql}}}
!How to change the relevant environment variables to include the custom perl module location(s)
In case of non-standard locations for perl modules, modify/extend the {{code{$~PERL5LIB}}}, {{code{$MANPATH}}} and {{code{$PATH}}} environment variables (e.g. in {{code{.bash_profile}}}) to include the local module-, manpage- and binary- directories:
{{codeblock{
myLocalDir=~/myperl
if [ -z "$~PERL5LIB" ]
then	# If ~PERL5LIB wasn't previously defined, set it...
"""	PERL5LIB=${myLocalDir}/lib:${myLocalDir}/lib/perl5"""
else  # ...otherwise, extend it.
"""	PERL5LIB=$PERL5LIB:${myLocalDir}/lib:${myLocalDir}/lib/perl5"""
fi
if [ -z "$MANPATH" ]
then
	MANPATH=${myLocalDir}/man
else 
	MANPATH=$MANPATH:${myLocalDir}/man
fi
"""PATH=${myLocalDir}/bin:${PATH}"""
export ~PERL5LIB MANPATH PATH}}}
!!Some guidelines for the setting of appropriate parameters for the evaluation of candidate synteny regions via HSP chaining and gene order alignment

!!!Parameter controlling the HSP chaining (cutoffs for the target loci):

{{code{''bitscore-cutoff''}}}: the bit-score threshold each consistent HSP chain has to reach in order to be considered for target loci grouping;
default value of 50 can be increased to e.g. 100, to more exclude spurious hits (that might lead to largely-merged sets of overlapping HSP chains), if needed (as done with the Hox and ParaHox applications)

{{code{''max-protein-overlap''}}}: the maximal overlap of query intervals to be tolerated between two consistently chained HSPs;  
default value of 40 amino acids is practically sufficient (to take into account blast hit properties (inaccuracy w.r.t. exon-intron-structure detection))

{{code{''loci-size-factor''}}}: the multiple to be used for restricting the HSP chain length for a biologically meaningful target locus;
default value of 2 should be increased if HSPs are expected to reside within a larger range. However, the resulting chained loci should still be biologically reasonable.

{{code{''max-loci-size''}}}: there is no change needed explicitely, this is only to set a global maximum useful in case of a large {{code{loci-size-factor}}} at the same time

!!!Parameter controlling the gene order alignment

In general, there is no change of the default values necessary.

{{code{''gapCosts''}}}: score value to be subtracted in case of a gap in the reference or the target sequence of loci; default=20 for both types of gaps;
it may be of use (it may be an option) to more penalize gaps in the reference sequence (which would mean an insertion/rearrangement within the target region), and to be more tolerant if the gap is within the target sequence of loci (gene loss).

{{code{''mismatchCost''}}}: value to subtract in case of a mismatch; default=1000, such that a mismatch will never be an option for the optimal aligmment (an infinite penalty is not necessary to prevent mismatches)

{{code{''misorientationFraction''}}}: the fraction in percent of the bit-score to use for HSP chains with opposite orientation w.r.t. the reference order of loci; default=90 percent (in practical not of such a great use)

!!Some guidelines for the setting of appropriate parameters for the search of candidate syntenic target regions

!!!parameter N - the number of different query protein hits to be contained at minimum (option in commandline tool: {{code{-Q}}} and/or {{code{-q}}})

For all practical purposes, a value of 1 should be sufficient to enable extraction of all the syntenic regions of interest.  However, allowing for such a relaxed constraint may lead to a relatively high number of candidate regions with only a few query-specific different hits. By limitting the number of reported regions (parameters {{code{-n}}} and {{code{-g}}}) this problem can be handled.  As candidate regions are reported in descending order based on their sum of all queries' maximal score, the most "syntenic" regions will be returned. Another advantage of setting {{code{N}}} to 1 is that in this case also gene loci with low gene content conservation (isolated loci) can be found among the reported regions depending on the value of the bitscores.

High values (e.g. 50 percent of the reference set size) can be used if good conservation of synteny and no duplication, massive rearrangment and/or gene loss events are expected w.r.t. the target species, relatively. This will reduce the number of candidate regions with low conservation of synteny.

!!!parameter L - the maximal length of a candidate syntenic target region:

This parameter limits the size of the reported candidate regions. Depending on the size differences between reference and target genome and its distribution of genes, this parameter should be adapted.  For example, when using human as reference species, a search within the teleost fishes should result in homologous cluster regions of sizes much smaller than the reference. Thus, values smaller than the reference block size might be sufficient. However to ensure not too miss a fraction of the cluster, e.g. in case of assembly problems (artificial inclusions/duplications etc), a moderate value such as twice (or higher) the reference size should work well, also for the remaining vertebrate genomes.

The length constraint is normally set relative to the reference size by specifying a size factor (option {{code{-f}}} in the commandline tool), alternatively as absolute size constraint (option {{code{-F}}}).

It can be easily tried out to allow the complete chromosome or contig as a valid candidate region (by setting L to a very large number), which however would imply that there is only one orthologous/homologous cluster locus expected per chromosome/contig of the target genome. But to get an overview on the general distribution of reference's blast hits among the different target chromosomes (which can be seen on the dotplot graphics after evaluation) this setting may be an option.

On the other hand, too small values of L (w.r.t. the actual cluster size expected) may result in return of partial cluster regions or missing of some target gene loci. To avoid this problem, default settings enable the output of partly overlapping candidate regions (see option {{code{-i}}}). Nevertheless it is generally advisable to adapt the parameter values if a first result output suggests it.
[[Introduction]]
!Step-by-step example

example case: ''Tbx2/4 cluster ortholog search''
This example demonstrates how to use SynBlast scripts step-by-step to obtain gene (cluster) ''orthologs'' and ''paralogs''.
Here, the mouse //Tbx2/4// cluster genes are used as reference. 
The SynBlast package and its prerequisites are assumed installed as described in [[Installation]]

The Ensembl ~APIs in this tutorial example are of release version 42 (dec2006), and so are the downloaded Ensembl genomic sequences in repeat-masked format (chromosome or contig-like sequences of whole genomes for some target species). This requirement is not checked fully automatically, but the Ensembl release version archive string is obtained by default automatically based on the API version in use, and added both to the reference data description ({{code{[[getEnsemblProteins.pl |getEnsemblProteinsUsage]]}}}) as well as the filtered target search results ({{code{[[doSyntenyFilter.pl |doSyntenyFilterUsage]]}}}).
/***
|Name|FontSizePlugin|
|Created by|SaqImtiaz|
|Location|http://tw.lewcid.org/#FontSizePlugin|
|Version|1.0|
|Requires|~TW2.x|
!Description:
Resize tiddler text on the fly. The text size is remembered between sessions by use of a cookie.
You can customize the maximum and minimum allowed sizes.
(only affects tiddler content text, not any other text)

Also, you can load a TW file with a font-size specified in the url.
Eg: http://tw.lewcid.org/#font:110

!Demo:
Try using the font-size buttons in the sidebar, or in the MainMenu above.

!Installation:
Copy the contents of this tiddler to your TW, tag with systemConfig, save and reload your TW.
Then put {{{<<fontSize "font-size:">>}}} in your SideBarOptions tiddler, or anywhere else that you might like.

!Usage
{{{<<fontSize>>}}} results in <<fontSize>>
{{{<<fontSize font-size: >>}}} results in <<fontSize font-size:>>

!Customizing:
The buttons and prefix text are wrapped in a span with class fontResizer, for easy css styling.
To change the default font-size, and the maximum and minimum font-size allowed, edit the config.fontSize.settings section of the code below.

!Notes:
This plugin assumes that the initial font-size is 100% and then increases or decreases the size by 10%. This stepsize of 10% can also be customized.

!History:
*27-07-06, version 1.0 : prevented double clicks from triggering editing of containing tiddler.
*25-07-06,  version 0.9

!Code
***/

//{{{
config.fontSize={};

//configuration settings
config.fontSize.settings =
{
            defaultSize : 100,  // all sizes in %
            maxSize : 200,
            minSize : 40,
            stepSize : 10
};

//startup code
var fontSettings = config.fontSize.settings;

if (!config.options.txtFontSize)
            {config.options.txtFontSize = fontSettings.defaultSize;
            saveOptionCookie("txtFontSize");}
setStylesheet(".tiddler .viewer {font-size:"+config.options.txtFontSize+"%;}\n","fontResizerStyles");
setStylesheet("#contentWrapper .fontResizer .button {display:inline;font-size:105%; font-weight:bold; margin:0 1px; padding: 0 3px; text-align:center !important;}\n .fontResizer {margin:0 0.5em;}","fontResizerButtonStyles");

//macro
config.macros.fontSize={};
config.macros.fontSize.handler = function (place,macroName,params,wikifier,paramString,tiddler)
{

               var sp = createTiddlyElement(place,"span",null,"fontResizer");
               sp.ondblclick=this.onDblClick;
               if (params[0])
                           createTiddlyText(sp,params[0]);
               createTiddlyButton(sp,"+","increase font-size",this.incFont);
               createTiddlyButton(sp,"=","reset font-size",this.resetFont);
               createTiddlyButton(sp,"–","decrease font-size",this.decFont);
}

config.macros.fontSize.onDblClick = function (e)
{
             if (!e) var e = window.event;
             e.cancelBubble = true;
             if (e.stopPropagation) e.stopPropagation();
             return false;
}

config.macros.fontSize.setFont = function ()
{
               saveOptionCookie("txtFontSize");
               setStylesheet(".tiddler .viewer {font-size:"+config.options.txtFontSize+"%;}\n","fontResizerStyles");
}

config.macros.fontSize.incFont=function()
{
               if (config.options.txtFontSize < fontSettings.maxSize)
                  config.options.txtFontSize = (config.options.txtFontSize*1)+fontSettings.stepSize;
               config.macros.fontSize.setFont();
}

config.macros.fontSize.decFont=function()
{

               if (config.options.txtFontSize > fontSettings.minSize)
                  config.options.txtFontSize = (config.options.txtFontSize*1) - fontSettings.stepSize;
               config.macros.fontSize.setFont();
}

config.macros.fontSize.resetFont=function()
{

               config.options.txtFontSize=fontSettings.defaultSize;
               config.macros.fontSize.setFont();
}

config.paramifiers.font =
{
               onstart: function(v)
                  {
                   config.options.txtFontSize = v;
                   config.macros.fontSize.setFont();
                  }
};
//}}}
/***
|''Name:''|ForEachTiddlerPlugin|
|''Version:''|1.0.4 (2006-01-06)|
|''Source:''|http://tiddlywiki.abego-software.de/#ForEachTiddlerPlugin|
|''Author:''|UdoBorkowski (ub [at] abego-software [dot] de)|
|''Licence:''|[[BSD open source license]]|
|''Macros:''|[[ForEachTiddlerMacro]] v1.0.4|
|''TiddlyWiki:''|1.2.38+, 2.0|
|''Browser:''|Firefox 1.0.4+; InternetExplorer 6.0|
!Description

Create customizable lists, tables etc. for your selections of tiddlers. Specify the tiddlers to include and their order through a powerful language.

''Syntax:'' 
|>|{{{<<}}}''forEachTiddler'' [''in'' //tiddlyWikiPath//] [''where'' //whereCondition//] [''sortBy'' //sortExpression// [''ascending'' //or// ''descending'']] [''script'' //scriptText//] [//action// [//actionParameters//]]{{{>>}}}|
|//tiddlyWikiPath//|The filepath to the TiddlyWiki the macro should work on. When missing the current TiddlyWiki is used.|
|//whereCondition//|(quoted) JavaScript boolean expression. May refer to the build-in variables {{{tiddler}}} and  {{{context}}}.|
|//sortExpression//|(quoted) JavaScript expression returning "comparable" objects (using '{{{<}}}','{{{>}}}','{{{==}}}'. May refer to the build-in variables {{{tiddler}}} and  {{{context}}}.|
|//scriptText//|(quoted) JavaScript text. Typically defines JavaScript functions that are called by the various JavaScript expressions (whereClause, sortClause, action arguments,...)|
|//action//|The action that should be performed on every selected tiddler, in the given order. By default the actions [[addToList|AddToListAction]] and [[write|WriteAction]] are supported. When no action is specified [[addToList|AddToListAction]]  is used.|
|//actionParameters//|(action specific) parameters the action may refer while processing the tiddlers (see action descriptions for details). <<tiddler [[JavaScript in actionParameters]]>>|
|>|~~Syntax formatting: Keywords in ''bold'', optional parts in [...]. 'or' means that exactly one of the two alternatives must exist.~~|

See details see [[ForEachTiddlerMacro]] and [[ForEachTiddlerExamples]].

!Revision history
* v1.0.4 (2006-01-06)
** Support TiddlyWiki 2.0
* v1.0.3 (2005-12-22)
** Features: 
*** Write output to a file supports multi-byte environments (Thanks to Bram Chen) 
*** Provide API to access the forEachTiddler functionality directly through JavaScript (see getTiddlers and performMacro)
** Enhancements:
*** Improved error messages on InternetExplorer.
* v1.0.2 (2005-12-10)
** Features: 
*** context object also holds reference to store (TiddlyWiki)
** Fixed Bugs: 
*** ForEachTiddler 1.0.1 has broken support on win32 Opera 8.51 (Thanks to BrunoSabin for reporting)
* v1.0.1 (2005-12-08)
** Features: 
*** Access tiddlers stored in separated TiddlyWikis through the "in" option. I.e. you are no longer limited to only work on the "current TiddlyWiki".
*** Write output to an external file using the "toFile" option of the "write" action. With this option you may write your customized tiddler exports.
*** Use the "script" section to define "helper" JavaScript functions etc. to be used in the various JavaScript expressions (whereClause, sortClause, action arguments,...).
*** Access and store context information for the current forEachTiddler invocation (through the build-in "context" object) .
*** Improved script evaluation (for where/sort clause and write scripts).
* v1.0.0 (2005-11-20)
** initial version

!Code
***/
//{{{

//============================================================================
//============================================================================
//		   ForEachTiddlerPlugin
//============================================================================
//============================================================================

version.extensions.ForEachTiddlerPlugin = {major: 1, minor: 0, revision: 4, date: new Date(2006,1,6), source: "http://tiddlywiki.abego-software.de/#ForEachTiddlergPlugin"};

// For backward compatibility with TW 1.2.x
//
if (!TiddlyWiki.prototype.forEachTiddler) {
	TiddlyWiki.prototype.forEachTiddler = function(callback) {
		for(var t in this.tiddlers) {
			callback.call(this,t,this.tiddlers[t]);
		};
	}
}

//============================================================================
// forEachTiddler Macro
//============================================================================

version.extensions.forEachTiddler = {major: 1, minor: 0, revision: 4, date: new Date(2006,1,6), provider: "http://tiddlywiki.abego-software.de"};

// ---------------------------------------------------------------------------
// Configurations and constants 
// ---------------------------------------------------------------------------

config.macros.forEachTiddler = {
	 // Standard Properties
	 label: "forEachTiddler",
	 prompt: "Perform actions on a (sorted) selection of tiddlers",

	 // actions
	 actions: {
		 addToList: {},
		 write: {}
	 }
}

// ---------------------------------------------------------------------------
//  The forEachTiddler Macro Handler 
// ---------------------------------------------------------------------------

config.macros.forEachTiddler.handler = function(place,macroName,params) {
	// config.macros.forEachTiddler.traceMacroCall(place,macroName,params);

	// --- Parsing ------------------------------------------

	var i = 0; // index running over the params
	// Parse the "in" clause
	var tiddlyWikiPath = undefined;
	if ((i < params.length) && params[i] == "in") {
		i++;
		if (i >= params.length) {
			this.handleError(place, "TiddlyWiki path expected behind 'in'.");
			return;
		}
		tiddlyWikiPath = this.paramEncode((i < params.length) ? params[i] : "");
		i++;
	}

	// Parse the where clause
	var whereClause ="true";
	if ((i < params.length) && params[i] == "where") {
		i++;
		whereClause = this.paramEncode((i < params.length) ? params[i] : "");
		i++;
	}

	// Parse the sort stuff
	var sortClause = null;
	var sortAscending = true; 
	if ((i < params.length) && params[i] == "sortBy") {
		i++;
		if (i >= params.length) {
			this.handleError(place, "sortClause missing behind 'sortBy'.");
			return;
		}
		sortClause = this.paramEncode(params[i]);
		i++;

		if ((i < params.length) && (params[i] == "ascending" || params[i] == "descending")) {
			 sortAscending = params[i] == "ascending";
			 i++;
		}
	}

	// Parse the script
	var scriptText = null;
	if ((i < params.length) && params[i] == "script") {
		i++;
		scriptText = this.paramEncode((i < params.length) ? params[i] : "");
		i++;
	}

	// Parse the action. 
	// When we are already at the end use the default action
	var actionName = "addToList";
	if (i < params.length) {
	   if (!config.macros.forEachTiddler.actions[params[i]]) {
			this.handleError(place, "Unknown action '"+params[i]+"'.");
			return;
		} else {
			actionName = params[i]; 
			i++;
		}
	} 
	
	// Get the action parameter
	// (the parsing is done inside the individual action implementation.)
	var actionParameter = params.slice(i);


	// --- Processing ------------------------------------------
	try {
		this.performMacro({
				place: place, 
				whereClause: whereClause, 
				sortClause: sortClause, 
				sortAscending: sortAscending, 
				actionName: actionName, 
				actionParameter: actionParameter, 
				scriptText: scriptText, 
				tiddlyWikiPath: tiddlyWikiPath});

	} catch (e) {
		this.handleError(place, e);
	}
}

// Returns an object with properties "tiddlers" and "context".
// tiddlers holds the (sorted) tiddlers selected by the parameter,
// context the context of the execution of the macro.
//
// The action is not yet performed.
//
// @parameter see performMacro
//
config.macros.forEachTiddler.getTiddlersAndContext = function(parameter) {

	var context = config.macros.forEachTiddler.createContext(parameter.place, parameter.whereClause, parameter.sortClause, parameter.sortAscending, parameter.actionName, parameter.actionParameter, parameter.scriptText, parameter.tiddlyWikiPath);

	var tiddlyWiki = parameter.tiddlyWikiPath ? this.loadTiddlyWiki(parameter.tiddlyWikiPath) : store;
	context["tiddlyWiki"] = tiddlyWiki;
	
	// Get the tiddlers, as defined by the whereClause
	var tiddlers = this.findTiddlers(parameter.whereClause, context, tiddlyWiki);
	context["tiddlers"] = tiddlers;

	// Sort the tiddlers, when sorting is required.
	if (parameter.sortClause) {
		this.sortTiddlers(tiddlers, parameter.sortClause, parameter.sortAscending, context);
	}

	return {tiddlers: tiddlers, context: context};
}

// Returns the (sorted) tiddlers selected by the parameter.
//
// The action is not yet performed.
//
// @parameter see performMacro
//
config.macros.forEachTiddler.getTiddlers = function(parameter) {
	return this.getTiddlersAndContext(parameter).tiddlers;
}

// Performs the macros with the given parameter.
//
// @param parameter holds the parameter of the macro as separate properties.
//				  The following properties are supported:
//
//						place
//						whereClause
//						sortClause
//						sortAscending
//						actionName
//						actionParameter
//						scriptText
//						tiddlyWikiPath
//
//					All properties are optional. 
//					For most actions the place property must be defined.
//
config.macros.forEachTiddler.performMacro = function(parameter) {
	var tiddlersAndContext = this.getTiddlersAndContext(parameter);

	// Perform the action
	var actionName = parameter.actionName ? parameter.actionName : "addToList";
	var action = config.macros.forEachTiddler.actions[actionName];
	if (!action) {
		this.handleError(parameter.place, "Unknown action '"+actionName+"'.");
		return;
	}

	var actionHandler = action.handler;
	actionHandler(parameter.place, tiddlersAndContext.tiddlers, parameter.actionParameter, tiddlersAndContext.context);
}

// ---------------------------------------------------------------------------
//  The actions 
// ---------------------------------------------------------------------------

// Internal.
//
// --- The addToList Action -----------------------------------------------
//
config.macros.forEachTiddler.actions.addToList.handler = function(place, tiddlers, parameter, context) {
	// Parse the parameter
	var p = 0;

	// Check for extra parameters
	if (parameter.length > p) {
		config.macros.forEachTiddler.createExtraParameterErrorElement(place, "addToList", parameter, p);
		return;
	}

	// Perform the action.
	var list = document.createElement("ul");
	place.appendChild(list);
	for (var i = 0; i < tiddlers.length; i++) {
		var tiddler = tiddlers[i];
		var listItem = document.createElement("li")
		list.appendChild(listItem);
		createTiddlyLink(listItem, tiddler.title, true);
	}
}

// Internal.
//
// --- The write Action ---------------------------------------------------
//
config.macros.forEachTiddler.actions.write.handler = function(place, tiddlers, parameter, context) {
	// Parse the parameter
	var p = 0;
	if (p >= parameter.length) {
		this.handleError(place, "Missing expression behind 'write'.");
		return;
	}

	var textExpression = config.macros.forEachTiddler.paramEncode(parameter[p]);
	p++;

	// Parse the "toFile" option
	var filename = null;
	var lineSeparator = undefined;
	if ((p < parameter.length) && parameter[p] == "toFile") {
		p++;
		if (p >= parameter.length) {
			this.handleError(place, "Filename expected behind 'toFile' of 'write' action.");
			return;
		}
		
		filename = config.macros.forEachTiddler.getLocalPath(config.macros.forEachTiddler.paramEncode(parameter[p]));
		p++;
		if ((p < parameter.length) && parameter[p] == "withLineSeparator") {
			p++;
			if (p >= parameter.length) {
				this.handleError(place, "Line separator text expected behind 'withLineSeparator' of 'write' action.");
				return;
			}
			lineSeparator = config.macros.forEachTiddler.paramEncode(parameter[p]);
			p++;
		}
	}
	
	// Check for extra parameters
	if (parameter.length > p) {
		config.macros.forEachTiddler.createExtraParameterErrorElement(place, "write", parameter, p);
		return;
	}

	// Perform the action.
	var func = config.macros.forEachTiddler.getEvalTiddlerFunction(textExpression, context);
	var count = tiddlers.length;
	var text = "";
	for (var i = 0; i < count; i++) {
		var tiddler = tiddlers[i];
		text += func(tiddler, context, count, i);
	}
	   
	if (filename) {
		if (lineSeparator != undefined) {
			lineSeparator = lineSeparator.replace(/\\n/mg, "\n").replace(/\\r/mg, "\r");
			text = text.replace(/\n/mg,lineSeparator);
		}
		saveFile(filename, convertUnicodeToUTF8(text));
	} else {
		var wrapper = createTiddlyElement(place, "span");
		wikify(text, wrapper);
	}
}


// ---------------------------------------------------------------------------
//  Helpers
// ---------------------------------------------------------------------------

// Internal.
//
config.macros.forEachTiddler.createContext = function(placeParam, whereClauseParam, sortClauseParam, sortAscendingParam, actionNameParam, actionParameterParam, scriptText, tiddlyWikiPathParam) {
	return {
		place : placeParam, 
		whereClause : whereClauseParam, 
		sortClause : sortClauseParam, 
		sortAscending : sortAscendingParam, 
		script : scriptText,
		actionName : actionNameParam, 
		actionParameter : actionParameterParam,
		tiddlyWikiPath : tiddlyWikiPathParam
	}
}

// Internal.
//
// Returns a TiddlyWiki with the tiddlers loaded from the TiddlyWiki of 
// the given path.
//
config.macros.forEachTiddler.loadTiddlyWiki = function(path, idPrefix) {
	if (!idPrefix) {
		idPrefix = "store";
	}
	
	// Read the content of the given file
	var content = loadFile(this.getLocalPath(path));
	if(content == null) {
		throw "TiddlyWiki '"+path+"' not found.";
	}
	
	// Locate the storeArea div's
	var posOpeningDiv = content.indexOf(startSaveArea);
	var posClosingDiv = content.lastIndexOf(endSaveArea);
	if((posOpeningDiv == -1) || (posClosingDiv == -1)) {
		throw "File '"+path+"' is not a TiddlyWiki.";
	}
	var storageText = content.substr(posOpeningDiv + startSaveArea.length, posClosingDiv);
	
	// Create a "div" element that contains the storage text
	var myStorageDiv = document.createElement("div");
	myStorageDiv.innerHTML = storageText;
	myStorageDiv.normalize();
	
	// Create all tiddlers in a new TiddlyWiki
	// (following code is modified copy of TiddlyWiki.prototype.loadFromDiv)
	var tiddlyWiki = new TiddlyWiki();
	var store = myStorageDiv.childNodes;
	for(var t = 0; t < store.length; t++) {
		var e = store[t];
		var title = null;
		if(e.getAttribute)
			title = e.getAttribute("tiddler");
		if(!title && e.id && e.id.substr(0,lenPrefix) == idPrefix)
			title = e.id.substr(lenPrefix);
		if(title && title != "") {
			var tiddler = tiddlyWiki.createTiddler(title);
			tiddler.loadFromDiv(e,title);
		}
	}
	tiddlyWiki.dirty = false;

	return tiddlyWiki;
}


	
// Internal.
//
// Returns a function that has a function body returning the given javaScriptExpression.
// The function has the parameters:
// 
//	 (tiddler, context, count, index)
//
config.macros.forEachTiddler.getEvalTiddlerFunction = function (javaScriptExpression, context) {
	var script = context["script"];
	var functionText = "theFunction = function(tiddler, context, count, index) { return "+javaScriptExpression+"}";
	var fullText = (script ? script+";" : "")+functionText;
	return eval(fullText);
}

// Internal.
//
config.macros.forEachTiddler.findTiddlers = function(whereClause, context, tiddlyWiki) {
	var result = [];
	var func = config.macros.forEachTiddler.getEvalTiddlerFunction(whereClause, context);
	tiddlyWiki.forEachTiddler(function(title,tiddler) {
		if (func(tiddler, context, undefined, undefined)) {
			result.push(tiddler);
		}
	});
	return result;
}

// Internal.
//
config.macros.forEachTiddler.createExtraParameterErrorElement = function(place, actionName, parameter, firstUnusedIndex) {
	var message = "Extra parameter behind '"+actionName+"':";
	for (var i = firstUnusedIndex; i < parameter.length; i++) {
		message += " "+parameter[i];
	}
	this.handleError(place, message);
}

// Internal.
//
config.macros.forEachTiddler.sortAscending = function(tiddlerA, tiddlerB) {
	var result = 
		(tiddlerA.forEachTiddlerSortValue == tiddlerB.forEachTiddlerSortValue) 
			? 0
			: (tiddlerA.forEachTiddlerSortValue < tiddlerB.forEachTiddlerSortValue)
			   ? -1 
			   : +1; 
	return result;
}

// Internal.
//
config.macros.forEachTiddler.sortDescending = function(tiddlerA, tiddlerB) {
	var result = 
		(tiddlerA.forEachTiddlerSortValue == tiddlerB.forEachTiddlerSortValue) 
			? 0
			: (tiddlerA.forEachTiddlerSortValue < tiddlerB.forEachTiddlerSortValue)
			   ? +1 
			   : -1; 
	return result;
}

// Internal.
//
config.macros.forEachTiddler.sortTiddlers = function(tiddlers, sortClause, ascending, context) {
	// To avoid evaluating the sortClause whenever two items are compared 
	// we pre-calculate the sortValue for every item in the array and store it in a 
	// temporary property ("forEachTiddlerSortValue") of the tiddlers.
	var func = config.macros.forEachTiddler.getEvalTiddlerFunction(sortClause, context);
	var count = tiddlers.length;
	for (var i = 0; i < count; i++) {
		var tiddler = tiddlers[i];
		tiddler.forEachTiddlerSortValue = func(tiddler,context, undefined, undefined);
	}

	// Do the sorting
	tiddlers.sort(ascending ? this.sortAscending : this.sortDescending);

	// Delete the temporary property that holds the sortValue.	
	for (var i = 0; i < tiddlers.length; i++) {
		delete tiddlers[i].forEachTiddlerSortValue;
	}
}


// Internal.
//
config.macros.forEachTiddler.trace = function(message) {
	displayMessage(message);
}

// Internal.
//
config.macros.forEachTiddler.traceMacroCall = function(place,macroName,params) {
	var message ="<<"+macroName;
	for (var i = 0; i < params.length; i++) {
		message += " "+params[i];
	}
	message += ">>";
	displayMessage(message);
}


// Internal.
//
// Creates an element that holds an error message
// 
config.macros.forEachTiddler.createErrorElement = function(place, exception) {
	var message = (exception.description) ? exception.description : exception.toString();
	return createTiddlyElement(place,"span",null,"forEachTiddlerError","<<forEachTiddler ...>>: "+message);
}

// Internal.
//
// @param place [may be null]
//
config.macros.forEachTiddler.handleError = function(place, exception) {
	if (place) {
		this.createErrorElement(place, exception);
	} else {
		throw exception;
	}
}

// Internal.
//
// Encodes the given string.
//
// Replaces 
//	 "$))" to ">>"
//	 "$)" to ">"
//
config.macros.forEachTiddler.paramEncode = function(s) {
	var reGTGT = new RegExp("\\$\\)\\)","mg");
	var reGT = new RegExp("\\$\\)","mg");
	return s.replace(reGTGT, ">>").replace(reGT, ">");
}

// Internal.
//
// Returns the given original path (that is a file path, starting with "file:")
// as a path to a local file, in the systems native file format.
//
// Location information in the originalPath (i.e. the "#" and stuff following)
// is stripped.
// 
config.macros.forEachTiddler.getLocalPath = function(originalPath) {
	// Remove any location part of the URL
	var hashPos = originalPath.indexOf("#");
	if(hashPos != -1)
		originalPath = originalPath.substr(0,hashPos);
	// Convert to a native file format assuming
	// "file:///x:/path/path/path..." - pc local file --> "x:\path\path\path..."
	// "file://///server/share/path/path/path..." - FireFox pc network file --> "\\server\share\path\path\path..."
	// "file:///path/path/path..." - mac/unix local file --> "/path/path/path..."
	// "file://server/share/path/path/path..." - pc network file --> "\\server\share\path\path\path..."
	var localPath;
	if(originalPath.charAt(9) == ":") // pc local file
		localPath = unescape(originalPath.substr(8)).replace(new RegExp("/","g"),"\\");
	else if(originalPath.indexOf("file://///") == 0) // FireFox pc network file
		localPath = "\\\\" + unescape(originalPath.substr(10)).replace(new RegExp("/","g"),"\\");
	else if(originalPath.indexOf("file:///") == 0) // mac/unix local file
		localPath = unescape(originalPath.substr(7));
	else if(originalPath.indexOf("file:/") == 0) // mac/unix local file
		localPath = unescape(originalPath.substr(5));
	else // pc network file
		localPath = "\\\\" + unescape(originalPath.substr(7)).replace(new RegExp("/","g"),"\\");	
	return localPath;
}

// ---------------------------------------------------------------------------
// Stylesheet Extensions (may be overridden by local StyleSheet)
// ---------------------------------------------------------------------------
//
setStylesheet(
	".forEachTiddlerError{color: #ffffff;background-color: #880000;}",
	"forEachTiddler");

//============================================================================
// End of forEachTiddler Macro
//============================================================================


//============================================================================
// String.startsWith Function
//============================================================================
//
// Returns true if the string starts with the given prefix, false otherwise.
//
version.extensions["String.startsWith"] = {major: 1, minor: 0, revision: 0, date: new Date(2005,11,20), provider: "http://tiddlywiki.abego-software.de"};
//
String.prototype.startsWith = function(prefix) {
	var n =  prefix.length;
	return (this.length >= n) && (this.slice(0, n) == prefix);
}



//============================================================================
// String.endsWith Function
//============================================================================
//
// Returns true if the string ends with the given suffix, false otherwise.
//
version.extensions["String.endsWith"] = {major: 1, minor: 0, revision: 0, date: new Date(2005,11,20), provider: "http://tiddlywiki.abego-software.de"};
//
String.prototype.endsWith = function(suffix) {
	var n = suffix.length;
	return (this.length >= n) && (this.right(n) == suffix);
}


//============================================================================
// String.contains Function
//============================================================================
//
// Returns true when the string contains the given substring, false otherwise.
//
version.extensions["String.contains"] = {major: 1, minor: 0, revision: 0, date: new Date(2005,11,20), provider: "http://tiddlywiki.abego-software.de"};
//
String.prototype.contains = function(substring) {
	return this.indexOf(substring) >= 0;
}

//============================================================================
// Array.indexOf Function
//============================================================================
//
// Returns the index of the first occurance of the given item in the array or 
// -1 when no such item exists.
//
// @param item [may be null]
//
version.extensions["Array.indexOf"] = {major: 1, minor: 0, revision: 0, date: new Date(2005,11,20), provider: "http://tiddlywiki.abego-software.de"};
//
Array.prototype.indexOf = function(item) {
	for (var i = 0; i < this.length; i++) {
		if (this[i] == item) {
			return i;
		}
	}
	return -1;
}

//============================================================================
// Array.contains Function
//============================================================================
//
// Returns true when the array contains the given item, otherwise false. 
//
// @param item [may be null]
//
version.extensions["Array.contains"] = {major: 1, minor: 0, revision: 0, date: new Date(2005,11,20), provider: "http://tiddlywiki.abego-software.de"};
//
Array.prototype.contains = function(item) {
	return (this.indexOf(item) >= 0);
}

//============================================================================
// Array.containsAny Function
//============================================================================
//
// Returns true when the array contains at least one of the elements 
// of the item. Otherwise (or when items contains no elements) false is returned.
//
version.extensions["Array.containsAny"] = {major: 1, minor: 0, revision: 0, date: new Date(2005,11,20), provider: "http://tiddlywiki.abego-software.de"};
//
Array.prototype.containsAny = function(items) {
	for(var i = 0; i < items.length; i++) {
		if (this.contains(items[i])) {
			return true;
		}
	}
	return false;
}


//============================================================================
// Array.containsAll Function
//============================================================================
//
// Returns true when the array contains all the items, otherwise false.
// 
// When items is null false is returned (even if the array contains a null).
//
// @param items [may be null] 
//
version.extensions["Array.containsAll"] = {major: 1, minor: 0, revision: 0, date: new Date(2005,11,20), provider: "http://tiddlywiki.abego-software.de"};
//
Array.prototype.containsAll = function(items) {
	for(var i = 0; i < items.length; i++) {
		if (!this.contains(items[i])) {
			return false;
		}
	}
	return true;
}



//}}}


/***
!Licence and Copyright
Copyright (c) abego Software ~GmbH, 2005 ([[www.abego-software.de|http://www.abego-software.de]])

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or other
materials provided with the distribution.

Neither the name of abego Software nor the names of its contributors may be
used to endorse or promote products derived from this software without specific
prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
***/
/***
|Name|FullScreenPlugin|
|Created by|SaqImtiaz|
|Location|http://tw.lewcid.org/#FullScreenPlugin|
|Version|1.1|
|Requires|~TW2.x|
!Description:
Toggle between viewing tiddlers fullscreen and normally. Very handy for when you need more viewing space.

!Demo:
Click the ↕ button in the toolbar for this tiddler. Click it again to turn off fullscreen.

!Installation:
Copy the contents of this tiddler to your TW, tag with systemConfig, save and reload your TW.
Edit the ViewTemplate to add the fullscreen command to the toolbar.

!History:
*25-07-06: ver 1.1
*20-07-06: ver 1.0

!Code
***/
//{{{
var lewcidFullScreen = false;

config.commands.fullscreen =
{
            text:" ↕ ",
            tooltip:"Fullscreen mode"
};

config.commands.fullscreen.handler = function (event,src,title)
{
            if (lewcidFullScreen == false)
               {
                lewcidFullScreen = true;
                setStylesheet('#sidebar, .header, #mainMenu{display:none;} #displayArea{margin:0em 0 0 0 !important;}',"lewcidFullScreenStyle");
               }
            else
               {
                lewcidFullScreen = false;
                setStylesheet(' ',"lewcidFullScreenStyle");
               }
}

config.macros.fullscreen={};
config.macros.fullscreen.handler =  function(place,macroName,params,wikifier,paramString,tiddler)
{
        var label = params[0]||" ↕ ";
        var tooltip = params[1]||"Fullscreen mode";
        createTiddlyButton(place,label,tooltip,config.commands.fullscreen.handler);
}

var lewcid_fullscreen_closeTiddler = Story.prototype.closeTiddler;
Story.prototype.closeTiddler =function(title,animate,slowly)
{
           lewcid_fullscreen_closeTiddler.apply(this,arguments);
           if (story.isEmpty() && lewcidFullScreen == true)
              config.commands.fullscreen.handler();
}


Slider.prototype.lewcidStop = Slider.prototype.stop;
Slider.prototype.stop = function()
{
           this.lewcidStop();
           if (story.isEmpty() && lewcidFullScreen == true)
              config.commands.fullscreen.handler();
}
//}}}
To get started with this blank TiddlyWiki, you'll need to modify the following tiddlers:
* SiteTitle & SiteSubtitle: The title and subtitle of the site, as shown above (after saving, they will also appear in the browser title bar)
* MainMenu: The menu (usually on the left)
* DefaultTiddlers: Contains the names of the tiddlers that you want to appear when the TiddlyWiki is opened
You'll also need to enter your username for signing your edits: <<option txtUserName>>
<<tabs tabsClass [[Example case: Tbx-Cluster ]] "Background information to the example case used in tutorial steps" [[Example case: T-box gene cluster]] [[Step1: Reference Data Retrieval ]] "Step 1 - Retrieve annotational data and sequences of proteins around a focal protein of interest" [[ReferenceDataRetrieval]] [[Step2: TBlastn Searches ]] "Step 2 - TBlastn Searches" [[tBlastnSearches]] [[Step3: SyntenyFiltering ]] "Step 3 - Filter out regions of conserved synteny" [[SyntenyFiltering]] [[Step4: SyntenyAlignments ]] "Step 4 - Rank synteny regions via gene order alignment" [[SyntenyAligning]] >>
<<forEachTiddler
where
'tiddler.tags.contains("ParamGuide")' sortBy 'tiddler.date' write '"*[["+tiddler.title+"|"+tiddler.title+"\]\]\n"'>>
<<top>><<icon top.bmp 16 16>>
<<toggleSideBar '' '' hide>><<icon toggle.bmp 16 16>>
<<jump j '' top>><<icon jump.bmp 16 16>>
<<fullscreen f>><<icon full.bmp 16 16>>
<<saveChanges>><<icon save.bmp 16 16>>
<<newTiddler>><<icon new.bmp 16 16>>
<<saveAndReload>><<icon save.bmp 16 16>>
/***
|Name|HoverMenuPlugin|
|Created by|SaqImtiaz|
|Location|http://tw.lewcid.org/#HoverMenuPlugin|
|Version|1.11|
|Requires|~TW2.x|
!Description:
Provides a hovering menu on the edge of the screen for commonly used commands, that scrolls with the page.

!Demo:
Observe the hovering menu on the right edge of the screen.

!Installation:
Copy the contents of this tiddler to your TW, tag with systemConfig, save and reload your TW.
To customize your HoverMenu, edit the HoverMenu shadow tiddler.

To 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!

The menu has an id of hoverMenu, in case you want to style the buttons in it using css.

!Notes:
Since 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.

If you dont intend to use these three macros at all, feel free to remove those sections of code in this tiddler.

!To Do:
* rework code to allow multiple hovering menus in different positions, horizontal etc.
* incorporate code for keyboard shortcuts that correspond to the buttons in the hovermenu

!History:
*03-08-06, ver 1.1.2: compatibility fix with SelectThemePlugin
*03-08-06,  ver 1.11: fixed error with button tooltips
*27-07-06, ver 1.1 : added JumpMacro to hoverMenu
*23-07-06

!Code
***/

/***
start HoverMenu plugin code
***/
//{{{
config.hoverMenu={};
//}}}

/***
HoverMenu configuration settings
***/
//{{{
config.hoverMenu.settings={
               align: 'right',    //align menu to right or left side of screen, possible values are 'right' and 'left'               
               x: 1,              // horizontal distance of menu from side of screen, increase to your liking.
               y: 158            //vertical distance of menu from top of screen at start, increase or decrease to your liking
               };
//}}}

//{{{
//continue HoverMenu plugin code
config.hoverMenu.handler=function()
{              
               if (!document.getElementById("hoverMenu"))
               {
               var theMenu = createTiddlyElement(document.getElementById("contentWrapper"), "div","hoverMenu");
               theMenu.setAttribute("refresh","content");
               theMenu.setAttribute("tiddler","HoverMenu");
               var menuContent = store.getTiddlerText("HoverMenu");
               wikify(menuContent,theMenu);
              }

	       var Xloc = this.settings.x;
	       Yloc =this.settings.y;
	       var ns = (navigator.appName.indexOf("Netscape") != -1);
	       function SetMenu(id)
                        {
		        var GetElements=document.getElementById?document.getElementById(id):document.all?document.all[id]:document.layers[id];
		        if(document.layers)GetElements.style=GetElements;
		        GetElements.sP=function(x,y){this.style[config.hoverMenu.settings.align]=x +"px";this.style.top=y +"px";};
		        GetElements.x = Xloc;
		        GetElements.y = findScrollY();
		        GetElements.y += Yloc;
		        return GetElements;
	                }
               window.LoCate_XY=function()
                        {
		        var pY =  findScrollY();
                        ftlObj.y += (pY + Yloc - ftlObj.y)/15;
		        ftlObj.sP(ftlObj.x, ftlObj.y);
		        setTimeout("LoCate_XY()", 10);
	                }
               ftlObj = SetMenu("hoverMenu");
	       LoCate_XY();
};

window.old_lewcid_hovermenu_restart = restart;
restart = function()
{
               window.old_lewcid_hovermenu_restart();
               config.hoverMenu.handler();
};

setStylesheet(
"#hoverMenu .imgLink, #hoverMenu .imgLink:hover {border:none; padding:0px; float:right; margin-bottom:2px; margin-top:0px;}\n"+
"#hoverMenu  .button, #hoverMenu  .tiddlyLink {border:none; font-weight:bold; background:#18f; color:#FFF; padding:0 5px; float:right; margin-bottom:4px;}\n"+
"#hoverMenu .button:hover, #hoverMenu .tiddlyLink:hover {font-weight:bold; border:none; color:#fff; background:#000; padding:0 5px; float:right; margin-bottom:4px;}\n"+
"#hoverMenu .button {width:100%; text-align:center}"+
"#hoverMenu { position:absolute; width:7px;}\n"+
"\n","hoverMenuStyles");


config.macros.renameButton={};
config.macros.renameButton.handler = function(place,macroName,params,wikifier,paramString,tiddler)
{

               if (place.lastChild.tagName!="BR")
                     {
                      place.lastChild.firstChild.data = params[0];
                      if (params[1]) {place.lastChild.title = params[1];}
                     }
};

config.shadowTiddlers["HoverMenu"]="<<top>>\n<<toggleSideBar>><<renameButton '>' >>\n<<jump j '' top>>\n<<saveChanges>><<renameButton s 'Save TiddlyWiki'>>\n<<newTiddler>><<renameButton n>>\n";
//}}}
//end HoverMenu plugin code

//Start ToggleSideBarMacro code
//{{{
config.macros.toggleSideBar={};

config.macros.toggleSideBar.settings={
         styleHide :  "#sidebar { display: none;}\n"+"#contentWrapper #displayArea { margin-right: 1em;}\n"+"",
         styleShow : " ",
         arrow1: "«",
         arrow2: "»"
};

config.macros.toggleSideBar.handler=function (place,macroName,params,wikifier,paramString,tiddler)
{
          var tooltip= params[1]||'toggle sidebar';
          var mode = (params[2] && params[2]=="hide")? "hide":"show";
          var arrow = (mode == "hide")? this.settings.arrow1:this.settings.arrow2;
          var label= (params[0]&&params[0]!='.')?params[0]+" "+arrow:arrow;
          var theBtn = createTiddlyButton(place,label,tooltip,this.onToggleSideBar,"button HideSideBarButton");
          if (mode == "hide")
             { 
             (document.getElementById("sidebar")).setAttribute("toggle","hide");
              setStylesheet(this.settings.styleHide,"ToggleSideBarStyles");
             }
};

config.macros.toggleSideBar.onToggleSideBar = function(){
          var sidebar = document.getElementById("sidebar");
          var settings = config.macros.toggleSideBar.settings;
          if (sidebar.getAttribute("toggle")=='hide')
             {
              setStylesheet(settings.styleShow,"ToggleSideBarStyles");
              sidebar.setAttribute("toggle","show");
              this.firstChild.data= (this.firstChild.data).replace(settings.arrow1,settings.arrow2);
              }
          else
              {    
               setStylesheet(settings.styleHide,"ToggleSideBarStyles");
               sidebar.setAttribute("toggle","hide");
               this.firstChild.data= (this.firstChild.data).replace(settings.arrow2,settings.arrow1);
              }

     return false;
}

setStylesheet(".HideSideBarButton .button {font-weight:bold; padding: 0 5px;}\n","ToggleSideBarButtonStyles");
//}}}
//end ToggleSideBarMacro code

//start JumpToTopMacro code
//{{{
config.macros.top={};
config.macros.top.handler=function(place,macroName)
{
               createTiddlyButton(place,"^","jump to top",this.onclick);
}
config.macros.top.onclick=function()
{
               window.scrollTo(0,0);
};

config.commands.top =
{
               text:" ^ ",
               tooltip:"jump to top"
};

config.commands.top.handler = function(event,src,title)
{
               window.scrollTo(0,0);
}
//}}}
//end JumpToStartMacro code

//start JumpMacro code
//{{{
config.macros.jump= {};
config.macros.jump.handler = function (place,macroName,params,wikifier,paramString,tiddler)
{
        var label = (params[0] && params[0]!=".")? params[0]: 'jump';
        var tooltip = (params[1] && params[1]!=".")? params[1]: 'jump to an open tiddler';
        var top = (params[2] && params[2]=='top') ? true: false;        

        var btn =createTiddlyButton(place,label,tooltip,this.onclick);
        if (top==true)
              btn.setAttribute("top","true")
}

config.macros.jump.onclick = function(e)
{
        if (!e) var e = window.event;
        var theTarget = resolveTarget(e);
        var top = theTarget.getAttribute("top");
	var popup = Popup.create(this);
	if(popup)
		{
                 if(top=="true")
                                {createTiddlyButton(createTiddlyElement(popup,"li"),'Top ↑','Top of TW',config.macros.jump.top);
                                 createTiddlyElement(popup,"hr");}
		
		story.forEachTiddler(function(title,element) {
			createTiddlyLink(createTiddlyElement(popup,"li"),title,true);
			});
                }
	Popup.show(popup,false);
	e.cancelBubble = true;
	if (e.stopPropagation) e.stopPropagation();
	return false;
}

config.macros.jump.top = function()
{
       window.scrollTo(0,0);
}
//}}}
//end JumpMacro code

//utility functions
//{{{
Popup.show = function(unused,slowly)
{
	var curr = Popup.stack[Popup.stack.length-1];
	var rootLeft = findPosX(curr.root);
	var rootTop = findPosY(curr.root);
	var rootHeight = curr.root.offsetHeight;
	var popupLeft = rootLeft;
	var popupTop = rootTop + rootHeight;
	var popupWidth = curr.popup.offsetWidth;
	var winWidth = findWindowWidth();
        if (isChild(curr.root,'hoverMenu'))
              var x = config.hoverMenu.settings.x;
        else
              var x = 0;
	if(popupLeft + popupWidth+x > winWidth)
		popupLeft = winWidth - popupWidth -x;
        if (isChild(curr.root,'hoverMenu'))
  	        {curr.popup.style.right = x + "px";}
        else
                curr.popup.style.left = popupLeft + "px";
	curr.popup.style.top = popupTop + "px";
	curr.popup.style.display = "block";
	addClass(curr.root,"highlight");
	if(config.options.chkAnimate)
		anim.startAnimating(new Scroller(curr.popup,slowly));
	else
		window.scrollTo(0,ensureVisible(curr.popup));
}

window.isChild = function(e,parentId) {
        while (e != null) {
                var parent = document.getElementById(parentId);
                if (parent == e) return true;
                e = e.parentNode;
                }
        return false;
};
//}}}


//{{{
// version: beta 1.1
//replace macro buttons with icons
// params[0] = image location
//params[1] = image width
//params[2] = image height
//params[3] = image title (optional)
config.macros.icon={};
config.macros.icon.handler = function(place,macroName,params,wikifier,paramString,tiddler)
{

               if (place.lastChild.tagName!="BR")
                     {
                     var tempTitle = place.lastChild.firstChild.title;
                     removeChildren(place.lastChild);
                     place.lastChild.className = "imgLink";
                     var img = createTiddlyElement(place.lastChild,"img");
                     img.src = params[0];
                     if (params[3])
                         img.title = params[3];
                     img.width= params[1];
                     img.height =params[2];
                     }
};

//use icons for toolbar commands.
// used in view template like:
// <span macro='commandIcon jump jump.bmp'></span>
//params[0] = command name
//params[1] = image location
config.macros.commandIcon={};
config.macros.commandIcon.handler = function(place,macroName,params,wikifier,paramString,tiddler)
{if(!e) var e = window.event;
    var img = createTiddlyElement(place,"img",null,"toolbarImg");
    img.src = params[1];
    img.onclick = function(){config.commands[params[0]].handler(e,place,story.findContainingTiddler(place).getAttribute("tiddler"));};
    img.title = config.commands[params[0]].tooltip;
}

setStylesheet(".toolbarImg {vertical-align: middle; cursor:pointer;}\n","commandIconStyles"); 

//}}}
!Requirements
*existing [[Perl|http://www.perl.org]] installation
*[[MySQL|http://www.mysql.com/]] (client files and development files are sufficient, e.g. rpm packages mysql-client and mysql-devel)
*CPAN Perl modules: [[GD|http://www.cpan.org/modules/by-module/GD/]], [[DBI|http://www.cpan.org/modules/by-module/DBI/]] and [[DBD::mysql|http://www.cpan.org/modules/by-module/DBD/]] (preferrably installed via rpm package manager).<html><br/></html> Have a look at the [[CPAN-MiniHowto]] if you wan't to install modules as a non-root user.
*Ensembl Core Perl API and Ensembl Compara Perl API, see http://www.ensembl.org/info/docs/api/api_installation.html. <html><br/></html> Note, that the used Ensembl API version should always be the same as the version of the Ensembl databases being used. A quick change between different API versions is possible with the {{code{cvs update}}} command (see bottom section on http://www.ensembl.org/info/docs/api/api_cvs.html)


!Installation instructions for SynBlast
#Download the package from http://www.bioinf.uni-leipzig.de/~joe/SynBlast/
#Extract the package: {{codeblock{
"""$ tar -zxvf SynBlast-0.03.tar.gz"""}}}
#Change Directory to extracted package: {{codeblock{
"""$ cd SynBlast-0.03/"""}}}
#Create the makefile (default installation destination is {{code{/usr/local}}}, optionally changeable by specifying the {{code{PREFIX}}} argument):{{codeblock{
"""$ perl Makefile.PL [PREFIX=YourDestination]"""}}}
#Install the package: {{codeblock{
$ make
$ make install}}}
Check in case of a local installation (i.e., if you use {{code{PREFIX=destination}}}), that your destination's subdir ''"bin"'' is in environment variable {{code{PATH}}}, and subdir ''"lib/perl5"'' is in env variable {{code{~PERL5LIB}}}, and subdir ''"man"'' is in env variable {{code{MANPATH}}}, as described in CPAN-MiniHowto for non-standard installation directories.


!The Idea
SynBlast is an approach to homology detection utilizing synteny information. It is intended to help with a reliable identification of orthologous and/or paralogous genes. It seems to be promising especially for genes in gene clusters that are expected or known to be conserved in related species. Even when the actual sequence similarity obtained from blast searches is only low or partial, e.g. in single protein domains or in case of gene-loss, a shared ancestry can eventually still be deduced via SynBlast.

!Sketch of the pipeline workflow
<part Mycell1 hidden>
#A focal protein-coding gene of interest and its surrounding proteins are selected for use as @@reference set@@.
#For each single reference protein significant @@sequence similarity hits@@ within specified (whole genome) nucleotide databases are obtained either by Blast (tblastn program) or any other Blast-like translated search utility (such as Blat).
#The syntenic relationships between the reference proteins are now used to identify more or less @@syntenic blocks of blast hits@@ for the target species, i.e. blast hits are filtered on putative homologous cluster positions.
#Finally, each identified target region of possibly syntenic blast hits is evaluated upon the sum of its blast scores of only those hits that could be assigned in agreement with the reference gene order (@@gene order alignment@@).
#Last but not least, a @@manual interpretation@@ of suggested cluster assignments and weightings is up to the user. Results are browsable html files with visualizations and additional text files for further analysis.
</part>
| [img[SynBlastWorkflow.png]]|<<tiddler ./Mycell1>>|

!!What the tool is for
*to support a manual blast-based orthology analysis for a limited set of protein-coding genes

!!What the tool is not for
*whole genome orthology analysis (only focal genes of interest)

!Introductory Remarks
SynBlast's main tools are 
*the blastresult filtering procedure ({{code{doSyntenyFilter.pl}}}) and 
*the gene order alignment procedure ({{code{doSyntenyAlignment.pl}}}).
Prerequisites for the use of these tools can be generated manually as well as automatically, depending on the source of data to be used.

When using [[Ensembl|http://www.ensembl.org/]] species and data, SynBlast offers the possibility to automatically retrieve the set of reference proteins from the Ensembl databases, including the description/annotation file for the reference region needed for further processing ({{code{getEnsemblProteins.pl}}}).

The subsequent [[Blast|http://www.ncbi.nlm.nih.gov/Education/BLASTinfo/information3.html]] step includes the translated Blast search to be done for each reference protein against selected genomes. Instead of doing this manually for a reference region this can be automatized by another script included in the package ({{code{doBlastJobs.pl}}}). 

!Contents
[[Installation]]
[[Example case: T-box gene cluster]]
[[ReferenceDataRetrieval]]
[[tBlastnSearches]]
[[SyntenyFiltering]]
[[SyntenyAligning]]
[[SynBlast-utilities]]
mailto:joe@bioinf.uni-leipzig.de
/***
|Name|JumpMacro|
|Created by|SaqImtiaz|
|Location|http://tw.lewcid.org/#JumpMacro|
|Version|1.0|
|Requires|~TW2.x|
!Description:
Macro version of the core jump command, that also provides an optional 'jump to top' button.

!Demo:
click the 'j' button in the hoverMenu on the right.

!Installation:
Copy the contents of this tiddler to your TW, tag with systemConfig, save and reload your TW.

!Usage
{{{<<jump>>}}}<<jump>>
{{{<<jump customlabel customtooltip top>>}}} <<jump customlabel customtooltip top>>
Note: passing the third parameter as top, enables the 'top' button in the dropdown.

!History:
27-07-06, ver1.0

!Code
***/

//{{{
config.macros.jump= {};
config.macros.jump.handler = function (place,macroName,params,wikifier,paramString,tiddler)
{
        var label = (params[0] && params[0]!=".")? params[0]: 'jump';
        var tooltip = (params[1] && params[1]!=".")? params[1]: 'jump to an open tiddler';
        var top = (params[2] && params[2]=='top') ? true: false;        

        var btn =createTiddlyButton(place,label,tooltip,this.onclick);
        if (top==true)
              btn.setAttribute("top","true")
}

config.macros.jump.onclick = function(e)
{
        if (!e) var e = window.event;
        var theTarget = resolveTarget(e);
        var top = theTarget.getAttribute("top");
	var popup = Popup.create(this);
	if(popup)
		{
                 if(top=="true")
                                {createTiddlyButton(createTiddlyElement(popup,"li"),'Top ↑','Top of TW',config.macros.jump.top);
                                 createTiddlyElement(popup,"hr");}
		
		story.forEachTiddler(function(title,element) {
			createTiddlyLink(createTiddlyElement(popup,"li"),title,true);
			});
                }
	Popup.show(popup,false);
	e.cancelBubble = true;
	if (e.stopPropagation) e.stopPropagation();
	return false;
}

config.macros.jump.top = function()
{
       window.scrollTo(0,0);
}
//}}}
/***
|Name|JumpToTopMacro|
|Created by|SaqImtiaz|
|Location|http://tw.lewcid.org/#JumpToTopMacro|
|Version|1.0|
|Requires|~TW2.x|
!Description:
Provides a toolbar command and a macro, that create a button for quickly jumping to the top of your TW.
Handy to place in the tiddler toolbar (edit the ViewTemplate)

Note: You can add an extra toolbar to the bottom of tiddlers as well with buttons of your choice, to allow easy access to the buttons/commands in it.

!Demo:
{{{<<top>>}}}<<top>>

!Installation:
Copy the contents of this tiddler to your TW, tag with systemConfig, save and reload your TW.

!History:
*23-07-06: ver 1.0

!Code
***/
//{{{
config.macros.top={};
config.macros.top.handler=function(place,macroName)
{
               createTiddlyButton(place,"^","jump to top",this.onclick);
}
config.macros.top.onclick=function()
{
               window.scrollTo(0,0);
};

config.commands.top =
{
               text:" ^ ",
               tooltip:"jump to top"
};

config.commands.top.handler = function(event,src,title)
{
               window.scrollTo(0,0);
}
//}}}
<!--{{{-->
<div class='header'>
     <div class='gradient' macro='gradient vert #FF8614 #DA4A0D '>
	<div class='titleLine' >
		<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
		<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
	</div>
<div id='topMenu' refresh='content' tiddler='MainMenu'></div>
    </div>
</div>
<div id='bodywrapper'>
<div id='sidebar'>
	<div id='sidebarOptions' refresh='content' 	tiddler='SideBarOptions'></div>
	<div id='sidebarTabs' refresh='content' force='true' tiddler='SideBarTabs'></div>
</div>
<div id='displayArea'>
	<div id='messageArea'></div>
	<div id='tiddlerDisplay'></div>
</div>
<div id='contentFooter'>TiddlyWiki</div>
</div>

<!--}}}-->
[[SideBarWG]]

/***
!Top Menu Styles
***/
/*{{{*/
#topMenu br {display:none; }
#topMenu { background: #000 ; color:#fff;padding: 1em 1em;}
/*}}}*/

/***
!General
***/
/*{{{*/
body {
 background: #444;
 margin: 0 auto;
}

 #contentWrapper{
 background: #fff;
 border: 0;
 margin: 0 auto;
 width: 792px;
 padding:0;
}
/*}}}*/

/***
!Header rules
***/
/*{{{*/
.titleLine{
 margin: 80px auto 0em ;
margin-left:1.7em;
margin-bottom: 40px;
 padding: 0;
 text-align: left;
 color: #fff;
}

.siteTitle {
	font-size: 2em;
        font-weight: bold;
}

.siteSubtitle {
	font-size: 1.1em;
        display: block;
        margin: .5em auto 1em;
}

.gradient {margin: 0 auto;}



.header {
 background: #fff; 
 margin: 0 auto;
 padding:0 12px;
 width: 768px;
}
/*}}}*/

/***
!Display Area
***/
/*{{{*/
#bodywrapper {margin:0 12px; padding:0;background:#fff; height:1%}

#displayArea{
 margin: 0em 16em 0em 1em;
 text-align: left;
}

.tiddler {
	padding: 1em 1em 0em 0em;
}

h1,h2,h3,h4,h5 { color: #000; background: transparent; padding-bottom:2px; border-bottom: 1px dotted #666; }
.title {color:black; font-size:1.8em; border-bottom:1px solid #333; padding-bottom:0.3px;}
.subtitle { font-size:90%; color:#ccc; padding-left:0.25em; margin-top:0.1em; }

.shadow .title {
	color: #aaa;
}

.tagClear{
	clear: none; 
}

* html .viewer pre {
	margin-left: 0em;
}

* html .editor textarea, * html .editor input {
	width: 98%;
}

.tiddler {margin-bottom:1em; padding-bottom:0em;}


.toolbar .button {color:#bbb; border:none;}
.toolbar .button:hover, .toolbar .highlight, .toolbar .marked, .toolbar a.button:active {background:transparent; color:#111; border:none; text-decoration:underline;}

#sidebar .highlight, #sidebar .marked {background:transparent;}

.tagging, .tagged {
	border: 1px solid #eee;
	background-color: #F7F7F7;
}

.selected .tagging, .selected .tagged {
	background-color: #eee;
	border: 1px solid #bbb;
}

 .tagging .listTitle, .tagged .listTitle {
	color: #bbb;
}

.selected .tagging .listTitle, .selected .tagged .listTitle {
	color: #222; 
}


.tagging .button:hover, .tagged .button:hover {
		border: none; background:transparent; text-decoration:underline; color:#000;
}

.tagging .button, .tagged .button {
		color:#aaa;
}

.selected .tagging .button, .selected .tagged .button {
		color:#000;
}

.viewer blockquote {
	border-left: 3px solid #000;
}

.viewer pre, .viewer code {
	border: 1px dashed #ccc;
	background: #eee;}

.viewer hr {
	border: 0;
	border-top: solid 1px #333;
 margin: 0 8em;
	color: #333;
}

.highlight, .marked {background:transparent; color:#111; border:none; text-decoration:underline;}

.viewer .highlight, .viewer .marked {text-decoration:none;}

#sidebarTabs .highlight, #sidebarTabs .marked {color:#000; text-decoration:none;}

.tabSelected {
 color: #000;
 background: #fff;
 border-top: solid 1px #ccc;
 border-left: solid 1px #ccc;
 border-right: solid 1px #ccc;
 border-bottom: none;
}

.viewer .tabSelected:hover{color:#000;}

.viewer .tabSelected {font-weight:bold;}

.tabUnselected {
 color: #999;
 background: #eee;
 border-top: solid 1px #ccc;
 border-left: solid 1px #ccc;
 border-right: solid 1px #ccc;
 border-bottom: solid 1px #ccc;
 padding-bottom:1px;
}

.tabContents {
 background: #fff;
  color: #000;
}
/*}}}*/
/***
!!!Tables
***/
/*{{{*/
.viewer table {
	border: 1px solid #000;
}

.viewer th, thead td {
	background: #000;
	border: 1px solid #000;
	color: #fff;
}

.viewer td, .viewer tr {
	border: 1px solid #111;
}
/*}}}*/


/***
!!!Editor area
***/
/*{{{*/
.editor input, .editor textarea {
	border: 1px solid #ccc;
}

.editor {padding-top:0.3em;}

.editor textarea:focus, .editor input:focus {
	border: 1px solid #333;
}
/*}}}*/

/***
!Sidebar
***/
/*{{{*/
#sidebar{
position:relative;
float:right;
margin-bottom:1em;
display:inline;
width: 16em;
}

#sidebarOptions .sliderPanel {
	background: #eee; border:1px solid #ccc;
}

/*}}}*/

/***
!Body Footer rules
***/
/*{{{*/
#contentFooter {
 text-align: left;
 clear: both;
 color:#fff;
 background: #000;
 padding: 1em 2em;
font-weight:bold;
}

/*}}}*/
/***
!Link Styles
***/
/*{{{*/
a{
	color: #000;
}

a:hover{
        color: #FF6600;
        background:#fff;
}


.button {
	color: #000;
	border: 1px solid #fff;
}

.button:hover {
	color: #fff;
	background: #ff8614;
	border-color: #000;
}

.button:active {
	color: #fff;
	background: #ff8614;
	border: 1px solid #000;
}

.tiddlyLink {border-bottom: 1px dotted #000;}
.tiddlyLink:hover {border-bottom: 1px dotted #FF6600;} 

.titleLine a {border-bottom: 1px dotted #FF9900;}

.titleLine a:hover {border-bottom: 1px dotted #fff;}

.siteTitle a, .siteSubtitle a{
 color: #fff;
}

.viewer .button {border: 1px solid #ff8614; font-weight:bold;}
.viewer .button:hover, .viewer .marked, .viewer .highlight{background:#ff8614; color:#fff; font-weight:bold; border: 1px solid #000;}

#topMenu .button, #topMenu .tiddlyLink {
 margin-left:0.5em; margin-right:0.5em;
 padding-left:3px; padding-right:3px;
 color:white;
}
#topMenu .button:hover, #topMenu .tiddlyLink:hover { background:#000; color:#FF8814}

#topMenu a{border:none;}
/*}}}*/

/***
!Message Area /%=================================================%/
***/
/*{{{*/
#messageArea {
	border: 4px dotted #ff8614;
	background: #000;
	color: #fff;
        font-size:90%;
}

#messageArea .button {
	padding: 0.2em;
	color: #000;
	background: #fff;
        text-decoration:none;
        font-weight:bold;
        border:1px solid #000; 
}

#messageArea a {color:#fff;}

#messageArea a:hover {color:#ff8614; background:transparent;}

#messageArea .button:hover {background: #FF8614; color:#fff; border:1px solid #fff; }

/*}}}*/

/***
!Popup /%=================================================%/
***/
/*{{{*/
.popup {
	background: #ff8814;
	border: 1px solid #333;
}

.popup hr {
	color: #333;
	background: #333;
	border-bottom: 1px;
}

.popup li.disabled {
	color: #333;
}

.popup li a, .popup li a:visited {
	color: #eee;
	border: none;
}

.popup li a:hover {
	background: #ff8614;
	color: #fff;
	border: none;
        text-decoration:underline;
}
/*}}}*/

.blog h2, .blog h3, .blog h4{
  margin:0;
  padding:0;
border-bottom:none;
}
.blog {margin-left:1.5em;}  


.blog .excerpt {
  margin:0;
margin-top:0.3em;
  padding: 0;
  margin-left:1em;
  padding-left:1em;
  font-size:90%;
  border-left:1px solid #ddd;
}

#tiddlerWhatsNew h1, #tiddlerWhatsNew h2 {border-bottom:none;}
div[tags~="RecentUpdates"], div[tags~="lewcidExtension"] {margin-bottom: 2em;}

#hoverMenu  .button, #hoverMenu  .tiddlyLink {border:none; font-weight:bold; background:#f37211; color:#fff; padding:0 5px; float:right; margin-bottom:4px;}
#hoverMenu .button:hover, #hoverMenu .tiddlyLink:hover {font-weight:bold; border:none; color:#f37211; background:#000; padding:0 5px; float:right; margin-bottom:4px;}

#topMenu .fontResizer {float:right;}

#topMenu .fontResizer .button{border:1px solid #000;}
#topMenu .fontResizer .button:hover {border:1px solid #f37211; color:#fff;}
#sidebarTabs .txtMainTab .tiddlyLinkExisting {
 font-weight: normal;
 font-style: normal;
}

#sidebarTabs .txtMoreTab .tiddlyLinkExisting {
 font-weight: bold;
 font-style: normal;
}

.blog h2, .blog h3, .blog h4{
  margin:0;
  padding:0;
border-bottom:none;
}
.blog {margin-left:1.5em;}  


.blog .excerpt {
  margin:0;
margin-top:0.3em;
  padding: 0;
  margin-left:1em;
  padding-left:1em;
  font-size:90%;
  border-left:1px solid #ddd;
}

#tiddlerWhatsNew h1, #tiddlerWhatsNew h2 {border-bottom:none;}
div[tags~="RecentUpdates"], div[tags~="lewcidExtension"] {margin-bottom: 2em;}

#hoverMenu {background:transparent;}
#hoverMenu  .button, #hoverMenu  .tiddlyLink {border:none; font-weight:bold; background:#f37211; color:#fff; padding:0 5px; float:right; margin-bottom:4px;}
#hoverMenu .button:hover, #hoverMenu .tiddlyLink:hover {font-weight:bold; border:none; color:#f37211; background:#000; padding:0 5px; float:right; margin-bottom:4px;}

#topMenu .fontResizer {float:right;}

#topMenu .fontResizer .button{border:1px solid #000;}
#topMenu .fontResizer .button:hover {border:1px solid #f37211; color:#fff;}
#sidebarTabs .txtMainTab .tiddlyLinkExisting {
 font-weight: normal;
 font-style: normal;
}

#sidebarTabs .txtMoreTab .tiddlyLinkExisting {
 font-weight: bold;
 font-style: normal;
}

tiddlers:
*LewcidOrangeBlogStyleSheet
*LewcidOrangeBlogPageTemplate

<<applyTheme LewcidOrangeBlog Preview>>
tiddlers:
*StyleSheet
*PageTemplate

<<applyTheme '' Preview>>
<<fontSize "font-size:">><<author>>
!![[Introduction]]
!![[Installation]]
!![[Guide through the Pipeline Steps]]
!![[Guidelines for parameter settings]]
!![[SynBlast-utilities]]

[[Introduction]]
[[Installation]]
[[Example case: T-box gene cluster]]
[[ReferenceDataRetrieval]]
[[tBlastnSearches]]
[[SyntenyFiltering]]
[[SyntenyAligning]]
[[SynBlast-utilities]]
config.options.chkAnimate=false;
/***

|Name|NavigationMacro|
|Created by|SaqImtiaz|
|Location|http://tw.lewcid.org/#NavigationMacro|
|Version|0.3 |
|Requires|~TW2.08+|
!Description:
*Creates Next and Prev buttons on tiddlers, to cycle through tiddlers in order.
**you can create next and previous buttons to navigate through your journals, or the tiddlers of a tutorial.
*You can exclude certain tiddlers, or navigate through tiddlers with a specific tag only.
*The tiddlers can be sorted by modified or created.
*Custom ordering will be available after the release of TW 2.1
*Needs to be added to the ViewTemplate
*Buttons are updated dynamically and are hidden if there is no next or previous tiddler.

!Usage
{{{<<navigation>>}}}
or for more options:
{{{<<navigation sort exclude tag labelPrevious labelNext >>}}}
where sort is ''created'' (default) or ''modified''
exlcude is the tag to exclude.
tag is the tag to navigate through.
labelPrevious is the label for the previous button.
labelNext is the label for the next button. 

I recommend adding it to the ViewTemplate in the viewer div:
{{{<div class='viewer'>
<span macro='view text wikified'></span>
<span macro='navigation "" "" plugin'></span></div>}}}



!Example:
The next and previous buttons at the bottom of this tiddler will cycle through all of my extensions for TW.
!History
* 25-06-06 : version 0.3, first release

!Code
***/
//{{{
window.refreshNavLink = function (e) {
             var title = e.getAttribute("here");
             var sort = e.getAttribute("sort");
             var exclude =  e.getAttribute("exclude");
             if (e.getAttribute("tag")!=undefined) var tag = e.getAttribute("tag");
             var navtype = e.getAttribute("navtype");
              if (tag) {var tiddlers = store.getTaggedTiddlers(tag,sort);}
              else {var tiddlers = store.getTiddlers(sort,exclude);}
              for (var g=0; g<tiddlers.length; g++)
                  {if (title==tiddlers[g].title)
                       {if(navtype=="next" && !tiddlers[g+1])                             
                             e.className += " navNonExisting"
                        else if (navtype=="prev" && !tiddlers[g-1])
                             e.className += " navNonExisting"
                        else e.className = "button";}
                  }
}


config.refreshers.navLink = function(e,changeList){         
             refreshNavLink(e);
} 



config.macros.navigation={};
config.macros.navigation.handler = function(place,macroName,params,wikifier,paramString,tiddler){

          var sort = (params[0] && params[0]!=".")? params[0]: "created";
          var exclude =(params[1] && params[1]!=".")? params[1]: undefined;
          if (params[2])
                {var tag= params[2];
                 if(tiddler.tags.contains(tag)==false)
                 return false;
                }
          var labelPrev = params[3] ? params[3] : "Previous";
          var labelNext = params[4] ? params[4] : "Next";

          var next = function(e){
              if (!e) var e=window.event;
              var theTarget = resolveTarget(e);
              var navtype = theTarget.getAttribute("navtype");
              if (tag) {var tiddlers = store.getTaggedTiddlers(tag,sort);}
              else {var tiddlers = store.getTiddlers(sort,exclude);}
              for (var g=0; g<tiddlers.length; g++)
                  {if (tiddler.title==tiddlers[g].title)
                        {if (navtype == "next")
                            story.displayTiddler(theTarget,tiddlers[g+1].title)
                        else if (navtype == "prev")
                            story.displayTiddler(theTarget,tiddlers[g-1].title)}
                  }
              }

     var createNavBtn = function(text,theId,mode){
         var nextBtn = createTiddlyButton(place,text,text,next,null,theId);
         nextBtn.setAttribute("refresh","navLink");
         nextBtn.setAttribute("here",tiddler.title);
         nextBtn.setAttribute("sort",sort);
         nextBtn.setAttribute("exclude",exclude);
         nextBtn.setAttribute("navtype",mode);
         if (tag) nextBtn.setAttribute("tag",tag);
         refreshNavLink(nextBtn);
         }
    createNavBtn(labelNext+" ►","NavNext","next");
    createNavBtn("◄ "+labelPrev,"NavPrevious","prev");

}

setStylesheet(
"#NavNext {float:right;}\n"+
"#NavPrevious {float:left;}\n"+
".navNonExisting {display:none;}\n"+
 "",
"NavMacroStyles");
//}}}
<!--{{{-->
<div class='header' macro='gradient vert [[ColorPalette::PrimaryLight]] [[ColorPalette::PrimaryMid]]'>
<table width="99%"><tr><td>
<div class='headerShadow'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
<div class='headerForeground'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
</td><td align="right"><span macro='search "" sizeTextbox:30 buttonAtRight:1'></span></td></tr></table>
</div>
<div id='mainMenu' refresh='content' tiddler='MainMenu'></div>
<!--
<div id='sidebar'>
<div id='sidebarOptions' refresh='content' tiddler='SideBarOptions'></div>
<div id='sidebarTabs' refresh='content' force='true' tiddler='SideBarTabs'></div>
</div>-->
<div id='displayArea'>
<div id='messageArea'></div>
<div id='tiddlerDisplay'></div>
</div>
<!--}}}-->
PageTemplate
/***
|<html><a name="Top"/></html>''Name:''|PartTiddlerPlugin|
|''Version:''|1.0.9 (2007-07-14)|
|''Source:''|http://tiddlywiki.abego-software.de/#PartTiddlerPlugin|
|''Author:''|UdoBorkowski (ub [at] abego-software [dot] de)|
|''Licence:''|[[BSD open source license]]|
|''CoreVersion:''|2.1.3|
|''Browser:''|Firefox 1.0.4+; InternetExplorer 6.0|
!Table of Content<html><a name="TOC"/></html>
* <html><a href="javascript:;" onclick="window.scrollAnchorVisible('Description',null, event)">Description, Syntax</a></html>
* <html><a href="javascript:;" onclick="window.scrollAnchorVisible('Applications',null, event)">Applications</a></html>
** <html><a href="javascript:;" onclick="window.scrollAnchorVisible('LongTiddler',null, event)">Refering to Paragraphs of a Longer Tiddler</a></html>
** <html><a href="javascript:;" onclick="window.scrollAnchorVisible('Citation',null, event)">Citation Index</a></html>
** <html><a href="javascript:;" onclick="window.scrollAnchorVisible('TableCells',null, event)">Creating "multi-line" Table Cells</a></html>
** <html><a href="javascript:;" onclick="window.scrollAnchorVisible('Tabs',null, event)">Creating Tabs</a></html>
** <html><a href="javascript:;" onclick="window.scrollAnchorVisible('Sliders',null, event)">Using Sliders</a></html>
* <html><a href="javascript:;" onclick="window.scrollAnchorVisible('Revisions',null, event)">Revision History</a></html>
* <html><a href="javascript:;" onclick="window.scrollAnchorVisible('Code',null, event)">Code</a></html>
!Description<html><a name="Description"/></html>
With the {{{<part aPartName> ... </part>}}} feature you can structure your tiddler text into separate (named) parts. 
Each part can be referenced as a "normal" tiddler, using the "//tiddlerName//''/''//partName//" syntax (e.g. "About/Features").  E.g. you may create links to the parts (e.g. {{{[[Quotes/BAX95]]}}} or {{{[[Hobbies|AboutMe/Hobbies]]}}}), use it in {{{<<tiddler...>>}}} or {{{<<tabs...>>}}} macros etc.


''Syntax:'' 
|>|''<part'' //partName// [''hidden''] ''>'' //any tiddler content// ''</part>''|
|//partName//|The name of the part. You may reference a part tiddler with the combined tiddler name "//nameOfContainerTidder//''/''//partName//. <<br>>If you use a partName containing spaces you need to quote it (e.g. {{{"Major Overview"}}} or {{{[[Shortcut List]]}}}).|
|''hidden''|When defined the content of the part is not displayed in the container tiddler. But when the part is explicitly referenced (e.g. in a {{{<<tiddler...>>}}} macro or in a link) the part's content is displayed.|
|<html><i>any&nbsp;tiddler&nbsp;content</i></html>|<html>The content of the part.<br>A part can have any content that a "normal" tiddler may have, e.g. you may use all the formattings and macros defined.</html>|
|>|~~Syntax formatting: Keywords in ''bold'', optional parts in [...]. 'or' means that exactly one of the two alternatives must exist.~~|
<html><sub><a href="javascript:;" onclick="window.scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>

!Applications<html><a name="Applications"/></html>
!!Refering to Paragraphs of a Longer Tiddler<html><a name="LongTiddler"/></html>
Assume you have written a long description in a tiddler and now you want to refer to the content of a certain paragraph in that tiddler (e.g. some definition.) Just wrap the text with a ''part'' block, give it a nice name, create a "pretty link" (like {{{[[Discussion Groups|Introduction/DiscussionGroups]]}}}) and you are done.

Notice this complements the approach to first writing a lot of small tiddlers and combine these tiddlers to one larger tiddler in a second step (e.g. using the {{{<<tiddler...>>}}} macro). Using the ''part'' feature you can first write a "classic" (longer) text that can be read "from top to bottom" and later "reuse" parts of this text for some more "non-linear" reading.

<html><sub><a href="javascript:;" onclick="window.scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>

!!Citation Index<html><a name="Citation"/></html>
Create a tiddler "Citations" that contains your "citations". 
Wrap every citation with a part and a proper name. 

''Example''
{{{
<part BAX98>Baxter, Ira D. et al: //Clone Detection Using Abstract Syntax Trees.// 
in //Proc. ICSM//, 1998.</part>

<part BEL02>Bellon, Stefan: //Vergleich von Techniken zur Erkennung duplizierten Quellcodes.// 
Thesis, Uni Stuttgart, 2002.</part>

<part DUC99>Ducasse, Stéfane et al: //A Language Independent Approach for Detecting Duplicated Code.// 
in //Proc. ICSM//, 1999.</part>
}}}

You may now "cite" them just by using a pretty link like {{{[[Citations/BAX98]]}}} or even more pretty, like this {{{[[BAX98|Citations/BAX98]]}}}.

<html><sub><a href="javascript:;" onclick="window.scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>

!!Creating "multi-line" Table Cells<html><a name="TableCells"/></html>
You may have noticed that it is hard to create table cells with "multi-line" content. E.g. if you want to create a bullet list inside a table cell you cannot just write the bullet list
{{{
* Item 1
* Item 2
* Item 3
}}}
into a table cell (i.e. between the | ... | bars) because every bullet item must start in a new line but all cells of a table row must be in one line.

Using the ''part'' feature this problem can be solved. Just create a hidden part that contains the cells content and use a {{{<<tiddler >>}}} macro to include its content in the table's cell.

''Example''
{{{
|!Subject|!Items|
|subject1|<<tiddler ./Cell1>>|
|subject2|<<tiddler ./Cell2>>|

<part Cell1 hidden>
* Item 1
* Item 2
* Item 3
</part>
...
}}}

Notice that inside the {{{<<tiddler ...>>}}} macro you may refer to the "current tiddler" using the ".".

BTW: The same approach can be used to create bullet lists with items that contain more than one line.

<html><sub><a href="javascript:;" onclick="window.scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>

!!Creating Tabs<html><a name="Tabs"/></html>
The build-in {{{<<tabs ...>>}}} macro requires that you defined an additional tiddler for every tab it displays. When you want to have "nested" tabs you need to define a tiddler for the "main tab" and one for every tab it contains. I.e. the definition of a set of tabs that is visually displayed at one place is distributed across multiple tiddlers.

With the ''part'' feature you can put the complete definition in one tiddler, making it easier to keep an overview and maintain the tab sets.

''Example''
The standard tabs at the sidebar are defined by the following eight tiddlers:
* SideBarTabs
* TabAll
* TabMore
* TabMoreMissing
* TabMoreOrphans
* TabMoreShadowed
* TabTags
* TabTimeline

Instead of these eight tiddlers one could define the following SideBarTabs tiddler that uses the ''part'' feature:
{{{
<<tabs txtMainTab 
    Timeline Timeline SideBarTabs/Timeline 
    All 'All tiddlers' SideBarTabs/All 
    Tags 'All tags' SideBarTabs/Tags 
    More 'More lists' SideBarTabs/More>>
<part Timeline hidden><<timeline>></part>
<part All hidden><<list all>></part>
<part Tags hidden><<allTags>></part>
<part More hidden><<tabs txtMoreTab 
    Missing 'Missing tiddlers' SideBarTabs/Missing 
    Orphans 'Orphaned tiddlers' SideBarTabs/Orphans 
    Shadowed 'Shadowed tiddlers' SideBarTabs/Shadowed>></part>
<part Missing hidden><<list missing>></part>
<part Orphans hidden><<list orphans>></part>
<part Shadowed hidden><<list shadowed>></part>
}}}

Notice that you can easily "overwrite" individual parts in separate tiddlers that have the full name of the part.

E.g. if you don't like the classic timeline tab but only want to see the 100 most recent tiddlers you could create a tiddler "~SideBarTabs/Timeline" with the following content:
{{{
<<forEachTiddler 
		sortBy 'tiddler.modified' descending 
		write '(index < 100) ? "* [["+tiddler.title+"]]\n":""'>>
}}}
<html><sub><a href="javascript:;" onclick="window.scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>

!!Using Sliders<html><a name="Sliders"/></html>
Very similar to the build-in {{{<<tabs ...>>}}} macro (see above) the {{{<<slider ...>>}}} macro requires that you defined an additional tiddler that holds the content "to be slid". You can avoid creating this extra tiddler by using the ''part'' feature

''Example''
In a tiddler "About" we may use the slider to show some details that are documented in the tiddler's "Details" part.
{{{
...
<<slider chkAboutDetails About/Details details "Click here to see more details">>
<part Details hidden>
To give you a better overview ...
</part>
...
}}}

Notice that putting the content of the slider into the slider's tiddler also has an extra benefit: When you decide you need to edit the content of the slider you can just doubleclick the content, the tiddler opens for editing and you can directly start editing the content (in the part section). In the "old" approach you would doubleclick the tiddler, see that the slider is using tiddler X, have to look for the tiddler X and can finally open it for editing. So using the ''part'' approach results in a much short workflow.

<html><sub><a href="javascript:;" onclick="window.scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>

!Revision history<html><a name="Revisions"/></html>
* v1.0.9 (2007-07-14)
** Bugfix: Error when using the SideBarTabs example and switching between "More" and "Shadow". Thanks to cmari for reporting the issue.
* v1.0.8 (2007-06-16)
** Speeding up display of tiddlers containing multiple pard definitions. Thanks to Paco Rivière for reporting the issue.
** Support "./partName" syntax inside <<tabs ...>> macro
* v1.0.7 (2007-03-07)
** Bugfix: <<tiddler "./partName">> does not always render correctly after a refresh (e.g. like it happens when using the "Include" plugin). Thanks to Morris Gray for reporting the bug.
* v1.0.6 (2006-11-07)
** Bugfix: cannot edit tiddler when UploadPlugin by Bidix is installed. Thanks to José Luis González Castro for reporting the bug.
* v1.0.5 (2006-03-02)
** Bugfix: Example with multi-line table cells does not work in IE6. Thanks to Paulo Soares for reporting the bug.
* v1.0.4 (2006-02-28)
** Bugfix: Shadow tiddlers cannot be edited (in TW 2.0.6). Thanks to Torsten Vanek for reporting the bug.
* v1.0.3 (2006-02-26)
** Adapt code to newly introduced Tiddler.prototype.isReadOnly() function (in TW 2.0.6). Thanks to Paulo Soares for reporting the problem.
* v1.0.2 (2006-02-05)
** Also allow other macros than the "tiddler" macro use the "." in the part reference (to refer to "this" tiddler)
* v1.0.1 (2006-01-27)
** Added Table of Content for plugin documentation. Thanks to RichCarrillo for suggesting.
** Bugfix: newReminder plugin does not work when PartTiddler is installed. Thanks to PauloSoares for reporting.
* v1.0.0 (2006-01-25)
** initial version
<html><sub><a href="javascript:;" onclick="window.scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>

!Code<html><a name="Code"/></html>
<html><sub><a href="javascript:;" onclick="window.scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>
***/
//{{{
//============================================================================
//                           PartTiddlerPlugin

// Ensure that the PartTiddler Plugin is only installed once.
//
if (!version.extensions.PartTiddlerPlugin) {



version.extensions.PartTiddlerPlugin = {
    major: 1, minor: 0, revision: 9,
    date: new Date(2007, 6, 14), 
    type: 'plugin',
    source: "http://tiddlywiki.abego-software.de/#PartTiddlerPlugin"
};

if (!window.abego) window.abego = {};
if (version.major < 2) alertAndThrow("PartTiddlerPlugin requires TiddlyWiki 2.0 or newer.");

//============================================================================
// Common Helpers

// Looks for the next newline, starting at the index-th char of text. 
//
// If there are only whitespaces between index and the newline 
// the index behind the newline is returned, 
// otherwise (or when no newline is found) index is returned.
//
var skipEmptyEndOfLine = function(text, index) {
	var re = /(\n|[^\s])/g;
	re.lastIndex = index;
	var result = re.exec(text);
	return (result && text.charAt(result.index) == '\n') 
			? result.index+1
			: index;
}


//============================================================================
// Constants

var partEndOrStartTagRE = /(<\/part>)|(<part(?:\s+)((?:[^>])+)>)/mg;
var partEndTagREString = "<\\/part>";
var partEndTagString = "</part>";

//============================================================================
// Plugin Specific Helpers

// Parse the parameters inside a <part ...> tag and return the result.
//
// @return [may be null] {partName: ..., isHidden: ...}
//
var parseStartTagParams = function(paramText) {
	var params = paramText.readMacroParams();
	if (params.length == 0 || params[0].length == 0) return null;
	
	var name = params[0];
	var paramsIndex = 1;
	var hidden = false;
	if (paramsIndex < params.length) {
		hidden = params[paramsIndex] == "hidden";
		paramsIndex++;
	}
	
	return {
		partName: name, 
		isHidden: hidden
	};
}

// Returns the match to the next (end or start) part tag in the text, 
// starting the search at startIndex.
// 
// When no such tag is found null is returned, otherwise a "Match" is returned:
// [0]: full match
// [1]: matched "end" tag (or null when no end tag match)
// [2]: matched "start" tag (or null when no start tag match)
// [3]: content of start tag (or null if no start tag match)
//
var findNextPartEndOrStartTagMatch = function(text, startIndex) {
	var re = new RegExp(partEndOrStartTagRE);
	re.lastIndex = startIndex;
	var match = re.exec(text);
	return match;
}

//============================================================================
// Formatter

// Process the <part ...> ... </part> starting at (w.source, w.matchStart) for formatting.
//
// @return true if a complete part section (including the end tag) could be processed, false otherwise.
//
var handlePartSection = function(w) {
	var tagMatch = findNextPartEndOrStartTagMatch(w.source, w.matchStart);
	if (!tagMatch) return false;
	if (tagMatch.index != w.matchStart || !tagMatch[2]) return false;

	// Parse the start tag parameters
	var arguments = parseStartTagParams(tagMatch[3]);
	if (!arguments) return false;
	
	// Continue processing
	var startTagEndIndex = skipEmptyEndOfLine(w.source, tagMatch.index + tagMatch[0].length);
	var endMatch = findNextPartEndOrStartTagMatch(w.source, startTagEndIndex);
	if (endMatch && endMatch[1]) {
		if (!arguments.isHidden) {
			w.nextMatch = startTagEndIndex;
			w.subWikify(w.output,partEndTagREString);
		}
		w.nextMatch = skipEmptyEndOfLine(w.source, endMatch.index + endMatch[0].length);
		
		return true;
	}
	return false;
}

config.formatters.push( {
    name: "part",
    match: "<part\\s+[^>]+>",
	
	handler: function(w) {
		if (!handlePartSection(w)) {
			w.outputText(w.output,w.matchStart,w.matchStart+w.matchLength);
		}
	}
} )

//============================================================================
// Extend "fetchTiddler" functionality to also recognize "part"s of tiddlers 
// as tiddlers.

var currentParent = null; // used for the "." parent (e.g. in the "tiddler" macro)

// Return the match to the first <part ...> tag of the text that has the
// requrest partName.
//
// @return [may be null]
//
var findPartStartTagByName = function(text, partName) {
	var i = 0;
	
	while (true) {
		var tagMatch = findNextPartEndOrStartTagMatch(text, i);
		if (!tagMatch) return null;

		if (tagMatch[2]) {
			// Is start tag
	
			// Check the name
			var arguments = parseStartTagParams(tagMatch[3]);
			if (arguments && arguments.partName == partName) {
				return tagMatch;
			}
		}
		i = tagMatch.index+tagMatch[0].length;
	}
}

// Return the part "partName" of the given parentTiddler as a "readOnly" Tiddler 
// object, using fullName as the Tiddler's title. 
//
// All remaining properties of the new Tiddler (tags etc.) are inherited from 
// the parentTiddler.
// 
// @return [may be null]
//
var getPart = function(parentTiddler, partName, fullName) {
	var text = parentTiddler.text;
	var startTag = findPartStartTagByName(text, partName);
	if (!startTag) return null;
	
	var endIndexOfStartTag = skipEmptyEndOfLine(text, startTag.index+startTag[0].length);
	var indexOfEndTag = text.indexOf(partEndTagString, endIndexOfStartTag);

	if (indexOfEndTag >= 0) {
		var partTiddlerText = text.substring(endIndexOfStartTag,indexOfEndTag);
		var partTiddler = new Tiddler();
		partTiddler.set(
						fullName,
						partTiddlerText,
						parentTiddler.modifier,
						parentTiddler.modified,
						parentTiddler.tags,
						parentTiddler.created);
		partTiddler.abegoIsPartTiddler = true;
		return partTiddler;
	}
	
	return null;
}

// Hijack the store.fetchTiddler to recognize the "part" addresses.
//
var hijackFetchTiddler = function() {
	var oldFetchTiddler = store.fetchTiddler ;
	store.fetchTiddler = function(title) {
		var result = oldFetchTiddler.apply(this, arguments);
		if (!result && title) {
			var i = title.lastIndexOf('/');
			if (i > 0) {
				var parentName = title.substring(0, i);
				var partName = title.substring(i+1);
				var parent = (parentName == ".") 
						? store.resolveTiddler(currentParent)
						: oldFetchTiddler.apply(this, [parentName]);
				if (parent) {
					return getPart(parent, partName, parent.title+"/"+partName);
				}
			}
		}
		return result;	
	};
};

// for debugging the plugin is not loaded through the systemConfig mechanism but via a script tag. 
// At that point in the "store" is not yet defined. In that case hijackFetchTiddler through the restart function.
// Otherwise hijack now.
if (!store) {
	var oldRestartFunc = restart;
	window.restart = function() {
		hijackFetchTiddler();
		oldRestartFunc.apply(this,arguments);
	};
} else
	hijackFetchTiddler();




// The user must not edit a readOnly/partTiddler
//

config.commands.editTiddler.oldIsReadOnlyFunction = Tiddler.prototype.isReadOnly;

Tiddler.prototype.isReadOnly = function() {
	// Tiddler.isReadOnly was introduced with TW 2.0.6.
	// For older version we explicitly check the global readOnly flag
	if (config.commands.editTiddler.oldIsReadOnlyFunction) {
		if (config.commands.editTiddler.oldIsReadOnlyFunction.apply(this, arguments)) return true;
	} else {
		if (readOnly) return true;
	}

	return this.abegoIsPartTiddler;
}

config.commands.editTiddler.handler = function(event,src,title)
{
	var t = store.getTiddler(title);
	// Edit the tiddler if it either is not a tiddler (but a shadowTiddler)
	// or the tiddler is not readOnly
	if(!t || !t.abegoIsPartTiddler)
		{
		clearMessage();
		story.displayTiddler(null,title,DEFAULT_EDIT_TEMPLATE);
		story.focusTiddler(title,"text");
		return false;
		}
}

// To allow the "./partName" syntax in macros we need to hijack 
// the invokeMacro to define the "currentParent" while it is running.
// 
var oldInvokeMacro = window.invokeMacro;
function myInvokeMacro(place,macro,params,wikifier,tiddler) {
	var oldCurrentParent = currentParent;
	if (tiddler) currentParent = tiddler;
	try {
		oldInvokeMacro.apply(this, arguments);
	} finally {
		currentParent = oldCurrentParent;
	}
}
window.invokeMacro = myInvokeMacro;

// To correctly support the "./partName" syntax while refreshing we need to hijack 
// the config.refreshers.tiddlers to define the "currentParent" while it is running.
// 
(function() {
	var oldTiddlerRefresher= config.refreshers.tiddler;
	config.refreshers.tiddler = function(e,changeList) {
		var oldCurrentParent = currentParent;
		try {
			currentParent = e.getAttribute("tiddler");
			return oldTiddlerRefresher.apply(this,arguments);
		} finally {
			currentParent = oldCurrentParent;
		}
	};
})();

// Support "./partName" syntax inside <<tabs ...>> macro
(function() {
	var extendRelativeNames = function(e, title) {
		var nodes = e.getElementsByTagName("a");
		for(var i=0; i<nodes.length; i++) {
			var node = nodes[i];
			var s = node.getAttribute("content");
			if (s && s.indexOf("./") == 0)
				node.setAttribute("content",title+s.substr(1));
		}
	};
	var oldHandler = config.macros.tabs.handler;
	config.macros.tabs.handler = function(place,macroName,params,wikifier,paramString,tiddler) {
		var result = oldHandler.apply(this,arguments);
		if (tiddler)
			extendRelativeNames(place, tiddler.title);
		return result;
	};
})();

// Scroll the anchor anchorName in the viewer of the given tiddler visible.
// When no tiddler is defined use the tiddler of the target given event is used.
window.scrollAnchorVisible = function(anchorName, tiddler, evt) {
	var tiddlerElem = null;
	if (tiddler) {
		tiddlerElem = document.getElementById(story.idPrefix + tiddler);
	}
	if (!tiddlerElem && evt) {
		var target = resolveTarget(evt);
		tiddlerElem = story.findContainingTiddler(target);
	}
	if (!tiddlerElem) return;

	var children = tiddlerElem.getElementsByTagName("a");
	for (var i = 0; i < children.length; i++) {
		var child = children[i];
		var name = child.getAttribute("name");
		if (name == anchorName) {
			var y = findPosY(child);
			window.scrollTo(0,y);
			return;
		}
	}
}

} // of "install only once"
//}}}

/***
<html><sub><a href="javascript:;" onclick="scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>

!Licence and Copyright
Copyright (c) abego Software ~GmbH, 2006 ([[www.abego-software.de|http://www.abego-software.de]])

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or other
materials provided with the distribution.

Neither the name of abego Software nor the names of its contributors may be
used to endorse or promote products derived from this software without specific
prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.

<html><sub><a href="javascript:;" onclick="scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>
***/
/***
|''Name:''|PasswordOptionPlugin|
|''Description:''|Extends TiddlyWiki options with non encrypted password option.|
|''Version:''|1.0.2|
|''Date:''|Apr 19, 2007|
|''Source:''|http://tiddlywiki.bidix.info/#PasswordOptionPlugin|
|''Author:''|BidiX (BidiX (at) bidix (dot) info)|
|''License:''|[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D ]]|
|''~CoreVersion:''|2.2.0 (Beta 5)|
***/
//{{{
version.extensions.PasswordOptionPlugin = {
	major: 1, minor: 0, revision: 2, 
	date: new Date("Apr 19, 2007"),
	source: 'http://tiddlywiki.bidix.info/#PasswordOptionPlugin',
	author: 'BidiX (BidiX (at) bidix (dot) info',
	license: '[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D]]',
	coreVersion: '2.2.0 (Beta 5)'
};

config.macros.option.passwordCheckboxLabel = "Save this password on this computer";
config.macros.option.passwordInputType = "password"; // password | text
setStylesheet(".pasOptionInput {width: 11em;}\n","passwordInputTypeStyle");

merge(config.macros.option.types, {
	'pas': {
		elementType: "input",
		valueField: "value",
		eventName: "onkeyup",
		className: "pasOptionInput",
		typeValue: config.macros.option.passwordInputType,
		create: function(place,type,opt,className,desc) {
			// password field
			config.macros.option.genericCreate(place,'pas',opt,className,desc);
			// checkbox linked with this password "save this password on this computer"
			config.macros.option.genericCreate(place,'chk','chk'+opt,className,desc);			
			// text savePasswordCheckboxLabel
			place.appendChild(document.createTextNode(config.macros.option.passwordCheckboxLabel));
		},
		onChange: config.macros.option.genericOnChange
	}
});

merge(config.optionHandlers['chk'], {
	get: function(name) {
		// is there an option linked with this chk ?
		var opt = name.substr(3);
		if (config.options[opt]) 
			saveOptionCookie(opt);
		return config.options[name] ? "true" : "false";
	}
});

merge(config.optionHandlers, {
	'pas': {
 		get: function(name) {
			if (config.options["chk"+name]) {
				return encodeCookie(config.options[name].toString());
			} else {
				return "";
			}
		},
		set: function(name,value) {config.options[name] = decodeCookie(value);}
	}
});

// need to reload options to load passwordOptions
loadOptionsCookie();

/*
if (!config.options['pasPassword'])
	config.options['pasPassword'] = '';

merge(config.optionsDesc,{
		pasPassword: "Test password"
	});
*/
//}}}
/***
|''Name:''|~PopupMacro|
|''Version:''|1.0.0 (2006-05-09)|
|''Source:''|http://tw.lewcid.org/#PopupMacro|
|''Author:''|Saq Imtiaz|
|''Description:''|Create popups with custom content|
|''Documentation:''|[[PopupMacro Documentation|PopupMacroDocs]]|
|''~Requires:''|TW Version 2.0.8 or better|
***/
// /%
{{{
config.macros.popup = {};
config.macros.popup.arrow = (document.all?"▼":"▾");
config.macros.popup.handler = function(place,macroName,params,wikifier,paramString,theTiddler) {

        if (!params[0] || !params[1]) 
             {createTiddlyError(place,'missing macro parameters','missing label or content parameter');
              return false;};
   
        var label = params[0];
        var source = (params[1]).replace(/\$\)\)/g,">>"); 
        var nestedId = params[2]? params[2]: 'nestedpopup';        

	var onclick = function(event) {
	        if(!event){var event = window.event;}
                var theTarget = resolveTarget(event);
                var nested = (!isNested(theTarget));
               
                if ((Popup.stack.length > 1)&&(nested==true)) {Popup.removeFrom(1);}
                else if(Popup.stack.length > 0 && nested==false) {Popup.removeFrom(0);};
                
                var theId = (nested==false)? "popup" : nestedId; 
	        var popup = createTiddlyElement(document.body,"ol",theId,"popup",null);
	        Popup.stack.push({root: button, popup: popup});

                wikify(source,popup);
		Popup.show(popup,true);
	        event.cancelBubble = true;
		if (event.stopPropagation) event.stopPropagation();
		return false;
	}
	var button = createTiddlyButton(place, label+this.arrow,label, onclick, null);
};

window.isNested = function(e) {
        while (e != null) {
                var contentWrapper = document.getElementById("contentWrapper");
                if (contentWrapper == e) return true;
                e = e.parentNode;
                }
        return false;
};

setStylesheet(
".popup, .popup a, .popup a:visited {color: #fff;}\n"+
".popup  a:hover {background: #014; color: #fff; border: none;}\n"+
".popup li , .popup ul, .popup ol {list-style:none !important; margin-left:0.3em !important; margin-right:0.3em; font-size:100%; padding-top:0.5px !important; padding:0px !important;}\n"+
"#nestedpopup {background:#2E5ADF; border: 1px solid #0331BF; margin-left:1em; }\n"+
"",
"CustomPopupStyles");

config.shadowTiddlers.PopupMacroDocs="The documentation is available [[here.|http://tw.lewcid.org/#PopupMacroDocs]]";
}}}
//%/
//{{{
TiddlyWiki.prototype.removeNotification = function(title,fn) {
	for (var i=0;i<this.namedNotifications.length;i++)
		if((this.namedNotifications[i].name == title) && (this.namedNotifications[i].notify == fn))
			this.namedNotifications.splice(i,1);
}
      
//checks to see if a tiddler exists in store or as a shadow.
TiddlyWiki.prototype.isTiddler= function (title)
        {return store.tiddlerExists(title) || store.isShadowTiddler(title)}

// Refresh all tiddlers in the Story
Story.prototype.lewcidrefreshAllTiddlers = function()
{
    var place = document.getElementById(this.container);
    var e = place.firstChild;
    if(!e) return;
    this.refreshTiddler(e.getAttribute("tiddler"),null,true);
    while((e = e.nextSibling) != null)
        this.refreshTiddler(e.getAttribute("tiddler"),null,true);
}

config.presentationPlugin ={
};

config.presentationPlugin.defaults = [
	{name: "StyleSheet", notify: refreshStyles},
	{name: "PageTemplate", notify: refreshPageTemplate}
	];

window.presentationMode='';

function applyPresentationMode (oldMode,Mode)
{
    presentationMode = Mode;
    var defaults = config.presentationPlugin.defaults;
    var oldStyleElement = document.getElementById(oldMode+"StyleSheet");
    if (oldStyleElement)
        {
        oldStyleElement.parentNode.removeChild(oldStyleElement);
        }
    for (var i=0; i<defaults.length; i++)
      {
        var def = defaults[i]["name"];
        var newMode = store.isTiddler(Mode + def)? Mode + def : def;
        store.removeNotification(oldMode + def, defaults[i]["notify"]);
        store.addNotification(newMode,defaults[i]["notify"]);
        store.notify(newMode); //just one do blanket notify instead?
      }
    story.lewcidrefreshAllTiddlers();
}

config.macros.author={};
config.macros.author.handler= function (place,macroName,params,wikifier,paramString,tiddler) {
	var e = createTiddlyElement(place,"div");
	e.setAttribute("refresh","macro");
	e.setAttribute("macroName","author");
	e.setAttribute("params",paramString);
	this.refresh(e,paramString);
}

config.macros.author.refresh = function(place,params){
    if (window.lewcideditmode== false)
        return false;
    removeChildren(place);
    var oldMode = window.presentationMode;
    var newMode = (oldMode == "Author")?"":"Author";
    var label = (oldMode == "Author")? "Presentation Mode":"Author Mode";
    var tooltip = label;
	createTiddlyButton(place,label,tooltip,function() {
		applyPresentationMode(oldMode,newMode);
	});
};

Story.prototype.chooseTemplateForTiddler_old_presentation = Story.prototype.chooseTemplateForTiddler;

Story.prototype.chooseTemplateForTiddler = function(title,template)
{
    if (!template)
        template = DEFAULT_VIEW_TEMPLATE;
    var mode = presentationMode;
    if (template == DEFAULT_VIEW_TEMPLATE)
        {
        if (store.isTiddler(mode+"ViewTemplate"))
            return mode+"ViewTemplate";
        }
    else if (template == DEFAULT_EDIT_TEMPLATE)
        {
        if (store.isTiddler(mode+"EditTemplate"))
            return mode+"EditTemplate";
        }
    return this.chooseTemplateForTiddler_old_presentation(title,template);
}

window.lewcideditmode = false;
config.paramifiers.author = {
	onstart: function(v) {
                 if (v!="true")
                     return false;
                applyPresentationMode("","Author");
                window.lewcideditmode =  true;
                refreshDisplay();
	            }
};
//}}}
The first step of the pipeline is to determine and extract the ''reference proteins'', namely all protein-coding genes around a focal gene of interest, in our example case gene //"Tbx2"// of //mouse// (Ensembl gene identifier is [[ENSMUSG00000000093|http://dec2006.archive.ensembl.org/Mus_musculus/geneview?gene=ENSMUSG00000000093]]) within a certain distance up- and downstream. As we use Ensembl data as reference this can be accomplished by the script {{code{[[getEnsemblProteins.pl|getEnsemblProteinsUsage]]}}}:

{{codeblock{
"""$ getEnsemblProteins.pl -f"""''5e5''""" -d"""''./proteins/''""" -h"""''Mus_musculus''""" [-c../myDBinitFile] [-xdec2006] """''-o''"""   ENSMUSG00000000093"""}}}
Command line options specify 
*the flanking size up- and downstream (''-f'', here "''5e5''" (500'000nt))
*the directory where to save protein fasta sequences (''-d'', here subdir "''proteins''")
*the Ensembl species name (space replaced by "_") of the reference proteins (''-h'', here "''Mus_musculus''")
*optionally a custom Registry Configuration File to use a local Ensembl mysql database as source (''-c'', see http://www.ensembl.org/info/docs/api/registry.html)
*optionally the Ensembl version date string for the Ensembl release used for the reference data. ONLY necessary if differing from the current API release version (not recommended). (''-x'', here "''dec2006''")
*to download the selected proteins locally (''-o'' flag)
Necessary arguments are one (or more) Ensembl gene identifier that is used as reference anchors (focal gene of interest, here "''~ENSMUSG00000000093''").
The output is then a reference annotation file (here {{code{[[Tbx2_ENSMUSG00000000093_5e5.protein.info|./TBX2_tutorial/Tbx2_ENSMUSG00000000093_5e5.protein.info]]}}}) containing some descriptive data (header) and a list of consecutive genes around the focal gene (as tab-separated entries, see bottom for our example). By default,  the shorter one of overlapping entries (and if of same strand) are commented out ({{code{#}}}). Before going on with the pipeline, some further entries can be commented out manually if necessary.
Note, that in case of a manual creation of the annotation file, the ''column''-tag line ({{code{"""#!columns=startPos,endPos,meanPos,protID..."""}}}) has to contain at least {{code{''protID''}}} (the query identifier for the Blast step), {{code{''startPos''}}}, {{code{''endPos''}}}, {{code{''ori''}}}, {{code{''protLength''}}} and {{code{''geneID''}}}. All further known/possible column names or annotation information can be added freely, and those defined here can be used/displayed as reference locus attribute in the final result HTML file of {{code{[[doSyntenyAlignment.pl|doSyntenyAlignmentUsage]]}}} (see option ''-refFields''), too.


{{code{[[Tbx2_ENSMUSG00000000093_5e5.protein.info|./TBX2_tutorial/Tbx2_ENSMUSG00000000093_5e5.protein.info]]}}}:
<html><pre>
#protein.info file
#!organism=Mus_musculus
#!ensemblRelease=dec2006
#!coordsystem=chromosome
#!seqregion=11
#!from=85149273
#!to=86157325
#!strand=1
#!length=1008053
#!focalgene=ENSMUSG00000000093
#!flankingsize=5e5
#!columns=startPos,endPos,meanPos,protID,protName,ori,geneID,geneName,transID,protLength,numExons
85171088        85641433        85325812        ENSMUSP00000090496      Bcas3   1       ENSMUSG00000059439      Bcas3   ENSMUST00000092821      943     26
# 85171088      85641545        85325791        ENSMUSP00000074416      Bcas3   1       ENSMUSG00000059439      Bcas3   ENSMUST00000074875      928     24
# 85325824      85641545        85393036        ENSMUSP00000098243      Q5SWI3_MOUSE    1       ENSMUSG00000059439      Bcas3   ENSMUST00000100677      476     12
# 85325833      85641545        85393063        ENSMUSP00000090497      Q5SWI2_MOUSE    1       ENSMUSG00000059439      Bcas3   ENSMUST00000092822      458     11
# 85286947      85313082        85292992        ENSMUSP00000098244      Q5SWI1_MOUSE    1       ENSMUSG00000059439      Bcas3   ENSMUST00000100678      165     5
# 85171088      85187358        85177258        ENSMUSP00000098245      Q5RI22_MOUSE    1       ENSMUSG00000059439      Bcas3   ENSMUST00000100679      120     5
85535164        85535469        85535311        ENSMUSP00000098240      Q3UV40_MOUSE    -1      ENSMUSG00000072590      Q3UV40_MOUSE    ENSMUST00000100674      101     1
# 85618018      85641433        85618141        ENSMUSP00000098241      Q5SWV7_MOUSE    1       ENSMUSG00000059439      Bcas3   ENSMUST00000100675      85      3
85649302        85657209        85654050        ENSMUSP00000000095      Tbx2    1       ENSMUSG00000000093      Tbx2    ENSMUST00000000095      711     7
85663048        85666526        85664200        ENSMUSP00000090493      Q5SSP8_MOUSE    -1      ENSMUSG00000069785      Q5SSP8_MOUSE    ENSMUST00000092818      169     3
85706258        85730940        85728320        ENSMUSP00000000096      Tbx4    1       ENSMUSG00000000094      Tbx4    ENSMUST00000000096      552     8
85877624        86015159        85955245        ENSMUSP00000043108      Brip1   -1      ENSMUSG00000034329      Brip1   ENSMUST00000044423      1174    19
# 85881187      86015159        85962278        ENSMUSP00000098238      Brip1   -1      ENSMUSG00000034329      Brip1   ENSMUST00000100673      824     17
# 86011350      86015159        86014131        ENSMUSP00000067831      Brip1   -1      ENSMUSG00000034329      Brip1   ENSMUST00000064301      87      4
86023489        86024337        86023909        ENSMUSP00000079878      4632419I22Rik   1       ENSMUSG00000062930      4632419I22Rik   ENSMUST00000081097      282     1
86028827        86072513        86049353        ENSMUSP00000018212      Ints2   -1      ENSMUSG00000018068      Ints2   ENSMUST00000018212      1198    24
# 8 transcripts passed filter; (in 1 cases genes are overlapping, but of different strand.)
# 8 transcripts are overlapping with a transcript of same strand but larger/same size, displayed as a comment only (overlappings of referenceID-proteins are all downloaded, but only one longest is displayed).
# (+ 2 skipped entries not displayed, whereof 0 nonCoding)
# on slice around ensembl-ID ENSMUSG00000000093
</pre></html>



/***
|Name|SaveAndReloadMacro|
|Created by|SaqImtiaz|
|Location|http://tw.lewcid.org/#SaveAndReloadMacro|
|Version|1.0|
|Requires|~TW2.x|
!Description:
Provides a button to save and reload TW. Useful if you are testing code and dont have AutoSave enabled.

!Demo:
{{{<<saveAndReload>>}}}<<saveAndReload>>

!Installation:
Copy the contents of this tiddler to your TW, tag with systemConfig, save and reload your TW.

!History:
*24-07-06: ver 1.0

!Code
***/
//{{{
config.macros.saveAndReload={};
config.macros.saveAndReload.handler= function(place,macroName,params,wikifier,paramString,tiddler)
{
        var label = params[0]||"Save & Reload";
        var tooltip = params[1]||"Save & reload";
        createTiddlyButton(place,label,tooltip,this.onclick);
}
config.macros.saveAndReload.onclick= function()
{
       saveChanges();
       window.location.reload( false );
}
//}}}
/***

''This plugin was previously called StyleChooser.''

|Name|SelectThemePlugin|
|Created by|SimonBaird and SaqImtiaz|
|Location|http://tw.lewcid.org/#SelectThemePlugin|
|Version|1.2.5|
|Requires|~TW2.x|
!Description
*An alternative style switcher, can be used to switch just stylesheets and/or pagetemplates, or a combination of both (a theme)
*you can add your own stylesheets and pagetemplates, or use a ThemePack, like BigThemePack.

!Usage
* You have to have fetch or create some styleSheets and pageTemplates to use this plugin.
**You can either get a ThemePack like BigThemePack which automatically adds themes to ThemeSelect.
**or create tiddlers with styleSheets and pageTemplates and tag them styleSheets and pageTemplates respectively.
* Put {{{<<themeSelect style 'Select theme'>>}}} in your SideBarOptions.

!Creating Theme Packs
*You can create your own theme pack if you like. Instructions can be found [[here.|CreateThemePack]]

!History
*20-Dec-06, v 1.2.5, fixed horizontal rules for IE (thanks Clint), compatibility fix with HoverMenuPlugin
* 08-Sept-06, v1.2.4, fixed bug with TW2.1
* 15-May-06, v1.2.3, added paramifier so you can put theme on url, eg http://www.somewhere.com/twfile.html#theme:Berry2, thanks Clint (Simon).
* 28-Apr-o6, v1.2.2, fixed bug with opening TW after deleting themepacks. (Saq)
* 26-Apr-06, v1.2.1, more code optimization, dropdowns now updated on the fly. (Saq)
* 25-Apr-06, v1.2.0, added 3rd party ThemePack support, and made various other improvements.(Simon & Saq)
* 24-Apr-06, v1.1.0, added: no styles and default styles options,<<br>>support for ThemePack, support for tag variations(Saq)
* 21-Apr-06, v1.0.0, Reworked dropdowns to include option for pagetemplates (Saq)
* 21-Apr-06, v0.9.0, Rewrote and added Saq's lovely dropdown select (Simon)
* 20-Apr-06, v0.0.1, Basic switcher working (Simon)

!Examples
|!Source|!Output|h
|{{{<<themeSelect style>>}}} for a dropdown with StyleSheets|<<themeSelect style>>|
|{{{<<themeSelect pagetemplate>>}}} for a dropdown with PageTemplates|<<themeSelect pagetemplate>>|
|{{{<<themeSelect style customlabel>>}}} to use a customlabel|<<themeSelect style customlabel>>|
* When applying a stylesheet or template, it also looks for a template or stylesheet respectively based on naming convention, eg MyFunkyStyleSheet and MyFunkyPageTemplate.

!Notes
* See also http://www.tiddlytools.com/#SelectStyleSheetPlugin for a more feature-rich style sheet switcher

! Ideas
* do ViewTemplate also?
* Pretty up the [x] bit

!Code
***/
//{{{
// for compatibility with TW <2.0.9
if (!Array.prototype.contains)
   Array.prototype.contains = function(item)
   {
    return this.find(item) != null;
    };

// for compatibility with TW <2.0.9
if (!Array.prototype.containsAny)
   Array.prototype.containsAny = function(items)
   {
    for(var i=0; i<items.length; i++)
        if (this.contains(items[i]))
            return true;
    return false;
    };
//}}}

//{{{
version.extensions.SelectTheme = { major: 1, minor: 2, revision: 5, date: new Date(2006,12,20),
	source: "http://tw.lewcid.org/#SelectTheme"
};

config.SelectTheme = {
	things: {
		style: {
			tag:        ["StyleSheets","StyleSheet","styleSheet","styleSheets","stylesheet","stylesheets"],
			theDefault: "StyleSheet",
			suffix:     "StyleSheet",
			notify:     refreshStyles,
			cookie:     "txtStyleSheet",
			otherThing: "pagetemplate",
			label:      "Choose StyleSheet: ",
			tooltip:     "Choose a StyleSheet",
			caseNone: { text:"None", title:"NoStyleSheet"},
                        caseDefault: { text:"Default", title:"StyleSheet" }

		},
		pagetemplate: {
			tag:        ["PageTemplates","PageTemplate","pageTemplates","pageTemplate","pagetemplate","pagetemplates"],
			theDefault: "PageTemplate",
			suffix:     "PageTemplate",
			notify:     refreshPageTemplate,
			cookie:     "txtPageTemplate",
			otherThing: "style",
			label: "Choose PageTemplate: ",
			tooltip:    "Choose a PageTemplate",
			caseNone: { text:"None", title:"NoPageTemplate"},
                        caseDefault: { text:"Default", title:"PageTemplate" }
		}

	},

                         specialCases: ["caseNone","caseDefault"]

};

TiddlyWiki.prototype.removeNotification = function(title,fn) {
	for (var i=0;i<this.namedNotifications.length;i++)
		if((this.namedNotifications[i].name == title) && (this.namedNotifications[i].notify == fn))
			this.namedNotifications.splice(i,1); // counting on it only being there once
}


var things = config.SelectTheme.things;
var specialCases=config.SelectTheme.specialCases;

for (var zz in things) {
	// make sure we have a value
	if (!config.options[things[zz].cookie])
		config.options[things[zz].cookie] = things[zz].theDefault;

	// remove core notify
	store.removeNotification(things[zz].theDefault,things[zz].notify);

	// and add our one
	store.addNotification(config.options[things[zz].cookie],things[zz].notify);

}

//checks to see if a tiddler exists in store or as a shadow.
TiddlyWiki.prototype.isTiddler= function (title)
        {return store.tiddlerExists(title) || store.isShadowTiddler(title)}

//hijack core function & make sure template exists
window.applyPageTemplate_themeSelect=window.applyPageTemplate;
window.applyPageTemplate=function(title){
           if(!store.isTiddler(title))
                       {title = things.pagetemplate.theDefault;}
           applyPageTemplate_themeSelect(title);
 }

TiddlyWiki.prototype.makeActiveTheme = function(what,title,alsoCheckOtherThing) {

	var thing = things[what];
        if (!store.isTiddler(title))
		title = thing.theDefault;

	var oldTitle = config.options[thing.cookie];

	if (what == "style") {
		// remove old style element from DOM
		var oldStyleElement = document.getElementById(oldTitle);
		oldStyleElement.parentNode.removeChild(oldStyleElement);
	}

	store.removeNotification(oldTitle,thing.notify);
	store.addNotification(title,thing.notify);
	store.notify(title);

	config.options[thing.cookie] = title;
	saveOptionCookie(thing.cookie);
	if (alsoCheckOtherThing)
		this.makeActiveTheme(thing.otherThing,
				title.replace(new RegExp(thing.suffix+"$"),"") + things[thing.otherThing].suffix,
						false);
};

if (config.hoverMenu)
    {
    old_hovermenu_makeActiveTheme = TiddlyWiki.prototype.makeActiveTheme;
    TiddlyWiki.prototype.makeActiveTheme = function(what,title,alsoCheckOtherThing)
        {
         old_hovermenu_makeActiveTheme.apply(this,arguments);
         if (!alsoCheckOtherThing)
                    config.hoverMenu.handler();
        };
    }

config.shadowTiddlers.NoStyleSheet = "";
config.shadowTiddlers.NoPageTemplate = config.shadowTiddlers.PageTemplate;


function switchTheme(e){
         if (!e) var e = window.event;
         var theTarget = resolveTarget(e);
         var theLink = theTarget;
         var switchTo= theLink.getAttribute("switchTo");
         var mode = theLink.getAttribute("mode");
         if ((config.options[things[mode].cookie])!=switchTo)
               {store.makeActiveTheme(mode,switchTo,true);};
         return(false);
}


config.macros.themeSelect={};
config.macros.themeSelect.dropdownchar = (document.all?"▼":"▾");
config.macros.themeSelect.handler = function(place,macroName,params,wikifier,paramString,tiddler){
         var arrow = config.macros.themeSelect.dropdownchar;
         var mode = params[0];
         var label = (params[1]?params[1]:things[mode].label) + arrow;
         var cookie = (config.options[things[mode].cookie]);

         var onclick = function(e)
             { if (!e) var e = window.event;
             var popup = Popup.create(this);

             var tagged=[];

	     store.forEachTiddler(function(title,tiddler) {
                  if ((tiddler.tags).containsAny(things[mode].tag)){
					tagged.push(tiddler.title);}
	     });

             //integrate ThemePacks
	     if (config.themes) {
		     // see what themes have been loaded...
		     for (var i=0;i<config.themes.length;i++) {
			    // see if there is one
			    var lookForThis = config.themes[i] + things[mode].suffix;
			    if (store.isShadowTiddler(lookForThis)) {
				   tagged.pushUnique(lookForThis);
			    }
		    }
		     tagged = tagged.sort();
             }

             //this function used later to create buttons
             var createThemeButton = function(switchTo){
                        var theButton = createTiddlyButton(createTiddlyElement(popup,"li"),text,null,switchTheme,useClass);
                        theButton.setAttribute("switchTo",switchTo);
                        theButton.setAttribute("mode",mode);};

            //create Buttons for None(shadow styles) & Default (StyleSheet)
                     // Default button is not created if StyleSheet doesnt exist.
             for(var t=0; t<specialCases.length; t++){
             var special = specialCases[t];
             var text = things[mode][special].text;
             var useClass = "tiddlyLinkExisting";   //redundant, optimize!
             if ((things[mode][special].title==cookie)||(special=="caseNone"&&!store.isTiddler(cookie)))
                      {text+= " [x]";
                      useClass = "currentlySelected";}
             if (!((special=="caseDefault")&&(!store.getTiddler(things[mode][special].title))))
             createThemeButton(things[mode][special].title);     }

             //insert horizontal rule
             //createTiddlyElement(createTiddlyElement(popup,"li"),"hr");
             createTiddlyElement(createTiddlyElement(popup,"li",null,"listBreak"),"div");

             //create buttons for all other stylesheet tiddlers
             for(var t=0; t<tagged.length; t++)
                     { var useClass = "tiddlyLinkExisting";
                       var text = (tagged[t]).replace((things[mode].suffix),"");
                     if (tagged[t]==(cookie) )
                           {text+=" [x]"; useClass="currentlySelected";}
                     if ((tagged[t]!= (things[mode].theDefault))&&tagged[t]!= (things[mode].none))
                        {createThemeButton(tagged[t]);}}
             Popup.show(popup,false);
             e.cancelBubble = true;
             if (e.stopPropagation)
                e.stopPropagation();
             return(false);
             };

        var createdropperButton = function(place){
           var sp = createTiddlyElement(place,"span",null,"ThemeChooserButton");
           var theDropDownBtn = createTiddlyButton(sp,label,things[mode].tooltip,onclick);
        };

        createdropperButton(place);
};


setStylesheet(".popup li a.currentlySelected {background:#ccc;color:black;font-weight:bold;}","currentlySelectedStyle"); // could do better probably...

config.macros.layoutChooser=config.macros.themeSelect;

//shadow tiddler to hold instructions for creating ThemePacks
config.shadowTiddlers.ThemePack='See http://simonbaird.com/mptw/#CreateThemePack'; 

config.macros.applyTheme = {handler: function (place,macroName,params,wikifier,paramString,tiddler) {
	var theme = params[0];
	var label = params[1]?params[1]:'Apply theme "' + theme + '"';
        var tooltip = 'Apply the "'+theme+'" theme to this TiddlyWiki';
	createTiddlyButton(place,label,tooltip,function() {
		store.makeActiveTheme("style",theme+things.style.suffix,true);
	});
}};


// this means you can put #theme:ThemeName in url. suggested by Clint
config.paramifiers.theme = {
	onstart: function(themeName) {
		store.makeActiveTheme("style",themeName+config.SelectTheme.things.style.suffix,true);
	}
};

//}}}

<<search>><<closeAll>><<permaview>><<themeSelect style 'select theme'>><<newTiddler>><<newJournal "DD MMM YYYY">><<saveChanges>><<upload >><<slider chkSliderOptionsPanel OptionsPanel "options »" "Change TiddlyWiki advanced options">>
/***
''Single Page Mode Plugin for TiddlyWiki version 2.0 or above''
^^author: Eric Shulman - ELS Design Studios
source: http://www.TiddlyTools.com/#SinglePageModePlugin
license: [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]^^

Normally, as you click on the links in TiddlyWiki, more and more tiddlers are displayed on the page. The order of this tiddler display depends upon when and where you have clicked. Some people like this non-linear method of reading the document, while others have reported that when many tiddlers have been opened, it can get somewhat confusing.

!!!!!Usage
<<<
SinglePageMode allows you to configure TiddlyWiki to navigate more like a traditional multipage web site with only one item displayed at a time.  You can select a checkbox in the AdvancedOptions tiddler to enable this behavior or revert to the standard TiddlyWiki multiple tiddler display behavior.

When SinglePageMode is enabled, the title of the current tiddler is automatically displayed in the browser window's titlebar and the browser's location URL is updated with a 'permalink' for the current tiddler so that it is easier to create a browser 'bookmark' for the current tiddler.

//Note: This feature currently effects ALL tiddler display behavior, including features that normally result in multiple tiddlers being displayed, such as the results of searches or the initial DefaultTiddlers shown when the document is loaded.  //
<<<
!!!!!Configuration
<<<
When installed, this plugin automatically adds a checkbox in the AdvancedOptions tiddler so you can enable/disable the plugin behavior.  You can also use the following ''control panel'' checkbox to change the current plugin handling:

<<option chkSinglePageMode>> Display one tiddler at a time
<<<
!!!!!Installation
<<<
import (or copy/paste) the following tiddlers into your document:
''SinglePageModePlugin'' (tagged with <<tag systemConfig>>)
^^documentation and javascript for SinglePageMode handling^^

When installed, this plugin automatically adds a checkbox in the AdvancedOptions tiddler so you can enable/disable this behavior.  However, if you have customized your AdvancedOptions, you will need to manually add ''"<< {{{option chkSinglePageMode}}} >> display one tiddler at a time"'' to your customized tiddler.
<<<
!!!!!Revision History
<<<
''2006.02.04 [2.1.1]''
moved global variable declarations to config.* to avoid FireFox 1.5.0.1 crash bug when assigning to globals
''2005.12.27 [2.1.0]''
hijack displayTiddlers() so that SPM can be suspended during startup while displaying the DefaultTiddlers (or #hash list) 
also, corrected initialization for undefined SPM flag to "false", so default behavior is to display multiple tiddlers
''2005.12.27 [2.0.0]''
Update for TW2.0
''2005.11.24 [1.1.2]''
When the back and forward buttons are used, the page now changes to match the URL.  Based on code added by Clint Checketts
''2005.10.14 [1.1.1]''
permalink creation now calls encodeTiddlyLink() to handle tiddler titles with spaces in them
''2005.10.14 [1.1.0]''
added automatic setting of window title and location bar ('auto-permalink').
feature suggestion by David Dickens.
''2005.10.09 [1.0.1]''
combined documentation and code in a single tiddler
''2005.08.15 [1.0.0]''
Initial Release
<<<
!!!!!Credits
<<<
This feature was developed by EricShulman from [[ELS Design Studios|http:/www.elsdesign.com]].
Support for BACK/FORWARD buttons adapted from code developed by Clint Checketts
<<<
!!!!!Code
***/
//{{{
version.extensions.SinglePageMode= {major: 2, minor: 1, revision: 1, date: new Date(2006,2,4)};

if (config.options.chkSinglePageMode==undefined)
	config.options.chkSinglePageMode=false;

config.options.chkSinglePageMode=true;
config.shadowTiddlers.AdvancedOptions
	+= "\n<<option chkSinglePageMode>> Display one tiddler at a time";

config.SPMTimer = 0;
config.lastURL = window.location.hash;
function checkLastURL()
{
	if (!config.options.chkSinglePageMode)
		{ window.clearInterval(config.SPMTimer); config.SPMTimer=0; return; }
	if (config.lastURL == window.location.hash)
		return;
	var tiddlerName = convertUTF8ToUnicode(decodeURI(window.location.hash.substr(1)));
	tiddlerName=tiddlerName.replace(/\[\[/,"").replace(/\]\]/,""); // strip any [[ ]] bracketing
	if (tiddlerName.length) story.displayTiddler(null,tiddlerName,1,null,null);
}

Story.prototype.coreDisplayTiddler=Story.prototype.displayTiddler;
Story.prototype.displayTiddler = function(srcElement,title,template,animate,slowly)
{
	if (config.options.chkSinglePageMode) {
		window.location.hash = encodeURIComponent(String.encodeTiddlyLink(title));
		config.lastURL = window.location.hash;
		document.title = wikifyPlain("SiteTitle") + " - " + title;
		story.closeAllTiddlers();
		if (!config.SPMTimer) config.SPMTimer=window.setInterval(function() {checkLastURL();},1000);
	}
	this.coreDisplayTiddler(srcElement,title,template,animate,slowly)
}

Story.prototype.coreDisplayTiddlers=Story.prototype.displayTiddlers;
Story.prototype.displayTiddlers = function(srcElement,titles,template,unused1,unused2,animate,slowly)
{
	// suspend single-page mode when displaying multiple tiddlers
	var save=config.options.chkSinglePageMode;
	config.options.chkSinglePageMode=false;
	this.coreDisplayTiddlers(srcElement,titles,template,unused1,unused2,animate,slowly);
	config.options.chkSinglePageMode=save;
}
//}}}
a step-by-step guide
SynBlast tutorial
.codeblock {font-size:110%;font-family:monospace; border:#333 solid 1px; background:#eee; color:#333; padding:0.2em; margin:0.2em; line-height:1.3em;}
.code {font-size:110%;font-family:monospace;}
@media print {#mainMenu {display: none ! important;}}
@media print {#topMenu {display: none ! important;}}
@media print {#sidebar {display: none ! important;}}
@media print {#messageArea {display: none ! important;}} 
@media print {#toolbar {display: none ! important;}}
@media print {.header {display: none ! important;}}
@media print {.tiddler .subtitle {display: none ! important;}}
@media print {.tiddler .toolbar {display; none ! important; }}
@media print {.tiddler .tagging {display; none ! important; }}
@media print {.tiddler .tagged {display; none ! important; }}
SynBlast - a package of perl scripts to simplify the detection of orthologs and paralogs via syntenic blocks (synteny-based homology pipeline)
Following (wrapper) scripts are not necessary for the pipeline to work, but can help to speed up whole procedure (batch jobs):
<<forEachTiddler
where
'tiddler.tags.contains("SynBlastUtils")' sortBy 'tiddler.title' write '"*[["+tiddler.title+"|"+tiddler.title+"\]\]\n"'>>
!Ranking of synteny regions by their gene order alignment scores w.r.t. the reference set


The tool {{code{doSyntenyAlignment.pl}}} performs the last step of the SynBlast pipeline. It ranks the selected regions of possibly more or less conserved synteny via gene order alignment to the block of reference proteins. See [[usage|doSyntenyAlignmentUsage]] for details on the various options.

First it is useful to check if all reference/query proteins could be found at all within the reference genome itself. Therefore it is useful to only run the script on a single test region.
As the best and second best within-reference hit is retrieved automatically from the raw tblastn Blast results (these data still has to be provided, at least for the reference genome!), there will be warning messages if 
*a best-hit within the reference does not match the same chromosome as specified in the annotation file, or
*a best-hit within the reference does not overlap with the annotated coordinates in the annotation file.
An error occures if a query protein does not have any blast-hit at all.
It is necessary to either repeat the Blast search (using maybe different Blast options), or to exclude (uncomment) the query protein from the reference annotation file, at least for the error-case.

{{codeblock{
"""$ doSyntenyAlignment.pl -i=Tbx2_ENSMUSG00000000093_5e5.protein.info -blastDir=./tblastn/ -blastFilePraefix=Tbx2_ENSMUSG00000000093_5e5.protein.info Tbx2_ENSMUSG00000000093_5e5.protein.syntenyRegions/Homo_sapiens.glob01.17.minQN3.fac4.01.blastresult"""}}}

The command line output shows if there are missing reference hits for some proteins, or if a best-hit is not mapping back to its annotated position within the reference genome:
<html><pre>
>blastresult directory name changed to ./tblastn
>creating p-loci data structure...done
 -> selfscore (ENSMUSP00000090496) successfully validated...
 -> selfscore (ENSMUSP00000098240) successfully validated...
 -> selfscore (ENSMUSP00000000095) successfully validated...
 -> selfscore (ENSMUSP00000090493) successfully validated...
 -> selfscore (ENSMUSP00000000096) successfully validated...
 -> selfscore (ENSMUSP00000043108) successfully validated...
WARNING: Best-reference-hit is not on the same chromosome/contig as the reference!
 -> the selfscore for query protein "ENSMUSP00000079878" is NOT valid!
 -> selfscore (ENSMUSP00000018212) successfully validated...
>chaining blast-hits together...done
>calculating gene order alignments...done
Argument "NoData" isn't numeric in int at /scr/mojito/joe/src/perl/lib/perl5/5.8.8/SynBlast/MySyntenyAln.pm line 893.
#Overview on processed synteny regions for Tbx2_ENSMUSG00000000093_5e5.protein.info
# AlnScore      QueryFile       TargetGenome    chr/contig      chr     startPos        endPos  hitsCount       queryCov        meanIdentity    ori     score
##############
# Homo_sapiens.glob01.17.minQN3.fac4.01.blastresult     4809
4809    Tbx2_ENSMUSG00000000093_5e5.protein.info        Homo_sapiens    17      17      56832320        56840484        8       84.4%   89.7%   1       1422
##For comparison: OptHitEntry for p2=>ENSMUSP00000000095=>Tbx2 maxScore=1422(q2)
</pre></html>

There is one warning for query protein "~ENSMUSP00000079878" that could not be found within the reference's blast results for some reason.
To proceed, this reference protein entry needs to be removed (or commented out) manually from the reference annotation file.
After doing this, running the above command once again now no longer results in a warning message.


The command to obtain the final results for all synteny regions (all available species) of type "minQN3" created during the previous [[SyntenyFiltering]] step is as follows:
{{codeblock{
"""$ doSyntenyAlignment.pl -i=Tbx2_ENSMUSG00000000093_5e5.protein.info -h=html/Tbx2vsHsaMmu.html -txtFile=html/Tbx2vsHsaMmu.txt -blastDir=./tblastn/ -blastFilePraefix=Tbx2_ENSMUSG00000000093_5e5.protein.info -lociS=4 -c=50 -o=40 -compara -comparaAll -printColors -globalRank=10 Tbx2_ENSMUSG00000000093_5e5.protein.syntenyRegions/*minQN3*blastresult"""}}}

The resulting html-file ([[html/Tbx2vsHsaMmu.html|./TBX2_tutorial/html/Tbx2vsHsaMmu.html]]) contains all selected synteny regions for all selected species, ranked by the gene order alignment score (default, ''-sortByRatio=0'')
The output is arranged as follows:
*overview table on ranked synteny regions displaying the target location and alignment score, as well as the positional coordinates for the assignments of the focal protein of interest.
*data table for reference protein loci displaying all selected data columns from the annotation file used in the current session
*parameter settings of the current session
*sequence of alignment tables, ranked via alignment score. Each alignment is displayed as a dotplot-like graphics (similarity scoring matrix and dynamic programming matrix/alignment path as one graphic), and a visualisation of the optimal alignment path chosen, including gene names and orientations. The focal gene is highlighted in both cases. The assignments for each reference locus is displayed additionally, containing the selected target loci column names (see option ''-qlociFields'').

A rather manual inspection is necessary to decide potential orthology or paralogy relationships from the assignments displayed.
A combination of results obtained from different paralogous reference clusters is adviced to avoid false-positive orthology assignments made from the data of one reference cluster source, only.
Some additional scripts and utilities to simplify the procedure or to check the global best blast-hits for comparison can be found in the package, too. See [[SynBlast-utilities]] for a description.
!Filtering blast-hits on synteny and local proximity

Now, all required data is available for the two core scripts of SynBlast: {{code{[[doSyntenyFilter.pl|doSyntenyFilterUsage]]}}} and {{code{[[doSyntenyAlignment.pl|doSyntenyAlignmentUsage]]}}}.
The first script, {{code{[[doSyntenyFilter.pl|doSyntenyFilterUsage]]}}}, filters out only those relevant blasthits, that occur together/neighbored with some amount of other query hits and within a specified maximum sequence range and distance from each other.
For more convenient results the default mode now uses the maximal HSP score of each query ID of a region to concentrate on only the relevant hit regions in case there are too much low-scoring hits. The number of regions to be detected at max can be specified both globally/genome-wide ({{code{-g}}} option) and chromosome/contig-wise ({{code{-n}}} option) as was done here to restrict to the best 10 regions only. 
This script has to be run for all genomes that were part of the [[Blast search step|tBlastnSearches]] and should be part of the current analysis.
Here we consider a rather strict setting and allow only those regions that contain at least 40 percent (3 in absolute numbers) of the number of different reference proteins. The command for the examplary mouse blast-hit filtering is as follows:

{{codeblock{
"""$ doSyntenyFilter.pl -dMus_musculus [-e dec2006] -r./tblastn/ -q40 -f4 -aTbx2_ENSMUSG00000000093_5e5.protein.info -o -g10 -n10 Tbx2_ENSMUSG00000000093_5e5.protein.info"""}}}
The output lists the detected regions of possibly conserved synteny (but at least gene content) fullfilling the specified requirements. So-called synteny regions are saved as text files containing the filtered blast hits and some annotational data.
<html><pre>
# using /homes/biertank/joe/public_html/SynBlast/tutorial/TBX2_tutorial/./tblastn as source directory for the blastresult files...
# using /homes/biertank/joe/public_html/SynBlast/tutorial/TBX2_tutorial/Tbx2_ENSMUSG00000000093_5e5.protein.syntenyRegions as output directory for the synteny-filtered blasthits...
Tbx2_ENSMUSG00000000093_5e5.protein.info read. (8 entries)
filtering blastfile "Tbx2_ENSMUSG00000000093_5e5.protein.info" (1/1)...

########################################
# Probable Syntenic Regions
# -of maximum size 4 x 901426 nt (3'605'704 nt)
# -containing at least 3 hits of different query
########################################
Regions sorted by SumOfMaxBitScoresPerQuery (and secondarily by totalScore) (only up to those with fullfilled QN-constraint, skipping overlapping ones):
SumOfMaxScores  start   rstart  end     QN      totalHSPcount   totalscore      %ofMaxRange
.........chromosome 16:
262     14902246        17326892        18500268        3       9       524     32.5    (marked for saving)
....chromosome 3:
247     95890999        99413243        99455528        3       8       489     1.1     (marked for saving)
...chromosome 11:
2454    82755448        85171088        86072513        8       98      13520   25      (marked for saving)

globally-best-10-regions:
=============================
chr     SumOfMaxScores  start   rstart  end     QN      totalHSPcount   totalscore      %ofRange
11      2454    82755448        85171088        86072513        8       98      13520   25      (saved)
16      262     14902246        17326892        18500268        3       9       524     32.5    (saved)
3       247     95890999        99413243        99455528        3       8       489     1.1     (saved)
global files summary:
Mus_musculus.glob01.11.minQN3.fac4.01.blastresult
Mus_musculus.glob02.16.minQN3.fac4.01.blastresult
Mus_musculus.glob03.3.minQN3.fac4.01.blastresult

# Done!
</pre></html>


The same command for Homo sapiens detects only one putative region for the parameter setting, which can also be due to the insensitiv blast parameter settings and the small number of reference proteins used in this example:
{{codeblock{
"""$ doSyntenyFilter.pl -dHomo_sapiens [-e dec2006] -r./tblastn/ -q40 -f4 -aTbx2_ENSMUSG00000000093_5e5.protein.info -o -g10 -n10 Tbx2_ENSMUSG00000000093_5e5.protein.info"""}}}
<html><pre>
# using /homes/biertank/joe/public_html/SynBlast/tutorial/TBX2_tutorial/./tblastn as source directory for the blastresult files...
# using /homes/biertank/joe/public_html/SynBlast/tutorial/TBX2_tutorial/Tbx2_ENSMUSG00000000093_5e5.protein.syntenyRegions as output directory for the synteny-filtered blasthits...
Tbx2_ENSMUSG00000000093_5e5.protein.info read. (8 entries)
filtering blastfile "Tbx2_ENSMUSG00000000093_5e5.protein.info" (1/1)...

########################################
# Probable Syntenic Regions
# -of maximum size 4 x 901426 nt (3'605'704 nt)
# -containing at least 3 hits of different query
########################################
Regions sorted by SumOfMaxBitScoresPerQuery (and secondarily by totalScore) (only up to those with fullfilled QN-constraint, skipping overlapping ones):
SumOfMaxScores  start   rstart  end     QN      totalHSPcount   totalscore      %ofMaxRange
.............chromosome 17:
1423    53759437        56111601        57358781        5       98      12971   34.5    (marked for saving)

globally-best-10-regions:
=============================
chr     SumOfMaxScores  start   rstart  end     QN      totalHSPcount   totalscore      %ofRange
17      1423    53759437        56111601        57358781        5       98      12971   34.5    (saved)
global files summary:
Homo_sapiens.glob01.17.minQN3.fac4.01.blastresult

# Done!
</pre></html>



Options specify
*the target species database name (''-d'')
*optionally the Ensembl version string for the local sequences (''-e''; only if of other version than the current API release in use. Should be the same as the one for the reference data)
*the source directory for the blasthits (''-r'')
*the minimum number of different query hits to be contained in a valid synteny region (''-q'', expressed as percentage of total number, i.e. here ''8''*''40%'' = minimum of ''3'' different queries; alternatively expressed as absolute number (''-Q''option))
*the size limit/constraint(''-f'', expressed as multiple of the reference range, i.e. this factor multiplied with the reference set's sequence range is set as maximum size for a valid synteny region; or additionally as absolute size limit using ''-F'')
*optionally the file name prefix for the single-blasthit-result-file (name of blastresult file in source directory but without "{{code{""".Species_name.blastresult"""}}}" ending)
*the number of globally-best regions to be saved (''-g'')
*the number of locally-best regions (per chromosome/contig) to be saved at max. (''-n'')
*the ''-o'' flag to save resulting region of blasthits (by default in subdir ending with "{{code{""".syntenyRegions"""}}}")
*the ''-s'' flag to disable the score-maximizing version (old version; not shown here; not recommended any longer)
Resulting synteny regions produced from the commands above are:
[[Tbx2_ENSMUSG00000000093_5e5.protein.syntenyRegions/Homo_sapiens.glob01.17.minQN3.fac4.01.blastresult|./TBX2_tutorial/Tbx2_ENSMUSG00000000093_5e5.protein.syntenyRegions/Homo_sapiens.glob01.17.minQN3.fac4.01.blastresult]]
[[Tbx2_ENSMUSG00000000093_5e5.protein.syntenyRegions/Mus_musculus.glob01.11.minQN3.fac4.01.blastresult|./TBX2_tutorial/Tbx2_ENSMUSG00000000093_5e5.protein.syntenyRegions/Mus_musculus.glob01.11.minQN3.fac4.01.blastresult]]
[[Tbx2_ENSMUSG00000000093_5e5.protein.syntenyRegions/Mus_musculus.glob02.16.minQN3.fac4.01.blastresult|./TBX2_tutorial/Tbx2_ENSMUSG00000000093_5e5.protein.syntenyRegions/Mus_musculus.glob02.16.minQN3.fac4.01.blastresult]]
[[Tbx2_ENSMUSG00000000093_5e5.protein.syntenyRegions/Mus_musculus.glob03.3.minQN3.fac4.01.blastresult|./TBX2_tutorial/Tbx2_ENSMUSG00000000093_5e5.protein.syntenyRegions/Mus_musculus.glob03.3.minQN3.fac4.01.blastresult]]

<html><pre>
#!organism=Mus_musculus
#!ensemblRelease=dec2005
#!coordsystem=chromosome
#!seqregion=11
#!from=85149273
#!to=86157325
#!strand=1
#!length=1008053
#!focalgene=ENSMUSG00000000093
#!flankingsize=5e5
#!columns=startPos,endPos,meanPos,protID,protName,ori,geneID,geneName,transID,protLength,numExons
85171088        85641433        85325812        ENSMUSP00000090496      Bcas3   1       ENSMUSG00000059439      Bcas3   ENSMUST00000092821      943     26
# 85171088      85641545        85325791        ENSMUSP00000074416      Bcas3   1       ENSMUSG00000059439      Bcas3   ENSMUST00000074875      928     24
# 85325824      85641545        85393036        ENSMUSP00000098243      Q5SWI3_MOUSE    1       ENSMUSG00000059439      Bcas3   ENSMUST00000100677      476     12
# 85325833      85641545        85393063        ENSMUSP00000090497      Q5SWI2_MOUSE    1       ENSMUSG00000059439      Bcas3   ENSMUST00000092822      458     11
# 85286947      85313082        85292992        ENSMUSP00000098244      Q5SWI1_MOUSE    1       ENSMUSG00000059439      Bcas3   ENSMUST00000100678      165     5
# 85171088      85187358        85177258        ENSMUSP00000098245      Q5RI22_MOUSE    1       ENSMUSG00000059439      Bcas3   ENSMUST00000100679      120     5
85535164        85535469        85535311        ENSMUSP00000098240      Q3UV40_MOUSE    -1      ENSMUSG00000072590      Q3UV40_MOUSE    ENSMUST00000100674      101     1
# 85618018      85641433        85618141        ENSMUSP00000098241      Q5SWV7_MOUSE    1       ENSMUSG00000059439      Bcas3   ENSMUST00000100675      85      3
85649302        85657209        85654050        ENSMUSP00000000095      Tbx2    1       ENSMUSG00000000093      Tbx2    ENSMUST00000000095      711     7
85663048        85666526        85664200        ENSMUSP00000090493      Q5SSP8_MOUSE    -1      ENSMUSG00000069785      Q5SSP8_MOUSE    ENSMUST00000092818      169     3
85706258        85730940        85728320        ENSMUSP00000000096      Tbx4    1       ENSMUSG00000000094      Tbx4    ENSMUST00000000096      552     8
85877624        86015159        85955245        ENSMUSP00000043108      Brip1   -1      ENSMUSG00000034329      Brip1   ENSMUST00000044423      1174    19
# 85881187      86015159        85962278        ENSMUSP00000098238      Brip1   -1      ENSMUSG00000034329      Brip1   ENSMUST00000100673      824     17
# 86011350      86015159        86014131        ENSMUSP00000067831      Brip1   -1      ENSMUSG00000034329      Brip1   ENSMUST00000064301      87      4
86023489        86024337        86023909        ENSMUSP00000079878      4632419I22Rik   1       ENSMUSG00000062930      4632419I22Rik   ENSMUST00000081097      282     1
86028827        86072513        86049353        ENSMUSP00000018212      Ints2   -1      ENSMUSG00000018068      Ints2   ENSMUST00000018212      1198    24
# 8 transcripts passed filter; (in 1 cases genes are overlapping, but of different strand.)
# 8 transcripts are overlapping with a transcript of same strand but larger/same size, displayed as a comment only (overlappings of referenceID-proteins are all downloaded, but only one longest is displayed).
# (+ 2 skipped entries not displayed, whereof 0 nonCoding)
# on slice around ensembl-ID ENSMUSG00000000093
</pre></html>
/***

|Name|ToggleSideBarMacro|
|Created by|SaqImtiaz|
|Location|http://tw.lewcid.org/#ToggleSideBarMacro|
|Version|1.0|
|Requires|~TW2.x|
!Description:
Provides a button for toggling visibility of the SideBar. You can choose whether the SideBar should initially be hidden or displayed.

!Demo
<<toggleSideBar "Toggle Sidebar">>

!Usage:
{{{<<toggleSideBar>>}}} <<toggleSideBar>>
additional options:
{{{<<toggleSideBar label tooltip show/hide>>}}} where:
label = custom label for the button,
tooltip = custom tooltip for the button,
show/hide = use one or the other, determines whether the sidebar is shown at first or not.
(default is to show the sidebar)

You can add it to your tiddler toolbar, your MainMenu, or where you like really.
If you are using a horizontal MainMenu and want the button to be right aligned, put the following in your StyleSheet:
{{{ .HideSideBarButton {float:right;} }}}

!History
*23-07-06: version 1.0: completely rewritten, now works with custom stylesheets too, and easier to customize start behaviour. 
*20-07-06: version 0.11
*27-04-06: version 0.1: working.

!Code
***/
//{{{
config.macros.toggleSideBar={};

config.macros.toggleSideBar.settings={
         styleHide :  "#sidebar { display: none;}\n"+"#contentWrapper #displayArea { margin-right: 1em;}\n"+"",
         styleShow : " ",
         arrow1: "«",
         arrow2: "»"
};

config.macros.toggleSideBar.handler=function (place,macroName,params,wikifier,paramString,tiddler)
{
          var tooltip= params[1]||'toggle sidebar';
          var mode = (params[2] && params[2]=="hide")? "hide":"show";
          var arrow = (mode == "hide")? this.settings.arrow1:this.settings.arrow2;
          var label= (params[0]&&params[0]!='.')?params[0]+" "+arrow:arrow;
          var theBtn = createTiddlyButton(place,label,tooltip,this.onToggleSideBar,"button HideSideBarButton");
          if (mode == "hide")
             { 
             (document.getElementById("sidebar")).setAttribute("toggle","hide");
              setStylesheet(this.settings.styleHide,"ToggleSideBarStyles");
             }
};

config.macros.toggleSideBar.onToggleSideBar = function(){
          var sidebar = document.getElementById("sidebar");
          var settings = config.macros.toggleSideBar.settings;
          if (sidebar.getAttribute("toggle")=='hide')
             {
              setStylesheet(settings.styleShow,"ToggleSideBarStyles");
              sidebar.setAttribute("toggle","show");
              this.firstChild.data= (this.firstChild.data).replace(settings.arrow1,settings.arrow2);
              }
          else
              {    
               setStylesheet(settings.styleHide,"ToggleSideBarStyles");
               sidebar.setAttribute("toggle","hide");
               this.firstChild.data= (this.firstChild.data).replace(settings.arrow2,settings.arrow1);
              }

     return false;
}

setStylesheet(".HideSideBarButton .button {font-weight:bold; padding: 0 5px;}\n","ToggleSideBarButtonStyles");

//}}}
UploadPlugin with <<tag UploadService>> extend TiddlyWiki with @@upload@@ and @@save to web@@ commands. 

See [[HowToUpload]].

[[Upload]] is :
This form upload any file with an UploadService describe in [[Upload]]
----
<html><center>
<form enctype="multipart/form-data" action="store.php" method="post" target="_blank">
 <input type="hidden" name="MAX_FILE_SIZE" value="3000000" />
This file : <input name="userfile" type="file" /><p>
Options* : <input type="text" name="UploadPlugin" size=80 value="backupDir=webBackups;uploaddir=.;user=UPLOAD_USER;password=UPLOAD_PASSWORD;debug=0;" /><p>
 <input type="submit" value="Upload" />
</form></center>
</html>
----
 * Substitute BACKUP_DIR, UPLOAD_DIR, UPLOAD_USER and UPLOAD_PASSWORD with your values. See UploadPlugin for option details. 
For security reason, don't save your password in a tiddler.
| !date | !user | !location | !storeUrl | !uploadDir | !toFilename | !backupdir | !origin |
| 09/08/2007 20:22:29 | JoeBioinf | [[SynBlast.html|file:///C:/Dokumente%20und%20Einstellungen/Joe/Desktop/SynBlast_Tutorial/SynBlast.html#UploadOptions]] | [[|http://www.bioinf.uni-leipzig.de/~joe/SynBlast/tutorial/]] | . | [[SynBlast.html | http://www.bioinf.uni-leipzig.de/~joe/SynBlast/tutorial/SynBlast.html]] | webBackups | failed |
| 09/08/2007 20:27:46 | JoeBioinf | [[SynBlast.html|file:///C:/Dokumente%20und%20Einstellungen/Joe/Desktop/SynBlast_Tutorial/SynBlast.html#UploadOptions]] | [[|http://www.bioinf.uni-leipzig.de/~joe/SynBlast/tutorial/]] | . | [[SynBlast.html | http://www.bioinf.uni-leipzig.de/~joe/SynBlast/tutorial/SynBlast.html]] | webBackups |
| 09/08/2007 20:30:36 | JoeBioinf | [[SynBlast.html|file:///C:/Dokumente%20und%20Einstellungen/Joe/Desktop/SynBlast_Tutorial/SynBlast.html#SideBarOptions]] | [[store.php|http://www.bioinf.uni-leipzig.de/~ joe/SynBlast/tutorial/store.php]] | . | [[SynBlast.html | http://www.bioinf.uni-leipzig.de/~ joe/SynBlast/tutorial/SynBlast.html]] | webBackups |
| 09/08/2007 20:32:06 | JoeBioinf | [[SynBlast.html|file:///C:/Dokumente%20und%20Einstellungen/Joe/Desktop/SynBlast_Tutorial/SynBlast.html#UploadOptions]] | [[store.php|http://www.bioinf.uni-leipzig.de/~joe/SynBlast/tutorial/store.php]] | . | [[SynBlast.html | http://www.bioinf.uni-leipzig.de/~joe/SynBlast/tutorial/SynBlast.html]] | webBackups | failed |
| 09/08/2007 20:33:50 | JoeBioinf | [[SynBlast.html|file:///C:/Dokumente%20und%20Einstellungen/Joe/Desktop/SynBlast_Tutorial/SynBlast.html#UploadOptions]] | [[store.php|http://www.bioinf.uni-leipzig.de/~joe/SynBlast/tutorial/store.php]] | . | [[SynBlast.html | http://www.bioinf.uni-leipzig.de/~joe/SynBlast/tutorial/SynBlast.html]] | webBackups | failed |
| 09/08/2007 20:35:17 | JoeBioinf | [[SynBlast.html|file:///C:/Dokumente%20und%20Einstellungen/Joe/Desktop/SynBlast_Tutorial/SynBlast.html#UploadOptions]] | [[store.php|http://www.bioinf.uni-leipzig.de/~joe/SynBlast/tutorial/store.php]] | . | [[SynBlast.html | http://www.bioinf.uni-leipzig.de/~joe/SynBlast/tutorial/SynBlast.html]] | webBackups | failed |
UploadPlugin uses the following sequence for finding parameters :
#''macro'' parameters
#''Options'' saved in cookies
#''Plugin'' default values
!Options used by UploadPlugin
| Option | Value | Default |
|Upload Username: |<<option txtUploadUserName>>| |
|Upload Password: |<<option pasUploadPassword>>| |
|Url of the UploadService script: |<<option txtUploadStoreUrl urlInput>>| store.php |
|Relative Directory where to store the file: |<<option txtUploadDir urlInput>>| . (the script directory) |
|Filename of the uploaded file: |<<option txtUploadFilename urlInput>>| index.html |
|Directory to backup file on webserver^^(1)^^: |<<option txtUploadBackupDir urlInput>>| //null// (none/no backup) |
|Log in UploadLog |<<option chkUploadLog>> Trace Upload| true |
|Maximum of lines in UploadLog |<<option txtUploadLogMaxLine>>| 10 |

^^(1)^^No backup if Backup Directory is empty, the previous file will be overwritten. Use a '.' to backup in the script directory.

<<upload>> with these options.

!Upload Macro parameters
{{{
<<upload [storeUrl [toFilename [backupDir [uploadDir [username]]]]]>>
 Optional positional parameters can be passed to overwrite UploadOptions. 
}}}

!UploadToFile Macro Macro parameters
{{{
<<uploadTofile [filename [tiddlerTitle]]>>
 tiddlerTitle, filename: if omitted the title of the current tiddler
}}}

<<uploadToFile allowedsites.txt allowedsites.txt>>
/***
|''Name:''|UploadPlugin|
|''Description:''|Save to web a TiddlyWiki|
|''Version:''|4.1.0|
|''Date:''|May 5, 2007|
|''Source:''|http://tiddlywiki.bidix.info/#UploadPlugin|
|''Documentation:''|http://tiddlywiki.bidix.info/#UploadPluginDoc|
|''Author:''|BidiX (BidiX (at) bidix (dot) info)|
|''License:''|[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D ]]|
|''~CoreVersion:''|2.2.0 (#3125)|
|''Requires:''|PasswordOptionPlugin|
***/
//{{{
version.extensions.UploadPlugin = {
	major: 4, minor: 1, revision: 0,
	date: new Date("May 5, 2007"),
	source: 'http://tiddlywiki.bidix.info/#UploadPlugin',
	author: 'BidiX (BidiX (at) bidix (dot) info',
	coreVersion: '2.2.0 (#3125)'
};

//
// Environment
//

if (!window.bidix) window.bidix = {}; // bidix namespace
bidix.debugMode = false;	// true to activate both in Plugin and UploadService
	
//
// Upload Macro
//

config.macros.upload = {
// default values
	defaultBackupDir: '',	//no backup
	defaultStoreScript: "store.php",
	defaultToFilename: "index.html",
	defaultUploadDir: ".",
	authenticateUser: true	// UploadService Authenticate User
};
	
config.macros.upload.label = {
	promptOption: "Save and Upload this TiddlyWiki with UploadOptions",
	promptParamMacro: "Save and Upload this TiddlyWiki in %0",
	saveLabel: "save to web", 
	saveToDisk: "save to disk",
	uploadLabel: "upload"	
};

config.macros.upload.messages = {
	noStoreUrl: "No store URL in parmeters or options",
	usernameOrPasswordMissing: "Username or password missing"
};

config.macros.upload.handler = function(place,macroName,params) {
	if (readOnly)
		return;
	var label;
	if (document.location.toString().substr(0,4) == "http") 
		label = this.label.saveLabel;
	else
		label = this.label.uploadLabel;
	var prompt;
	if (params[0]) {
		prompt = this.label.promptParamMacro.toString().format([this.destFile(params[0], 
			(params[1] ? params[1]:bidix.basename(window.location.toString())), params[3])]);
	} else {
		prompt = this.label.promptOption;
	}
	createTiddlyButton(place, label, prompt, function() {config.macros.upload.action(params);}, null, null, this.accessKey);
};

config.macros.upload.action = function(params)
{
		// for missing macro parameter set value from options
		var storeUrl = params[0] ? params[0] : config.options.txtUploadStoreUrl;
		var toFilename = params[1] ? params[1] : config.options.txtUploadFilename;
		var backupDir = params[2] ? params[2] : config.options.txtUploadBackupDir;
		var uploadDir = params[3] ? params[3] : config.options.txtUploadDir;
		var username = params[4] ? params[4] : config.options.txtUploadUserName;
		var password = config.options.pasUploadPassword; // for security reason no password as macro parameter	
		// for still missing parameter set default value
		if ((!storeUrl) && (document.location.toString().substr(0,4) == "http")) 
			storeUrl = bidix.dirname(document.location.toString())+'/'+config.macros.upload.defaultStoreScript;
		if (storeUrl.substr(0,4) != "http")
			storeUrl = bidix.dirname(document.location.toString()) +'/'+ storeUrl;
		if (!toFilename)
			toFilename = bidix.basename(window.location.toString());
		if (!toFilename)
			toFilename = config.macros.upload.defaultToFilename;
		if (!uploadDir)
			uploadDir = config.macros.upload.defaultUploadDir;
		if (!backupDir)
			backupDir = config.macros.upload.defaultBackupDir;
		// report error if still missing
		if (!storeUrl) {
			alert(config.macros.upload.messages.noStoreUrl);
			clearMessage();
			return false;
		}
		if (config.macros.upload.authenticateUser && (!username || !password)) {
			alert(config.macros.upload.messages.usernameOrPasswordMissing);
			clearMessage();
			return false;
		}
		bidix.upload.uploadChanges(false,null,storeUrl, toFilename, uploadDir, backupDir, username, password); 
		return false; 
};

config.macros.upload.destFile = function(storeUrl, toFilename, uploadDir) 
{
	if (!storeUrl)
		return null;
		var dest = bidix.dirname(storeUrl);
		if (uploadDir && uploadDir != '.')
			dest = dest + '/' + uploadDir;
		dest = dest + '/' + toFilename;
	return dest;
};

//
// uploadOptions Macro
//

config.macros.uploadOptions = {
	handler: function(place,macroName,params) {
		var wizard = new Wizard();
		wizard.createWizard(place,this.wizardTitle);
		wizard.addStep(this.step1Title,this.step1Html);
		var markList = wizard.getElement("markList");
		var listWrapper = document.createElement("div");
		markList.parentNode.insertBefore(listWrapper,markList);
		wizard.setValue("listWrapper",listWrapper);
		this.refreshOptions(listWrapper,false);
		var uploadCaption;
		if (document.location.toString().substr(0,4) == "http") 
			uploadCaption = config.macros.upload.label.saveLabel;
		else
			uploadCaption = config.macros.upload.label.uploadLabel;
		
		wizard.setButtons([
				{caption: uploadCaption, tooltip: config.macros.upload.label.promptOption, 
					onClick: config.macros.upload.action},
				{caption: this.cancelButton, tooltip: this.cancelButtonPrompt, onClick: this.onCancel}
				
			]);
	},
	refreshOptions: function(listWrapper) {
		var uploadOpts = [
			"txtUploadUserName",
			"pasUploadPassword",
			"txtUploadStoreUrl",
			"txtUploadDir",
			"txtUploadFilename",
			"txtUploadBackupDir",
			"chkUploadLog",
			"txtUploadLogMaxLine",
			]
		var opts = [];
		for(i=0; i<uploadOpts.length; i++) {
			var opt = {};
			opts.push()
			opt.option = "";
			n = uploadOpts[i];
			opt.name = n;
			opt.lowlight = !config.optionsDesc[n];
			opt.description = opt.lowlight ? this.unknownDescription : config.optionsDesc[n];
			opts.push(opt);
		}
		var listview = ListView.create(listWrapper,opts,this.listViewTemplate);
		for(n=0; n<opts.length; n++) {
			var type = opts[n].name.substr(0,3);
			var h = config.macros.option.types[type];
			if (h && h.create) {
				h.create(opts[n].colElements['option'],type,opts[n].name,opts[n].name,"no");
			}
		}
		
	},
	onCancel: function(e)
	{
		backstage.switchTab(null);
		return false;
	},
	
	wizardTitle: "Upload with options",
	step1Title: "These options are saved in cookies in your browser",
	step1Html: "<input type='hidden' name='markList'></input><br>",
	cancelButton: "Cancel",
	cancelButtonPrompt: "Cancel prompt",
	listViewTemplate: {
		columns: [
			{name: 'Description', field: 'description', title: "Description", type: 'WikiText'},
			{name: 'Option', field: 'option', title: "Option", type: 'String'},
			{name: 'Name', field: 'name', title: "Name", type: 'String'}
			],
		rowClasses: [
			{className: 'lowlight', field: 'lowlight'} 
			]}
}

//
// upload functions
//

if (!bidix.upload) bidix.upload = {};

if (!bidix.upload.messages) bidix.upload.messages = {
	//from saving
	invalidFileError: "The original file '%0' does not appear to be a valid TiddlyWiki",
	backupSaved: "Backup saved",
	backupFailed: "Failed to upload backup file",
	rssSaved: "RSS feed uploaded",
	rssFailed: "Failed to upload RSS feed file",
	emptySaved: "Empty template uploaded",
	emptyFailed: "Failed to upload empty template file",
	mainSaved: "Main TiddlyWiki file uploaded",
	mainFailed: "Failed to upload main TiddlyWiki file. Your changes have not been saved",
	//specific upload
	loadOriginalHttpPostError: "Can't get original file",
	aboutToSaveOnHttpPost: 'About to upload on %0 ...',
	storePhpNotFound: "The store script '%0' was not found."
};

bidix.upload.uploadChanges = function(onlyIfDirty,tiddlers,storeUrl,toFilename,uploadDir,backupDir,username,password)
{
	var callback = function(status,uploadParams,original,url,xhr) {
		if (!status) {
			displayMessage(bidix.upload.messages.loadOriginalHttpPostError);
			return;
		}
		if (bidix.debugMode) 
			alert(original.substr(0,500)+"\n...");
		// Locate the storeArea div's 
		var posDiv = locateStoreArea(original);
		if((posDiv[0] == -1) || (posDiv[1] == -1)) {
			alert(config.messages.invalidFileError.format([localPath]));
			return;
		}
		bidix.upload.uploadRss(uploadParams,original,posDiv);
	};
	
	if(onlyIfDirty && !store.isDirty())
		return;
	clearMessage();
	// save on localdisk ?
	if (document.location.toString().substr(0,4) == "file") {
		var path = document.location.toString();
		var localPath = getLocalPath(path);
		saveChanges();
	}
	// get original
	var uploadParams = Array(storeUrl,toFilename,uploadDir,backupDir,username,password);
	var originalPath = document.location.toString();
	// If url is a directory : add index.html
	if (originalPath.charAt(originalPath.length-1) == "/")
		originalPath = originalPath + "index.html";
	var dest = config.macros.upload.destFile(storeUrl,toFilename,uploadDir);
	var log = new bidix.UploadLog();
	log.startUpload(storeUrl, dest, uploadDir,  backupDir);
	displayMessage(bidix.upload.messages.aboutToSaveOnHttpPost.format([dest]));
	if (bidix.debugMode) 
		alert("about to execute Http - GET on "+originalPath);
	var r = doHttp("GET",originalPath,null,null,null,null,callback,uploadParams,null);
	if (typeof r == "string")
		displayMessage(r);
	return r;
};

bidix.upload.uploadRss = function(uploadParams,original,posDiv) 
{
	var callback = function(status,params,responseText,url,xhr) {
		if(status) {
			var destfile = responseText.substring(responseText.indexOf("destfile:")+9,responseText.indexOf("\n", responseText.indexOf("destfile:")));
			displayMessage(bidix.upload.messages.rssSaved,bidix.dirname(url)+'/'+destfile);
			bidix.upload.uploadMain(params[0],params[1],params[2]);
		} else {
			displayMessage(bidix.upload.messages.rssFailed);			
		}
	};
	// do uploadRss
	if(config.options.chkGenerateAnRssFeed) {
		var rssPath = uploadParams[1].substr(0,uploadParams[1].lastIndexOf(".")) + ".xml";
		var rssUploadParams = Array(uploadParams[0],rssPath,uploadParams[2],'',uploadParams[4],uploadParams[5]);
		bidix.upload.httpUpload(rssUploadParams,convertUnicodeToUTF8(generateRss()),callback,Array(uploadParams,original,posDiv));
	} else {
		bidix.upload.uploadMain(uploadParams,original,posDiv);
	}
};

bidix.upload.uploadMain = function(uploadParams,original,posDiv) 
{
	var callback = function(status,params,responseText,url,xhr) {
		var log = new bidix.UploadLog();
		if(status) {
			// if backupDir specified
			if ((params[3]) && (responseText.indexOf("backupfile:") > -1))  {
				var backupfile = responseText.substring(responseText.indexOf("backupfile:")+11,responseText.indexOf("\n", responseText.indexOf("backupfile:")));
				displayMessage(bidix.upload.messages.backupSaved,bidix.dirname(url)+'/'+backupfile);
			}
			var destfile = responseText.substring(responseText.indexOf("destfile:")+9,responseText.indexOf("\n", responseText.indexOf("destfile:")));
			displayMessage(bidix.upload.messages.mainSaved,bidix.dirname(url)+'/'+destfile);
			store.setDirty(false);
			log.endUpload("ok");
		} else {
			alert(bidix.upload.messages.mainFailed);
			displayMessage(bidix.upload.messages.mainFailed);
			log.endUpload("failed");			
		}
	};
	// do uploadMain
	var revised = bidix.upload.updateOriginal(original,posDiv);
	bidix.upload.httpUpload(uploadParams,revised,callback,uploadParams);
};

bidix.upload.httpUpload = function(uploadParams,data,callback,params)
{
	var localCallback = function(status,params,responseText,url,xhr) {
		url = (url.indexOf("nocache=") < 0 ? url : url.substring(0,url.indexOf("nocache=")-1));
		if (xhr.status == httpStatus.NotFound)
			alert(bidix.upload.messages.storePhpNotFound.format([url]));
		if ((bidix.debugMode) || (responseText.indexOf("Debug mode") >= 0 )) {
			alert(responseText);
			if (responseText.indexOf("Debug mode") >= 0 )
				responseText = responseText.substring(responseText.indexOf("\n\n")+2);
		} else if (responseText.charAt(0) != '0') 
			alert(responseText);
		if (responseText.charAt(0) != '0')
			status = null;
		callback(status,params,responseText,url,xhr);
	};
	// do httpUpload
	var boundary = "---------------------------"+"AaB03x";	
	var uploadFormName = "UploadPlugin";
	// compose headers data
	var sheader = "";
	sheader += "--" + boundary + "\r\nContent-disposition: form-data; name=\"";
	sheader += uploadFormName +"\"\r\n\r\n";
	sheader += "backupDir="+uploadParams[3] +
				";user=" + uploadParams[4] +
				";password=" + uploadParams[5] +
				";uploaddir=" + uploadParams[2];
	if (bidix.debugMode)
		sheader += ";debug=1";
	sheader += ";;\r\n"; 
	sheader += "\r\n" + "--" + boundary + "\r\n";
	sheader += "Content-disposition: form-data; name=\"userfile\"; filename=\""+uploadParams[1]+"\"\r\n";
	sheader += "Content-Type: text/html;charset=UTF-8" + "\r\n";
	sheader += "Content-Length: " + data.length + "\r\n\r\n";
	// compose trailer data
	var strailer = new String();
	strailer = "\r\n--" + boundary + "--\r\n";
	data = sheader + data + strailer;
	if (bidix.debugMode) alert("about to execute Http - POST on "+uploadParams[0]+"\n with \n"+data.substr(0,500)+ " ... ");
	var r = doHttp("POST",uploadParams[0],data,"multipart/form-data; boundary="+boundary,uploadParams[4],uploadParams[5],localCallback,params,null);
	if (typeof r == "string")
		displayMessage(r);
	return r;
};

// same as Saving's updateOriginal but without convertUnicodeToUTF8 calls
bidix.upload.updateOriginal = function(original, posDiv)
{
	if (!posDiv)
		posDiv = locateStoreArea(original);
	if((posDiv[0] == -1) || (posDiv[1] == -1)) {
		alert(config.messages.invalidFileError.format([localPath]));
		return;
	}
	var revised = original.substr(0,posDiv[0] + startSaveArea.length) + "\n" +
				store.allTiddlersAsHtml() + "\n" +
				original.substr(posDiv[1]);
	var newSiteTitle = getPageTitle().htmlEncode();
	revised = revised.replaceChunk("<title"+">","</title"+">"," " + newSiteTitle + " ");
	revised = updateMarkupBlock(revised,"PRE-HEAD","MarkupPreHead");
	revised = updateMarkupBlock(revised,"POST-HEAD","MarkupPostHead");
	revised = updateMarkupBlock(revised,"PRE-BODY","MarkupPreBody");
	revised = updateMarkupBlock(revised,"POST-SCRIPT","MarkupPostBody");
	return revised;
};

//
// UploadLog
// 
// config.options.chkUploadLog :
//		false : no logging
//		true : logging
// config.options.txtUploadLogMaxLine :
//		-1 : no limit
//      0 :  no Log lines but UploadLog is still in place
//		n :  the last n lines are only kept
//		NaN : no limit (-1)

bidix.UploadLog = function() {
	if (!config.options.chkUploadLog) 
		return; // this.tiddler = null
	this.tiddler = store.getTiddler("UploadLog");
	if (!this.tiddler) {
		this.tiddler = new Tiddler();
		this.tiddler.title = "UploadLog";
		this.tiddler.text = "| !date | !user | !location | !storeUrl | !uploadDir | !toFilename | !backupdir | !origin |";
		this.tiddler.created = new Date();
		this.tiddler.modifier = config.options.txtUserName;
		this.tiddler.modified = new Date();
		store.addTiddler(this.tiddler);
	}
	return this;
};

bidix.UploadLog.prototype.addText = function(text) {
	if (!this.tiddler)
		return;
	// retrieve maxLine when we need it
	var maxLine = parseInt(config.options.txtUploadLogMaxLine,10);
	if (isNaN(maxLine))
		maxLine = -1;
	// add text
	if (maxLine != 0) 
		this.tiddler.text = this.tiddler.text + text;
	// Trunck to maxLine
	if (maxLine >= 0) {
		var textArray = this.tiddler.text.split('\n');
		if (textArray.length > maxLine + 1)
			textArray.splice(1,textArray.length-1-maxLine);
			this.tiddler.text = textArray.join('\n');		
	}
	// update tiddler fields
	this.tiddler.modifier = config.options.txtUserName;
	this.tiddler.modified = new Date();
	store.addTiddler(this.tiddler);
	// refresh and notifiy for immediate update
	story.refreshTiddler(this.tiddler.title);
	store.notify(this.tiddler.title, true);
};

bidix.UploadLog.prototype.startUpload = function(storeUrl, toFilename, uploadDir,  backupDir) {
	if (!this.tiddler)
		return;
	var now = new Date();
	var text = "\n| ";
	var filename = bidix.basename(document.location.toString());
	if (!filename) filename = '/';
	text += now.formatString("0DD/0MM/YYYY 0hh:0mm:0ss") +" | ";
	text += config.options.txtUserName + " | ";
	text += "[["+filename+"|"+location + "]] |";
	text += " [[" + bidix.basename(storeUrl) + "|" + storeUrl + "]] | ";
	text += uploadDir + " | ";
	text += "[[" + bidix.basename(toFilename) + " | " +toFilename + "]] | ";
	text += backupDir + " |";
	this.addText(text);
};

bidix.UploadLog.prototype.endUpload = function(status) {
	if (!this.tiddler)
		return;
	this.addText(" "+status+" |");
};

//
// Utilities
// 

bidix.checkPlugin = function(plugin, major, minor, revision) {
	var ext = version.extensions[plugin];
	if (!
		(ext  && 
			((ext.major > major) || 
			((ext.major == major) && (ext.minor > minor))  ||
			((ext.major == major) && (ext.minor == minor) && (ext.revision >= revision))))) {
			// write error in PluginManager
			if (pluginInfo)
				pluginInfo.log.push("Requires " + plugin + " " + major + "." + minor + "." + revision);
			eval(plugin); // generate an error : "Error: ReferenceError: xxxx is not defined"
	}
};

bidix.dirname = function(filePath) {
	if (!filePath) 
		return;
	var lastpos;
	if ((lastpos = filePath.lastIndexOf("/")) != -1) {
		return filePath.substring(0, lastpos);
	} else {
		return filePath.substring(0, filePath.lastIndexOf("\\"));
	}
};

bidix.basename = function(filePath) {
	if (!filePath) 
		return;
	var lastpos;
	if ((lastpos = filePath.lastIndexOf("#")) != -1) 
		filePath = filePath.substring(0, lastpos);
	if ((lastpos = filePath.lastIndexOf("/")) != -1) {
		return filePath.substring(lastpos + 1);
	} else
		return filePath.substring(filePath.lastIndexOf("\\")+1);
};

bidix.initOption = function(name,value) {
	if (!config.options[name])
		config.options[name] = value;
};

//
// Initializations
//

// require PasswordOptionPlugin 1.0.1 or better
bidix.checkPlugin("PasswordOptionPlugin", 1, 0, 1);

// styleSheet
setStylesheet('.txtUploadStoreUrl, .txtUploadBackupDir, .txtUploadDir {width: 22em;}',"uploadPluginStyles");

//optionsDesc
merge(config.optionsDesc,{
	txtUploadStoreUrl: "Url of the UploadService script (default: store.php)",
	txtUploadFilename: "Filename of the uploaded file (default: in index.html)",
	txtUploadDir: "Relative Directory where to store the file (default: . (downloadService directory))",
	txtUploadBackupDir: "Relative Directory where to backup the file. If empty no backup. (default: ''(empty))",
	txtUploadUserName: "Upload Username",
	pasUploadPassword: "Upload Password",
	chkUploadLog: "do Logging in UploadLog (default: true)",
	txtUploadLogMaxLine: "Maximum of lines in UploadLog (default: 10)"
});

// Options Initializations
bidix.initOption('txtUploadStoreUrl','');
bidix.initOption('txtUploadFilename','');
bidix.initOption('txtUploadDir','');
bidix.initOption('txtUploadBackupDir','');
bidix.initOption('txtUploadUserName','');
bidix.initOption('pasUploadPassword','');
bidix.initOption('chkUploadLog',true);
bidix.initOption('txtUploadLogMaxLine','10');


// Backstage
merge(config.tasks,{
	uploadOptions: {text: "upload", tooltip: "Change UploadOptions and Upload", content: '<<uploadOptions>>'}
});
config.backstageTasks.push("uploadOptions");


//}}}

/***
|''Name:''|UploadToFileMacro|
|''Description:''|Upload a tiddler as a file using UploadPlugin context. Used with the SimonBaird's HideWhenPlugin ViewTemplate provides a new command in the tiddler toolbar.|
|''Version:''|2.0.1|
|''Date:''|Apr 21, 2007|
|''Source:''|http://tiddlywiki.bidix.info/#UploadToFileMacro|
|''Usage:''|{{{<<uploadTofile [filename [tiddlerTitle]]>>}}}<br>{{{tiddlerTitle, filename: if omitted the title of the current tiddler}}}|
|''Author:''|BidiX (BidiX (at) bidix (dot) info)|
|''License:''|[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D ]]|
|''CoreVersion:''|2.2.0|
|''Requires:''|UploadPlugin|
***/
//{{{
version.extensions.UploadToFileMacro = {
	major: 2, minor: 0, revision: 1, 
	date: new Date("Apr 21, 2007"),
	source: 'http://tiddlywiki.bidix.info/#UploadToFilePlugin',
	author: 'BidiX (BidiX (at) bidix (dot) info',
	coreVersion: '2.2.0'
};

// require UploadPlugin 4.0.0 or better
config.macros.uploadToFile = {
	label: "upload %0 to file %1",
	prompt: "upload tiddler '%0' to file '%1' ",
	warning: "Are you sure you want to upload '%0'?",
	messages: {
		fileUploaded: "tiddler '%0' uploaded to file '%1'",
		fileNotUploaded: "tiddler '%0' NOT uploaded"
	},

	handler: function(place, macroName, params, wikifier,paramString, tiddler) {
		// parameters initialization
		var toFilename = params[0];
		var tiddlerTitle = params[1];
		if (!tiddlerTitle) { 
			tiddlerTitle = tiddler.title;
		} else {
			tiddler = store.getTiddler(tiddlerTitle);
		}
		if (!toFilename) { 
			toFilename = tiddlerTitle;
		} 
		var prompt = this.prompt.format([tiddlerTitle, toFilename]);
		createTiddlyButton(place, this.label.format([params[1], params[0]]), this.prompt.format([tiddlerTitle, toFilename]), 
			function () {
				config.macros.uploadToFile.upload(tiddler, null, toFilename); 
				return false;}, 
			null, null, null);
	},

	upload:  function(tiddler, storeUrl, toFilename, uploadDir, backupDir, username, password) {
		if (!tiddler)	{
			alert("Tiddler not found.");
			return false;
		}
		var uploadIt = true; 
		if ((this.warning) && (!confirm(this.warning.format([tiddler.title])))) 
			return false;
		// parameters initialization
		storeUrl = (storeUrl ? storeUrl : config.options.txtUploadStoreUrl);
		toFilename = (toFilename ? toFilename : tiddler.title);
		backupDir = (backupDir ? backupDir : config.options.txtUploadBackupDir);
		uploadDir = (uploadDir ? uploadDir : config.options.txtUploadDir);
		username = (username ? username : config.options.txtUploadUserName);
		password = (password ? password :config.options.pasUploadPassword);
		var callback = function(status,params,responseText,url,xhr) {
			if (status) { 
				if (responseText.substring(0,1) == '0') {
					// if backupDir specified
					if ((params[3]) && (responseText.indexOf("backupfile:") > -1))  {
						var backupfile = responseText.substring(responseText.indexOf("backupfile:")+11,
							responseText.indexOf("\n", responseText.indexOf("backupfile:")));
						displayMessage(bidix.upload.messages.backupSaved,bidix.dirname(url)+'/'+backupfile);
					}
					var destfile = responseText.substring(responseText.indexOf("destfile:")+9,
						responseText.indexOf("\n", responseText.indexOf("destfile:")));
					if (destfile.substring(0,2) == './') 
						destfile = destfile.substring(2);
					displayMessage(config.macros.uploadToFile.messages.fileUploaded.format([params[6],destfile]),
						bidix.dirname(url)+'/'+destfile);
				} else {
					alert(responseText);
					displayMessage(config.macros.uploadToFile.messages.fileNotUploaded.format([params[1]]));
				}
			} else {
				displayMessage("HTTP Error " + xhr.status + " in accessing " + url);
			}
		};
		var uploadParams = Array(storeUrl,toFilename,uploadDir,backupDir,username,password, tiddler.title);
		return bidix.upload.httpUpload(uploadParams,tiddler.text,callback,uploadParams);
		
	}
};

bidix.checkPlugin = function(plugin, major, minor, revision) {
	var ext = version.extensions[plugin];
	if (!
		(ext  && 
			((ext.major > major) || 
			((ext.major == major) && (ext.minor > minor))  ||
			((ext.major == major) && (ext.minor == minor) && (ext.revision >= revision))))) {
			// write error in PluginManager
			if (pluginInfo)
				pluginInfo.log.push("Requires " + plugin + " " + major + "." + minor + "." + revision);
			eval(plugin); // generate an error : "Error: ReferenceError: xxxx is not defined"
	}
};

//
// Initializations
//

// require PasswordOptionPlugin 1.0.1 or better
bidix.checkPlugin("UploadPlugin", 4, 0, 0);

//}}}
<!--{{{-->
<!--<div class='toolbar' macro='toolbar closeTiddler closeOthers +editTiddler > fields syncing permalink references jump'></div>-->

<div class='title' macro='view title'></div>

<div class='subtitle'><!--<span macro='view modifier link'></span>, -->(last modified <span macro='view modified date [[DD MMM YYYY, hh:mm]]'></span>)</div>

<div class='tagging' macro='tagging'></div>
<!--<div class='tagged' macro='tags'></div>-->
<div class='viewer'> <span macro='navigation "" "" tutorial'></span></div> <div class='viewer'><br/> <span macro='view text wikified'></span> <span macro='navigation "" "" tutorial'></span> </div>
<div class='tagClear'></div>
<!--}}}-->
/***
|''Name:''|YourSearchPlugin|
|''Version:''|2.1.1 (2007-03-11)|
|''Source:''|http://tiddlywiki.abego-software.de/#YourSearchPlugin ([[del.icio.us|http://del.icio.us/post?url=http://tiddlywiki.abego-software.de/index.html%23YourSearchPlugin]])|
|''Author:''|UdoBorkowski (ub [at] abego-software [dot] de)|
|''Licence:''|[[BSD open source license (abego Software)|http://www.abego-software.de/legal/apl-v10.html]]|
|''Copyright:''|&copy; 2005-2006 [[abego Software|http://www.abego-software.de]]|
|''~CoreVersion:''|2.1.0|
|''Browser:''|Firefox 1.0.4+; Firefox 1.5; ~InternetExplorer 6.0|
!About YourSearch
YourSearch gives you a bunch of new features to simplify and speed up your daily searches in TiddlyWiki. It seamlessly integrates into the standard TiddlyWiki search: just start typing into the 'search' field and explore!

For more information see [[Help|YourSearch Help]].
!Compatibility
This plugin requires TiddlyWiki 2.1. 
Check the [[archive|http://tiddlywiki.abego-software.de/archive]] for ~YourSearchPlugins supporting older versions of TiddlyWiki.
!Source Code
***/
/***
This plugin's source code is compressed (and hidden). Use this [[link|http://tiddlywiki.abego-software.de/archive/YourSearchPlugin/Plugin-YourSearch-src.2.1.1.js]] to get the readable source code.
***/
///%
if(!version.extensions.YourSearchPlugin){version.extensions.YourSearchPlugin={major:2,minor:1,revision:1,source:"http://tiddlywiki.abego-software.de/#YourSearchPlugin",licence:"[[BSD open source license (abego Software)|http://www.abego-software.de/legal/apl-v10.html]]",copyright:"Copyright (c) abego Software GmbH, 2005-2007 (www.abego-software.de)"};if(!window.abego){window.abego={};}if(!Array.forEach){Array.forEach=function(_1,_2,_3){for(var i=0,len=_1.length;i<len;i++){_2.call(_3,_1[i],i,_1);}};Array.prototype.forEach=function(_5,_6){for(var i=0,len=this.length;i<len;i++){_5.call(_6,this[i],i,this);}};}abego.toInt=function(s,_9){if(!s){return _9;}var n=parseInt(s);return (n==NaN)?_9:n;};abego.createEllipsis=function(_b){var e=createTiddlyElement(_b,"span");e.innerHTML="&hellip;";};abego.shallowCopy=function(_d){if(!_d){return _d;}var _e={};for(var n in _d){_e[n]=_d[n];}return _e;};abego.copyOptions=function(_10){return !_10?{}:abego.shallowCopy(_10);};abego.countStrings=function(_11,s){if(!s){return 0;}var len=s.length;var n=0;var _15=0;while(1){var i=_11.indexOf(s,_15);if(i<0){return n;}n++;_15=i+len;}return n;};abego.getBracedText=function(_17,_18,_19){if(!_18){_18=0;}var re=/\{([^\}]*)\}/gm;re.lastIndex=_18;var m=re.exec(_17);if(m){var s=m[1];var _1d=abego.countStrings(s,"{");if(!_1d){if(_19){_19.lastIndex=re.lastIndex;}return s;}var len=_17.length;for(var i=re.lastIndex;i<len&&_1d;i++){var c=_17.charAt(i);if(c=="{"){_1d++;}else{if(c=="}"){_1d--;}}}if(!_1d){if(_19){_19.lastIndex=i-1;}return _17.substring(m.index+1,i-1);}}};abego.select=function(_21,_22,_23,_24){if(!_24){_24=[];}_21.forEach(function(t){if(_22.call(_23,t)){_24.push(t);}});return _24;};abego.TiddlerFilterTerm=function(_26,_27){if(!_27){_27={};}var _28=_26;if(!_27.textIsRegExp){_28=_26.escapeRegExp();if(_27.fullWordMatch){_28="\\b"+_28+"\\b";}}var _29=new RegExp(_28,"m"+(_27.caseSensitive?"":"i"));this.tester=new abego.MultiFieldRegExpTester(_29,_27.fields,_27.withExtendedFields);};abego.TiddlerFilterTerm.prototype.test=function(_2a){return this.tester.test(_2a);};abego.parseNewTiddlerCommandLine=function(s){var m=/(.*?)\.(?:\s+|$)([^#]*)(#.*)?/.exec(s);if(!m){m=/([^#]*)()(#.*)?/.exec(s);}if(m){var r;if(m[3]){var s2=m[3].replace(/#/g,"");r=s2.parseParams("tag");}else{r=[[]];}var _2f=m[2]?m[2].trim():"";r.push({name:"text",value:_2f});r[0].text=[_2f];return {title:m[1].trim(),params:r};}else{return {title:s.trim(),params:[[]]};}};abego.parseTiddlerFilterTerm=function(_30,_31,_32){var re=/\s*(?:(?:\{([^\}]*)\})|(?:(=)|([#%!])|(?:(\w+)\s*\:(?!\/\/))|(?:(?:("(?:(?:\\")|[^"])+")|(?:\/((?:(?:\\\/)|[^\/])+)\/)|(\w+\:\/\/[^\s]+)|([^\s\)\-\"]+)))))/mg;var _34={"!":"title","%":"text","#":"tags"};var _35={};var _36;re.lastIndex=_31;while(1){var i=re.lastIndex;var m=re.exec(_30);if(!m||m.index!=i){throw "Word or String literal expected";}if(m[1]){var _39={};var _3a=abego.getBracedText(_30,0,_39);if(!_3a){throw "Invalid {...} syntax";}var f=Function("tiddler","return ("+_3a+");");return {func:f,lastIndex:_39.lastIndex,markRE:null};}if(m[2]){_36=true;}else{if(m[3]){_35[_34[m[3]]]=1;}else{if(m[4]){_35[m[4]]=1;}else{var _3c=m[6];var _3d=m[5]?window.eval(m[5]):m[6]?m[6]:m[7]?m[7]:m[8];var _3e=abego.copyOptions(_3e);_3e.fullWordMatch=_36;_3e.textIsRegExp=_3c;var _3f=[];for(var n in _35){_3f.push(n);}if(_3f.length==0){_3e.fields=_3e.defaultFields;}else{_3e.fields=_3f;_3e.withExtendedFields=false;}var _41=new abego.TiddlerFilterTerm(_3d,_3e);var _42=_3c?_3d:_3d.escapeRegExp();if(_42&&_36){_42="\\b"+_42+"\\b";}return {func:function(_43){return _41.test(_43);},lastIndex:re.lastIndex,markRE:_42?"(?:"+_42+")":null};}}}}};abego.BoolExp=function(s,_45,_46){this.s=s;var _47=_46&&_46.defaultOperationIs_OR;var _48=/\s*(?:(\-|not)|(\())/gi;var _49=/\s*\)/g;var _4a=/\s*(?:(and|\&\&)|(or|\|\|))/gi;var _4b=/\s*[^\)\s]/g;var _4c=/\s*(\-|not)?(\s*\()?/gi;var _4d;var _4e=function(_4f){_4c.lastIndex=_4f;var m=_4c.exec(s);var _51;var _52;if(m&&m.index==_4f){_4f=_4c.lastIndex;_51=m[1];if(m[2]){var e=_4d(_4f);_49.lastIndex=e.lastIndex;if(!_49.exec(s)){throw "Missing ')'";}_52={func:e.func,lastIndex:_49.lastIndex,markRE:e.markRE};}}if(!_52){_52=_45(s,_4f,_46);}if(_51){_52.func=(function(f){return function(_55){return !f(_55);};})(_52.func);_52.markRE=null;}return _52;};_4d=function(_56){var _57=_4e(_56);while(1){var l=_57.lastIndex;_4a.lastIndex=l;var m=_4a.exec(s);var _5a;var _5b;if(m&&m.index==l){_5a=!m[1];_5b=_4e(_4a.lastIndex);}else{try{_5b=_4e(l);}catch(e){return _57;}_5a=_47;}_57.func=(function(_5c,_5d,_5e){return _5e?function(_5f){return _5c(_5f)||_5d(_5f);}:function(_60){return _5c(_60)&&_5d(_60);};})(_57.func,_5b.func,_5a);_57.lastIndex=_5b.lastIndex;if(!_57.markRE){_57.markRE=_5b.markRE;}else{if(_5b.markRE){_57.markRE=_57.markRE+"|"+_5b.markRE;}}}};var _61=_4d(0);this.evalFunc=_61.func;if(_61.markRE){this.markRegExp=new RegExp(_61.markRE,_46.caseSensitive?"mg":"img");}};abego.BoolExp.prototype.exec=function(){return this.evalFunc.apply(this,arguments);};abego.BoolExp.prototype.getMarkRegExp=function(){return this.markRegExp;};abego.BoolExp.prototype.toString=function(){return this.s;};abego.MultiFieldRegExpTester=function(re,_63,_64){this.re=re;this.fields=_63?_63:["title","text","tags"];this.withExtendedFields=_64;};abego.MultiFieldRegExpTester.prototype.test=function(_65){var re=this.re;for(var i=0;i<this.fields.length;i++){var s=store.getValue(_65,this.fields[i]);if(typeof s=="string"&&re.test(s)){return this.fields[i];}}if(this.withExtendedFields){return store.forEachField(_65,function(_69,_6a,_6b){return typeof _6b=="string"&&re.test(_6b)?_6a:null;},true);}return null;};abego.TiddlerQuery=function(_6c,_6d,_6e,_6f,_70){if(_6e){this.regExp=new RegExp(_6c,_6d?"mg":"img");this.tester=new abego.MultiFieldRegExpTester(this.regExp,_6f,_70);}else{this.expr=new abego.BoolExp(_6c,abego.parseTiddlerFilterTerm,{defaultFields:_6f,caseSensitive:_6d,withExtendedFields:_70});}this.getQueryText=function(){return _6c;};this.getUseRegExp=function(){return _6e;};this.getCaseSensitive=function(){return _6d;};this.getDefaultFields=function(){return _6f;};this.getWithExtendedFields=function(){return _70;};};abego.TiddlerQuery.prototype.test=function(_71){if(!_71){return false;}if(this.regExp){return this.tester.test(_71);}return this.expr.exec(_71);};abego.TiddlerQuery.prototype.filter=function(_72){return abego.select(_72,this.test,this);};abego.TiddlerQuery.prototype.getMarkRegExp=function(){if(this.regExp){return "".search(this.regExp)>=0?null:this.regExp;}return this.expr.getMarkRegExp();};abego.TiddlerQuery.prototype.toString=function(){return (this.regExp?this.regExp:this.expr).toString();};abego.PageWiseRenderer=function(){this.firstIndexOnPage=0;};merge(abego.PageWiseRenderer.prototype,{setItems:function(_73){this.items=_73;this.setFirstIndexOnPage(0);},getMaxPagesInNavigation:function(){return 10;},getItemsCount:function(_74){return this.items?this.items.length:0;},getCurrentPageIndex:function(){return Math.floor(this.firstIndexOnPage/this.getItemsPerPage());},getLastPageIndex:function(){return Math.floor((this.getItemsCount()-1)/this.getItemsPerPage());},setFirstIndexOnPage:function(_75){this.firstIndexOnPage=Math.min(Math.max(0,_75),this.getItemsCount()-1);},getFirstIndexOnPage:function(){this.firstIndexOnPage=Math.floor(this.firstIndexOnPage/this.getItemsPerPage())*this.getItemsPerPage();return this.firstIndexOnPage;},getLastIndexOnPage:function(){return Math.min(this.getFirstIndexOnPage()+this.getItemsPerPage()-1,this.getItemsCount()-1);},onPageChanged:function(_76,_77){},renderPage:function(_78){if(_78.beginRendering){_78.beginRendering(this);}try{if(this.getItemsCount()){var _79=this.getLastIndexOnPage();var _7a=-1;for(var i=this.getFirstIndexOnPage();i<=_79;i++){_7a++;_78.render(this,this.items[i],i,_7a);}}}finally{if(_78.endRendering){_78.endRendering(this);}}},addPageNavigation:function(_7c){if(!this.getItemsCount()){return;}var _7d=this;var _7e=function(e){if(!e){var e=window.event;}var _81=abego.toInt(this.getAttribute("page"),0);var _82=_7d.getCurrentPageIndex();if(_81==_82){return;}var _83=_81*_7d.getItemsPerPage();_7d.setFirstIndexOnPage(_83);_7d.onPageChanged(_81,_82);};var _84;var _85=this.getCurrentPageIndex();var _86=this.getLastPageIndex();if(_85>0){_84=createTiddlyButton(_7c,"Previous","Go to previous page (Shortcut: Alt-'<')",_7e,"prev");_84.setAttribute("page",(_85-1).toString());_84.setAttribute("accessKey","<");}for(var i=-this.getMaxPagesInNavigation();i<this.getMaxPagesInNavigation();i++){var _88=_85+i;if(_88<0){continue;}if(_88>_86){break;}var _89=(i+_85+1).toString();var _8a=_88==_85?"currentPage":"otherPage";_84=createTiddlyButton(_7c,_89,"Go to page %0".format([_89]),_7e,_8a);_84.setAttribute("page",(_88).toString());}if(_85<_86){_84=createTiddlyButton(_7c,"Next","Go to next page (Shortcut: Alt-'>')",_7e,"next");_84.setAttribute("page",(_85+1).toString());_84.setAttribute("accessKey",">");}}});abego.LimitedTextRenderer=function(){var _8b=40;var _8c=4;var _8d=function(_8e,_8f,_90){var n=_8e.length;if(n==0){_8e.push({start:_8f,end:_90});return;}var i=0;for(;i<n;i++){var _93=_8e[i];if(_93.start<=_90&&_8f<=_93.end){var r;var _95=i+1;for(;_95<n;_95++){r=_8e[_95];if(r.start>_90||_8f>_93.end){break;}}var _96=_8f;var _97=_90;for(var j=i;j<_95;j++){r=_8e[j];_96=Math.min(_96,r.start);_97=Math.max(_97,r.end);}_8e.splice(i,_95-i,{start:_96,end:_97});return;}if(_93.start>_90){break;}}_8e.splice(i,0,{start:_8f,end:_90});};var _99=function(_9a){var _9b=0;for(var i=0;i<_9a.length;i++){var _9d=_9a[i];_9b+=_9d.end-_9d.start;}return _9b;};var _9e=function(c){return (c>="a"&&c<="z")||(c>="A"&&c<="Z")||c=="_";};var _a0=function(s,_a2){if(!_9e(s[_a2])){return null;}for(var i=_a2-1;i>=0&&_9e(s[i]);i--){}var _a4=i+1;var n=s.length;for(i=_a2+1;i<n&&_9e(s[i]);i++){}return {start:_a4,end:i};};var _a6=function(s,_a8,_a9){var _aa;if(_a9){_aa=_a0(s,_a8);}else{if(_a8<=0){return _a8;}_aa=_a0(s,_a8-1);}if(!_aa){return _a8;}if(_a9){if(_aa.start>=_a8-_8c){return _aa.start;}if(_aa.end<=_a8+_8c){return _aa.end;}}else{if(_aa.end<=_a8+_8c){return _aa.end;}if(_aa.start>=_a8-_8c){return _aa.start;}}return _a8;};var _ab=function(s,_ad){var _ae=[];if(_ad){var _af=0;var n=s.length;var _b1=0;do{_ad.lastIndex=_af;var _b2=_ad.exec(s);if(_b2){if(_af<_b2.index){var t=s.substring(_af,_b2.index);_ae.push({text:t});}_ae.push({text:_b2[0],isMatch:true});_af=_b2.index+_b2[0].length;}else{_ae.push({text:s.substr(_af)});break;}}while(true);}else{_ae.push({text:s});}return _ae;};var _b4=function(_b5){var _b6=0;for(var i=0;i<_b5.length;i++){if(_b5[i].isMatch){_b6++;}}return _b6;};var _b8=function(s,_ba,_bb,_bc,_bd){var _be=Math.max(Math.floor(_bd/(_bc+1)),_8b);var _bf=Math.max(_be-(_bb-_ba),0);var _c0=Math.min(Math.floor(_bb+_bf/3),s.length);var _c1=Math.max(_c0-_be,0);_c1=_a6(s,_c1,true);_c0=_a6(s,_c0,false);return {start:_c1,end:_c0};};var _c2=function(_c3,s,_c5){var _c6=[];var _c7=_b4(_c3);var pos=0;for(var i=0;i<_c3.length;i++){var t=_c3[i];var _cb=t.text;if(t.isMatch){var _cc=_b8(s,pos,pos+_cb.length,_c7,_c5);_8d(_c6,_cc.start,_cc.end);}pos+=_cb.length;}return _c6;};var _cd=function(s,_cf,_d0){var _d1=_d0-_99(_cf);while(_d1>0){if(_cf.length==0){_8d(_cf,0,_a6(s,_d0,false));return;}else{var _d2=_cf[0];var _d3;var _d4;if(_d2.start==0){_d3=_d2.end;if(_cf.length>1){_d4=_cf[1].start;}else{_8d(_cf,_d3,_a6(s,_d3+_d1,false));return;}}else{_d3=0;_d4=_d2.start;}var _d5=Math.min(_d4,_d3+_d1);_8d(_cf,_d3,_d5);_d1-=(_d5-_d3);}}};var _d6=function(_d7,s,_d9,_da,_db){if(_da.length==0){return;}var _dc=function(_dd,s,_df,_e0,_e1){var t;var _e3;var pos=0;var i=0;var _e6=0;for(;i<_df.length;i++){t=_df[i];_e3=t.text;if(_e0<pos+_e3.length){_e6=_e0-pos;break;}pos+=_e3.length;}var _e7=_e1-_e0;for(;i<_df.length&&_e7>0;i++){t=_df[i];_e3=t.text.substr(_e6);_e6=0;if(_e3.length>_e7){_e3=_e3.substr(0,_e7);}if(t.isMatch){createTiddlyElement(_dd,"span",null,"marked",_e3);}else{createTiddlyText(_dd,_e3);}_e7-=_e3.length;}if(_e1<s.length){abego.createEllipsis(_dd);}};if(_da[0].start>0){abego.createEllipsis(_d7);}var _e8=_db;for(var i=0;i<_da.length&&_e8>0;i++){var _ea=_da[i];var len=Math.min(_ea.end-_ea.start,_e8);_dc(_d7,s,_d9,_ea.start,_ea.start+len);_e8-=len;}};this.render=function(_ec,s,_ee,_ef){if(s.length<_ee){_ee=s.length;}var _f0=_ab(s,_ef);var _f1=_c2(_f0,s,_ee);_cd(s,_f1,_ee);_d6(_ec,s,_f0,_f1,_ee);};};(function(){function alertAndThrow(msg){alert(msg);throw msg;}if(version.major<2||(version.major==2&&version.minor<1)){alertAndThrow("YourSearchPlugin requires TiddlyWiki 2.1 or newer.\n\nCheck the archive for YourSearch plugins\nsupporting older versions of TiddlyWiki.\n\nArchive: http://tiddlywiki.abego-software.de/archive");}abego.YourSearch={};var _f3;var _f4;var _f5=function(_f6){_f3=_f6;};var _f7=function(){return _f3?_f3:[];};var _f8=function(){return _f3?_f3.length:0;};var _f9=4;var _fa=10;var _fb=2;var _fc=function(s,re){var m=s.match(re);return m?m.length:0;};var _100=function(_101,_102){var _103=_102.getMarkRegExp();if(!_103){return 1;}var _104=_101.title.match(_103);var _105=_104?_104.length:0;var _106=_fc(_101.getTags(),_103);var _107=_104?_104.join("").length:0;var _108=_101.title.length>0?_107/_101.title.length:0;var rank=_105*_f9+_106*_fb+_108*_fa+1;return rank;};var _10a=function(_10b,_10c,_10d,_10e,_10f,_110){_f4=null;var _111=_10b.reverseLookup("tags",_110,false);try{var _112=[];if(config.options.chkSearchInTitle){_112.push("title");}if(config.options.chkSearchInText){_112.push("text");}if(config.options.chkSearchInTags){_112.push("tags");}_f4=new abego.TiddlerQuery(_10c,_10d,_10e,_112,config.options.chkSearchExtendedFields);}catch(e){return [];}var _113=_f4.filter(_111);var _114=abego.YourSearch.getRankFunction();for(var i=0;i<_113.length;i++){var _116=_113[i];var rank=_114(_116,_f4);_116.searchRank=rank;}if(!_10f){_10f="title";}var _118=function(a,b){var _11b=a.searchRank-b.searchRank;if(_11b==0){if(a[_10f]==b[_10f]){return (0);}else{return (a[_10f]<b[_10f])?-1:+1;}}else{return (_11b>0)?-1:+1;}};_113.sort(_118);return _113;};var _11c=80;var _11d=50;var _11e=250;var _11f=50;var _120=25;var _121=10;var _122="yourSearchResult";var _123="yourSearchResultItems";var _124;var _125;var _126;var _127;var _128;var _129=function(){if(version.extensions.YourSearchPlugin.styleSheetInited){return;}version.extensions.YourSearchPlugin.styleSheetInited=true;setStylesheet(store.getTiddlerText("YourSearchStyleSheet"),"yourSearch");};var _12a=function(){return _125!=null&&_125.parentNode==document.body;};var _12b=function(){if(_12a()){document.body.removeChild(_125);}};var _12c=function(e){_12b();var _12e=this.getAttribute("tiddlyLink");if(_12e){var _12f=this.getAttribute("withHilite");var _130=highlightHack;if(_12f&&_12f=="true"&&_f4){highlightHack=_f4.getMarkRegExp();}story.displayTiddler(this,_12e);highlightHack=_130;}return (false);};var _131=function(){if(!_126){return;}var root=_126;var _133=findPosX(root);var _134=findPosY(root);var _135=root.offsetHeight;var _136=_133;var _137=_134+_135;var _138=findWindowWidth();if(_138<_125.offsetWidth){_125.style.width=(_138-100)+"px";_138=findWindowWidth();}var _139=_125.offsetWidth;if(_136+_139>_138){_136=_138-_139-30;}if(_136<0){_136=0;}_125.style.left=_136+"px";_125.style.top=_137+"px";_125.style.display="block";};var _13a=function(){if(_125){window.scrollTo(0,ensureVisible(_125));}if(_126){window.scrollTo(0,ensureVisible(_126));}};var _13b=function(){_131();_13a();};var _13c;var _13d;var _13e=new abego.PageWiseRenderer();var _13f=function(_140){this.itemHtml=store.getTiddlerText("YourSearchItemTemplate");if(!this.itemHtml){alertAndThrow("YourSearchItemTemplate not found");}this.place=document.getElementById(_123);if(!this.place){this.place=createTiddlyElement(_140,"div",_123);}};merge(_13f.prototype,{render:function(_141,_142,_143,_144){_13c=_144;_13d=_142;var item=createTiddlyElement(this.place,"div",null,"yourSearchItem");item.innerHTML=this.itemHtml;applyHtmlMacros(item,null);refreshElements(item,null);},endRendering:function(_146){_13d=null;}});var _147=function(){if(!_125||!_126){return;}var html=store.getTiddlerText("YourSearchResultTemplate");if(!html){html="<b>Tiddler YourSearchResultTemplate not found</b>";}_125.innerHTML=html;applyHtmlMacros(_125,null);refreshElements(_125,null);var _149=new _13f(_125);_13e.renderPage(_149);_13b();};_13e.getItemsPerPage=function(){var n=(config.options.chkPreviewText)?abego.toInt(config.options.txtItemsPerPageWithPreview,_121):abego.toInt(config.options.txtItemsPerPage,_120);return (n>0)?n:1;};_13e.onPageChanged=function(){_147();};var _14b=function(){if(_126==null||!config.options.chkUseYourSearch){return;}if((_126.value==_124)&&_124&&!_12a()){if(_125&&(_125.parentNode!=document.body)){document.body.appendChild(_125);_13b();}else{abego.YourSearch.onShowResult(true);}}};var _14c=function(){_12b();_125=null;_124=null;};var _14d=function(self,e){while(e!=null){if(self==e){return true;}e=e.parentNode;}return false;};var _150=function(e){if(e.target==_126){return;}if(e.target==_127){return;}if(_125&&_14d(_125,e.target)){return;}_12b();};var _152=function(e){if(e.keyCode==27){_12b();}};addEvent(document,"click",_150);addEvent(document,"keyup",_152);var _154=function(text,_156,_157){_124=text;_f5(_10a(store,text,_156,_157,"title","excludeSearch"));abego.YourSearch.onShowResult();};var _158=function(_159,_15a,_15b,_15c,_15d,_15e){_129();_124="";var _15f=null;var _160=function(txt){if(config.options.chkUseYourSearch){_154(txt.value+' #=searchable',config.options.chkCaseSensitiveSearch,config.options.chkRegExpSearch);}else{story.search(txt.value,config.options.chkCaseSensitiveSearch,config.options.chkRegExpSearch);}_124=txt.value;};var _162=function(e){_160(_126);return false;};var _164=function(e){if(!e){var e=window.event;}_126=this;switch(e.keyCode){case 13:if(e.ctrlKey&&_128&&_12a()){_128.onclick.apply(_128,[e]);}else{_160(this);}break;case 27:if(_12a()){_12b();}else{this.value="";clearMessage();}break;}if(String.fromCharCode(e.keyCode)==this.accessKey||e.altKey){_14b();}if(this.value.length<3&&_15f){clearTimeout(_15f);}if(this.value.length>2){if(this.value!=_124){if(!config.options.chkUseYourSearch||config.options.chkSearchAsYouType){if(_15f){clearTimeout(_15f);}var txt=this;_15f=setTimeout(function(){_160(txt);},500);}}else{if(_15f){clearTimeout(_15f);}}}if(this.value.length==0){_12b();}};var _168=function(e){this.select();clearMessage();_14b();};var args=_15d.parseParams("list",null,true);var _16b=getFlag(args,"buttonAtRight");var _16c=getParam(args,"sizeTextbox",this.sizeTextbox);var btn;if(!_16b){btn=createTiddlyButton(_159,this.label,this.prompt,_162);}var txt=createTiddlyElement(_159,"input",null,null,null);if(_15b[0]){txt.value=_15b[0];}txt.onkeyup=_164;txt.onfocus=_168;txt.setAttribute("size",_16c);txt.setAttribute("accessKey",this.accessKey);txt.setAttribute("autocomplete","off");if(config.browser.isSafari){txt.setAttribute("type","search");txt.setAttribute("results","5");}else{txt.setAttribute("type","text");}if(_16b){btn=createTiddlyButton(_159,this.label,this.prompt,_162);}_126=txt;_127=btn;};var _16f=function(){_12b();var _170=_f7();var n=_170.length;if(n){var _172=[];for(var i=0;i<n;i++){_172.push(_170[i].title);}story.displayTiddlers(null,_172);}};var _174=function(_175,_176,_177,_178){invokeMacro(_175,"option",_176,_177,_178);var elem=_175.lastChild;var _17a=elem.onclick;elem.onclick=function(e){var _17c=_17a.apply(this,arguments);_147();return _17c;};return elem;};var _17d=function(s){var _17f=["''","{{{","}}}","//","<<<","/***","***/"];var _180="";for(var i=0;i<_17f.length;i++){if(i!=0){_180+="|";}_180+="("+_17f[i].escapeRegExp()+")";}return s.replace(new RegExp(_180,"mg"),"").trim();};var _182=function(){var i=_13c;return (i>=0&&i<=9)?(i<9?(i+1):0):-1;};var _184=new abego.LimitedTextRenderer();var _185=function(_186,s,_188){_184.render(_186,s,_188,_f4.getMarkRegExp());};var _189=TiddlyWiki.prototype.saveTiddler;TiddlyWiki.prototype.saveTiddler=function(_18a,_18b,_18c,_18d,_18e,tags,_190){_189.apply(this,arguments);_14c();};var _191=TiddlyWiki.prototype.removeTiddler;TiddlyWiki.prototype.removeTiddler=function(_192){_191.apply(this,arguments);_14c();};config.macros.yourSearch={label:"yourSearch",prompt:"Gives access to the current/last YourSearch result",handler:function(_193,_194,_195,_196,_197,_198){if(_195.length==0){return;}var name=_195[0];var func=config.macros.yourSearch.funcs[name];if(func){func(_193,_194,_195,_196,_197,_198);}},tests:{"true":function(){return true;},"false":function(){return false;},"found":function(){return _f8()>0;},"previewText":function(){return config.options.chkPreviewText;}},funcs:{itemRange:function(_19b){if(_f8()){var _19c=_13e.getLastIndexOnPage();var s="%0 - %1".format([_13e.getFirstIndexOnPage()+1,_19c+1]);createTiddlyText(_19b,s);}},count:function(_19e){createTiddlyText(_19e,_f8().toString());},query:function(_19f){if(_f4){createTiddlyText(_19f,_f4.toString());}},version:function(_1a0){var t="YourSearch %0.%1.%2".format([version.extensions.YourSearchPlugin.major,version.extensions.YourSearchPlugin.minor,version.extensions.YourSearchPlugin.revision]);var e=createTiddlyElement(_1a0,"a");e.setAttribute("href","http://tiddlywiki.abego-software.de/#YourSearchPlugin");e.innerHTML="<font color=\"black\" face=\"Arial, Helvetica, sans-serif\">"+t+"<font>";},copyright:function(_1a3){var e=createTiddlyElement(_1a3,"a");e.setAttribute("href","http://www.abego-software.de");e.innerHTML="<font color=\"black\" face=\"Arial, Helvetica, sans-serif\">&copy; 2005-2006 <b><font color=\"red\">abego</font></b> Software<font>";},newTiddlerButton:function(_1a5){if(_f4){var r=abego.parseNewTiddlerCommandLine(_f4.getQueryText());var btn=config.macros.newTiddler.createNewTiddlerButton(_1a5,r.title,r.params,"new tiddler","Create a new tiddler based on search text. (Shortcut: Ctrl-Enter; Separators: '.', '#')",null,"text");var _1a8=btn.onclick;btn.onclick=function(){_12b();_1a8.apply(this,arguments);};_128=btn;}},linkButton:function(_1a9,_1aa,_1ab,_1ac,_1ad,_1ae){if(_1ab<2){return;}var _1af=_1ab[1];var text=_1ab<3?_1af:_1ab[2];var _1b1=_1ab<4?text:_1ab[3];var _1b2=_1ab<5?null:_1ab[4];var btn=createTiddlyButton(_1a9,text,_1b1,_12c,null,null,_1b2);btn.setAttribute("tiddlyLink",_1af);},closeButton:function(_1b4,_1b5,_1b6,_1b7,_1b8,_1b9){var _1ba=createTiddlyButton(_1b4,"close","Close the Search Results (Shortcut: ESC)",_12b);},openAllButton:function(_1bb,_1bc,_1bd,_1be,_1bf,_1c0){var n=_f8();if(n==0){return;}var _1c2=n==1?"open tiddler":"open all %0 tiddlers".format([n]);var _1c3=createTiddlyButton(_1bb,_1c2,"Open all found tiddlers (Shortcut: Alt-O)",_16f);_1c3.setAttribute("accessKey","O");},naviBar:function(_1c4,_1c5,_1c6,_1c7,_1c8,_1c9){_13e.addPageNavigation(_1c4);},"if":function(_1ca,_1cb,_1cc,_1cd,_1ce,_1cf){if(_1cc.length<2){return;}var _1d0=_1cc[1];var _1d1=(_1d0=="not");if(_1d1){if(_1cc.length<3){return;}_1d0=_1cc[2];}var test=config.macros.yourSearch.tests[_1d0];var _1d3=false;try{if(test){_1d3=test(_1ca,_1cb,_1cc,_1cd,_1ce,_1cf)!=_1d1;}else{_1d3=(!eval(_1d0))==_1d1;}}catch(ex){}if(!_1d3){_1ca.style.display="none";}},chkPreviewText:function(_1d4,_1d5,_1d6,_1d7,_1d8,_1d9){var _1da=_1d6.slice(1).join(" ");var elem=_174(_1d4,"chkPreviewText",_1d7,_1d9);elem.setAttribute("accessKey","P");elem.title="Show text preview of found tiddlers (Shortcut: Alt-P)";return elem;}}};config.macros.foundTiddler={label:"foundTiddler",prompt:"Provides information on the tiddler currently processed on the YourSearch result page",handler:function(_1dc,_1dd,_1de,_1df,_1e0,_1e1){var name=_1de[0];var func=config.macros.foundTiddler.funcs[name];if(func){func(_1dc,_1dd,_1de,_1df,_1e0,_1e1);}},funcs:{title:function(_1e4,_1e5,_1e6,_1e7,_1e8,_1e9){if(!_13d){return;}var _1ea=_182();var _1eb=_1ea>=0?"Open tiddler (Shortcut: Alt-%0)".format([_1ea.toString()]):"Open tiddler";var btn=createTiddlyButton(_1e4,null,_1eb,_12c,null);btn.setAttribute("tiddlyLink",_13d.title);btn.setAttribute("withHilite","true");_185(btn,_13d.title,_11c);if(_1ea>=0){btn.setAttribute("accessKey",_1ea.toString());}},tags:function(_1ed,_1ee,_1ef,_1f0,_1f1,_1f2){if(!_13d){return;}_185(_1ed,_13d.getTags(),_11d);},text:function(_1f3,_1f4,_1f5,_1f6,_1f7,_1f8){if(!_13d){return;}_185(_1f3,_17d(_13d.text),_11e);},field:function(_1f9,_1fa,_1fb,_1fc,_1fd,_1fe){if(!_13d){return;}var name=_1fb[1];var len=_1fb.length>2?abego.toInt(_1fb[2],_11f):_11f;var v=store.getValue(_13d,name);if(v){_185(_1f9,_17d(v),len);}},number:function(_202,_203,_204,_205,_206,_207){var _208=_182();if(_208>=0){var text="%0)".format([_208.toString()]);createTiddlyElement(_202,"span",null,"shortcutNumber",text);}}}};var opts={chkUseYourSearch:true,chkPreviewText:true,chkSearchAsYouType:true,chkSearchInTitle:true,chkSearchInText:true,chkSearchInTags:true,chkSearchExtendedFields:true,txtItemsPerPage:_120,txtItemsPerPageWithPreview:_121};for(var n in opts){if(config.options[n]==undefined){config.options[n]=opts[n];}}config.shadowTiddlers.AdvancedOptions+="\n<<option chkUseYourSearch>> Use 'Your Search' //([[more options|YourSearch Options]]) ([[help|YourSearch Help]])// ";config.shadowTiddlers["YourSearch Help"]="!Field Search\nWith the Field Search you can restrict your search to certain fields of a tiddler, e.g"+" only search the tags or only the titles. The general form is //fieldname//'':''//textToSearch// (e."+"g. {{{title:intro}}}). In addition one-character shortcuts are also supported for the standard field"+"s {{{title}}}, {{{text}}} and {{{tags}}}:\n|!What you want|!What you type|!Example|\n|Search ''titles "+"only''|start word with ''!''|{{{!jonny}}} (shortcut for {{{title:jonny}}})|\n|Search ''contents/text "+"only''|start word with ''%''|{{{%football}}} (shortcut for {{{text:football}}})|\n|Search ''tags only"+"''|start word with ''#''|{{{#Plugin}}} (shortcut for {{{tags:Plugin}}})|\n\nUsing this feature you may"+" also search the extended fields (\"Metadata\") introduced with TiddlyWiki 2.1, e.g. use {{{priority:1"+"}}} to find all tiddlers with the priority field set to \"1\".\n\nYou may search a word in more than one"+" field. E.g. {{{!#Plugin}}} (or {{{title:tags:Plugin}}} in the \"long form\") finds tiddlers containin"+"g \"Plugin\" either in the title or in the tags (but does not look for \"Plugin\" in the text). \n\n!Boole"+"an Search\nThe Boolean Search is useful when searching for multiple words.\n|!What you want|!What you "+"type|!Example|\n|''All words'' must exist|List of words|{{{jonny jeremy}}} (or {{{jonny and jeremy}}}"+")|\n|''At least one word'' must exist|Separate words by ''or''|{{{jonny or jeremy}}}|\n|A word ''must "+"not exist''|Start word with ''-''|{{{-jonny}}} (or {{{not jonny}}})|\n\n''Note:'' When you specify two"+" words, separated with a space, YourSearch finds all tiddlers that contain both words, but not neces"+"sarily next to each other. If you want to find a sequence of word, e.g. '{{{John Brown}}}', you need"+" to put the words into quotes. I.e. you type: {{{\"john brown\"}}}.\n\nUsing parenthesis you may change "+"the default \"left to right\" evaluation of the boolean search. E.g. {{{not (jonny or jeremy)}}} finds"+" all tiddlers that contain neither \"jonny\" nor \"jeremy. In contrast to this {{{not jonny or jeremy}}"+"} (i.e. without parenthesis) finds all tiddlers that either don't contain \"jonny\" or that contain \"j"+"eremy\".\n\n!'Exact Word' Search\nBy default a search result all matches that 'contain' the searched tex"+"t. E.g. if you search for {{{Task}}} you will get all tiddlers containing 'Task', but also '~Complet"+"edTask', '~TaskForce' etc.\n\nIf you only want to get the tiddlers that contain 'exactly the word' you"+" need to prefix it with a '='. E.g. typing '=Task' will find the tiddlers that contain the word 'Tas"+"k', ignoring words that just contain 'Task' as a substring.\n\n!~CaseSensitiveSearch and ~RegExpSearch"+"\nThe standard search options ~CaseSensitiveSearch and ~RegExpSearch are fully supported by YourSearc"+"h. However when ''~RegExpSearch'' is on Filtered and Boolean Search are disabled.\n\nIn addition you m"+"ay do a \"regular expression\" search even with the ''~RegExpSearch'' set to false by directly enterin"+"g the regular expression into the search field, framed with {{{/.../}}}. \n\nExample: {{{/m[ae][iy]er/"+"}}} will find all tiddlers that contain either \"maier\", \"mayer\", \"meier\" or \"meyer\".\n\n!~JavaScript E"+"xpression Filtering\nIf you are familiar with JavaScript programming and know some TiddlyWiki interna"+"ls you may also use JavaScript expression for the search. Just enter a JavaScript boolean expression"+" into the search field, framed with {{{ { ... } }}}. In the code refer to the variable tiddler and e"+"valuate to {{{true}}} when the given tiddler should be included in the result. \n\nExample: {{{ { tidd"+"ler.modified > new Date(\"Jul 4, 2005\")} }}} returns all tiddler modified after July 4th, 2005.\n\n!Com"+"bined Search\nYou are free to combine the various search options. \n\n''Examples''\n|!What you type|!Res"+"ult|\n|{{{!jonny !jeremy -%football}}}|all tiddlers with both {{{jonny}}} and {{{jeremy}}} in its tit"+"les, but no {{{football}}} in content.|\n|{{{#=Task}}}|All tiddlers tagged with 'Task' (the exact wor"+"d). Tags named '~CompletedTask', '~TaskForce' etc. are not considered.|\n\n!Access Keys\nYou are encour"+"aged to use the access keys (also called \"shortcut\" keys) for the most frequently used operations. F"+"or quick reference these shortcuts are also mentioned in the tooltip for the various buttons etc.\n\n|"+"!Key|!Operation|\n|{{{Alt-F}}}|''The most important keystroke'': It moves the cursor to the search in"+"put field so you can directly start typing your query. Pressing {{{Alt-F}}} will also display the pr"+"evious search result. This way you can quickly display multiple tiddlers using \"Press {{{Alt-F}}}. S"+"elect tiddler.\" sequences.|\n|{{{ESC}}}|Closes the [[YourSearch Result]]. When the [[YourSearch Resul"+"t]] is already closed and the cursor is in the search input field the field's content is cleared so "+"you start a new query.|\n|{{{Alt-1}}}, {{{Alt-2}}},... |Pressing these keys opens the first, second e"+"tc. tiddler from the result list.|\n|{{{Alt-O}}}|Opens all found tiddlers.|\n|{{{Alt-P}}}|Toggles the "+"'Preview Text' mode.|\n|{{{Alt-'<'}}}, {{{Alt-'>'}}}|Displays the previous or next page in the [[Your"+"Search Result]].|\n|{{{Return}}}|When you have turned off the 'as you type' search mode pressing the "+"{{{Return}}} key actually starts the search (as does pressing the 'search' button).|\n\n//If some of t"+"hese shortcuts don't work for you check your browser if you have other extensions installed that alr"+"eady \"use\" these shortcuts.//";config.shadowTiddlers["YourSearch Options"]="|>|!YourSearch Options|\n|>|<<option chkUseYourSearch>> Use 'Your Search'|\n|!|<<option chkPreviewText"+">> Show Text Preview|\n|!|<<option chkSearchAsYouType>> 'Search As You Type' Mode (No RETURN required"+" to start search)|\n|!|Default Search Filter:<<option chkSearchInTitle>>Title ('!')     <<option chk"+"SearchInText>>Text ('%')     <<option chkSearchInTags>>Tags ('#')    <<option chkSearchExtendedFiel"+"ds>>Extended Fields<html><br><font size=\"-2\">The fields of a tiddlers that are searched when you don"+"'t explicitly specify a filter in the search text <br>(Explictly specify fields using one or more '!"+"', '%', '#' or 'fieldname:' prefix before the word/text to find).</font></html>|\n|!|Number of items "+"on search result page: <<option txtItemsPerPage>>|\n|!|Number of items on search result page with pre"+"view text: <<option txtItemsPerPageWithPreview>>|\n";config.shadowTiddlers["YourSearchStyleSheet"]="/***\n!~YourSearchResult Stylesheet\n***/\n/*{{{*/\n.yourSearchResult {\n\tposition: absolute;\n\twidth: 800"+"px;\n\n\tpadding: 0.2em;\n\tlist-style: none;\n\tmargin: 0;\n\n\tbackground: #ffd;\n\tborder: 1px solid DarkGra"+"y;\n}\n\n/*}}}*/\n/***\n!!Summary Section\n***/\n/*{{{*/\n.yourSearchResult .summary {\n\tborder-bottom-width:"+" thin;\n\tborder-bottom-style: solid;\n\tborder-bottom-color: #999999;\n\tpadding-bottom: 4px;\n}\n\n.yourSea"+"rchRange, .yourSearchCount, .yourSearchQuery   {\n\tfont-weight: bold;\n}\n\n.yourSearchResult .summary ."+"button {\n\tfont-size: 10px;\n\n\tpadding-left: 0.3em;\n\tpadding-right: 0.3em;\n}\n\n.yourSearchResult .summa"+"ry .chkBoxLabel {\n\tfont-size: 10px;\n\n\tpadding-right: 0.3em;\n}\n\n/*}}}*/\n/***\n!!Items Area\n***/\n/*{{{*"+"/\n.yourSearchResult .marked {\n\tbackground: none;\n\tfont-weight: bold;\n}\n\n.yourSearchItem {\n\tmargin-to"+"p: 2px;\n}\n\n.yourSearchNumber {\n\tcolor: #808080;\n}\n\n\n.yourSearchTags {\n\tcolor: #008000;\n}\n\n.yourSearc"+"hText {\n\tcolor: #808080;\n\tmargin-bottom: 6px;\n}\n\n/*}}}*/\n/***\n!!Footer\n***/\n/*{{{*/\n.yourSearchFoote"+"r {\n\tmargin-top: 8px;\n\tborder-top-width: thin;\n\tborder-top-style: solid;\n\tborder-top-color: #999999;"+"\n}\n\n.yourSearchFooter a:hover{\n\tbackground: none;\n\tcolor: none;\n}\n/*}}}*/\n/***\n!!Navigation Bar\n***/"+"\n/*{{{*/\n.yourSearchNaviBar a {\n\tfont-size: 16px;\n\tmargin-left: 4px;\n\tmargin-right: 4px;\n\tcolor: bla"+"ck;\n\ttext-decoration: underline;\n}\n\n.yourSearchNaviBar a:hover {\n\tbackground-color: none;\n}\n\n.yourSe"+"archNaviBar .prev {\n\tfont-weight: bold;\n\tcolor: blue;\n}\n\n.yourSearchNaviBar .currentPage {\n\tcolor: #"+"FF0000;\n\tfont-weight: bold;\n\ttext-decoration: none;\n}\n\n.yourSearchNaviBar .next {\n\tfont-weight: bold"+";\n\tcolor: blue;\n}\n/*}}}*/\n";config.shadowTiddlers["YourSearchResultTemplate"]="<!--\n{{{\n-->\n<span macro=\"yourSearch if found\">\n<!-- The Summary Header ============================"+"================ -->\n<table class=\"summary\" border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">"+"<tbody>\n  <tr>\n\t<td align=\"left\">\n\t\tYourSearch Result <span class=\"yourSearchRange\" macro=\"yourSearc"+"h itemRange\"></span>\n\t\t&nbsp;of&nbsp;<span class=\"yourSearchCount\" macro=\"yourSearch count\"></span>\n"+"\t\tfor&nbsp;<span class=\"yourSearchQuery\" macro=\"yourSearch query\"></span>\n\t</td>\n\t<td class=\"yourSea"+"rchButtons\" align=\"right\">\n\t\t<span macro=\"yourSearch chkPreviewText\"></span><span class=\"chkBoxLabel"+"\">preview text</span>\n\t\t<span macro=\"yourSearch newTiddlerButton\"></span>\n\t\t<span macro=\"yourSearch openAllButton\"></span>\n\t\t<span macro=\"yourSearch lin"+"kButton 'YourSearch Options' options 'Configure YourSearch'\"></span>\n\t\t<span macro=\"yourSearch linkB"+"utton 'YourSearch Help' help 'Get help how to use YourSearch'\"></span>\n\t\t<span macro=\"yourSearch clo"+"seButton\"></span>\n\t</td>\n  </tr>\n</tbody></table>\n\n<!-- The List of Found Tiddlers ================="+"=========================== -->\n<div id=\"yourSearchResultItems\" itemsPerPage=\"25\" itemsPerPageWithPr"+"eview=\"10\"></div>\n\n<!-- The Footer (with the Navigation) ==========================================="+"= -->\n<table class=\"yourSearchFooter\" border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\"><tbody"+">\n  <tr>\n\t<td align=\"left\">\n\t\tResult page: <span class=\"yourSearchNaviBar\" macro=\"yourSearch naviBar"+"\"></span>\n\t</td>\n\t<td align=\"right\"><span macro=\"yourSearch version\"></span>, <span macro=\"yourSearc"+"h copyright\"></span>\n\t</td>\n  </tr>\n</tbody></table>\n<!-- end of the 'tiddlers found' case ========="+"================================== -->\n</span>\n\n\n<!-- The \"No tiddlers found\" case ================="+"========================== -->\n<span macro=\"yourSearch if not found\">\n<table class=\"summary\" border="+"\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\"><tbody>\n  <tr>\n\t<td align=\"left\">\n\t\tYourSearch Resu"+"lt: No tiddlers found for <span class=\"yourSearchQuery\" macro=\"yourSearch query\"></span>.\n\t</td>\n\t<t"+"d class=\"yourSearchButtons\" align=\"right\">\n\t\t<span macro=\"yourSearch newTiddlerButton\"></span>\n\t\t<span macro=\"yourSearch linkButton 'YourSearch Options'"+" options 'Configure YourSearch'\"></span>\n\t\t<span macro=\"yourSearch linkButton 'YourSearch Help' help"+" 'Get help how to use YourSearch'\"></span>\n\t\t<span macro=\"yourSearch closeButton\"></span>\n\t</td>\n  <"+"/tr>\n</tbody></table>\n</span>\n\n\n<!--\n}}}\n-->\n";config.shadowTiddlers["YourSearchItemTemplate"]="<!--\n{{{\n-->\n<span class='yourSearchNumber' macro='foundTiddler number'></span>\n<span class='yourSea"+"rchTitle' macro='foundTiddler title'/></span>&nbsp;-&nbsp;\n<span class='yourSearchTags' macro='found"+"Tiddler field tags 50'/></span>\n<span macro=\"yourSearch if previewText\"><div class='yourSearchText' macro='fo"+"undTiddler field text 250'/></div></span>\n<!--\n}}}\n-->";config.shadowTiddlers["YourSearch"]="<<tiddler [[YourSearch Help]]>>";config.shadowTiddlers["YourSearch Result"]="The popup-like window displaying the result of a YourSearch query.";config.macros.search.handler=_158;var _20c=function(){if(config.macros.search.handler!=_158){alert("Message from YourSearchPlugin:\n\n\nAnother plugin has disabled the 'Your Search' features.\n\n\nYou may "+"disable the other plugin or change the load order of \nthe plugins (by changing the names of the tidd"+"lers)\nto enable the 'Your Search' features.");}};setTimeout(_20c,5000);abego.YourSearch.getStandardRankFunction=function(){return _100;};abego.YourSearch.getRankFunction=function(){return abego.YourSearch.getStandardRankFunction();};abego.YourSearch.getCurrentTiddler=function(){return _13d;};abego.YourSearch.closeResult=function(){_12b();};abego.YourSearch.getFoundTiddlers=function(){return _f3;};abego.YourSearch.getQuery=function(){return _f4;};abego.YourSearch.onShowResult=function(_20d){highlightHack=_f4?_f4.getMarkRegExp():null;if(!_20d){_13e.setItems(_f7());}if(!_125){_125=createTiddlyElement(document.body,"div",_122,"yourSearchResult");}else{if(_125.parentNode!=document.body){document.body.appendChild(_125);}}_147();highlightHack=null;};})();}
//%/
<!--
{{{
-->
<span macro="yourSearch if found">
<!-- The Summary Header ============================================ -->
<table class="summary" border="0" width="100%" cellspacing="0" cellpadding="0"><tbody>
  <tr>
	<td align="left">
		YourSearch Result <span class="yourSearchRange" macro="yourSearch itemRange"></span>
		&nbsp;of&nbsp;<span class="yourSearchCount" macro="yourSearch count"></span>
		for&nbsp;<span class="yourSearchQuery" macro="yourSearch query"></span>
	</td>
	<td class="yourSearchButtons" align="right">
		<span macro="yourSearch chkPreviewText"></span><span class="chkBoxLabel">preview text</span>
		<!-- <span macro="yourSearch newTiddlerButton"></span> -->
		<span macro="yourSearch openAllButton"></span>
		<span macro="yourSearch linkButton 'YourSearch Options' options 'Configure YourSearch'"></span>
		<span macro="yourSearch linkButton 'YourSearch Help' help 'Get help how to use YourSearch'"></span>
		<span macro="yourSearch closeButton"></span>
	</td>
  </tr>
</tbody></table>

<!-- The List of Found Tiddlers ============================================ -->
<div id="yourSearchResultItems" itemsPerPage="25" itemsPerPageWithPreview="10"></div>

<!-- The Footer (with the Navigation) ============================================ -->
<table class="yourSearchFooter" border="0" width="100%" cellspacing="0" cellpadding="0"><tbody>
  <tr>
	<td align="left">
		Result page: <span class="yourSearchNaviBar" macro="yourSearch naviBar"></span>
	</td>
	<td align="right"><span macro="yourSearch version"></span>, <span macro="yourSearch copyright"></span>
	</td>
  </tr>
</tbody></table>
<!-- end of the 'tiddlers found' case =========================================== -->
</span>


<!-- The "No tiddlers found" case =========================================== -->
<span macro="yourSearch if not found">
<table class="summary" border="0" width="100%" cellspacing="0" cellpadding="0"><tbody>
  <tr>
	<td align="left">
		YourSearch Result: No tiddlers found for <span class="yourSearchQuery" macro="yourSearch query"></span>.
	</td>
	<td class="yourSearchButtons" align="right">
		<!-- <span macro="yourSearch newTiddlerButton"></span> -->
		<span macro="yourSearch linkButton 'YourSearch Options' options 'Configure YourSearch'"></span>
		<span macro="yourSearch linkButton 'YourSearch Help' help 'Get help how to use YourSearch'"></span>
		<span macro="yourSearch closeButton"></span>
	</td>
  </tr>
</tbody></table>
</span>


<!--
}}}
-->
*combines textual alignment output of several reference sets (several paralogous blocks from one species) via resorting
*helps to avoid false positive ortholog assignments
*creates a registry configuration file out of a simple list of species database access data in tabular format.
<html><pre>
~> doBlastJobs.pl --help
SynBlast-0.02
doBlastJobs.pl's Time-stamp: <2008-03-27 16:30:58 joe>
see http://www.bioinf.uni-leipzig.de/Software/SynBlast/ for updates.
Usage:
    doBlastJobs.pl [-dDatabaseName] [-sAlternativeDatabaseFiles]
    [-eQueryDir] [-rResultDir] [-ce-value_CutOff] [-taddQuotedBlastParam]
    [-n] [-o] [-a] [--help] [--version] protein.info-file

Options:
    -d Database_Name [String]
         default = Homo_sapiens

    -e QueryDir [String]
         look for query sequences in QueryDir

         default is "infoFile_name" with suffix 'dir'

    -s Alternative_Database_Files [String]
         use alternative db files

         default is
         "/scr/tequilla/genomes/DNA/vertebrata/${DBname}/chr\*.fa"

    -o
         overwrite flag: existing blastresults are ignored

    -n
         noPBSflag: ignore available pbs-system, use getFreeHost variant
         getFreeHost version needs ssh1-compatible id_keys and set up
         ssh-agent for ssh without need for password or private key input;
         to achieve this, the command is: eval `ssh-agent`; ssh-add;

    -a each query is blasted separately on a free remote host (using
    getFreeHost.pl and ssh with key-identification (is always done if -n
    param set (no pbs)), or scheduled by an available openPBS queuing system
    (start from within a pbs server necessary for this)
         (default otherwise: all query sequences are searched in one local
         blast-run)

    -r ResultDir [String]
         write blastresults to ResultDir. default is
         {QueryDir}/{BlastProgram_Name}

    -c E-value_CutOff [String]
         default is "1e-10"

    protein.info-file [String]
         The reference info file containing the query names.

</pre></html>
<html><pre>
~> doSyntenyAlignment.pl --help
SynBlast-0.02
doSyntenyAlignment.pl's Time-stamp: <2008-06-16 14:27:21 joe>
see http://www.bioinf.uni-leipzig.de/Software/SynBlast/ for updates.
Usage:
    doSyntenyAlignment.pl -i|infoFile=Protein.InfoFile

    [-sortByRatio=0|1|2|3] [-h|htmlFile=ResultHtmlFile]
    [-txtFile=ResultTxtFile] [-n|number=NumberOfResultsInHTML]
    [-r|refFields=comma-separated-ploci-fields]
    [-p|plociFields=comma-separated-ploci-fields]
    [-q|qlociFields=comma-separated-qloci-fields]
    [-e|compara[=EnsEMBL_DB_init file]] [-comparaAll] [-globalRank]
    [-printColors] [-showAllRegions] [-s|mean]

    [-blastDir=tblastnSourceDir]
    [-blastFilePraefix=AlternativeBlastFilePraefix] [-wublast]

    [-c|sCutOff=CutoffBitscore] [-o|protOverlap=MaxProteinOverlap]
    [-l|lociSizeFactor= LociSizeFactor] [-mLociSize=MaxGlobLociSize]
    [-g|gapCosts=gapCost(s)] [-m|mismatchCost=MismatchCost]
    [-t|misOriPenalty=PenaltyFactorMisorientation]

    [-noRelScore] [-maxQlociDist=distance]

    [-ensemblHost=EnsEMBL_DB_host] [-ensemblUser=EnsEMBL_DB_user]

    [-v|verbose] [--help] [--manual] [--version]

    [[-deepChaining]] [[-snumber=NumberOfResultsPerSpeciesInHTML]]
    [[-trackerInputFile=TrackerInputFile]]
    [[-trackerN=NumberOfExonPerSpecies]]
    [[-trackerFlankS=NumberOfNucleotidesToAdd]]

    SyntenyBlasthitFile(s)

Arguments:
    -i|infoFile= protein.info-file [String]
         specifies the annotation file containing sequence features
         (proteins) to be used as reference loci during alignment (reference
         gene order). For Ensembl genomes, getEnsemblProteins.pl performs
         the retrieval automatically. The format is a tab-separated list of
         features describing each protein-coding gene of the set, one per
         line. Definition of columns (column names separated by comma) and
         some more annotation descriptors have to be specified in the head,
         see following example:

           # protein.info file manually generated
           #!organism=Branchiostoma
           #!coordsystem=scaffold
           #!seqregion=scaffold_89
           #!from=1
           #!to=650000
           #!strand=1
           #!focalgene=89000016
           #!columns=startPos,endPos,geneName,protID,ori,geneID,numExons,protLength
           42268   52505   gene1       fgenesh2_pm.scaffold_89000001   -1      89000001        3       592
           136667  137756  gene2       fgenesh2_pg.scaffold_89000006   1       89000006        2       121
           139176  141632  -       fgenesh2_pg.scaffold_89000007   -1      89000007        5       452
           147110  150418  -       fgenesh2_pg.scaffold_89000009   -1      89000009        1       1103
           #testcomment
           163582  175636  -       fgenesh2_pg.scaffold_89000011   1       89000011        15      649
           ...

    SyntenyBlasthitFile(s)
         The (syntenic) blast hit files to process. Each file is later
         displayed as an alignment to the reference proteins. These files
         should be automatically generated using doSyntenyFilter.pl out of
         raw blast results in tabular format (either NCBI or WUBLAST
         format). The syntenic blast hit files are expected in NCBI-like
         tabular format.

Options:
         -sortByRatio[=0|1|2|3]
               To specify the use of ratio sum scores (sum of ratios of intra-/inter-scores), 
               instead of the gene order alignment score, as sorting/ranking criterium for evaluated synteny regions.
               Note that only finally assigned (i.e. assigned in the optimal gene order alignment selected) target loci 
               are taken into account when calculating the alternative scores of a synteny region.
               This can help to better distinguish between orthologs and paralogs.

                      0=off,default (sort by gene order alignment score)
                      1=ratioSum       (sum of ratios)
                      2=logRatioSum    (sum of logarithmized ratios)
                      3=focalRatioSum  (sum of ratios weighted with the distance to the focal gene position)

         -h|htmlFile= ResultHtmlFile [String]
               To output the ranked gene order alignments as tables in html format to the specified file 
               (this also creates a subdirectory for dotplot and alignment graphics as well as assembled blast hits)

         -txtFile= ResultTxtFile [String]
               To output the ranked gene order alignments as tables in txt format (tab-delimited) to the specified file

         -n|number= NumberOfResultsInHTML [Integer]
               To limit the number of displayed results in html file.
               This can be used e.g. to only look at the results of  the 10 best evaluated target regions.
               default = 0
               (no limit, i.e. each candidate region is displayed as result, as long as there was any assignment of a target locus possible)

         -r|refFields= comma-separated-ploci-fields [String]
               To select custom p-loci-data columns displayed/used for the reference overview table in the HTML file
               Note: Column names have to correspond to those used within the annotation file.
        
               default is: "geneName,protID,transID,geneID,protName,chr,startPos,endPos,meanPos,ori,numExons,protLength"
 
               standard/possible field names are (column names created by L<getEnsemblProteins.pl>): 
                      chr
                      startPos
                      endPos
                      meanPos (added automatically, if mean flag set)
                      protID
                      transID
                      geneID
                      ori
                      protLength
                      protName
                      numExons
                      geneName

         -p|plociFields= comma-separated-ploci-fields [String]
               To select custom ploci-data columns displayed/used for the detailed alignment table in the HTML file
               default is: "protID,geneName,optQloci";
               possible field names are:
                      the same names as for the B<-r|refFields=> option +
                      optQloci

         -q|qlociFields= comma-separated-qloci-fields [String]
               To select custom qloci-data columns displayed/used for the detailed alignment table in the HTML file
               default is: "score,chr,startPos,endPos,ori,hits,queryCov,meanIdentity,hitsLength,intra_inter";
               possible field names are:
                      score
                      ori
                      startPos
                      endPos
                      meanPos (is displayed automatically, if mean flag set)
                      chr
                      queryCov
                      meanIdentity
                      hitsCount
                      hitsLength
                      hits
                      compara (is displayed automatically, if compara flag set)
                      globalRank (is displayed automatically, if globalRank flag set)
                      intra_inter (is displayed automatically, if sortByRatio flag set)

         -e|compara[=EnsEMBL_DB_RegistryInitFile [String]]
               Flag to enable retrieval and display of Compara results for assigned focal gene loci, 
               i.e. if the target assignment for the focal reference gene (only shown in result overview table) is according to the orthology prediction of the Ensembl Compara database 
               (see 'compara' field in tables).
               Additionally, sequences of Compara-annotated proteins (comparaHits) as well as yet-unannotated (w.r.t. Compara) proteins within the assigned target interval are saved as 
               fasta files into the subdirectory I<<geneID>-homologs>
               Optionally, one can here specify a user-configured Ensembl_DB_RegistryInitFile for use of local Ensembl databases (mysql).
               See http://www.ensembl.org/info/using/api/registry/index.html about the format of such a configuration file.

         -comparaAll
               Flag to enable display of Compara comparison/result for each assignment in the detailed alignment table.

         -globalRank[=NumberOfBestHitsToReport [Integer]]
               Flag to enable the retrieval of globally best hits and display of rank number for each assignment
               (see column 'globalRank' in the detailed alignment table)

         -printColors
               Flag to use printer-friendly colors for all graphics in HTML file
               (at the moment, only the dotplot graphics is created in a second version colored black and white.)

         -showAllRegions
               Flag to display results for all input regions (even if no alignment/target locus is available); 
               By default, regions with no alignment score are not displayed.

         -blastDir= tblastnSourceDir [String]
               To specify the directory containing the appropriate tblastn result files,
               needed for the retrieval of the global-best-hit ranks (see option L<-globalRank>).
               The format of file names for the tblastn result files has to be either "QueryID.<SpeciesName>.blastresult" (by default)
               or "<BlastFilePraefix>.<SpeciesName>.blastresult" (if <BlastFilePraefix> is set).
               default = "tblastn" 

         -blastFilePraefix= BlastFilePraefix [String]
               To specify an alternative blast file praefix and not to look for query specific blast result files,
               but a file named "<BlastFilePraefix>.<SpeciesName>.blastresult"
               Needed for the retrieval of the global-best-hit ranks (see option L<-globalRank>).
               default = undef 
               (There is one query specific blast result file for every single query sequence, named "QueryID.<SpeciesName>.blastresult"

         -wublast
               Flag to use raw blastresults in WU-BLAST tabular format (instead of NCBI format)
               (only relevant for the raw blast results needed for the globalRank option and the selfscore calculation!)

         -c|sCutOff= CutoffBitscore [Integer]
               To set the minimum bitscore that has to be reached by any assembled blast hit to be considered as target locus.
               default = 50  

         -o|protOverlap= MaxProteinOverlap [Integer]
               To set the maximal amount of positions that neighbored tblastn hits may overlap on the query site to still be considered as 'consistent'.
               default = 30 
               (amino acid positions) 

         -l|lociSizeFactor= LociSizeFactor [Float]
               To specify the maximal length allowed for a target locus, relative to the query's range.
               default = 2.0 
               (i.e. twice of the query's range/size is used to restrict the length of a target locus;
                3 or 4 may be a better factor not to miss some more distant exon hits for an assembled hit in some cases)

         -mLociSize= MaxGlobLociSize [Integer]
               To specify a maximally allowed size (genomic extension) for valid target loci 
               default = 0 (not set)
               if set, the maximal size is restricted, but may be even smaller depending on parameter I<-l> (LociSizeFactor)

         -g|gapCosts= gapCost [String]
               To specify the gap costs for the gene order alignment, 
               (better to speak of gap scores, as values should be negative here!)
               default = "-2e1:-2e1" (gapP[:gapQ])
               Note: It is possible to specify gap costs for insertions in the target sequence of loci (gapP, i.e. gaps in the reference sequence of loci),
                     separately from the gap costs for gaps within the sequence of target loci (gapQ).

         -m|mismatchCost= MismatchCost [String]
               To specify the score (cost) for a mismatch within gene loci alignment.
               Note: This value should be relatively/highly negative in relation to usually occuring match scores and gap scores, 
               to simply not allow mismatches in optimal alignments!
               default = -1000

         -t|misOriPenalty= PenaltyFactorMisorientation [Integer]
               To specify the fraction of the matching score that is used in case of misorientated loci matching within the alignment; 
               default = 90 (in percent)

         -maxQlociDist= distance [String]
               To set the maximal distance between neighbored target loci that are not marked orange/black in the dotplot graphics. 
               (This is just to identify biologically more meaningful blocks of contigous target hits more easily, in case of large-sized synteny regions.)
               default = 500000 nt
               (use 0 for the maximal distance between neighbored reference loci multiplied with the <LociSizeFactor>)

         -rlociSizeFactor= RefLociSizeFactor [Float]>
               The LociSizeFactor for the reference-score retrieval (needed for selfscore, intra/inter-scores calculations) can be specified, separately.
               default = 2.0
 
               Note: The other parameters used to obtain the best and second best within-reference scores (as needed for the blast-score normalization 
               as well as the intra/inter-score calculations) are fixed: sCutoff=0; protOverlap=40; mLociSize=0.

         -noRelScore
               Flag to disable the use of relative scores for alignment calculations
               default is: the calculated relative score will be used for alignment calculations 
               Note: This is only possible if within-reference blast hit data is available for all reference protein queries. 
                     Otherwise those reference entries will have to be removed from the reference set, manually.

  rarely used options:
         -ensemblHost= EnsEMBL_DB_Hostname [String]
         -ensemblUser= EnsEMBL_DB_Username [String]
         -s|mean
               Flag: using the mean CDS(annotation)/HSP(blasthit) position as sort index
               (default is: using the start and end positions and combine overlapping loci)

         -v|verbose
               verboseFlag: prints intermediate results verbosely (not recommended)

         -snumber= NumberOfResultsPerSpeciesInHTML [Integer]
               To limit the number of displayed results for each species in html file. [experimental]
               default = 0
               (no limit)

         -trackerInputFile= TrackerInputFile [String]
               generates inputfile for use with the Tracker program [experimental]

         -trackerN= NumberOfExonPerSpecies [Integer]
               number of genes per species to write to tracker input file, 
               default = 0 (no tracker input is generated at all)

         -deepChaining [experimental]
               Flag to use the recursive version considering all possible combinations of HSPs maximizing the assembled hit 
               w.r.t. query overlap size, range factor, and score cutoff parameters (not recommended)
               default is: using an alignment based approach relying on consistent overlappings of putative exon matches! 
               (faster but might miss some HSPs due to overlap with insignificant HSPs) 


</pre></html>
<html><pre>
~> doSyntenyFilter.pl --help
SynBlast-0.02
doSyntenyFilter.pl's Time-stamp: <2008-06-16 14:30:00 joe>
see http://www.bioinf.uni-leipzig.de/Software/SynBlast/ for updates.
Usage:
    doSyntenyFilter.pl [-d DBname] [-e Ensembl_DB_Version_String] [-r
    Blastresult_Source_Directory] [-a BlastFilePraefix] [-q MinQueryPercent]
    [-Q MinQueryNumber] [-f SizeFactor] [-F MaxAbsoluteSize] [-w
    Region_Destination_Directory] [-o (WriteResultFlag) ] [-n
    MaxResultsPerCtgToWrite] [-g MaxResultsToWrite] [-c ScoreThreshold] [-i
    MaxOverlapPercent] [-W (WU-BLAST_Flag) ] [-Rchr/contig] [-s
    (disableUseOfScoreFlag) ] [-G SlidingWindowStepSizeParam]

    [--help] [--version] protein.info-File

Options:
    -d DBname [String]
          To specify the name of the target species (or database name).
          This item is used to select the appropriate blast result files of type "[QueryID|<BlastFilePrefix>].<DBname>.blastresult".
          default = Homo_sapiens 

    -e Ensembl_DB_Version_String [String]
          To specify the Ensembl version of the target species database, e.g. "aug2006" for the Ensembl release 46.
          This is optional but recommended if Ensembl databases are used. Evaluated target regions are then correctly linked to
          the entries of the appropriate Ensembl archive web site.
          Note: Database versions of reference and target species data as well as the used Ensembl API version should be the same! 
          default = "dec2006"

    -r Blastresult_Source_Directory [String]
          To specify the directory containing the appropriate blast result files, e.g. "/scratch/joe/tblastn"
          The format of file names for the blast result files has to be either "QueryID.<DBname>.blastresult" (by default)
          or "<BlastFilePraefix>.<DBname>.blastresult" (if <BlastFilePraefix> is set).
          default = "tblastn"

    -a BlastFilePraefix [String]
          To specify an alternative blast file praefix and not to look for query specific blast result files,
          but a file named "<BlastFilePraefix>.<DBname>.blastresult"
          default = undef 
          (There is one query specific blast result file for every single query sequence, named "QueryID.<DBname>.blastresult"

    -q MinQueryPercent [Integer]
          To specify the Minimum-Query-Number constraint in percent (i.e. the number of query-specific HSPs to be contained
          in a reported candidate region at minimum, given in percent relative to the number of total query proteins in the reference set).
          Note that the maximum of both resulting values (L<MinQueryPercent> and L<MinQueryNumber>) is used as final QueryNumber constraint!
          default = 0 
          (i.e. at least hits from L<MinQueryNumber> different queries are necessary for a region to be reported.)

    -Q MinQueryNumber [Integer]
          To specify the Minimum-Query-Number constraint as absolute number (i.e. the number of query-specific HSPs to be contained
          in a reported candidate region at minimum).
          Note that the maximum of both resulting values (L<MinQueryPercent> and L<MinQueryNumber>) is used as final QueryNumber constraint!
          default = 2 
          (i.e. hits from at least two different reference proteins are necessary for a region to be reported.)
 
    -f SizeFactor [Float]
          To specify the maximal length allowed for a candidate syntenic target region, relative to the reference block's size.
          Depending on the size differences between reference and target genome and its distribution of genes, 
          this parameter should be adapted.
          default = 2.0 
          (i.e. twice of the original reference's size, depending on the positions/range of genes, is used to restrict 
          the length of reported synteny regions)

    -F MaxAbsoluteSize [Integer]
          To specify the maximal length allowed for a candidate syntenic target region in absolute numbers (in nts).
          Note that the minimum of both resulting sizes (L<SizeFactor>-based size and L<MaxAbsoluteSize>) 
          is used as the final MaxLength constraint
          default = 0 
          (i.e. not set/disabled) 

    -w Region_Destination_Directory [String]
          To specify where to save the extracted candidate regions (blast result files).
          default is the subdirectory with the name of the <protein.info-file> + ".syntenyRegions"

    -o
          Flag to enable the output of all candidate regions to files in L<Region_Destination_Directory>.
          default = not set
          (i.e. by default no output to any files)

    -n MaxResultsPerChromosomeToWrite [Pos. Integer]
          To specify the number of regions for each target chromosome/contig to be reported at maximum.
          default = 100
          (i.e. only the first best 100 candidate regions per chromosome/contig, sorted according to the sum of 
          maximum bitscores of all HSPs for each different query, are written to files/displayed)

    -g MaxResultsInTotalToWrite [Pos. Integer]
          To specify the number of regions in total to be reported at maximum. Sorting of candidate regions is again 
          according to the sum of query-specific bitscores (unless old version, with option -s is used).
          Note: This option has no function if the non-score version (option -s) is used.
          default = 0
          (i.e. no restriction, only the number of regions per chromosome/contig is restricted then)
 
    -c ScoreThreshold [Integer]
          To specify the bit-score value that a single HSP must reach to be considered for the score-based selection
          e.g. 50. In general there is no need to change the default. This option could be used to eliminate regions with spurious hits,
          still experimental.
          default = 0 

    -i MaxOverlapPercent [Integer]
          To specify the maximally allowed overlap size in percent for lower-scoring overlapping result regions.
          Regions overlapping more than this fraction in size with an already/previously extracted candidate region 
          are simply ignored.
          default = 25
          (i.e. up to 25 percent of reported candidate regions' sizes may be overlapping by default)

    -W
          Flag to use tabular blastresults in WU-BLAST format (different columns and orders). 
          Note: output (synteny candidate regions) are always in a NCBI-BLAST-like tabular format!

    -R Chromosome/Contig [String]
          To restrict the search/extraction on only a certain chromosome/contig [experimental]
          default = undef

    -s
          Flag to disable the use of score-based selection.
          (use of old filter version instead which does not take any score values into account; not recommended!)
 
    -G SlidingWindowStepSizeParam [Integer]
          To set indirectly the stepSize for the sliding window method: referenceSize/param => stepSize, 
          i.e. high values for this parameter increase the number of region-windows calculated for each target sequence
          default = 100. [experimental]

Arguments:
         protein.info-file [String]
               The reference info file to use.
               It specifies the annotation file containing the sequence features (proteins) to be used as reference syntenic region.
               For Ensembl genomes, L<getEnsemblProteins.pl> performs the retrieval/creation of such a file automatically.
               The format is a tab-separated list of features describing each protein-coding gene of the set, one per line. 
               Definition of columns (column names separated by comma) and some more annotation descriptors have to be specified in the head,
               see the following example:

                # protein.info file manually generated
                #!organism=Branchiostoma
                #!coordsystem=scaffold
                #!seqregion=scaffold_89
                #!from=1
                #!to=650000
                #!strand=1
                #!focalgene=89000016
                #!columns=startPos,endPos,geneName,protID,ori,geneID,numExons,protLength
                42268   52505   gene1   fgenesh2_pm.scaffold_89000001   -1      89000001        3       592
                136667  137756  gene2   fgenesh2_pg.scaffold_89000006   1       89000006        2       121
                139176  141632  -       fgenesh2_pg.scaffold_89000007   -1      89000007        5       452
                147110  150418  -       fgenesh2_pg.scaffold_89000009   -1      89000009        1       1103
                #testcomment
                163582  175636  -       fgenesh2_pg.scaffold_89000011   1       89000011        15      649
                ...


</pre></html>
//{{{
~> getBestBlastHit.pl --help
SynBlast-0.02
getBestBlastHit.pl's Time-stamp: <2008-03-27 16:30:37 joe>
see http://www.bioinf.uni-leipzig.de/Software/SynBlast/ for updates.
Usage:
    getBestBlastHit.pl [-iProtein.InfoFile] [-ccutoff_bitscore]
    [-oMax_ProteinOverlap] [-h(EnsEMBL_)OrganismName] [-rChr_Contig]
    [-nNumberOfLevels] [-aAlternativeBlastFile] [-W WU-BLAST_Flag] [-v]
    [-stblastn-sourceDIR] [-lSizeFactor] [-mMaxRegionSize] [-e]
    [-jEnsEMBL_DB_init file] [--help] [--version] [Blast-QueryIDs (e.g.
    ENSP000xxxxx)]

Options:
    -i Protein.InfoFile [String]
    -c Cutoff_bitscore [Float]
         default=0

    -o Max_ProteinOverlap [Integer]
         in amino acids, default=30

    -h (EnsEMBL_)OrganismName [String]
         default is Homo_sapiens

    -r Chromosome/Contig [String]
         restrict search only within certain chromosome/contig

         default is: best blast hit of all is found (regardless which
         chr/contig on)

    -n NumberOfLevels [Integer]
         prints more than only the first best blast hit(s)

         default is: 1 (only the best assembled blast hit/loci is listed)

    -a AlternativeBlastFileName [String]
         specifies in which file to look for blasthits.

         default is: ${blastQID}*${organismN}.blastresult

    -W   for use of tabular blastresults in WU-BLAST format (different
         columns and orders).

    -v
         VerboseFlag: prints results verbosely

    -s tblastn-sourceDIR [String]
         specify the source dir for the tblastn-result-files to be used
         (default is: ./tblastn)

    -l SizeFactor [Integer]
         specify a multiple of the reference cds range/size allowed for
         resulting assembled blast hits (default is: 2)

    -m MaxRegionSize [Integer]
         specify a maximal allowed size (genomic extension) for allowed
         assembled blast hit loci (default is 0 (not set)), if set, the
         maximal size is restricted, but may be even smaller depending on
         parameter -l (SizeFactor)

    -e
         Flag: check if result for reference gene is according to
         Orthology-Annotation of EnsEMBL-Compara database

    -j EnsEMBL_DB_init file [String]
         only if -e option set; set optional ensembl database init file

         default = automatic retrieving via 'ensembldb.ensembl.org'

         see http://www.ensembl.org/info/software/registry/index.html

    -w
         Flag: using all queryIDs out of info-file, regardless which
         queryIDs are submitted via command line

    Blast-QueryID(s)
         The queryIDs to use to obtain the best assembled blastHit for. (if
         missing, the reference protein ID(s) are used automatically)

//}}}
<html><pre>
~> getEnsemblProteins.pl --help
SynBlast-0.02
getEnsemblProteins.pl's Time-stamp: <2008-03-27 16:30:21 joe>
see http://www.bioinf.uni-leipzig.de/Software/SynBlast/ for updates.
Usage:
    getEnsemblProteins.pl [-fFlankingSize] [-nMaxNumberOfFlankingProteins]
    [-iIntervalStart[:IntervalEnd]_position] [-lcontig/chromosome]
    [-dProteinDir] [-hEnsEMBL_OrganismName] [-cEnsEMBL_DB_init file]
    [-xEnsemblVersionDate] [-eEnsEMBL_DB_host] [-uEnsEMBL_DB_user] [-s] [-o]
    [--help] [--version] EnsEMBL_ID(s)

Options:
    -f FlankingSize [String]
         flanking size around selected gene, default=1e6

    -i IntervalStart[:IntervalEnd]_position [String]
         additionally, sequence interval can be specified (start and end
         positions) containing hopefully selected gene, default=not used;
         the flanking size param is then used to limit the max size of the
         interval to search on (started from start position of interval)

    -l chromosome/contig [String]
         given a chromosome/contig name in combination with sequence
         interval (option -i), it displays only the proteins within the
         interval and does not save/download anything

    -n MaxNumberOfFlankingProteins [Integer]
         Maximum number of flanking genes for target gene to be used
         (default=0 => all within flanking size or sequence interval are
         used).

    -d proteinDir [String]
         save fasta files in proteinDir default proteinDir is
         {geneID}_{flankS}.protein.dir

    -h EnsEMBL_OrganismName [String]
         default is Homo_sapiens

         the correspondent database for the API release (e.g. 36) is then
         chosen automatically or as specified in EnsEMBL_DB_init file.

    -c EnsEMBL_DB_init file [String]
         default behaviour => automatic retrieving via
         'ensembldb.ensembl.org'

         see http://www.ensembl.org/info/software/registry/index.html

    -x Ensembl-DB-Version-String [String]
         e.g. "aug2006" (default: "dec2006")

    -s
         downloads/displays all coding transcripts within region, even if
         overlapping (for manually editing) (default is: only the longest
         protein-transcript for each overlapping transcript groups and
         strand is downloaded, and further transcripts are only displayed as
         comment (#))

    -o
         additionally download protein sequences as fasta files (only
         entries that are not comment out are used)

    EnsEMBL_ID(s)
         The gene ID(s) to use.

</pre></html>
getFreeHosts.pl
*helper utility for ssh-connectable network of unix machines (such as our local bioinf network) to get a free host to start blast searches on
*requires automatic ssh1-authentication via public key.
orgs.blasterei.sh
*helps to automatize blast searching for several reference sets and several genomes
Usage (defaults in []):
{{code{"""orgs.blasterei.sh infoFileFilter[ENSG] (orgDirs[_]) (refProtDir[../proteins]) (blastResultDir[./tblastn]) (evalueCutOff[1e-5]) (addParam)"""}}}
*helps to automatize the syntenyAlignment procedure for several reference sets and several genomes

Usage (defaults in []):
{{code{"""orgs.synAligning.sh infoFileFilter[ENSG] (orgDirs[_]) (minQN[3]) (sCutOff[50]) (addParam1) (addParam2) (dirForCombinedOrgs)"""}}}
*automatizes the syntenyFiltering procedure for several reference sets and several genomes

Usage (defaults in []):
{{code{"""orgs.synFiltering.sh infoFileFilter[ENSG] (orgDirs[_]) (minQN[4]) (tblastDir[./tblastn]) (addParam1)"""}}}

!!separateBlastResults.pl
*creates multiple blastresult files out of a single one, separation is done by query name.
Usage: {{code{"""separateBlastResults.pl inputfile resultSuffix [sepIdx outdir]"""}}}
Within the following Blast step, each reference protein is blast-searched in translated mode against selected target genome databases.
Results for a reference file should be available in standard tabular blast output format (blastall output param {{code{''-m8''}}}), either in separate files for each query protein or altogether in one blast result file, but in both cases separated by target species names.

In order to work with the next tool of the pipeline ({{code{[[doSyntenyFilter.pl|doSyntenyFilterUsage]]}}}), blastresults should be named
*{{code{"""ProteinID.Species_name.blastresult"""}}} (for the single protein case) and
*{{code{"""myReferenceSet_Name.Species_name.blastresult"""}}} (for the one-file result version),
respectively.

Procedure with the provided script {{code{[[doBlastJobs.pl|doBlastJobsUsage]]}}} is as follows:
{{codeblock{
"""$ doBlastJobs.pl -d"""''Homo_sapiens''""" -s/scr/k10/genomes/EnsEMBL42/homo_sapiens/homo_sapiens.dna_rm.chromosome[.log] """<html>\<br/></html>"""-e"""''./proteins/''""" -r"""''./tblastn/''""" -c"""''1e-5''""" -t"""''"-f999 -gF -W4"''""" """<html>\<br/></html>"""Tbx2_ENSMUSG00000000093_5e5.protein.info"""}}}
Parameter settings are:
*''-d'' to specify the target species name
*''-s'' to specify the target species database(s) (dummy-"{{code{.log}}}"-files and {{code{/pathToDatabaseDir/*.log}}} can be used to select several databases for one species)
*''-e'' to specify the query protein source directory
*''-r'' to specify the blastresult destination directory
*''-c'' to specify blast-evalue cutoff
*''-t'' to add further BLAST parameters (quoted!, here {{code{-t"-f999 -gF -W4"}}}) <html>Note, that these Blast parameter settings are not very sensitive, and are used here only for demonstration purposes; short explanation:<br/></html>
**"-g F ",   ### ungapped style of alignment (default is gapped alignment!)
**"-f 999 ", ## neighborhood word threshold score (default is 13) -> high value removes neighborhood words and makes seeding require matching words (-> less sensitiv but extremely faster)
**"-W 4 ", ## a more stringent word size (default is 3))
A reference annotation file (here ''"""Tbx2_ENSMUSG00000000093_5e5.protein.info"""'') is required as argument.

This blast step is performed for every target species (genome) that should be part of the final analysis, but normally at least the reference species genome itself (also due to normalization reasons).

The step for the mouse genome could be done like this:
{{codeblock{
"""$ doBlastJobs.pl -d"""''Mus_musculus''""" -s/scr/k10/genomes/EnsEMBL42/mus_musculus/mus_musculus.dna_rm.chromosome[.log] """<html>\<br/></html>"""-e"""''./proteins/''""" -r"""''./tblastn/''""" -c"""''1e-5''""" -t"""''"-f999 -gF -W4"''""" """<html>\<br/></html>"""Tbx2_ENSMUSG00000000093_5e5.protein.info"""}}}

Of course, these procedures can also be done by manual {{code{blastall}}} commands, or even using another Blast-like tool such as [[BLAT| http://genome.ucsc.edu/FAQ/FAQblat.html]] or [[WU-BLAST|http://blast.wustl.edu/]]. However, the same tabular output format is assumed in subsequent steps, hence individual advantages (such as automatic exon assembly) of other tools cannot be considered, yet. 

The resulting blast-hits produced by the commands from above for our example are then listed in the following files in tabular format (one-result-file-per-genome version):
[[tblastn/Tbx2_ENSMUSG00000000093_5e5.protein.info.Homo_sapiens.blastresult|./TBX2_tutorial/tblastn/Tbx2_ENSMUSG00000000093_5e5.protein.info.Homo_sapiens.blastresult]]
[[tblastn/Tbx2_ENSMUSG00000000093_5e5.protein.info.Mus_musculus.blastresult|./TBX2_tutorial/tblastn/Tbx2_ENSMUSG00000000093_5e5.protein.info.Mus_musculus.blastresult]]