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, #backstageArea {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
!What is the information content of this image?
''50 pixels x 50 pixels, values = 1 or 0''  [img[01/Rand1x.png]]
!!!
!What is the information content of this image?
''50 pixels x 50 pixels, values = 1 or 0'' [img[01/Rand2.png]]
!!!
''Measure information content by file size:''
<html>
<img src="01/Rand1x.png" style="height:200px">
<img src="01/Rand2.png" style="height:200px">
</html>
| !FORMAT | !Image 1 | !Image 2|
| TIFF | 670.5 kb | 670.5 kb |
| JPG | 72.1 kb | 42.3 kb |
| PNG |  4.5 kb | 3.1 kb |
''Two Components to information:''
* an ABSOLUTE content
** tif
** jpg
** png
* a RELATIVE expression
** distribution of elements
** abundance of elements
<html>
<img src="01/Rand1x.png" style="height:150px">
<img src="01/Rand2.png" style="height:150px">
</html>
// Consider the PNG file format as a @@genotype@@, and the physical expression of that file as its @@phenotype@@//
!!!
''Information is loosely referred to by several concepts . . . ''
# ''Entropy''
** ~Shannon-Weaver formulation
*** H = -1 * sum{ p~~i~~ * log~~2~~(p~~i~~) }
*** where p~~i~~ = the proportion of the i^^th^^ event or state in a system 
**  Serves as a proxy for a distribution test 
*** sensitive to the distribution and relative abundance of all p~~i~~
*** maximal when highly organized, predictable 
*** minimal when fully random, unpredictable or chaotic
** Amino Acid entropy:
*** consider an amino acid frequency distribution where all 20 AA's were equally represented
*** p(A) = p(C) = p(D) . . . . . = p(Y) = 0.05 
*** but amino acids in genomes are not evenly distributed . . . AminoAcidEntropy
# ''Uncertainty''
** Information tells you about parts of a system
** More information about parts provides better knowledge of the total system
** High entropy = higher certainty that knowing one part of the system, you can guess another
*** [[01-03]]
# ''Complexity''
** The more complex a system is, the more unpredictable the state of its parts.
** Low entropy = low certainty = higher complexity
** Amino Acid word dictionaries . . . . AAdict
!!!
1. Information in biological systems is highly compressed, condensed and confounded
2. Data mining: ~GenBank resources: http://www.ncbi.nlm.nih.gov/genomes/lproks.cgi
3. Analysis pipeline: minimizing human intervention . . . . [[Entropy|01/Entropy.mov]]
4. Result QC: evaluating the validity of results
5. PERL scripting: how to submit 200 jobs simultaneously on Biowolf
6. Multivariate Stats: linear discriminate function analysis . . . [[LDA]]
7. Formulating testable hypotheses
8. Linking ~Genome-Transcriptome-Proteome-Environment: [[psychrophilic glucokinase|01/Colwellia-GK.mpg]]
!!!
* What is a gene?
* How much information is there in a gene?
{{{
>gi|158333234|ref|YP_001514406.1| NUDIX hydrolase [Acaryochloris marina MBIC11017]
MPYTYDYPRPGLTVDCVVFGLDEQIDLKVLLIQRQIPPFQHQWALPGGFVQMDESLEDAARRELREETGV
QGIFLEQLYTFGDLGRDPRDRIISVAYYALINLIEYPLQASTDAEDAAWYSIENLPSLAFDHAQILKQAI
RRLQGKVRYEPIGFELLPQKFTLTQIQQLYETVLGHPLDKRNFRKKLLKMDLLIPLDEQQTGVAHRAARL
YQFDQSKYELLKQQGFNFEV
}}}
{{{
>ref|NC_009925.1|:c2319-1627
ATGCCCTATACCTATGATTATCCGCGCCCTGGTCTTACCGTTGACTGCGTGGTGTTTGGCCTAGACGAAC
AGATCGATCTCAAAGTCCTACTGATTCAGCGCCAGATTCCCCCTTTCCAGCATCAGTGGGCATTACCCGG
AGGCTTTGTGCAGATGGATGAATCTTTAGAAGACGCGGCTCGCCGGGAGCTGCGAGAAGAAACGGGGGTT
CAGGGTATTTTCCTAGAGCAGCTCTATACCTTTGGCGATTTGGGTCGAGATCCGCGCGATCGCATCATCT
CCGTTGCCTACTACGCTCTAATCAACCTCATCGAATATCCTTTACAAGCCTCTACTGATGCTGAAGACGC
AGCCTGGTACTCCATTGAGAATTTGCCATCTCTAGCTTTTGATCATGCTCAAATCTTGAAACAGGCCATC
CGGCGATTGCAGGGCAAAGTTCGCTACGAACCGATTGGCTTCGAACTACTGCCGCAAAAATTTACACTCA
CCCAAATTCAGCAGCTTTACGAAACAGTTCTTGGCCATCCTCTAGATAAACGGAACTTTCGTAAGAAATT
GCTAAAAATGGATCTCTTAATTCCCCTTGATGAGCAACAAACTGGAGTTGCTCATCGTGCTGCCAGACTC
TATCAGTTCGACCAAAGCAAATACGAGCTATTGAAACAACAGGGATTTAACTTCGAGGTTTGA
}}}
* GenBank Sucks
* Biowolf: [[SSH]] connection
!!!

!What are patterns
''Survey a collection of genes for comparative patterns''

Zeldovich et al. 2007, PLOS, January 2007 | Volume 3 | Issue 1 | e [[download here|02/Zeldovich-PLOS2007.pdf]]
[img[02/zeldovich-title.png]]
[img[02/zeldovich-fig1.png]]
[img[02/zeldovich-formula.png]]
!!!
!! Isoelectric point of a proteome
[img[02/kiraga-IEP-title.png]]
[img[02/kiraga-IEP-citation.png]]
[[download here|02/Protein-IPselection.pdf]]
!!!
!!Easy Questions
* ''Are genomes/genes random collections of sequence?''
[img[02/AAcountsStats.png]]

''Test Distribution: random model p(A) = p(C) = p(D) . . . . = p(Y)
[img[02/AAcountsStats-random.png]]

@@''Chi-Square:  sum[(AAi - AAr)^2/AAr] = 4.02e05; critical value(df=19, p=0.001) = 42.31''@@
!!!
* ''Is the answer different if you look at nucleotide sequences or amino acid sequences?''
!!!
!! What is the biggest question you can answer?
''Depends on the biggest tool you can use . . . ''
** scripts/programming vs spreadsheets
** can you plot 556,473 points?
<html><img src="02/NIH-Fig1.png" style="height:400px"></html>
!!!
''So what if all these genomes are available?''
** Look at the GenBank page
** Information is useless unless you can 'handle' it.
*** Do you really want [[the truth | 03/Homer-TRUTH.wav]] ?
** The more INFORMATION you can handle, the bigger the questions you will think of to try and answer.
 
!!!
!! Isoelectric point of a proteome
[img[02/Kiraga-IEP-title.png]]
[img[02/kiraga-IEP-citation.png]]
[img[03/kiraga-fig1.png]]
| [img[03/kiraga-fig6a.png]] | [img[03/kiraga-fig6b.png]] |
!!!
''* * * *   Data Input / Results Output   * * * *''
<html><center><img src="03/080201-Plot01FEB-01to09.png" style="height:600px"></center></html>
''* * * *   Zeldovich et al.   * * * *''
<html><center><img src="03/zeldovich-fig1.png" style="height:500px"></center></html>
!!!
''* * * *  Amino Acid Frequencies  * * * *''
# Exercise to collect data: AAFreq
# What comes next with this data . . . . . ?
## Define a question . . . . [[03question]]
## Look at the data from the perspective of that question
## Define a hypothesis test
# Next Exercise: data integration
!!!
{{{
#!/usr/bin/python
# MAY 2008: CALCULATE AND PLOT Phi AND Psi ANGLES IN PDB PROTIEN FILES
# Original scripts compiled/derived from Peter Cock
# http://www2.warwick.ac.uk/fac/sci/moac/currentstudents/peter_cock/python/ramachandran/

# USER VARIABLES . . . . . . . . . . . . . . . .
# pdb_file = "SuccinateDehydrogenase"
pdb_file = "Alpha-Helix"

# MODULE IMPORT . . . . . . . . . . . . . . . . 
import math
import re
import Numeric
from vardump import *
from rpy import *
from pylab import *
import Bio.PDB
r.library("MASS")

# GLOBAL VARIABLE DECLARATION . . . . . . . . . . . . . . . .
rama_GENERAL = "General"
rama_GLYCINE = "Glycine"
rama_PROLINE = "Proline"
rama_PRE_PRO = "Pre-Pro"
ramachandran_types = [rama_GENERAL,rama_GLYCINE,rama_PROLINE,rama_PRE_PRO]
scatter_x = dict()
scatter_y = dict()
for ramachandran_type in ramachandran_types :
    scatter_x[ramachandran_type]=[]
    scatter_y[ramachandran_type]=[]  
xmap=[]
ymap=[]

# Color scheme from RAMPAGE: http://raven.bioc.cam.ac.uk/rampage.php
rama_settings = {"General" : ([0, 0.0005, 0.02, 1],
                              ['#FFFFFF','#B3E8FF','#7FD9FF'],
                              "top500-angles/pct/rama/rama500-general.data"),
                              # or rama500-general-nosec.data
                 "Glycine" : ([0, 0.002,  0.02, 1],
                              ['#FFFFFF','#FFE8C5','#FFCC7F'],
                              "top500-angles/pct/rama/rama500-gly-sym.data"),
                              # or rama500-gly-sym-nosec.data
                 "Proline" : ([0, 0.002,  0.02, 1],
                              ['#FFFFFF','#D0FFC5','#7FFF8C'],
                              "top500-angles/pct/rama/rama500-pro.data"),
                 "Pre-Pro" : ([0, 0.002,  0.02, 1],
                              ['#FFFFFF','#B3E8FF','#7FD9FF'],
                              "top500-angles/pct/rama/rama500-prepro.data")}
                 #P.S. Also rama500-ala-nosec.data


# ------------------------------------------------------------------
# SUBROUTINE FUNCTIONS----------------------------------------------
# ------------------------------------------------------------------
def load_data_file(filename) :
    # data setup for 3D contour plotting . . . .
    xmap = []
    ymap = []
    STEP=2
    HALF_STEP=1
    STEP = HALF_STEP*2
    lower_bounds = range(-180, 180, STEP)
    mid_points = range(-180+HALF_STEP, 180+HALF_STEP, STEP)
    upper_bounds = range(-180+STEP, 180+STEP, STEP)
    data = Numeric.array([[0.0 for x in mid_points] for y in mid_points], typecode=Numeric.Float) 
    # data = zeros( (361,361) )    
    
    # reformat structure scores for new metric
    #xmap = range(-360,361,2)  # last entry will be 358 (... while xmap < 359 ...)
    #ymap = range(-360,361,2)
    #xmap = range(0,361,1)  # last entry will be 358 (... while xmap < 359 ...)
    #ymap = range(0,361,1)
    
    xmap = mid_points
    ymap = mid_points
    print mid_points
    
    """
    # Table name/description: "Top500 General case (not Gly, Pro, or pre-Pro) B<30"
    # Number of dimensions: 2
    # For each dimension, 1 to 2: lower_bound  upper_bound  number_of_bins  wrapping
    #   x1: -180.0 180.0 180 true
    #   x2: -180.0 180.0 180 true
    # List of table coordinates and values. (Value is last number on each line.)
    -179.0 -179.0 0.0918642445114388
    -179.0 -177.0 0.07105717866463215
    ...
    """
    input_file = open(filename,"r")
    phicount = 0
    psicount = 0
    for line in input_file :
        #Strip the newline character(s) from the end of the line
        if line[-1]=="\n" : line = line[:-1]
        if line[-1]=="\r" : line = line[:-1]
        if line[0]=="#" :
            #comment
            pass
        else :
            nums = line.split()
            
            phi = float(nums[0])
            psi = float(nums[1])
            x = DIF(phi,psi)
            y = RAT(phi,psi)
            # print x, y
            if x == 0 :
                x = 1
            if (x % 2 == 0):
                z1 = xmap.index(int(x+1))
            else:
                z1 = xmap.index(int(x))
            if int(y) % 2 == 0 :
                z2 = ymap.index(int(y+1))
            else:
                z2 = ymap.index(int(y))
                
            # print x, y
            #z1 = xmap.index(int(x))
            #z2 = ymap.index(int(y))
            # print z1, z2
            data[z1,z2] = data[z1,z2] + float(nums[2])
            
            
            #data[psicount,phicount] = float(parts[2])
            #psicount = psicount + 1
            #if (psicount > 179):
            #    psicount = 0
            #    phicount = phicount + 1   
  
    input_file.close()
    print len(xmap), len(ymap), len(data)
    ## Smooth DATA . . . .
    for i in range(179):
        for j in range(179):
            k = j
            while (data[i,k] == 0 | k < 179):
                k = k+1
            for m in range(j,k):
                data[i,m] = data[i,k]
            j = k
    for j in range(179):
        for i in range(2,179):
            k = i-1
            data[i,j] = 0.5*(data[i,j] + data[k,j])
    
    #print data
    #sys.exit()  
    return (data, lower_bounds, xmap, ymap, upper_bounds)
# ------------------------------------------------------------------
def DIF(phi, psi):
    x = phi - psi
    if x > 179:
        x = -179 + (x - 179)
    if x < -179:
        x = 179 + (x + 179)
    return x
# ------------------------------------------------------------------
def RAT(phi, psi):
    y = 179 * (phi/psi)
    while y > 179:
        y = -179 + (y - 179)
    while y < -179:
        y = 179 + (y + 179)
    return y
# ------------------------------------------------------------------
def degrees(rad_angle) :
    """Converts any angle in radians to degrees.

    If the input is None, the it returns None.
    For numerical input, the output is mapped to [-180,180]
    """
    if rad_angle is None :
        return None
    angle = rad_angle * 180 / math.pi
    while angle > 180 :
        angle = angle - 360
    while angle < -180 :
        angle = angle + 360
    return angle
# ------------------------------------------------------------------
def residue_ramachandran_type(residue) :
    """   > Expects Bio.PDB residues, returns ramachandran 'type'
          > If this is the last residue in a polypeptide, use None
    for next_residue.
          > Return value is a string: "General", "Glycine", "Proline"
    or "Pre-Pro".
    """
    
    matchnum = re.search(r", (\d+),", str(residue.get_id()))
    if matchnum is not None:
        next = int(matchnum.groups()[0]) + 1
    next_residue = chain[next]
    if residue.resname.upper()=="GLY" :
        return "Glycine"
    elif residue.resname.upper()=="PRO" :
        return "Proline"
    elif next_residue is not None \
    and next_residue.resname.upper()=="PRO" :
        #exlcudes those that are Pro or Gly
        return "Pre-Pro"
    else :
        return "General"     
# ------------------------------------------------------------------

# ------------------------------------------------------------------
# ------  M  A  I  N ----------------------------------------------
# ------------------------------------------------------------------

# Load PDB File . . . . 
print "Opening PDB file..."
structure = Bio.PDB.PDBParser().get_structure(pdb_file, "%s.pdb" % pdb_file)
model = structure[0]
# chain = model[" "]
# chain.id = 1
# dumpObj(model)
print "------------------------------------------"

# Phi and Psi  calculations using Bio-Py . . . . . 
for model in structure :
    for chain in model :
        print "Chain >%s<" % str(chain.id)
        polypeptides = Bio.PDB.CaPPBuilder().build_peptides(chain)
        for poly_index, poly in enumerate(polypeptides) :
            phi_psi = poly.get_phi_psi_list()
            for res_index, residue in enumerate(poly) :
                phi, psi = phi_psi[res_index]
                print residue.resname, phi, psi
                if phi and psi :
                    ramachandran_type = residue_ramachandran_type(residue)
                    assert ramachandran_type in ramachandran_types
                    phid = degrees(phi)
                    psid = degrees(psi)
                    scatter_x[ramachandran_type].append(DIF(phid,psid))
                    scatter_y[ramachandran_type].append(RAT(phid,psid))                      


# Plot Phi and Psi distributions . . . . . .    
print "Running plotting routine . . . . "

# for (i,ramachandran_type) in enumerate(ramachandran_types) :
ramachandran_type = "General"
(rama_levels, rama_colors, rama_filename) = rama_settings[ramachandran_type]
print "Loading data file: " + rama_filename,
zdata, lower_bounds, xmap, ymap, upper_bounds = load_data_file(rama_filename)
#for i in range(len(ymap)):
#    ymap[i] = ymap[i]/180

plot(scatter_x[ramachandran_type],scatter_y[ramachandran_type],'yo',markersize=5)
#hold(True)
levels = [0.0005, 0.005, 0.05]
contourf(xmap, ymap, zdata, levels, alpha=0.5)
hold(True)
contour(xmap, ymap, zdata, levels)
# ylim(-5,5)
xlabel('Score1',fontsize=24,fontweight='bold')
ylabel('Score2',fontsize=24,fontweight='bold')
#xlabel('$\phi$',fontsize=24,fontweight='bold')
#ylabel('$\psi$',fontsize=24,fontweight='bold')
title(pdb_file,fontsize=18,fontweight='bold')

show()
# savefig("%s-plot3.png" % pdb_file,format='png')
}}}
!!
<html><center><table><tr>
<td><img src="03/zeldovich-fig1.png" style="height:300px"></td>
<td><b>9 of the 63 physical anomalies of water</b><img src="03/anomal-legend.png" style="height:100px"><img src="03/anomal3.gif" style="height:200px"></td>
</tr></table></center></html>
''Amino Acid Selection Score: Repetition or Retention or Preference Index''
<html><img src="04/Fig02-ORFscore-draft02.png" style="height:400px"></html>
''Data Reduction''  Collapse the AAi position score into an average score across the entire ORF. Allows for the direct comparison of ORFs to assess the relative difference in amino acid word repetition.
!!!
''Amino Acid Selection Score vs. Optimal Growth Temperature''
<html><img src="04/7983-Cluster25425.png" style="height:400px"></html>
! Informatic Calculation:
# For every ORF in every Genome, calculate the mean AA~~i~~ selection index
# For every ORF
## find the homologous ORFs in other genomes
## run linear regression of SelScore vs T~~og~~
## assess results?
# How do you process that much information?

!!!
!!! ~CD-HIT:
* Combine all the microbial fasta files into one, concatenated, group fasta file.
* Run ch-hit @40% to identify homologous gene "clusters"
* How do you sort through the 130,000 gene clusters looking for the "needle in a haystack"?
<html><img src="04/cluster.png" style="height:200px"></html>

!!! PYTHON:
'' This was accomplished with a python script that accessed the R package stats, then used the MatLab libraries to generate the graphs and save them to file.'' 
@@Thanks to Ryan Dale for exploring how to get this integration working AND goading me into attempting to learn some of it@@

''Strategy'':
** find cluster with >10 genes
** calculate Score vs. Tog regression correlation coefficient and p-value
** if p < 0.01, plot regression, save graph

{{{
#!/usr/bin/python

from rpy import *
from pylab import *
import re
infile = open('Nature105-SelScoreEdit2-mod5_limit10_20.txt','r')
out = open('LogFile.txt','w')

#-----------------------------------------------------
def getAttachment(FILE):
	ctype, encoding = mimetypes.guess_type(FILE)
	if ctype is None or encoding is not None:
		ctype = 'application/octet-stream'
	maintype, subtype = ctype.split('/', 1)
	fp = open(FILE, 'rb')
	attach = MIMEImage(fp.read(),_subtype=subtype)
	fp.close
	attach.add_header('Content-Disposition', 'attachment', filename=FILE)
	return attach
#-----------------------------------------------------

count = 0
tog=[]
sel=[]
mb=[]
gc=[]
Genomes=[]
Gene='no-match'

for line in infile:
	match1 = re.search(r"Cluster (\d+)", line)
	if match1 is not None:
		Cluster = match1.groups()[0]

	match2 = re.search(r"\s+:(\d.*)\.\.\.", line)
	if match2 is not None:
		Data = match2.groups()[0]
		Nums = Data.split(':')
		# 0= Tog; 1= Sel; 2= Size; 3= GC
		tog.append(float(Nums[0]))
		sel.append(float(Nums[1])*1000)
		mb.append(float(Nums[2]))
		gc.append(float(Nums[3]))
		count += 1
		
		match3 = re.search(r"\|\s(.*)\s\[", line)
		if match3 is not None:
			Gene = match3.groups()[0]

		match4 = re.search(r"aa, > (.*) gi\|", line)
		if match4 is not None:
			Genomes.append(match4.groups()[0])
		else:
			Genomes.append('unknown')
			
	elif match2 is None and count > 20:
		#-----------------------------------------------	
# Get Raw Linear Model for sel vs. genome size . . . . .  
		MB = r.cor_test(x=mb,y=sel,method='pearson')
		Pmb = float(MB['p.value'])
		sel_mean = 0.0
		for i in range(len(sel)):
			sel_mean = sel_mean + sel[i]
		sel_mean = sel_mean/(len(sel) + 1)
		selin = []
		selout = []
		togin = []
		togout = []
		mbin=[]
		mbout=[]
		gcin=[]
		gcout=[]
		genout = []
# Covariate-Constrained Contrast . . . remove effect of genome size
#     on sel score . . . sel[i] - zi = resdiual not accounted for by MB
#     and screen outliers . . . . . . . . . . . . . . . . .			
		#if (Pmb < 0.05):		
		ls_fit = r.lsfit(mb,sel)
		m = ls_fit['coefficients']['X']
		b = ls_fit['coefficients']['Intercept']				
		for i in range(len(mb)):
			zi = m*mb[i] + b
			selin.append(sel_mean +(sel[i] - zi))
			togin.append(tog[i])
			mbin.append(mb[i])
			gcin.append(gc[i])			
				
		# Run IN-lier R Linear Regression . . . 
		TOG1 = r.cor_test(x=togin,y=selin,method='pearson')
		Pnum1 = float(TOG1['p.value'])
		Rnum1 = abs(float(TOG1['estimate']['cor']))
		Pvalue1 = "%0.4f" % Pnum1
		Rvalue1 = "%0.4f" % Rnum1
		N1 = "%2.0f" % len(selin)	
		
		TOG2 = r.cor_test(x=tog,y=sel,method='pearson')
		Pnum2 = float(TOG2['p.value'])
		Rnum2 = abs(float(TOG2['estimate']['cor']))
		Pvalue2 = "%0.4f" % Pnum2
		Rvalue2 = "%0.4f" % Rnum2
		N2 = "%2.0f" % len(sel)				

		if Pnum1 < 0.01:				
			Rtext = re.search(r"0.(\d+)", Rvalue1.__str__())
			TITLE = Gene[0:30]
			Pstat1 = 'p-value= ' + Pvalue1
			Rstat1 = 'r= ' + Rvalue1
			Pstat2 = 'p-value= ' + Pvalue2
			Rstat2 = 'r= ' + Rvalue2
			N1 = 'n= ' + N1
			N2 = 'n= ' + N2
			FILE = 'plots/' + Rtext.groups()[0] + '-' + 'Cluster' + Cluster + '.png'
			LineY1 = []
			LineX1 = []
			ls_fit = r.lsfit(togin,selin)
			m = ls_fit['coefficients']['X']
			b = ls_fit['coefficients']['Intercept']
			for z in range(5,100):
				xi = m*z + b
				LineY1.append(xi)
				LineX1.append(z)
			LineY2 = []
			LineX2 = []
			ls_fit = r.lsfit(tog,sel)
			m = ls_fit['coefficients']['X']
			b = ls_fit['coefficients']['Intercept']
			for z in range(5,100):
				xi = m*z + b
				LineY2.append(xi)
				LineX2.append(z)
	
			ymax = 0
			for i in range(count):
				if sel[i] > ymax:
					ymax = sel[i]
			for i in range(len(selin)):
				if selin[i] > ymax:
					ymax = selin[i]
			ytext = ymax*0.90
			plot(togin,selin,'bo',markersize=10)
			hold(True)
			#plot(togout,selout,'yo',markersize=10)
			plot(LineX1,LineY1,'-',linewidth=2,color='r')
			xlabel('Tog',fontsize=18,fontweight='bold')
			ylabel('SelScore AAi (-MB)',fontsize=18,fontweight='bold')
			ylim(0,ymax*1.1)
			xlim(xmax=105)
			title(TITLE,fontsize=18,fontweight='bold')
			text(10,ytext,Pstat1,fontsize=14)
			text(10,ytext*0.95,Rstat1,fontsize=14)
			text(10,ytext*0.90,N1,fontsize=14)							
			savefig(FILE,format='png')
			close()
			mssg = Cluster+'\t'+TITLE+'\t'+Pstat1+'\t'+Rstat1+'\n'
			print '> ', Cluster, TITLE, Pstat1, Rstat1, N1, N2
			out.write(mssg)
				
		# Reset Arrays before running next cluster
		count = 0
		tog=[]
		sel=[]
		mb=[]
		gc=[]
		Genomes=[]
		Gene='no-match'
		
# ------ EOF ------
print '\n\n\n*** DONE ***\n\n\n'
# ------ EOF ------
}}}
!!''Amino Acid Frequencies''
** Log into your Biowolf account
** Establish the "01-Genomes" link
{{{
biowolf> ln -s /home/marsh/06-ClassGenomes 01-Genomes
}}}
** Copy the perl script "~12.01-TallyAminoAcidFreqs.pl" from "~01-Genomes" to your home directory.
** Also copy the shell script "00-RUN.sh"
** Now you will need the file transfer sheel to copy those two files from your biowolf account to your local computer for editing.
** Edit the 00-RUN.sh file (see JEdit): 
*** enter your email address on line 6 in place of "amarsh@udel.edu"
*** enter a short job descriptor for "jobid" on line 8, maybe "~AAfreq" because you are gong to be running the amino acid frequency script.
<html><center><img src="00/runshell.png" style="height:300px"></center></html>
** Edit the "~12.01-TallyAminoAcidFreqs.pl" script
*** enter a string in place of the word "DATE" on line 12. This is just an identifier tag for the output file name.
<html><center><img src="00/12edit.png" style="height:300px"></center></html>
** Now copy the edited files back to your Biowolf home directory, overwriting the original versions which you no longer need.
** Biowolf Test: submit the perl job to the cluster . . . . 
{{{
biowolf> qsub 00-RUN.sh
}}}
*** This shell file tells Biowolf that you want to run a single job on one cpu, then starts the job by issuing the command "perl //filename//" so that script 12 is now executed by the perl interpreter.
** You can check the job status by entering: "qstat" and looking for your name and the jobid string. Or you could enter "qstat -u classXX" where XX is the user number of your account name. The job will run very quickly and you should get an email confirmation of when it started and then when it stopped.
** After the run, enter "ls -l" to get a listing of your directory and it should look somethig like:
<html><center><img src="00/dirlist.png" style="height:100px"></center></html>
** The new file "~AminoAcidFreqTable-YYYY.txt" was produced by the program and is a tab-delimited text file with the percent amino acid composition of the 620 microbial genomes. 
** Copy this file to your local computer and you can import it into Excel to look at the numbers that are there. 
!!!
An information complexity metric is plotted for each AA dictionary (1- to 12-mer) for 150 free-living microbial genomes. The organizational structure of local amino acid word usage can be captured in a quantitative statistic derived from the Shannon-Weaver entropy formulation. The log scale on the y-axis is indicative of the wide differences that exist among these genomes in terms of how amino acid ‘motifs’ are utilized within a whole genome. The red reference line represents an environmental genome ‘community’ from a hydrothermal vent sample.
[img[01/AAcomplexity.png]]
>I was playing around with R and amino acid freq data this morning and found a great new function in ggplot2 called melt which reshapes data. Plots attached and code below.
>-ryan
{{{
# import
d=read.table('AminoAcidFreqTable-02March08.txt', sep='\t', header=T)

# load ggplot2
library(ggplot2)

# takes a while, but looks cool
plotmatrix(d[,2:21])

# reshape the dataframe to convert the amino acid freq columns into
# a "variable" column (factor of A, C, D, E, F, etc)
# and a "value" column (freqs for each aa)
m=melt(d,id.var=c('Genome','MB','GC','Pgenes','Code','Topt','AAmb'))

# plot the melted dataframe
ggplot(m)+aes(x=GC,y=value,colour=variable)+geom_point()+facet_grid(.~variable)
}}}
<html><img src="04/RD-aafreq-vs-gc.png" style="height:100px"></html>
<html><img src="04/RD-scatterplot.png" style="height:800px"></html>
[[More Help using MELT in R can be found here|http://www.jstatsoft.org/v21/i12/paper]]
!!!
[img[AAFreq/Tyrosine.png]]
<html><img src="AAFreq/PLOT_20-AAfreq-v-AAmb.png" style="height:600px"></html>
!!!
<html><img src="AAFreq/PLOT_20-AAfreq-v-GC.png" style="height:600px"></html>
* ''Calculate a sum of squares difference between each Freq(~AA~~i~~) and the Freq(~AA~~mean~~)''
<html><img src="AAFreq/PLOT_AAdif-v-AAmb.png" style="height:400px"></html>
''Sum of Squares difference plotted against %GC''
<html><img src="AAFreq/PLOT_AAdif-v-GC.png" style="height:400px"></html>
!!!
''Instead of Sum of Squares, look at the relationship to ENTROPY:''
<html><img src="AAFreq/PLOT_AAEntropy-v-GC.png" style="height:400px"></html>
!!!
''Candidate Genome: //Carsonella rudii//''
<html><img src="AAFreq/PLOT_Carsonella_AAFreq.png" style="height:400px"></html>
[[Carsonella]]
!!!
''Frequency of Alanine plotted against AA Entropy . . . ''
<html><img src="AAFreq/PLOT_AlanineFreq-v-Entropy.png" style="height:400px"></html>
!!!
{{{
clear all;
close all;

% Setup Variables . . . . . . 
load AAFreqTableData;
AA = data(:,1:20);
MB = data(:,21);
GC = data(:,22);
Pgenes = data(:,23);
Coding = data(:,24);
Topt = data(:,25);
AAmb = data(:,26);
for i=1:length(data)
    Genome{i} = textdata{i+1};
end

% Calculate Sum of Squares Difference . . . . . . 
MEAN = mean(AA);
MEANmat = repmat(MEAN,length(AA),1);
DIFF = (MEANmat - AA).^2;
SUM = sum(DIFF,2);
% %PLOT OUTPUT . . . . . . . .
%-------------------------------
figure;
plot(GC,SUM,'o','MarkerEdgeColor','b','MarkerFaceColor','g','MarkerSize',8);
set(gca,'FontSize',14,'FontWeight','bold');
%xlabel('Genome Size (AAmb)','FontSize',18,'FontWeight','bold');
xlabel('%GC','FontSize',18,'FontWeight','bold');
ylabel('\Sigma (\it{f_{aa}} - \it{f_{mean_{aa}}} )^2','FontSize',18,'FontWeight','bold');

% Calculate AA entropy . . . . . 
H = sum(-1*AA.*(log2(AA)),2);

% %PLOT OUTPUT . . . . . . . .
%-------------------------------
figure;
plot(GC,H,'o','MarkerEdgeColor','b','MarkerFaceColor','g','MarkerSize',8);
set(gca,'FontSize',14,'FontWeight','bold');
%xlabel('Genome Size (AAmb)','FontSize',18,'FontWeight','bold');
xlabel('%GC','FontSize',18,'FontWeight','bold');
ylabel('AAFreq H','FontSize',18,'FontWeight','bold');

% %AAFREQ HISTOGRAM PLOT
% %#111 = Candidatus_Carsonella_ruddii_PV-PID17977
%--------------------------------------
figure;
bar(AA(111,:),1);
ticks = 1:20;
set(gca,'XTick',ticks,'XTickLabel',{'A','C','D','E','F','G','H','I','K','L','M','N','P','Q','R','S','T','V','W','Y'});
set(gca,'XLim',[0.5 20.5]);
ylabel('AAFreq','FontSize',18,'FontWeight','bold');
title('Candidatus: Carsonella ruddii','FontSize',18,'FontWeight','bold');

figure;
plot(H,AA(:,1),'o','MarkerEdgeColor','b','MarkerFaceColor','g','MarkerSize',8);
set(gca,'FontSize',14,'FontWeight','bold');
xlabel('AA Entropy H','FontSize',18,'FontWeight','bold');
ylabel('Alanine Freq','FontSize',18,'FontWeight','bold');


%EOF
}}}
{{{
% AA Freq plots 5 x 4 panels = 20 total

close all;
clear all;

% Setup Variables . . . . . . 
load AAFreqTableData;
AA = data(:,1:20);
MB = data(:,21);
GC = data(:,22);
Pgenes = data(:,23);
Coding = data(:,24);
Topt = data(:,25);
AAmb = data(:,26);
for i=1:length(data)
    Genome{i} = textdata{i+1};
end

X = AAmb;
TITLE = 'Genome Size (AAmb)';

AAlabels = [ 'A', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'Y' ];
Xmax = max(X);
Ymax = max(max(AA));
Ymin = min(min(AA));
interval = Xmax/500;
z = min(X):interval:Xmax;
[Nrows Mcols] = size(AA);

figure('Position',[100 100 1000 800]);
for k=1:20
    x = X;  % x is edited each time through, needs to be reset
    y = AA(:,k);
    ymax = max(y);
    index = isnan(x);
    x(index)=[];
    y(index)=[];
    line1= polyfit(x,y,1);
    fY = polyval(line1,z);
    subplot(5,4,k)
    plot(x,y,'o', 'MarkerFaceColor','b','MarkerSize',4); hold on;
    plot(z,fY,'-k','LineWidth',2); hold on;
    set(gca, 'XLim', [0 Xmax],'YLim', [0 Ymax]); 
    rho = corr(x,y);
    text(Xmax/10, Ymax/1.2, AAlabels(k), 'FontSize',14, 'FontWeight','bold');
    text(Xmax/3,  Ymax/1.2,['r^2 = ', num2str(rho)], 'FontSize',14);
    if (k==1)
        title(TITLE,'FontSize',18,'FontWeight','bold');
        ylabel('AA Freq','FontSize',14,'FontWeight','bold');
    end
end   
}}}
!!Using Bioinformatics for Good and not Evil . . . .
After downloading the output file from exercise #2, I was hoping you would throw your hands up in the air and with complete frustration say "Now What?"  For that is the real question. Yes, you now have the amino acid frequency distributions of 620 microbial genomes . . . . but that is just data. Just numbers. You have to add the biology to it in order to makes sense out of the distribution patterns.

* A modification has now been added to the previous perl script so that in addition to the AA freqs, some other data for each genome is written to the ouput file for ''data exploration''. //Mostly in Bioinformatics, you don't know exactly what you are looking for until you find it. And in order to find it, you have to be searching//.
<html><img src="AAFreq/perlscript.png" style="height:300px"></html>
* After working through this exercise, you should start to think about how to answer this question: 
| @@''Which genome has the most different amino acid frequency distribution?''@@ |

!! Exercise . . . . 
** copy the new perl script using this command:
{{{
biowolf> cp 01*/12.02-TallyAminoAcidFreqs.pl 12.02-TallyAminoAcidFreqs.pl 
}}}
** Edit the output file name.
** Edit the 00-RUN.sh file so that this new "12.02" script is run instead of the "12.01" version.
** Then __qsub 00-RUN.sh__
* The new output file will contain the following additional files:
** MB = genome size; this is the GenBank nt count found on the internal project pages
** GC = G+C content of the genome from the GenBank main page
** Pgenes = number of protein coding genes
** Coding = %nucleotides located in predicted ORFs
** Topt = optimum growth temperature
** ~AAmb = genome size used in the analysis; this is the amino acid count in the non-redundant fasta file (after cd-hit 95%) expressed in the equivalent number of nucleotide mega base pairs, (so #AAs * 3 / 10^^6^^)

With this information you should be able to start looking for patterns with the data table, even with just using Excel, such as this plot:
[img[00/Tyrosine.png]]
! Results: 
''Go To:'' AAresults
!!!


!!! Tool = MatLab
* To efficiently process the amino acid frequency data, we will use the package ''MatLab'' (although ''R'' would work just as well).
* The "~AminoAcidFreqTable-//DATE//.txt" file can be easily imported straight into MatLab. Just accept the default variable names and then enter this command:
{{{
> save AAFreqTableData
}}}
* Now copy the scripts AAfrq-matlab1 and AAfrq-matlab2 to your local machine and run them.
!!! RESULTS:
## AAfreq01: Tyrosine composition plotted in Excel
## AAfreq02: 20 AA freqs vs AAmb, Matlab script #2
## AAfreq03: 20 AA freqs vs %GC, Matlab script #2
## AAfreq-R: Ryan's R plots . . . 
## AAfreq04: How do we find which is the most different? Matlab script #1
## AAfreq05: What does this difference look like against %GC?, Matlab script #1
## AAfreq06: AA Freq Entropy vs %GC, Matlab script #1
## AAfreq07: Every genome is an island?, Matlab script #1
## AAfreq08: Alanine Freq as a function of Entropy, Matlab script #1

!!! CONCLUSIONS: 
# Is protein composition more sensitive to genome size or genome nucleotide composition?
# Very different alanine frequencies between highly over-represented and highly under-represented can occur at the same 'organizational' state as measured by entropy or a sum of squares distance metric of the AA freq distribution.
# What does this imply about how %GC should quantitatively approached? 

!!!


''~BioInformatics Exercise #2:''  We want to further develop our ability to isolate or identify the selective forces that determine the bulk distribution of amino acid residues in microbial genomes.
# BACKGROUND = [[AAscore-intro]]
** We assume differences in amino acid usage within a proteome must be related to functional differences that impact fitness of a genome.
# HYPOTHESIS = [[AAscore-hypo]]
** //The disequilibrium in how amino acids are used in individual proteins compared to the total proteome of a genome, is indicative of the intensity of selection pressures that are shaping the evolution of that genome.//
# TOOLS = [[AAscore-tool]]
** Genome List: two groups of organisms under different selection pressures
** script ''12.03-~ScoreAminoAcidSumSquares.pl'' to run the calcs
** R ''ggplot2''
# RESULTS:
** Good Luck with the interpretation . . . . . 
<html><img src="AAscore/PLOT-FvP.png" style="height:200px"></html>
5. Analysis = [[AAscore-results]]

!!!
.
!! HYPOTHESIS:
Let's start with formulating a null statement that we can use as a guide for data collection. Consider an organism that is perfectly adapted to its environment/life-style. Consider this level of adaptation to represent a high state of near-equilibrium from the perspective of the selection pressures exerted upon the proteome and the fitness phenotypes that are returned by its overall function. The idea to stress here is that a highly adapted organism is going to experience very low levels of selection because its fitness is already maximal. Remember that selection only operates against less-fit phenotypes, so full-fitness implies that an organism has reached some equilibrium between lower selection pressures and higher fitness values.

Now lets float a strawman idea that we can pursue quantitatively:  An organism that is highly adapted will utilize amino acids at the same frequencies among all proteins. IF there is an ideal AA composition for the proteome of an organism, by default a highly adapted (evolved?) organism will have constrained amino acid usage among all of its genes to contribute towards the total AA frequencies found within the entire proteome.

@@''NULL HYPOTHESIS:''  The disequilibrium in how amino acids are used in individual proteins compared to the total proteome of a genome, is indicative of the intensity of selection pressures that are shaping the evolution of that genome.@@

A strawman idea/hypothesis does not have to be true, it just has to be something you can start testing. It serves just as an model to direct where you are going to collect data and how you are going to process that data to derive a metric that can put this idea to a test.



!!!
.
!! BACKGROUND:
We have been considering patterns of individual amino acid frequencies so far in class. We know that different genomes employ different ratios of amino acids in their proteomes. For example, if we compare amino acid frequencies in free-living vs. human pathogenic microbes in the following figure, we see that there are some amino acids that are visually distinct between these two groups of organisms. 

''WHY?'' Obviously, these two groups have very different life-history strategies and are adapted to survive in very different environrments. Thus, we assume that differences in amino acid usage within the proteomes must be related to functional differences that impact fitness. 

''Conclusion:'' A key feature that makes genomes different is the shift in amino acid usage frequencies that have been selected for within their protepmes. If you had a metric to identify this difference, then you would have a good idea of what the mechanism or underlying selective force could be. 
<html><img src="AAscore/Fig01-AAFreq.png" style="height:500px"></html>

!!!
.
!! Sum of the AAi Distances
First option is to plot the SumScore variable coded by the GROUP designations in your list. If there is a clear separation between GROUPS in this plot, bingo, analysis done.
{{{
# import dataframe - - - - - - - - - - - - - - - - - - - - 
d=read.table('AminoAcidSumSquareTable-21MAR.txt', sep='\t', header=T)

# assign GROUP to be used as a factor in plots- - - - - - - - - - 
d$Group<- as.factor(d$Group)

# startup ggplot routines - - - - - - - - - - - - - - - - - - - - 
library(ggplot2)

# simple plot - - - - - - - - - - - - - - - - - - - - 
ggplot(d)+geom_point(aes(x=AAmb,y=SumScore,colour=Group))+geom_smooth(aes(x=AAmb,y=SumScore,colour=Group), method="lm")
}}}
<html><img src="data/AAscore/Group1v2plot.png" style="height:300px"></html>

!! Distribution of AA distance frequencies (RDale)
{{{
# setup
library(ggplot2)
d=read.table('AminoAcidSumSquareTable-21MAR.txt', sep='\t', header=T)
m=melt(d,id=1:7)

# histograms are unordered, difficult to interpret
ggplot(m)+aes(x=value)+geom_histogram()+facet_grid(variable~.)

# reorder factors in "variable" by the mean of their values.
m$variable = reorder(m$variable, m$value, mean)

# easier to interpret after reordering
ggplot(m)+aes(x=value)+geom_histogram(aes(fill=variable))+facet_grid(variable~.)
}}}
<html><img src="data/AAscore/HistogramSummary-ordered.png" style="height:400px"></html>

!! PCA Analysis
{{{
#--------------------------------------------------------------
# Data Input and Setup----------------------
d=read.table('AminoAcidSumSquareTable-21MAR.txt', sep='\t', header=T)
fAA = d[,8:27]
d$Group <- as.factor(d$Group)
d$Phylo <- as.factor(d$Phylo)

# Normalize data --------------------------
xbar = mean(fAA)
fAAnorm = fAA[,1:20]-xbar[1:20]
fAAnorm2 = (fAA[,1:20]/xbar[1:20])-1

# RUN PCA -------------------
pcdata<-princomp(fAAnorm2,cor=TRUE)

# Extract the genome points ---------------
d$PCA1=pcdata$scores[,1]
d$PCA2=pcdata$scores[,2]

# Extract the AA factor lines ---------------------
pca <- data.frame(AA1=pcdata$loadings[,1]*20, AA2=pcdata$loadings[,2]*20)

# Build layered plot ---------------------------
p = ggplot() + coord_equal()
p = p + geom_point(data=d, aes(x=PCA1,y=PCA2,colour=Phylo),size=4)
p = p + geom_segment(data=pca, aes(x=0,y=0,xend=AA1, yend=AA2),colour="red",arrow=arrow(length=unit(1,"cm"),angle=30))
p = p + geom_text(data=pca, aes(x=AA1*1.1,y=AA2*1.1),label=row.names(pca))
p
}}}
<html><img src="data/AAscore/PCAbiplot-AAscores-Phylo.png" style="height:600px"></html>

!! LDA Multivariate Analysis
In ''R'' the routine is contained within a library named "ade4" see [[LDA|http://pbil.univ-lyon1.fr/ade4html/discrimin.html]]
In ''MatLab'' the routine is in a "Statistical Pattern Recognition Toolbox" [[STPRtool|http://cmp.felk.cvut.cz/cmp/software/stprtool/manual/index.html]]
{{{
    % Set distance matrix variables . . . . . 
        D = pdist(databoot,'cityblock');
        [Z,E] = cmdscale(D);
        in_data.X = Z';
        
    % Call the Linear Discriminant Analysis . . . . . .
        in_data.y = ID; % once the data is regrouped, ID is the same. 
        model = lda(in_data);
        model.W = real(model.W);
        model.b = real(model.b);
        model.eigval = real(model.eigval);
        out_data = linproj(in_data, model);
        index = isnan(out_data.X(1,:));
        out_data.X(:,index)=[];
        index = isnan(out_data.X(2,:));
        out_data.X(:,index)=[];
}}}
<html><img src="data/lda/ldaplot01.png" style="height:500px"></html>
!!LDA REFERENCE PLOT:
<html><img src="data/lda/FIG_Sb_1&3_C22.png" style="height:500px"></html>
<html><img src="data/lda/Fig-Supp-LDAdistribution.png" style="height:400px"></html>
!!!
.
!! APPROACH:
We are going to use a distance metric (sum of squares) to calculate how different the amino acid composition of each gene is from the total amino acid proteome composition of a genome. The computational strategy is straight forward:
# Input a list of test genomes
# Foreach genome in that list:
** first calculate the AA freqs in the total proteome
** Then start another loop . . .
*** Foreach ORF in that genome > 50 AAs
**** Calculate the AA freq distribution
**** Foreach Amino Acid: 
***** Calculate the sos, AA~~i~~ += (OBSfreq - PROTfreq)^^2^^
**** End Loop
**** Sum all the AA~~i~~ sos
*** End Loop
** End Loop
# Output results into a table for analysis
!! TOOLS:
# Use an genome list that compares different groups. If you asked to look at a specific comparison, I generated that list and emailed it to you. If you don't have any ideas in mind, then [[here is a list|AAscore/GenomeList-TerSpec-vs-Aquat-class.txt]] I generated to compare Terrestrial/Specialized vs. Aquatic microbes. All lists are available on Biowolf. Just navigate to "01-Genomes/00-GenLists/". ''You need to place a copy of a genome list in your home directory to run the perl script.'' NOTE: There is a column in each list file named "Group". This column divides the genomes in the list into two groups (1 or 2) so it is this variable that will be used for the primary level of discrimination in the stats analysis. 
# Use the 3rd version of the AAfreq script: ''12.03-~ScoreAminoAcidSumSquares.pl''. Edit the input list name and the output file name. Run.
# Plot Results in R. Here are some commands you can use. You'll need to edit a few of the lines to be specific for your files/variables:
{{{
# import dataframe - - - - - - - - - - - - - - - - - - - - 
d=read.table('AminoAcidSumSquareTable-XXXXX.txt', sep='\t', header=T)

# assign GROUP to be used as a factor in plots- - - - - - - - - - 
d$Group<- as.factor(d$Group)

# startup ggplot routines - - - - - - - - - - - - - - - - - - - - 
library(ggplot2)

# simple plot - - - - - - - - - - - - - - - - - - - - 
ggplot(d) + aes(x=AAmb,y=SumScore,colour=Group) + geom_point()

# Very cool function Ryan Dale found:  - - - - - - - - - - - - - - - - 
# Note that each list has one unique variable, either Phylo, Habitat, Topt
# Enter the name of that variable in the 'XXX' position
m=melt(d,id.var=c('Genome','MB','GC','AAmb','SumScore','Group','XXXX'))

# complex plot - - - - - - - - - - - - - - - - - - - - 
ggplot(m)+aes(x=SumScore,y=value,colour=variable,shape=Group)+geom_point()+facet_grid(.~variable)
}}}

4. Also use the correlograms in R that we looked at in the last class:
{{{
# import data table
d=read.table('AminoAcidFreqTable-29FEB.txt', sep='\t', header=T)

# assign amino acid frequencies to one variable
fAA=d[,2:21]

# plot correlogram
library(corrgram)
corrgram(fAA, order=TRUE, lower.panel=panel.pie, upper.panel=panel.shade,
text.panel=panel.txt, main="AAfreq")
}}}

!!!
.
<<options>>
<html><img src="07/Alpha-Helix-biopython.png" style="height:500px"></html>
!!
<html><img src="07/ahelixR1.png" style="height:500px"></html>
!!!
<html><img src="07/080505-AlphaHelix-plot02.png" style="height:500px"></html>
!!
<html><img src="07/080505-AlphaHelix-plot03.png" style="height:500px"></html>
!!
.
!!!Distribution of amino acids
[img[01/AAprofiles.png]]
!!!AA Entropy vs Genome Size
[img[01/AAentropy_mb.png]]
!!!AA Entropy vs G+C content
[img[01/AAentropy_gc.png]]
<html><img src="06/s01.png" style="height:50px"><br><img src="06/s02.png" style="height:100px"></html>
([[PDF|06/Barthet-MATkEvolution-JME-2008.pdf]] link to article here.)
!! Focus of work:
<html><img src="06/s03.png" style="height:100px"></html>
!! AA class composition:
<html><img src="06/f01.png" style="height:300px"></html>
!! AA Variance by sector of ORF:
<html><img src="06/f03.png" style="height:450px"></html>
!! Comparison of variance to other ORFs:
<html><img src="06/t02.png" style="height:300px"></html>
!! Conclusion:
<html><img src="06/c01.png" style="height:100px"></html>
!!!
Get BioPython [[HERE | http://biopython.org/wiki/Main_Page]]
[img[07/biopy01.png]]
!!
Biowolf is the 286-core parallel computign cluster maintained at the Delaware Biotechnology Institute. Class accounts will be assigned to any participants interested in learning how to utilize this resource.

''A Hitchhiker's Guide to Biowolf:'' http://bioit.dbi.udel.edu/howto/sge.html

{{{
prompt> ssh username@biowolf.dbi.udel.edu
}}}

{{{
commands:
      ls  = list files aka "dir"
      rm = remove file aka "delete"
      cd = change directory
      ln = symbolic link
          example: ln -s source_folder myfolder
      tarballs . . . .  filename.tar
               tar xcf filename.tar
}}}
!! Access the Genome Folders in my home directory
{{{
prompt> ln -s /home/marsh/06-ClassGenomes 01-Genomes
}}}

!!Simple Commands in Biowolf:
I forgot to mention that when biowolf runs a job in the cluster, it writes all the screen output into a separate file in your home directory that starts with the jobid string you put into the 00-RUN.sh file, followed by an ".o" followed by the job number. It also generates a file that tells you were the job is running that has the same name as above except instead of ".o" there is a ".po" in the name. The first one is important. The second one you can ignore.

If the job id string is AAfreqy then you  would find something like "AAfreqy.o267456" once the job started running. The quickest way to see how a job is doing is to use either the "more" or the "tail" command to read what is in the file:
{{{
	biowolf> more AAfreqy.o267456
}}}
A note about the wild card character "*". The asterisk is your friend. It can save you lots of typing. If you want to do anything with a file or directory all you have to do is type in enough characters so that the target (file or directory) is unique and then just the asterisk will do the rest. As above:
{{{
	biowolf> more *6
}}}
would give the same result if there were no other files that ended in "6". 
{{{
        biowolf> more AA*
}}}
would list the contents of both the ".o" and the ".po" files.

I like to add numerals to the begging of all my directory names because it makes it faster to jump around with the "cd" command:
{{{
	biowolf> cd 01*
}}}
would move you into the 01-Genomes folder.
{{{
	biowolf> cd 01*/02*
}}}
would move you into the 02-FAAfiles folder in the 01-Genomes folder.


!!!
[img[00/cdhit01.png]]
!!http://cd-hit.org
<html><img src="00/cdhit02.png" style="height:300px"></html>
!!!
''Candidatus: //Carsonella ruddii// PV.''  Candidatus //Carsonella ruddii// PV is an obligate endosymbiont of //Pachypsylla venusta//, an insect that feeds only on plant phloem sap. Phloem sap is poor in essential amino acids which are provided by the endosymbiont. The genome of Candidatus //Carsonella ruddii// PV, is 160 kbp and is @@the smallest genome sequenced to date@@, retaining genes primarily involved in amino acid synthesis and translation. This organism will be used for comparative analysis with other insect endosymbionts.
Go to ~GenBank Project Page[[ PID17977 |http://www.ncbi.nlm.nih.gov/sites/entrez?db=genomeprj&cmd=Retrieve&dopt=Overview&list_uids=17977]]
/***
|Name|CheckboxPlugin|
|Source|http://www.TiddlyTools.com/#CheckboxPlugin|
|Version|2.2.4|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <<br>>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|Add checkboxes to your tiddler content|
This plugin extends the TiddlyWiki syntax to allow definition of checkboxes that can be embedded directly in tiddler content.  Checkbox states are preserved by either:
* automatically modifying the tiddler content (deprecated)
* or, by setting/removing tags on specified tiddlers,
* or, by setting custom field values on specified tiddlers,
* or, by saving to a locally-stored cookie ID.
When an ID is assigned to the checkbox, it enables direct programmatic access to the checkbox DOM element, as well as creating an entry in TiddlyWiki's config.options[ID] internal data.  In addition to tracking the checkbox state, you can also specify custom javascript for programmatic initialization and onClick event handling for any checkbox, so you can provide specialized side-effects in response to state changes.
!!!!! Inline wiki-syntax usage
<<<
//{{{
[ ]or[_] and [x]or[X]
//}}}
Simple checkboxes using 'Inline X' storage.  The current unchecked/checked state is indicated by the character between the {{{[}}} and {{{]}}} brackets ("_" means unchecked, "X" means checked).  When you click on a checkbox, the current state is retained by directly modifying the tiddler content to place the corresponding "_" or "X" character in between the brackets.
>//''NOTE: 'Inline X' syntax has been deprecated...''  This storage format only works properly for checkboxes that are directly embedded and accessed from content in a single tiddler.  However, if that tiddler is 'transcluded' into another (by using the {{{<<tiddler TiddlerName>>}}} macro), the 'Inline X' will be ''erroneously stored in the containing tiddler's source content, resulting in corrupted content in that tiddler.''  For anything but the most simple of "to do list" uses, you should select from the various alternative storage methods described below...//
//{{{
[x=id]
//}}}
Assign an optional ID to the checkbox so you can use {{{document.getElementByID("id")}}} to manipulate the checkbox DOM element, as well as tracking the current checkbox state in {{{config.options["id"]}}}.  If the ID starts with "chk" the checkbox state will also be saved in a cookie, so it can be automatically restored whenever the checkbox is re-rendered (overrides any default {{{[x]}}} or {{{[_]}}} value).  If a cookie value is kept, the "_" or "X" character in the tiddler content remains unchanged, and is only applied as the default when a cookie-based value is not currently defined.
//{{{
[x(title|tag)] or [x(title:tag)]
//}}}
Initializes and tracks the current checkbox state by setting or removing a particular tag value from a specified tiddler.  If you omit the tiddler title (and the | or : separator), the specified tag is assigned to the current tiddler.  If you omit the tag value, as in {{{(title|)}}}, the default tag, {{{checked}}}, is assumed.  Omitting both the title and tag, {{{()}}}, tracks the checkbox state by setting the "checked" tag on the current tiddler.  When tag tracking is used, the "_" or "X" character in the tiddler content remains unchanged, and is not used to set or track the checkbox state.  If a tiddler title named in the tag does not exist, the checkbox state defaults to the "inline X" value.  If this value is //checked//, or is subsequently changed to //checked//, it will automatically create the missing tiddler and then add the tag to it.  //''NOTE: beginning with version 2.1.2 of this plugin, the "|" separator is the preferred separator between the title and tag name, as it avoids syntactic ambiguity when ":" is used within tiddler titles or tag names.''//
//{{{
[x(field@tiddler)]
//}}}
Initializes and tracks the current checkbox state by setting a particular custom field value from a specified tiddler.  If you omit the tiddler title (but not the "@" separator), the specified field on the current tiddler is used.  If you omit the field name, as in {{{(@tiddler)}}}, a default fieldname of {{{checked}}} is assumed.  Omitting both the field and the tiddler title, {{{(@)}}}, defaults to setting the "checked" field on the current tiddler.  When field tracking is used, the "_" or "X" character in the tiddler content remains unchanged, and is not used to set or track the checkbox state.  If the tiddler title named in the parameter does not exist, the checkbox state defaults to the "inline X" value.  If this value is //checked// or is subsequently changed to //checked//, it will automatically create the missing tiddler and then add the field to it.
//{{{
[x{javascript}{javascript}]
//}}}
You can define optional javascript code segments to add custom initialization and/or 'onClick' handling to a checkbox.  The current checkbox state (and it's other DOM attributes) can be set or read from within these code segments by reference to the default context-object, 'this'.

The first code segment will be executed when the checkbox is initially displayed, so that you can programmatically determine it's starting checked/unchecked state.  The second code segment (if present) is executed whenever the checkbox is clicked, so that you can perform programmed responses or intercept and override the checkbox state based on complex logic using the TW core API or custom functions defined in plugins (e.g. testing a particular tiddler title to see if certain tags are set or setting some tags when the checkbox is clicked).

Note: if you want to use the default checkbox initialization processing with a custom onclick function, use this syntax: {{{ [x=id{}{javascript}] }}} 
<<<
!!!!! Macro usage
<<<
In addition to embedded checkboxes using the wiki syntax described above, a ''macro-based syntax'' is also provided, for use in templates where wiki syntax cannot be directly used.  This macro syntax can also be used in tiddler content, as an alternative to the wiki syntax.  When embedded in [[PageTemplate]], [[ViewTemplate]], or [[EditTemplate]] (or custom alternative templates), use the following macro syntax:
//{{{
<span macro="checkbox target checked id onInit onClick"></span>
//}}}
or, when embedded in tiddler content, use the following macro syntax:
//{{{
<<checkbox target checked id onInit onClick>>
//}}}
where:
''target''
>is either a tag reference (e.g., ''tagname|tiddlername'') or a field reference (e.g. ''fieldname@tiddlername''), as described above.
''checked'' (optional)
>is a keyword that sets the initial state of the checkbox to "checked".  When omitted, the default checkbox state is "unchecked".
''id'' (optional)
>specifies an internal config.options.* ID, as described above.  If the ID begins with "chk", a cookie-based persistent value will be created to track the checkbox state in between sessions.
''onInit'' (optional)
>contains a javascript event handler to be performed when the checkbox is initially rendered (see details above).
''onClick'' (optional)
>contains a javascript event handler to be performed each time the checkbox is clicked (see details above).
>//note: to use the default onInit handler with a custom onClick handler, use "" (empty quotes) as a placeholder for the onInit parameter//
<<<
!!!!!Examples
<<<
''checked and unchecked static default ("inline X") values:''
//{{{
[X] label
[_] label
//}}}
>[X] label
>[_] label
''document-based value (id='demo', no cookie):''
//{{{
[_=demo] label
//}}}
>[_=demo] label
''cookie-based value  (id='chkDemo'):''
//{{{
[_=chkDemo] label
//}}}
>[_=chkDemo] label
''tag-based value (TogglyTagging):''
//{{{
[_(CheckboxPlugin|demotag)]
[_(CheckboxPlugin|demotag){this.refresh.tagged=this.refresh.container=false}]
//}}}
>[_(CheckboxPlugin|demotag)] toggle 'demotag' (and refresh tiddler display)
>[_(CheckboxPlugin|demotag){this.refresh.tagged=this.refresh.container=false}] toggle 'demotag' (no refresh)
''field-based values:''
//{{{
[_(demofield@CheckboxPlugin)] demofield@CheckboxPlugin
[_(demofield@)] demofield@ (equivalent to demonfield@ current tiddler)
[_(checked@CheckboxPlugin)] checked@CheckboxPlugin
[_(@CheckboxPlugin)] @CheckboxPlugin
[_(@)] @ (equivalent to checked@ current tiddler)
//}}}
>[_(demofield@CheckboxPlugin)] demofield@CheckboxPlugin
>[_(demofield@)] demofield@ (current tiddler)
>[_(checked@CheckboxPlugin)] checked@CheckboxPlugin
>[_(@CheckboxPlugin)] @CheckboxPlugin
>[_(@)] toggle field: @ (defaults to "checked@here")
>click to view current: <<toolbar fields>>
''custom init and onClick functions:''
//{{{
[X{this.checked=true}{alert(this.checked?"on":"off")}] message box with checkbox state
//}}}
>[X{this.checked=true}{alert(this.checked?"on":"off")}] message box with checkbox state
''retrieving option values:''
>config.options['demo']=<script>return config.options['demo']?"true":"false";</script>
>config.options['chkDemo']=<script>return config.options['chkDemo']?"true":"false";</script>
<<<
!!!!!Configuration
<<<
Normally, when a checkbox state is changed, the affected tiddlers are automatically re-rendered, so that any checkbox-dependent dynamic content can be updated.  There are three possible tiddlers to be re-rendered, depending upon where the checkbox is placed, and what kind of storage method it is using.
*''container'': the tiddler in which the checkbox is displayed. (e.g., this tiddler)
*''tagged'': the tiddler that is being tagged (e.g., "~MyTask" when tagging "~MyTask:done")
*''tagging'': the "tag tiddler" (e.g., "~done" when tagging "~MyTask:done")
You can set the default refresh handling for all checkboxes in your document by using the following javascript syntax either in a systemConfig plugin, or as an inline script.  (Substitute true/false values as desired):
{{{config.checkbox.refresh = { tagged:true, tagging:true, container:true };}}}

You can also override these defaults for any given checkbox by using an initialization function to set one or more of the refresh options.  For example:
{{{[_{this.refresh.container=false}]}}}
<<<
!!!!!Installation
<<<
import (or copy/paste) the following tiddlers into your document:
''CheckboxPlugin'' (tagged with <<tag systemConfig>>)
<<<
!!!!!Revision History
<<<
2007.08.06 - 2.2.5 supress automatic refresh of any tiddler that is currently being edited.  Ensures that current tiddler edit sessions are not prematurely discarded (losing any changes).  However, if checkbox changes a tag on a tiddler being edited, update the "tags" input field (if any) so that saving the edited tiddler correctly reflects any changes due to checkbox activity... see refreshEditorTagField().
2007.07.13 - 2.2.4 in handler(), fix srctid reference (was "w.tiddler", should have been "w.tiddler.title").  This fixes broken 'inline X' plus fatal macro error when using PartTiddlerPlugin.  Thanks to cmari for reporting the problem and UdoBorkowski for finding the code error.
2007.06.21 - 2.2.3 suppress automatic refresh of tiddler when using macro-syntax to prevent premature end of tiddler editing session.
2007.06.20 - 2.2.2 fixed handling for 'inline X' when checkboxes are contained in a 'trancluded' tiddler.  Now, regardless of where an inline X checkbox appears, the X will be placed in the originating source tiddler, rather than the tiddler in which the checkbox appears.
2007.06.17 - 2.2.1 Refactored code to add checkbox //macro// syntax for use in templates (e.g., {{{macro="checkbox ..."}}}. Also, code cleanup of existing tag handling.
2007.06.16 - 2.2.0 added support for tracking checkbox states using tiddler fields via "(fieldname@tiddlername)" syntax.
2006.05.04 - 2.1.3 fix use of findContainingTiddler() to check for a non-null return value, so that checkboxes won't crash when used outside of tiddler display context (such as in header, sidebar or mainmenu)
2006.03.11 - 2.1.2 added "|" as delimiter to tag-based storage syntax (e.g. "tiddler|tag") to avoid parsing ambiguity when tiddler titles or tag names contain ":".   Using ":" as a delimiter is still supported but is deprecated in favor of the new "|" usage.  Based on a problem reported by JeffMason.
2006.02.25 - 2.1.0 added configuration options to enable/disable forced refresh of tiddlers when toggling tags
2006.02.23 - 2.0.4 when toggling tags, force refresh of the tiddler containing the checkbox.
2006.02.23 - 2.0.3 when toggling tags, force refresh of the 'tagged tiddler' so that tag-related tiddler content (such as "to-do" lists) can be re-rendered.
2006.02.23 - 2.0.2 when using tag-based storage, allow use [[ and ]] to quote tiddler or tag names that contain spaces:
{{{[x([[Tiddler with spaces]]:[[tag with spaces]])]}}}
2006.01.10 - 2.0.1 when toggling tags, force refresh of the 'tagging tiddler'.  For example, if you toggle the "systemConfig" tag on a plugin, the corresponding "systemConfig" TIDDLER will be automatically refreshed (if currently displayed), so that the 'tagged' list in that tiddler will remain up-to-date.
2006.01.04 - 2.0.0 update for ~TW2.0
2005.12.27 - 1.1.2 Fix lookAhead regExp handling for {{{[x=id]}}}, which had been including the "]" in the extracted ID.  
Added check for "chk" prefix on ID before calling saveOptionCookie()
2005.12.26 - 1.1.2 Corrected use of toUpperCase() in tiddler re-write code when comparing {{{[X]}}} in tiddler content with checkbox state. Fixes a problem where simple checkboxes could be set, but never cleared.
2005.12.26 - 1.1.0 Revise syntax so all optional parameters are included INSIDE the [ and ] brackets.  Backward compatibility with older syntax is supported, so content changes are not required when upgrading to the current version of this plugin.   Based on a suggestion by GeoffSlocock
2005.12.25 - 1.0.0 added support for tracking checkbox state using tags ("TogglyTagging")
Revised version number for official post-beta release.
2005.12.08 - 0.9.3 support separate 'init' and 'onclick' function definitions.
2005.12.08 - 0.9.2 clean up lookahead pattern
2005.12.07 - 0.9.1 only update tiddler source content if checkbox state is actually different.  Eliminates unnecessary tiddler changes (and 'unsaved changes' warnings)
2005.12.07 - 0.9.0 initial BETA release
<<<
!!!!!Credits
<<<
This feature was created by EricShulman from [[ELS Design Studios|http:/www.elsdesign.com]]
<<<
!!!!!Code
***/
//{{{
version.extensions.CheckboxPlugin = {major: 2, minor: 2, revision:5 , date: new Date(2007,8,6)};
//}}}

//{{{
config.checkbox = { refresh: { tagged:true, tagging:true, container:true } };
config.formatters.push( {
	name: "checkbox",
	match: "\\[[xX_ ][\\]\\=\\(\\{]",
	lookahead: "\\[([xX_ ])(=[^\\s\\(\\]{]+)?(\\([^\\)]*\\))?({[^}]*})?({[^}]*})?\\]",
	handler: function(w) {
		var lookaheadRegExp = new RegExp(this.lookahead,"mg");
		lookaheadRegExp.lastIndex = w.matchStart;
		var lookaheadMatch = lookaheadRegExp.exec(w.source)
		if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
			// get params
			var checked=(lookaheadMatch[1].toUpperCase()=="X");
			var id=lookaheadMatch[2];
			var target=lookaheadMatch[3];
			if (target) target=target.substr(1,target.length-2).trim(); // trim off parentheses
			var fn_init=lookaheadMatch[4];
			var fn_click=lookaheadMatch[5];
			var tid=story.findContainingTiddler(w.output);  if (tid) tid=tid.getAttribute("tiddler");
			var srctid=w.tiddler?w.tiddler.title:null;
			config.macros.checkbox.create(w.output,tid,srctid,w.matchStart+1,checked,id,target,config.checkbox.refresh,fn_init,fn_click);
			w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;
		}
	}
} );
config.macros.checkbox = {
	handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		if(!(tiddler instanceof Tiddler)) { // if no tiddler passed in try to find one
			var here=story.findContainingTiddler(place);
			if (here) tiddler=store.getTiddler(here.getAttribute("tiddler"))
		}
		var srcpos=0; // "inline X" not applicable to macro syntax
		var target=params.shift(); if (!target) target="";
		var defaultState=params[0]=="checked"; if (defaultState) params.shift();
		var id=params.shift(); if (id && !id.length) id=null;
		var fn_init=params.shift(); if (fn_init && !fn_init.length) fn_init=null;
		var fn_click=params.shift(); if (fn_click && !fn_click.length) fn_click=null;
		var refresh={ tagged:true, tagging:true, container:false };
		this.create(place,tiddler.title,tiddler.title,0,defaultState,id,target,refresh,fn_init,fn_click);
	},
	create: function(place,tid,srctid,srcpos,defaultState,id,target,refresh,fn_init,fn_click) {
		// create checkbox element
		var c = document.createElement("input");
		c.setAttribute("type","checkbox");
		c.onclick=this.onClickCheckbox;
		c.srctid=srctid; // remember source tiddler
		c.srcpos=srcpos; // remember location of "X"
		c.container=tid; // containing tiddler (may be null if not in a tiddler)
		c.tiddler=tid; // default target tiddler 
		c.refresh = {};
		c.refresh.container = refresh.container;
		c.refresh.tagged = refresh.tagged;
		c.refresh.tagging = refresh.tagging;
		place.appendChild(c);
		// set default state
		c.checked=defaultState;
		// track state in config.options.ID
		if (id) {
			c.id=id.substr(1); // trim off leading "="
			if (config.options[c.id]!=undefined)
				c.checked=config.options[c.id];
			else
				config.options[c.id]=c.checked;
		}
		// track state in (tiddlername|tagname) or (fieldname@tiddlername)
		if (target) {
			var pos=target.indexOf("@");
			if (pos!=-1) {
				c.field=pos?target.substr(0,pos):"checked"; // get fieldname (or use default "checked")
				c.tiddler=target.substr(pos+1); // get specified tiddler name (if any)
				if (!c.tiddler || !c.tiddler.length) c.tiddler=tid; // if tiddler not specified, default == container
				if (store.getValue(c.tiddler,c.field)!=undefined)
					c.checked=(store.getValue(c.tiddler,c.field)=="true"); // set checkbox from saved state
			} else {
				var pos=target.indexOf("|"); if (pos==-1) var pos=target.indexOf(":");
				c.tag=target;
				if (pos==0) c.tag=target.substr(1); // trim leading "|" or ":"
				if (pos>0) { c.tiddler=target.substr(0,pos); c.tag=target.substr(pos+1); }
				if (!c.tag.length) c.tag="checked";
				var t=store.getTiddler(c.tiddler);
				if (t && t.tags)
					c.checked=t.isTagged(c.tag); // set checkbox from saved state
			}
		}
		if (fn_init) c.fn_init=fn_init.trim().substr(1,fn_init.length-2); // trim off surrounding { and } delimiters
		if (fn_click) c.fn_click=fn_click.trim().substr(1,fn_click.length-2);
		c.init=true; c.onclick(); c.init=false; // compute initial state and save in tiddler/config/cookie
	},
	onClickCheckbox: function(event) {
		if (this.fn_init)
			// custom function hook to set initial state (run only once)
			{ try { eval(this.fn_init); this.fn_init=null; } catch(e) { displayMessage("Checkbox init error: "+e.toString()); } }
		else if (this.fn_click)
			// custom function hook to override or react to changes in checkbox state
			{ try { eval(this.fn_click) } catch(e) { displayMessage("Checkbox click error: "+e.toString()); } }
		if (this.id)
			// save state in config AND cookie (only when ID starts with 'chk')
			{ config.options[this.id]=this.checked; if (this.id.substr(0,3)=="chk") saveOptionCookie(this.id); }
		if (this.srctid && this.srcpos>0 && (!this.id || this.id.substr(0,3)!="chk") && !this.tag && !this.field) {
			// save state in tiddler content only if not using cookie, tag or field tracking
			var t=store.getTiddler(this.srctid); // put X in original source tiddler (if any)
			if (t && this.checked!=(t.text.substr(this.srcpos,1).toUpperCase()=="X")) { // if changed
				t.set(null,t.text.substr(0,this.srcpos)+(this.checked?"X":"_")+t.text.substr(this.srcpos+1),null,null,t.tags);
				if (!story.isDirty(t.title)) story.refreshTiddler(t.title,null,true);
				store.setDirty(true);
			}
		}
		if (this.field) {
			if (this.checked && !store.tiddlerExists(this.tiddler))
				store.saveTiddler(this.tiddler,this.tiddler,"",config.options.txtUserName,new Date());
			// set the field value in the target tiddler
			store.setValue(this.tiddler,this.field,this.checked?"true":"false");
			// DEBUG: displayMessage(this.field+"@"+this.tiddler+" is "+this.checked);
		}
		if (this.tag) {
			if (this.checked && !store.tiddlerExists(this.tiddler))
				store.saveTiddler(this.tiddler,this.tiddler,"",config.options.txtUserName,new Date());
			var t=store.getTiddler(this.tiddler);
			if (t) {
				var tagged=(t.tags && t.tags.find(this.tag)!=null);
				if (this.checked && !tagged) { t.tags.push(this.tag); store.setDirty(true); }
				if (!this.checked && tagged) { t.tags.splice(t.tags.find(this.tag),1); store.setDirty(true); }
			}
			// if tag state has been changed, update display of corresponding tiddlers (unless they are in edit mode...)
			if (this.checked!=tagged) {
				if (this.refresh.tagged) {
					if (!story.isDirty(this.tiddler)) story.refreshTiddler(this.tiddler,null,true); // the TAGGED tiddler in view mode
					else config.macros.checkbox.refreshEditorTagField(this.tiddler,this.tag,this.checked); // the TAGGED tiddler in edit mode (with tags field)
				}
				if (this.refresh.tagging)
					if (!story.isDirty(this.tag)) story.refreshTiddler(this.tag,null,true); // the TAGGING tiddler
			}
		}
		// refresh containing tiddler (but not during initial rendering, or we get an infinite loop!) (and not when editing container)
		if (!this.init && this.refresh.container && this.container!=this.tiddler)
			if (!story.isDirty(this.container)) story.refreshTiddler(this.container,null,true); // the tiddler CONTAINING the checkbox
		return true;
	},
	refreshEditorTagField: function(title,tag,set) {
		var tagfield=story.getTiddlerField(title,"tags");
		if (!tagfield||tagfield.getAttribute("edit")!="tags") return; // if no tags field in editor (i.e., custom template)
		var tags=tagfield.value.readBracketedList();
		if (tags.contains(tag)==set) return; // if no change needed
		if (set) tags.push(tag); // add tag
		else tags.splice(tags.indexOf(tag),1); // remove tag
		for (var t=0;t<tags.length;t++) tags[t]=String.encodeTiddlyLink(tags[t]);
		tagfield.value=tags.join(" "); // reassemble tag string (with brackets as needed)
		return;
	}
}
//}}}
Background: #fffffd
Foreground: #000
PrimaryPale: #f00
PrimaryLight: #18f
PrimaryMid: #04b
PrimaryDark: #018
SecondaryPale: #ffc
SecondaryLight: #fe8
SecondaryMid: #db4
SecondaryDark: #841
TertiaryPale: #eeeeff
TertiaryLight: #999
TertiaryMid: #666
TertiaryDark: #444
Error: #f88
[img[anim-codingpain.gif]]
''Dr. Adam G. Marsh''
645.4367
amarsh@udel.edu

!!!
.
Background: #fff . . . . . main page color
Foreground: #000 . . . . . main text color
PrimaryPale: #8cf
PrimaryLight: #18f
PrimaryMid: #04b . . . . main text emphasis color (main menu items, tiddlers)
PrimaryDark: #014 . . . . . text in sidebar menu
SecondaryPale: #ffc
SecondaryLight: #fe8 . . . color of background highlight
SecondaryMid: #db4
SecondaryDark: #841
TertiaryPale: #eee . . . . background of inactive menu or tag boxes
TertiaryLight: #ccc . . . background of active tag boxes
TertiaryMid: #999 . . . in active tab background
TertiaryDark: #666 . . . secondary notes (created text on tiddler title)
Error: #f88
FrontPage
!!!
<html><center><img src="00/RD-aafreq-vs-gc.png" style="height:70px"></center></html>
! MAST 667-015
<html>
<div style="color: rgb(100, 100, 150); font-family: Monaco;">
This course serves as a general introduction to using informatic methods in order to link genomic/proteomic sequence features to specific mechanisms of environmental adaptations. The format is informal, with general discussions each week of topics/techniques in this developing field. The goal of the course is to ensure that CMES students interested in this line of research are fully aware of the intellectual challenges in environmental genomics and have some familiarity with the computational tools that are available to tackle these difficult bioinformatic questions.
</div></html>
!!
[img[00/agm3.png]]
!FTP a nucleotide fasta file tarball . . . . 
** Look here GenBank, and compare the two "portals" for getting sequences from gene bank
** Use the link to get to the [[FTP page | ftp://ftp.ncbi.nlm.nih.gov/genomes/Bacteria/]]
** download the "all.ffn.tar.gz" file just by clicking on it.
** copy the file from your local computer to your biowolf account. 
** make a new dir:
{{{
biowolf> mkdir 02-FFNfiles
}}}
** now copy the tarball to that directory
** move to the new directory
{{{
biowolf> cd 02*
}}}
** untar the files
{{{
biowolf> tar xvf all.ffn.tar.gz
}}}
** compare what you get to what you see in my ffn directory:
{{{
biowolf> cd ~/01*/03*
biowolf> ls -l
}}}

The plugin page is at: [[http://www.math.ist.utl.pt/~psoares/addons.html|http://www.math.ist.utl.pt/~psoares/addons.html]]
<<photoGallery url:00-DailyNotes/pics/2003-*.jpg first:1 last:5 height:150 time:3000 labels:'PhotoLegends'>>
!!The Emerald City: http://www.ncbi.nlm.nih.gov/genomes/lproks.cgi
[img[02/ncbi-lproks.png]]

!!The Man Behind The Curtain: ftp://ftp.ncbi.nlm.nih.gov/genomes/Bacteria/
[img[02/ftp-ncbi.png]]

!!!
''jEdit'' is a feature-rich programmer's text editor built on Java that will run on all computers with JRE (java runtime environment). To download, install, and set up jEdit as quickly and painlessly as possible, go to the [[Quick Start page | http://www.jedit.org/index.php?page=quickstart]].
<html><img src="00/jedit.png" style="height:300px"></html>
!!!
<<today>>
|>|Tag Lookup Table|
|Tag = journal|Tag = research|
|<<tagging journal>>|<<tagging research>>|
------------
Get Komodo [[HERE | http://www.activestate.com/Products/komodo_ide/komodo_edit.mhtml]]
[img[07/komodopy01.png]]
!!
Linear discriminant function analysis of the word repeat distances for each genome in the FREE and PATH groups. (a) Differences in patterns of amino acid word usage (Fig 1) evidence a highly significant discrimination (p < 0.0001) between F and P genomes, with a non-dimensional separation between the group centroids of 349 statisticals units. (b) This difference is not present in the randomized genomes; inset plotted at a fine scale to show the 5.8 unit separation the random group centroids. 
<html><img src="01/NIH-Fig3.png" style="height:350px"></html>
!!!
| !Lecture | !Date | !General Topic |
| [[01|Lecture01-13FEB]] | 13FEB | Information In Genomes |
| [[02|Lecture02-20FEB]] | 20FEB | Data Mining |
| [[03|Lecture03-27FEB]] | 27FEB | Analytical Pipeline |
| [[04|Lecture04-05MAR]] | 05MAR | Amino Acid Freq Pipeline |
| Biowolf Workshop | 12MAR | R:"corrgram" function |
| No Class | 19MAR | |
| [[05|Lecture05-26MAR]] | 26MAR | Amino Acid Research Hypothesis |
| //Spring Break// | 02APR | |
| [[06|Lecture06-14MAY]] | 14MAY | Methodology and Result Summary |
!!!
!Information in Biological Systems
''What is information?''
** [[01-01]]  How much information is in this random image?
** [[01-02]]  How much information is in this distributed image?
** [[01-03]]  Comparing information content
** [[01-04]]  Information: levels
** [[01-05]]  Information: semantics
** [[01-06]]  Bioinformatics: information expansion
!!!
!Data Mining
''What is mining information?''
** [[02-01]]  How much information is in this gene sequence?
** [[02-02]]  No gene is an island . . . . 
** [[02-03]]  No protein is an island . . . .
** [[02-04]]  Define your quest
** [[02-05]]  Ask questions on large scales
** [[Biowolf]]
** CD-HIT
** [[SSH]]
!!!
!Analysis Pipeline
''An information superhighway on your desk''
** [[03-01]]  GenBank resources
** [[03-02]]  Tom Hanson: proteome isoelectric point
** [[03-03]]  Surfing the pipeline . . . . .
** [[03-04]]  Amino Acids: What are they good for?
** [[03-05]]  Amino Acid Frequencies
!!!
# Biowolf commands . . . [[Biowolf]]
# Analytical Pipeline . . . 
## [[04-01]] Amino Acid Repetition Index
## [[04-02]] ORF Selection Score vs Temperature
## [[04-03]] Pipeline: iterative tasks are automated  
## [[04-04|04/GenomeSizeRegressions.mov]] Data Screening . . . 
# [[PYTHON]]
# MatLab
# [[R stats|Rstats]]
# AAhunt -> AAresults
# Now What? Next Exercise . . . . . 
!!!
# ''Hypothesis development''
## Amino acid usage //WITHIN// a genome
## Quantifying differences
## Biological significance of the ''variance'' in AA representation within a gene
## What is a core genome?
# ''PERL script structure''
## embedded calculations
## data output format: //know your endgame//
# ''DATA Analysis''
## R package scripts
## general descriptors
## ggplot2
## PCA

''A full exercise has been outlined on the Project Page: AAscore. The details of that analysis, from hypothesis to apotheosis, provide the framework for the above talking points.''
!!!
[img[00/agm3.png]]
# @@''QUESTION:'' IS THERE A RELATIONSHIP BETWEEN AA COMPOSITION AND PEPTIDE STRUCTURE?@@
# We have amino acid composition data:
** Variance of composition among proteins within a genome
** Distance measure from genome core composition
** Does it relate to structure? PeptideCompositionStructure
# ''Ramachandran Plots . . . .''
** Phi and Psi angle plots of the alpha-carbons of amino acids in a protein molecules peptide //backbone//.
** Tools: (note: __''Ryan "soon-to-be-professor" Dale''__ introduced me to these tools)
*** [[PYTHON]]
*** [[Rpy]]
*** BioPython
*** MatPlotLib
*** [[Komodo]] Script Editor
** Script Tools
*** [[Peter Cock|PCrama]], Warwick University, UK
*** Alpha Helix plot in R: Alpha-Rplot
*** Alpha Helix plot in BioPython/Pylab: Alpha-BioPy
*** [[03.3-rama.py]]
** Data . . . 
*** Ramachandran Plot for 16AA alpha helix: AlphaPhiPsi
*** Ramachandran Plot for Succinate Dehydrogenase: SDH-PhiPsi
# BioPython Tutorial: [[HERE|07/Tutorial-Biopython.pdf]]
# Python Bioinformatics Course: PyBioInfo

!!!
[[''DOWNLOAD''|04/Lombardot-MetaLook-MarineEnvironmentalGenomics.pdf]]
[img[04/lombardot1.png]]
[img[04/lombardot2.png]]
[img[04/lombardot3.png]]
[[''DOWNLOAD''|04/Lombardot-MetaLook-MarineEnvironmentalGenomics.pdf]]
!!!
[[FrontPage]]
OverView
[[Syllabus]]
[[Lecture Index]]
[[Projects]]
[[Tools]]
[[References]]
[[Contact]]
!!!
!Papers in the works . . . 

!!!
Unfortunately, the University of Delaware no longer supports free licenses for students, only faculty. Student versions are available for purchase at a large discount, but you should ask your advisor to send this email to Anita Schwartz (anita@udel.edu):
{{{
Dear Ms. Schwartz,
I need to install MatLab on a research computer in my lab for the 
(choose one: Windows, OS X, or Linux) operating system. 
Could you please send me the install diskettes or the download instructions? 
Thank you.
Sincerely, .......
}}}
''MatLab Tutorial: Lots of online resources available. Best HELP index of any program I have ever used.''
[[MATLAB HOME|http://www.mathworks.com/]]
<html><img src="00/matlab.png" style="height:300px"></html>

!!!
Get MatPlotLib [[HERE | http://matplotlib.sourceforge.net/]]
[img[07/matpy01.png]]
!!
{{{
<html><img src="XXXX.png" style="height:600px"></html>
}}}
! MAST 667-015
''This course serves as a general introduction to using informatic methods in order to link genomic/proteomic sequence features to specific mechanisms of environmental adaptations. The format is informal, with general discussions each week of topics/techniques in this developing field. The goal of the course is to ensure that CMES students interested in this line of research are fully aware of the intellectual challenges in environmental genomics and have some familiarity with the computational tools that are available to tackle these difficult bioinformatic questions''. 

@@ The first half of the course will be lecture/discussions of: @@
1. Information in biological systems
2. Data mining
3. Analysis pipeline
4. Result QC
5. PERL scripting
6. Multivariate Stats
7. Formulating testable hypotheses
8. Linking Genome-Transcriptome-Proteome-Environment

@@ The second half of the course will focus on individual research projects @@
1. Student presentations of techniques they have tried
2. Student presentations of data they have synthesized/integrated

All participants will get a user account on Biowolf, which is the 286 CPU cluster at DBI, for running informatics based exercises (which are voluntary). A full data set of 620 microbial genomes is now in place on Biowolf for your use.  For the second half of the course, we will discuss/present data generated by any participants who are interested in doing a small informatics project. If there is enough critical mass of interested people, we should be able to generate enough exploratory data for a small manuscript. 

!!!
Peter Cock - R and Python Scripts:
http://www2.warwick.ac.uk/fac/sci/moac/currentstudents/peter_cock/r/ramachandran/
[img[07/peter-rama.png]]
!!
[[HOMEPAGE|http://www.python.org]]
<html><img src="00/python.png" style="height:400px"></html>
!!!
<!--{{{-->
<div class='header' macro='gradient vert #cc5544 #2255aa'
<div class='headerShadow'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
<span class='topMenu' refresh='content' tiddler='TopMenu'></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>
<!--}}}-->
@@Is there a structural relationship that would explain the variance in composition of individual proteins we have observed?@@
<html><img src="data/AAscore/HistogramSummary-ordered.png" style="height:400px"></html>
//From AAscore-results//
!!
[img[07/phipsi.png]]
!!
<<slideShow>>
-s-

<<photoGallery url:photos/lisboa-*.jpg first:0 last:3 height:200 time:2000 labels:'Legendas'>>
/***
|''Name:''|PhotoGalleryPlugin|
|''Description:''|A browser for a photo gallery with navigational buttons and optional subtitles|
|''Version:''|1.0.0|
|''Date:''|Sep 12, 2007|
|''Source:''|http://www.math.ist.utl.pt/~psoares/addons.html|
|''Documentation:''|[[PhotoGalleryPlugin Documentation|PhotoGalleryPluginDoc]]|
|''Author:''|Paulo Soares|
|''License:''|[[Creative Commons Attribution-Share Alike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|
|''~CoreVersion:''|2.1.0|
***/
//{{{
config.macros.photoGallery = {};
var photoGalleryAutoAdvanceObject=null;
var photoGalleryLabels=null;

photoGalleryAutoAdvance = function() {
 var viewer=document.getElementById("imageGallery");
 var play=document.getElementById("photoGalleryPlayButton");
 var time = parseFloat(viewer.getAttribute("AdvanceTime"));
 if(photoGalleryAutoAdvanceObject) {
  clearInterval(photoGalleryAutoAdvanceObject);
  photoGalleryAutoAdvanceObject = null;
  play.firstChild.data = '►';
 } else {
  if(time>0) {
   photoGalleryAutoAdvanceObject = setInterval("photoGalleryJump('n')", time);
   play.firstChild.data = '▣';
  }
 }
 return;
}

photoGalleryJump = function(step) {
 var viewer=document.getElementById("imageGallery");
 var current = parseFloat(viewer.getAttribute("currentImage"));
 var first = parseFloat(viewer.getAttribute("firstImage"));
 var last = parseFloat(viewer.getAttribute("lastImage"));
 switch (step) {
  case "f":
   var target=first;
   break;
  case "l":
   var target=last;
   break;
  case "n":
   var target = ((current+1)>last) ? first : current+1; 
   break;
  case "p":
   var target = ((current-1)<first) ? last : current-1; 
 }
 document.getElementById( 'imageGalleryObject'+current).style.display='none';
 viewer.setAttribute("currentImage",target);
 document.getElementById( 'imageGalleryObject'+target).style.display='block';
 var currentImage = document.getElementById('currentImage');
 if(currentImage) currentImage.firstChild.data = (target-first+1) + '/'+ (last-first+1);
 currentImage = document.getElementById('photoGalleryLabel');
 if(currentImage) currentImage.firstChild.data = photoGalleryLabels[target-first];
 return;
}

config.macros.photoGallery.handler= function(place,macroName,params,wikifier,paramString,tiddler) {
 if (params.length<3) return;
 var args = paramString.parseParams("list",null,true);
 var title = tiddler.title;
 var url = getParam(args,"url",undefined);
 var first = getParam(args,"first",undefined);
 var last = getParam(args,"last",undefined);
 var height = getParam(args,"height",undefined);
 var width = getParam(args,"width",undefined);
 var time = getParam(args,"time",0);
 var labels = getParam(args,"labels",undefined);
 var numbers = getParam(args,"numbers",true);
 var tiddlerElements = document.getElementById("tiddler"+title).childNodes;
 for (var i = 0; i < tiddlerElements.length; i++){
  if (tiddlerElements[i].className == "viewer"){
   var viewer = tiddlerElements[i];
   break;
  }
 }
 var photoGalleryNextImage = function(e){photoGalleryJump('n');}
 var photoGalleryPreviousImage = function(e){photoGalleryJump('p');}
 var photoGalleryLastImage = function(e){photoGalleryJump('l');}
 var photoGalleryFirstImage = function(e){photoGalleryJump('f');}
 var pictureHolder = document.createElement('CENTER');
 pictureHolder.id = "imageGallery";
 createTiddlyButton(pictureHolder,"«","",photoGalleryFirstImage);
 createTiddlyButton(pictureHolder,"‹","",photoGalleryPreviousImage);
 if(time>0) {
  var play = createTiddlyButton(pictureHolder,"►","",photoGalleryAutoAdvance);
  play.id = 'photoGalleryPlayButton';
  pictureHolder.setAttribute("advanceTime",time);
 }
 createTiddlyButton(pictureHolder,"›","",photoGalleryNextImage);
 createTiddlyButton(pictureHolder,"»","",photoGalleryLastImage);
 pictureHolder.setAttribute("currentImage",first);
 pictureHolder.setAttribute("firstImage",first);
 pictureHolder.setAttribute("lastImage",last);
 var pos = url.indexOf('*');
 var image;
 var style='block';
 if(labels) photoGalleryLabels = store.getTiddlerText(labels).split("\n");
 for(i=first; i<=last; i++){
  image=pictureHolder.appendChild(document.createElement('IMG'));
  image.src = url.substring(0,pos)+i+url.substring(pos+1);
  image.id = 'imageGalleryObject'+i;
  image.style.display=style;
  image.style.marginTop="0.5em";
  image.style.marginBottom="0.5em";
  style='none';
  if(height) image.height = height;
  if(width) image.width = width;
  viewer.appendChild(pictureHolder);
 }
 if(labels) createTiddlyElement(pictureHolder,"DIV","photoGalleryLabel","",photoGalleryLabels[0]);
 if(numbers==true){
  var numImages=last-first+1;
  createTiddlyElement(pictureHolder,"SPAN","currentImage","","1/"+numImages);
 }
}
//}}}
/***
|''Name:''|PhotoShowPlugin|
|''Description:''|Photo gallery slide show|
|''Version:''|1.0.2|
|''Date:''|Oct 07, 2007|
|''Source:''|http://www.math.ist.utl.pt/~psoares/addons.html|
|''Documentation:''|[[PhotoShowPlugin Documentation|PhotoShowPluginDoc]]|
|''Author:''|Paulo Soares|
|''License:''|[[Creative Commons Attribution-Share Alike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|
|''~CoreVersion:''|2.1.0|
|''Requires:''|[[SlideShowPlugin]]|
***/
//{{{
config.macros.photoShow = {
	handler: function(place,macroName,params,wikifier,paramString,tiddler) {
			if (params.length<3) return;
			title = tiddler.title;
			var url = params[0];
			var first = params[1];
			var last = params[2];
			var pos = url.indexOf('*');
		// Grab the 'viewer' element
			var tiddlerElements = document.getElementById("tiddler"+title).childNodes;
			var viewer;
			for (var i = 0; i < tiddlerElements.length; i++){
				if (tiddlerElements[i].className == "viewer"){
					viewer = tiddlerElements[i];
					break;
				}
			}
		var pictureHolder;
		var separator;
		for(i=first; i<=last; i++){
			separator=document.createElement('HR');
			separator.className="slideSeparator";
			viewer.appendChild(separator);
			pictureHolder = document.createElement('CENTER');
			pictureHolder.appendChild(document.createElement('IMG'));
			pictureHolder.lastChild.src = url.substring(0,pos)+i+url.substring(pos+1);
			viewer.appendChild(pictureHolder);
		}
	}
};

config.shadowTiddlers.PhotoShowPluginDoc="The documentation is missing. It is available [[here|http://www.math.ist.utl.pt/~psoares/addons.html#PhotoShowPluginDoc]].";
//}}}
/***
|''Name:''|PlasticCalendarPlugin|
|''Description:''|This plugin creates a custom Gregorian calendar|
|''Version:''|1.3.1|
|''Date:''|Mar 13, 2007|
|''Source:''|http://www.math.ist.utl.pt/~psoares/addons.html|
|''Documentation:''|[[PlasticCalendarPlugin Documentation|PlasticCalendarPluginDoc]]|
|''Author:''|Paulo Soares|
|''License:''|[[Creative Commons Attribution-Share Alike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|
|''~CoreVersion:''|2.1.0|
***/
{{{
// --------------------------------------------------------------------
// Calendar
// --------------------------------------------------------------------

config.macros.calendar = {holidays: []};
config.macros.calendar.options = {
 // day week starts from (normally 0-Su or 1-Mo)
 calendarWeekStart: 0,
 calendarToday: "Today",
 calendarHoliday: "Holiday: ",
 calendarLongDateFormat: "0DD/0MM/YYYY",
 calendarShortDateFormat: "0DD/0MM",
 calendarTag: ["journal"]
};

/***************************************************************************
** Internal functions
***************************************************************************/
var cldTag;

config.macros.calendar.calendarIsHoliday = function(date) {
 var cm = config.macros.calendar;
 var longHoliday = date.formatString(cm.options.calendarLongDateFormat);
 var shortHoliday = date.formatString(cm.options.calendarShortDateFormat);
 for(var i = 0; i < cm.holidays.length; i++) {
 if(cm.holidays[i][0] == longHoliday || cm.holidays[i][0] == shortHoliday) {
 return cm.holidays[i];
 }
 }
 return null;
}

config.macros.calendar.onClickOtherDay = function(e) {
 var day = this.getAttribute('tiddlylink');
 story.displayTiddler(null,day,DEFAULT_EDIT_TEMPLATE);
 for(var i=0; i<cldTag.length;i++){
 story.setTiddlerTag(day, cldTag[i], 0);
 }
 story.focusTiddler(day,"text");
}

config.macros.calendar.getPopupText = function(title) {
 var popup_entries = store.getTiddlerText(title).split("\n");
 var popup = popup_entries[0];
 if(popup_entries.length>1) popup += " ...";
 return popup;
}

config.macros.calendar.findCalendar = function(child) {
 var parent;
 while (child && child.parentNode) {
 parent = child.parentNode;
 if (parent.id == "calendarWrapper") {
 return parent;
 }
 child = parent;
 }
 return null;
}

config.macros.calendar.selectDate = function(e) {
 if (!e) var e = window.event;
 var cm = config.macros.calendar;
 var calendar = cm.findCalendar(this);
 if (calendar) {
 var d = this.getAttribute("date");
 if (d != null) cm.makeCalendar(calendar, new Date(new Number(d)));
 }
 e.cancelBubble = true;
 if (e.stopPropagation) e.stopPropagation();
 return false;
}

config.macros.calendar.makeCalendar = function(calendar, dt_current) {
 var cm = config.macros.calendar;
 var currentDay = new Date(new Number(calendar.getAttribute("currentDay")));
 var setControls = calendar.getAttribute("setControls");
 calendar.setAttribute("date", dt_current.valueOf());

 while (calendar.hasChildNodes())
 calendar.removeChild(calendar.firstChild);

if(setControls==1){
 // get same date in the previous year
 var dt_prev_year = new Date(dt_current);
 dt_prev_year.setFullYear(dt_prev_year.getFullYear() - 1);
 if (dt_prev_year.getDate() != dt_current.getDate())
 dt_prev_year.setDate(0);

 // get same date in the next year
 var dt_next_year = new Date(dt_current);
 dt_next_year.setFullYear(dt_next_year.getFullYear() + 1);
 if (dt_next_year.getDate() != dt_current.getDate())
 dt_next_year.setDate(0);

 // get same date in the previous month
 var dt_prev_month = new Date(dt_current);
 dt_prev_month.setMonth(dt_prev_month.getMonth() - 1);
 if (dt_prev_month.getDate() != dt_current.getDate())
 dt_prev_month.setDate(0);

 // get same date in the next month
 var dt_next_month = new Date(dt_current);
 dt_next_month.setMonth(dt_next_month.getMonth() + 1);
 if (dt_next_month.getDate() != dt_current.getDate())
 dt_next_month.setDate(0);
}

 // get first day to display in the grid for current month
 var dt_firstday = new Date(dt_current);
 dt_firstday.setDate(1);
 dt_firstday.setDate(1 - (7 + dt_firstday.getDay() - cm.options.calendarWeekStart) % 7);

 var area, header;
 var line, cell, i;

 // 1 - calendar header table
 // 2 - print weekdays titles
 // 3 - calendar days table 
calendar.cellPadding = 0;
calendar.cellSpacing = 0;
area = createTiddlyElement(calendar, "tbody");

 // 1 - calendar header table
 header = createTiddlyElement(area,"tr", "calendarHeader");
 header.cellPadding = 0;
 header.cellSpacing = 0;

if(setControls==1){ 
var headerValues = [
 [ "<<", "selectYear", dt_prev_year.valueOf() ],
 [ "<", "selectMonth", dt_prev_month.valueOf() ],
 [ config.messages.dates.months[dt_current.getMonth()] + ' ' + dt_current.getFullYear(),
 "selectToday", currentDay.valueOf() ],
 [ ">", "selectMonth", dt_next_month.valueOf() ],
 [ ">>", "selectYear", dt_next_year.valueOf() ]
 ];

 for (i = 0; i < headerValues.length; ++i) {
 var link = createTiddlyElement(header,"td", null, null, headerValues[i][0]);
 if(i==2) link.colSpan=3;
 link.onclick = cm.selectDate;
 link.setAttribute("date", headerValues[i][2]);
 }
} else {
 var link = createTiddlyElement(header,"td", null, null, 
config.messages.dates.months[dt_current.getMonth()] + ' ' + dt_current.getFullYear());
link.colSpan=7;
}

 // 2 - print weekdays titles
 line = createTiddlyElement(area, "tr", "weekNames");
 for (var n = 0; n < 7; ++n) {
 createTiddlyElement(line, "td", null, null, config.messages.dates.shortDays[(cm.options.calendarWeekStart + n)%7]);
 }

 // 3 - calendar days table
 var dt_current_day = new Date(dt_firstday);
 var day_class;
 var title;
 var holiday;
 var popup;
 var clickHandler;

 while (dt_current_day.getMonth() == dt_current.getMonth() ||
 dt_current_day.getMonth() == dt_firstday.getMonth()) {

 // print row header
 line = createTiddlyElement(area, "tr", "calendarLine", null, null);
 for (var n_current_wday = 0; n_current_wday < 7; ++n_current_wday) {
 title = dt_current_day.formatString(cm.options.calendarLongDateFormat);
 clickHandler = cm.onClickOtherDay;
 popup = null;
 holiday = cm.calendarIsHoliday(dt_current_day);

 if (holiday != null) {
 // holidays
 day_class = (holiday.length==3)? holiday[2]: "holiDay";
 popup = cm.options.calendarHoliday + holiday[1];
 } else if (dt_current_day.getDay() == 0 || dt_current_day.getDay() == 6) {
 // weekend days
 day_class = "weekDay";
 } else {
 // print working days of current month
 day_class = "workingDay";
 }

if(dt_current_day.getMonth() == dt_current.getMonth()){
 if (currentDay.valueOf() == dt_current_day.valueOf()) {
 // print current date
 if (store.tiddlerExists(title)){
 // day has a tiddler associated with it
 day_class += " currentscheduledDay";
 clickHandler = onClickTiddlerLink;
 popup = cm.options.calendarToday + ": "+ cm.getPopupText(title);
 } else {
 day_class += " currentDay";
 popup = cm.options.calendarToday;
}
}


 if (store.tiddlerExists(title) && store.getTiddler(title).isTagged(cldTag[0]))  {
 // day has a tiddler associated with it
 day_class += " scheduledDay";
 clickHandler = onClickTiddlerLink;
 popup = cm.getPopupText(title);
 }
}

 // extra formatting for days of previous or next month
 if (dt_current_day.getMonth() != dt_current.getMonth()) {
 day_class += " otherMonthDay";
 }

 var text = dt_current_day.getDate();
 var cell = createTiddlyElement(line, "td", null, day_class, text);
 cell.onclick=clickHandler;
 cell.setAttribute("date", dt_current_day.valueOf());
 cell.setAttribute("tiddlyLink", title);
 if(popup) cell.setAttribute("title", popup);
 dt_current_day.setDate(dt_current_day.getDate()+1);
 }
 }
}

config.macros.calendar.handler = function(place,macroName,params,wikifier,paramString,tiddler) {
 var start_date = new Array();
 var date = new Date();
 var cldParams = paramString.parseParams('calendarParams', null, true);
 var cldYear = (cldParams[0].year)?parseFloat(cldParams[0].year[0]): date.getFullYear();
 var cldMonth = (cldParams[0].month)?parseFloat(cldParams[0].month[0]): date.getMonth();
 var n_months = (cldParams[0].numberMonths)?parseFloat(cldParams[0].numberMonths[0]): 1;
 var n_cols = (cldParams[0].numberColumns)?parseFloat(cldParams[0].numberColumns[0]): 3;
 cldTag = (cldParams[0].tag)?cldParams[0].tag[0].split("#"): config.macros.calendar.options.calendarTag;
 for(var i = 0; i < n_months; i++){
 start_date[i] = new Date(cldYear, cldMonth+i, 1);
 }
 var n_rows = Math.max(1,Math.ceil(n_months/n_cols));
 n_cols = Math.min(n_cols,n_months);
 var setControls=(n_months>1)? 0: 1;
 var currentDay = new Date();
 currentDay = new Date(currentDay.getFullYear(), currentDay.getMonth(), currentDay.getDate());
 var holder = createTiddlyElement(place, "table", null,"calendarHolder");
 var holderTable = createTiddlyElement(holder, "tbody");
 for(var i = 0; i < n_rows; i++){
 var holderLine = createTiddlyElement(holderTable, "tr");
 for(var j = 0; j < n_cols; j++){
 var holderCell = createTiddlyElement(holderLine, "td");
 if(n_cols*i+j+1<=n_months){
 var calendar = createTiddlyElement(holderCell, "table", "calendarWrapper");
 calendar.setAttribute("name", "calendarWrapper");
 calendar.setAttribute("setControls", setControls);
 calendar.setAttribute("currentDay", currentDay.valueOf());
 config.macros.calendar.makeCalendar(calendar, start_date[n_cols*i+j]);
 }
 }
 }
}

function refreshCalendars(hint) {
 var calendars = document.getElementsByName("calendarWrapper");
 var i, c;
 for (i = 0; i < calendars.length; ++i) {
 c = calendars.item(i);
 if (c.id == "calendarWrapper") {
 config.macros.calendar.makeCalendar(c, new Date(new Number(c.getAttribute("date"))));
 }
 }
}

store.addNotification(null, refreshCalendars);

setStylesheet("/***\n!Calendar Styles\n***/\n/*{{{*/\n .viewer .calendarHolder {\n margin-left: auto;\n margin-right: auto;\n border: none;\n}\n\n .viewer .calendarHolder table {\n border: none;\n margin: 0;\n}\n\n .viewer .calendarHolder tr {\n border: none;\n vertical-align: top;\n}\n\n .viewer .calendarHolder td {\n border: none;\n vertical-align: top;\n}\n\n .viewer #calendarWrapper {\n width: 21em;\n border: 2px solid #4682b4;\n cursor: pointer;\n}\n\n #calendarWrapper #calendarLine td {\n height: 2.5em;\n}\n\n #calendarWrapper tr {\n border:none;\n}\n\n #calendarWrapper td {\n text-align: center;\n vertical-align: middle;\n width: 14.28%;\n border:none;\n}\n\n #calendarWrapper #calendarHeader td{\n color: #ffffff;\n background-color: #4682b4;\n height: 2em;\n}\n\n #calendarWrapper #weekNames td {\n color: #ffffff;\n background-color: #87cefa;\n height: 2em;\n}\n\n #calendarWrapper .weekDay {\n background-color: #ccff99;\n}\n\n #calendarWrapper .holiDay {\n background-color: #9acd32;\n}\n\n #calendarWrapper .currentDay {\n border: solid #ff0000 2px;\n font-weight: bold;\n}\n\n #calendarWrapper .currentscheduledDay {\n border: solid #ff0000 2px;\n font-weight: bold;\n}\n\n #calendarWrapper .workingDay {\n background-color: #ffffff;\n}\n\n #calendarWrapper .scheduledDay {\n border: solid orange 2px;\n}\n\n #calendarWrapper .otherMonthDay {\n background-color: #999;\n}\n\n/*}}}*/","CalendarStyles");

config.shadowTiddlers.PlasticCalendarPluginDoc="The documentation is missing. It is available [[here|http://www.math.ist.utl.pt/~psoares/addons.html#PlasticCalendarPluginDoc]].";
}}}
version.extensions.Holidays = {
 major: 1, minor: 1, revision: 0,
 date: new Date(2006, 4, 18), 
 type: 'config'
};

config.macros.calendar.holidays = [ ["01/01", "New Year's day"], ["25/12", "Christmas day", "Christian"] ];
''1. Metric validation''
''2. Retain all ORF variance calculations''
!Bioinformatics Exercises (voluntary) . . . .
The currently available microbial genome sequences are compiled in this data table: [[GENOME DATA TABLE|00/GenBankData-16JAN.html]]
# ''FTP from ~GenBank'': go to GBftp
# ''Amino Acid Frequencies for 620 microbial genomes'': go to AAFreq
# ''Working with amino acid frequencies'': go to AAhunt
** Here are some results that have been generated in MatLab: go to AAresults
# Analysis of the difference in AA usage WITHIN a genome = AAscore

!!!
Course can be found online: http://www.pasteur.fr/recherche/unites/sis/formation/python/index.html
[img[07/python-bioinfo.png]]
!!

Get [[Python Here | www.python.org]]
[img[07/py01.png]]
!!
!Be lazy with TAB completion

''prerequisites:''
 http://www.ee.surrey.ac.uk/Teaching/Unix/unix1.html (UNIX Tutorial One)

''Hitting the tab key at the command line, at any time, will try to auto-complete what you started typing.''  

!Example 1
It's probably easiest just to try it for yourself, but here are some examples.

Say your home directory has the following contents:
{{{
user@biowolf ~ $ ls
01-Genomes
really-long-name-of-a-directory-one
really-long-name-of-a-directory-two
12.01-TallyAminoAcidFreqs.pl
}}}

Say you want to change to the 01-Genomes directory.  Try typing the first character of the name . . .
{{{
user@biowolf ~ $ cd 0
}}}
. . . then hit the ''tab'' key.  The shell will auto-complete:
{{{
user@biowolf ~ $ cd 01-Genomes
}}}
It was able to auto-complete because {{{01-Genomes}}} is the only directory in the current directory that starts with a {{{0}}}.  Since this is what you want, just hit ''enter'' and you'll change to that directory:
{{{
user@biowolf ~/01-Genomes $
}}}
All you really typed was 6 keys: {{{cd (space) 0 (tab) (Enter)}}}

!Example 2
Sometimes auto-complete finds multiple options that start with the characters you entered.  If that is the case, then hitting tab will only auto-complete up to a point.  It needs a hint from you to tell which of the multiple options you want.  Hitting tab again immediately will show you the possible options that need to be disambiguated.  At any time you can give auto-complete a hint (another character or two), then hit tab again and it will fill in as much as it can given your hint.  

Say you want to change to the directory {{{really-long-name-of-a-directory-two}}}.  Start by typing the first letter of the directory . . .
{{{
user@biowolf ~ $ cd r
}}}
. . . then hit ''tab''.  The shell auto-completes as much as it can:
{{{
user@biowolf ~ $ cd really-long-name-of-a-directory-
}}}
Notice it stopped before the end . . . hitting enter at this point would give an error, "-bash: cd: really-long-name-of-a-directory-: No such file or directory".  At this point, auto-complete doesn't know if you mean {{{really-long-name-of-a-directory-one}}} or {{{really-long-name-of-a-directory-two}}}. You could try hitting tab again to see all the possibilities that auto-complete thinks you're trying to say.  

For now, try typing a {{{t}}} to give it a hint . . .
{{{
user@biowolf ~ $ cd really-long-name-of-a-directory-t
}}}
. . . and hit ''tab''.
{{{
user@biowolf ~ $ cd really-long-name-of-a-directory-two
}}}
sweet, it found it.  Now hit enter.
{{{
user@biowolf ~/really-long-name-of-a-directory-two $
}}}
To get here you only typed 8 keys: {{{cd (space) r (tab) t (tab) (Enter)}}} instead of the 38 it would take if you typed it all out.  
Plus, no typos!

With a few minutes of practice, you can navigate many nested directories easily by tapping ''tab'', giving hints when needed.  With a few more minutes of practice, it's possible to navigate directory structures faster than you could in Windows Explorer or Mac OS Finder.
[[Zeldovich et al. PLOS 2007|02/Zeldovich-PLOS2007.pdf]]
[[Kiraga et al. BMC Genomics 2007|02/Protein-IPselection.pdf]]
[[Lombardot et al. 2007, BMC Bioinformatics|LombardotRef]]
!!!
Home is here: http://rpy.sourceforge.net/
[img[07/rpy.png]]
!!
![[Download the R package here|http://www.r-project.org/index.html]]
[img[04/r1.png]]
<html><img src="04/r2.png" style="height:300px"></html>
[[Download a simple R tutorial|Tutorial-Verzani-SimpleR.pdf]]

[[QUICK-R Guide|http://www.statmethods.net/index.html]]
<html><img src="00/quickR.png" style="height:300px"></html>
!!!
<html><img src="07/080507-SDH-plot1.png" style="height:500px"></html>
!!
<html><img src="07/080507-SDH-plot2.png" style="height:500px"></html>
!!
.
''SSH is an ecrypted file transfer protocol that replaces telnet or ftp''
!!For Windows OS, available at http://www.udel.edu/network:
[img[02/udnetwork01.png]]
[img[02/udnetwork02.png]]
!!!
!!For Mac OS X, it's already installed and running, but you can get update it: http://code.google.com/p/macfuse/
<html><img src="02/macfuse.png" style="height:400px"></html>
!!!
!!For linux/unix flavors, it is already installed and running. I like the KDE desktop file manager because it automatically mounts ssh connections as "drives".
!!!
!! SSH setup for automatic login to Biowolf:

SSH has a system for allowing computers to recognize each other and bypass the exchange of a password when connecting them. The way it works is that your local computer (A) generates an encrypted KEY that is then put in a file in your home directory on Biowolf. Login authorization is then determined by the computers 'recognizing' each other using this key.

First, start an SSH-client (command) terminal window on local computer (here named 'LOCAL'). Then generate the ssh key by following these commands, but do not enter a 'passphrase' when prompted. Just hit return twice.
{{{
LOCAL> ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/user/.ssh/id_rsa): 
Created directory '/home/user/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/user/.ssh/id_rsa.
Your public key has been saved in /home/user/.ssh/id_rsa.pub.
The key fingerprint is:
3e:4f:05:79:3a:9f:96:7c:3b:ad:e9:58:37:bc:37:e4 user@LOCAL
}}}
Now use ssh to create a directory ~/.ssh Biowolf. (The directory may already exist, which is fine). Use your classXX username. You will be prompted for your password:
{{{
LOCAL> ssh classXX@biowolf.dbi.udel.edu mkdir -p .ssh
}}}

Now we just add/append the public key from LOCAL to your Biowolf account in a file named "authorized_keys". Again use your classXX username and you will be prompted for your password:
{{{
LOCAL> cat .ssh/id_rsa.pub | ssh classXX@biowolf.dbi.udel.edu 'cat >> .ssh/authorized_keys'
}}}
From now on you can log into Biowolf from your LOCAL computer without entering a password. 

You can streamline the login process even more by establishing an 'alias' command in your shell profile. This is easy to do, but depends upon what shell you are running on your LOCAL computer. For a C shell (csh) add a line like this to the ''.cshrc'' file in your home directory on LOCAL (//note that this is a hidden file//):
{{{
alias biowolf ssh -l classXX biowolf.dbi.udel.edu
}}}

For a bash shell add a line like this to the ''.bash_profile'' file in your home directory on LOCAL (//note that this is a hidden file//):
{{{
alias biowolf='ssh -l classXX biowolf.dbi.udel.edu'
}}}

From a terminal window you need to restart the shell with either:
** prompt> source .cshrc
** prompt> source .bashrc
And then you can log into your Biowolf account with just the command:
{{{
LOCAL> biowolf
}}}
 . . . . mast 667-015 S08

Environmental Bioinformatics
The plugin page is at: [[http://www.math.ist.utl.pt/~psoares/addons.html|http://www.math.ist.utl.pt/~psoares/addons.html]]
<<slideShow>>
-s-
!Text for first slide
-s-
!Text for second slide
-s-
#Outline 1
##Outline 2
###Outline 3
-s-
end
/***
|''Name:''|SlideShowPlugin|
|''Description:''|Creates a simple slide show type display|
|''Version:''|1.5.3|
|''Date:''|Sep 12, 2007|
|''Source:''|http://www.math.ist.utl.pt/~psoares/addons.html|
|''Documentation:''|[[SlideShowPlugin Documentation|SlideShowPluginDoc]]|
|''Author:''|Paulo Soares and [[Clint Checketts|http://www.checkettsweb.com]]|
|''License:''|[[Creative Commons Attribution-Share Alike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|
|''~CoreVersion:''|2.1.0|
***/
//{{{
config.macros.slideShow = {label: "slide show", maxTOCLength: 30};
config.macros.slideShow.messages = {gotoLabel: "Go to slide:"};
config.views.wikified.slideShow = {text: "slide show", tooltip: "Start slide show"};
config.views.wikified.slideShow.quit = {text: "end", tooltip: "Quit the slide show"};
config.views.wikified.slideShow.firstSlide = {text: "<<", tooltip: "first slide"};
config.views.wikified.slideShow.previousSlide = {text: "<", tooltip: "previous slide"};
config.views.wikified.slideShow.nextSlide = {text: ">", tooltip: "next slide"};
config.views.wikified.slideShow.lastSlide = {text: ">>", tooltip: "last slide"};
config.views.wikified.slideShow.resetClock = {text: " ", tooltip: "reset"};

config.formatters.push( {
	name: "SlideSeparator",
	match: "^-s-+$\\n?",
	handler: function(w) {
		createTiddlyElement(w.output,"hr",null,'slideSeparator');
	}
});

function changeStyleSheet(tiddlerName) {
	setStylesheet(store.getRecursiveTiddlerText("StyleSheetColors"),"StyleSheetColors");
	setStylesheet(store.getRecursiveTiddlerText("StyleSheetLayout"),"StyleSheetLayout");
	setStylesheet(store.getRecursiveTiddlerText(tiddlerName == null ? "StyleSheet" : tiddlerName,""),"StyleSheet");
}

//Excellent (and versatile) reparser created by Paul Petterson for parsing the paramString in a macro
function reparse( params ) {
	var re = /([^:\s]+)(?:\:((?:\d+)|(?:["'](?:[^"']+)["']))|\s|$)/g;
	var ret = new Array();
	var m;
	while( (m = re.exec( params )) != null ) ret[ m[1] ] = m[2]?m[2]:true;
	return ret;
}

function getElementsByClass(searchClass,node,tag) {
	var classElements = new Array();
	if ( node == null ) node = document;
	if ( tag == null ) tag = '*';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
	var j=0;
	for (var i = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}

// 'keys' code adapted from S5 which in turn was adapted from MozPoint (http://mozpoint.mozdev.org/)
function keys(key) {
with(config.macros.slideShow){
	if (document.getElementById('contentWrapper').className == "slideShowMode"){
		if (!key) {
			key = event;
			key.which = key.keyCode;
		}
 		switch (key.which) {
			case 32: // spacebar
				if(time>0){
					if(autoAdvance){
						clearInterval(autoAdvance);
						autoAdvance = null;
					} else {
						autoAdvance=setInterval("GoToSlide(1)", time);
					}
				}
				break;
			case 34: // page down
			case 39: // rightkey
				GoToSlide("n");
				break;
			case 40: // downkey
				GoToSlide(-1);
				break;
			case 33: // page up
			case 37: // leftkey
				GoToSlide("p");
				break;
			case 38: // upkey
				GoToSlide(1);
				break;
			case 36: // home
				GoToSlide("f");
				break;
			case 35: // end
				GoToSlide("l");
				break;
			case 27: // escape
				endSlideShow();
				break;
		}
	}
	return false;
}
}

function clicker(e) {
	if (!e) var e = window.event;
	var target = resolveTarget(e);
	//Whenever something is clicked that won't advance the slide make sure that the table of contents gets hidden
	if (target.getAttribute('href') != null || isParentOrSelf(target, 'toc') || isParentOrSelf(target,'embed') || isParentOrSelf(target,'object') || isParentOrSelf(target, 'slideFooter') || isParentOrSelf(target, 'navigator')){
		 //Don't hide the TOC if the indexNumbers (which trigger the index) is clicked
		if(isParentOrSelf(target,'indexNumbers') || isParentOrSelf(target,'jumpInput')){
 			return true;
		}
		showHideTOC('none');
		return true;
	}
	//Advance a slide if the TOC is visible otherwise make sure that the TOC gets hidden
	if ((!e.which && e.button == 1) || e.which == 1) {
		if (document.getElementById('toc').style.display != 'block'){
			GoToSlide("n");
		} else {
			showHideTOC('none');
		}
	}
	if ((!e.which && e.button == 2) || e.which == 3) {
		if (document.getElementById('toc').style.display != 'block'){
			GoToSlide("p");
		} else {
			showHideTOC('none');
		}
		return false;
	}
}

function isParentOrSelf(element, id) {
	if (element == null || element.nodeName=='BODY') return false;
	else if (element.id == id) return true;
	else return isParentOrSelf(element.parentNode, id);
}

function GoToSlide(step) {
	var new_pos;
	var slideHolder = document.getElementById('slideContainer');
	//The parse float ensures that the attribute is returned as a number and not a string.
	var cur_pos = parseFloat(slideHolder.getAttribute('currentslide'));
	var numberSlides = parseFloat(slideHolder.getAttribute('numberSlides'));
	switch (step) {
		case "f":
			new_pos=0;
			break;
		case "l":
			new_pos=numberSlides-1;
			break;
		case "n":
			var numberOverlays = parseFloat(slideHolder.childNodes[cur_pos].getAttribute('numberOverlays'));
			var currentOverlay = parseFloat(slideHolder.getAttribute('currentOverlay'));
			if(numberOverlays==0 || currentOverlay==numberOverlays){
				if(noClicks==false) new_pos=cur_pos+1;
			} else {
				var className="Overlay"+currentOverlay;
				var overlay=getElementsByClass(className,slideHolder.childNodes[cur_pos]);
				for(var i=0; i<overlay.length; i++) {overlay[i].className=className+' previousOverlay';}
				currentOverlay++;
				slideHolder.setAttribute('currentOverlay',currentOverlay);
				className="Overlay"+currentOverlay;
				overlay=getElementsByClass(className,slideHolder.childNodes[cur_pos]);
				for(i=0; i<overlay.length; i++) {overlay[i].className=className+' currentOverlay';}
				return false;
			}
			break;
		case "p":
			var numberOverlays = parseFloat(slideHolder.childNodes[cur_pos].getAttribute('numberOverlays'));
			var currentOverlay = parseFloat(slideHolder.getAttribute('currentOverlay'));
			if(numberOverlays==0 || currentOverlay==0){
				if(noClicks==false) new_pos=cur_pos-1;
			} else {
				var className="Overlay"+currentOverlay;
				var overlays=getElementsByClass(className,slideHolder.childNodes[cur_pos]);
				for(var i=0; i<overlays.length; i++) {overlays[i].className=className+' nextOverlay';}
				currentOverlay--;
				className="Overlay"+currentOverlay;
				overlays=getElementsByClass(className,slideHolder.childNodes[cur_pos]);
				for(i=0; i<overlays.length; i++) {overlays[i].className=className+' currentOverlay';}
				slideHolder.setAttribute('currentOverlay',currentOverlay);
				return false;
			}
			break;
		default:
			new_pos=cur_pos+step;
	}
	if(slideShowCircularMode && new_pos == numberSlides) new_pos=0;
	if(slideShowCircularMode && new_pos<0) new_pos=(numberSlides - 1);
	if(step!=0 && new_pos>=0 && new_pos<numberSlides) {
		slideHolder.childNodes[cur_pos].style.display='none';
		slideHolder.childNodes[new_pos].style.display='block';
		slideHolder.setAttribute('currentslide',new_pos);
		var numberOverlays = parseFloat(slideHolder.childNodes[new_pos].getAttribute('numberOverlays'));
		if(step=="p"){
			var currentOverlay=numberOverlays;
			var state=' previousOverlay';
		} else {
			var currentOverlay=0;
			var state=' nextOverlay';
		}
		slideHolder.setAttribute('currentOverlay',currentOverlay);
		if(numberOverlays>0) {
			for(var i=1; i<=numberOverlays; i++){
				var className="Overlay"+i;
				var overlays=getElementsByClass(className,slideHolder.childNodes[new_pos]);
				for(var j=0; j<overlays.length; j++) {overlays[j].className=className+state;}
			}
			if(step=="p"){
				var className="Overlay"+numberOverlays;
				var overlays=getElementsByClass(className,slideHolder.childNodes[new_pos]);
				for(var j=0; j<overlays.length; j++) {overlays[j].className=className+' currentOverlay';}
			}
		}
		new_pos++;
		var indexNumbers = document.getElementById('indexNumbers');
		indexNumbers.firstChild.data = new_pos+'/'+numberSlides;
		if((new_pos==numberSlides) && !slideShowCircularMode && autoAdvance) clearInterval(autoAdvance);
		return true;
	}
	return false;
}

function tocShowSlide(e) {
	if (!e) var e = window.event;
	var target = resolveTarget(e);
	var slide = target.getAttribute('slideNumber');
	var cur_pos = document.getElementById('slideContainer').getAttribute('currentslide');
	var step = slide-cur_pos;
	if(step!=0) GoToSlide(step);
	showHideTOC('none');
	return;
}

//Toggle the display of the table of contents
function showHideTOC(display){
	var toc = document.getElementById('toc');
	//Reset the input box
	document.getElementById('jumpInput').value = "";
	if (display == null || display.length == null){
		if (toc.style.display == 'none' || toc.style.display == ''){
			toc.style.display = 'block';
			document.getElementById('jumpInput').focus();
		} else {
			toc.style.display = 'none';
		}
	} else {
		toc.style.display = display;
		if (display == 'block')
			document.getElementById('jumpInput').focus();
	}
}

function padZero(x){return (x>=10 || x<0 ? "" : "0")+x;}

function setClock(){
	var actualTime = new Date();
	var newTime = actualTime.getTime() - clockStartTime;
	newTime = clockMultiplier*newTime+clockInterval+clockCorrection;
	actualTime.setTime(newTime);
	newTime = padZero(actualTime.getHours()) + ":" + padZero(actualTime.getMinutes())+ ":" + padZero(actualTime.getSeconds());
	var clock = document.getElementById('slideClock');
	clock.firstChild.nodeValue = newTime;
}

function resetClock(){
	var time = new Date(0);
	if(clockStartTime>time){
		var startTime = new Date();
		clockStartTime=startTime.getTime();
	}
}

var title;
var place;
var autoAdvance=null;
var slideClock=null;
var noOverlays=false;
var noClicks=false;
var forceRefresh=false;
var time = 0;
var slideShowCircularMode;
var slideShowStyleSheet;
var slideShowParams;
var clockMultiplier;
var clockInterval;
var clockCorrection=0;
var clockStartTime;
var openTiddlers;

config.macros.slideShow.handler = function(aPlace,macroName,params,wikifier,paramString,tiddler){
	if(tiddler instanceof Tiddler){
		var lingo = config.views.wikified.slideShow;
		if (!e) var e = window.event;
 		place = aPlace;
		title = tiddler.title;
		params = reparse(paramString);
		var onclick = function(){config.macros.slideShow.onClickSlideShow(params);};
		createTiddlyButton(aPlace,lingo.text,lingo.tooltip,onclick);
	}
}

config.macros.slideShow.onClickSlideShow = function(newParams) {
//	if(typeof(newParams)=="number") newParams=slideShowParams;
	openTiddlers = new Array;
	var viewer=document.getElementById('tiddlerDisplay');
	for(var i=0; i<viewer.childNodes.length; i++){
		var name = viewer.childNodes[i].getAttribute('tiddler');
		openTiddlers.push(name);
	}
	document.oncontextmenu = function(e){return false;}
	clockMultiplier = 1;
	clockInterval = 0;
	var startTime = new Date(0);
	slideShowCircularMode = false;
	time = 0;
	slideShowStyleSheet = null;
	if(newParams['style']){
		slideShowStyleSheet = eval(newParams['style']);
	} 
	if(newParams['repeat']){
		slideShowCircularMode = true;
	}
	if(newParams['noClicks']){
		noClicks = true;
	}
	if(newParams['forceRefresh']){
		forceRefresh = true;
	}
	if(newParams['slidePause'] > 0){
		time = newParams['slidePause'];
	}
	if(newParams['clock']){
		clockCorrection=startTime.getTimezoneOffset()*60000;
		startTime = new Date();
		var clockType= eval(newParams['clock']);
		if(clockType != '+') {
			clockMultiplier = -1;
			clockInterval = -clockType*60000;
		}
	}
	clockStartTime=startTime.getTime();
	if(newParams['noOverlays']){
		noOverlays = true;
	}
	clearMessage();
	//Attach the key and mouse listeners
	document.onkeyup = keys;
	document.onmouseup = clicker;
	story.refreshTiddler(title,"SlideShowViewTemplate",true);
	createSlides(newParams);
	slideClock=setInterval("setClock()", 1000); 
	if(time>0) autoAdvance=setInterval("GoToSlide(1)", time); 
	story.closeAllTiddlers(title);
	toggleSlideStyles();
	return;
}

config.macros.slideShow.endSlideShow=function(){
	var showHolder = document.getElementById('slideShowWrapper');
	showHolder.parentNode.removeChild(showHolder);
	document.oncontextmenu =  function(e){};
	if(autoAdvance) clearInterval(autoAdvance);
	if(slideClock) clearInterval(slideClock);
	noClicks=false;
	story.refreshTiddler(title,null,true);
	story.closeAllTiddlers();
	toggleSlideStyles();
	story.displayTiddlers(null,openTiddlers,DEFAULT_VIEW_TEMPLATE);
	document.onmouseup = function(){};
}

function isInteger(s){
	var i;
	for (i = 0; i < s.length; i++){
		// Check that current character is number.
		var c = s.charAt(i);
		if (((c < "0") || (c > "9"))) return false;
	}
	// All characters are numbers.
	return true;
}

function jumpInputToSlide(e){
	if (!e) {
		e = window.event;
		e.which = e.keyCode;
	}
	if(e.which==13){
		var jumpInput= document.getElementById("jumpInput").value;
		if(isInteger(jumpInput)){
			var step=jumpInput-document.getElementById('slideContainer').getAttribute('currentslide')-1;
			if (GoToSlide(step)){
				showHideTOC('none'); 
			}
		}
	}
	return;
}

//Used to shorten the TOC fields
function abbreviateLabel(label){
	var maxTOCLength = config.macros.slideShow.maxTOCLength;
	if(label.length>maxTOCLength) {
		var temp = new Array();
		temp = label.split(' ');
		label = temp[0];
		for(var j=1; j<temp.length; j++){
			if((label.length+temp[j].length)<=maxTOCLength){
				label += " " + temp[j];
			} else {
				label += " ...";
				break;
			}
		}
	}
	return label;
}

function createSlides(newParams){
	var lingo = config.views.wikified.slideShow;
	//Remove dblClick on edit function
	var theTiddler = document.getElementById("tiddler"+title);
	theTiddler.ondblclick = function() {};
	// Grab the 'viewer' element and give it a signature so the show can be resumed if stopped
	var tiddlerElements = theTiddler.childNodes;
	var viewer;
	for (var i = 0; i < tiddlerElements.length; i++){
		if (tiddlerElements[i].className == "viewer") viewer = tiddlerElements[i];
	}
	viewer.id = 'slideShowWrapper';
	//Hide the text that comes before the first H1 element (I think I may put this into a cover page type thing)
	while(viewer.childNodes.length > 0 && viewer.firstChild.nodeName.toUpperCase() != "HR" && viewer.firstChild.className!="slideSeparator") {
		viewer.removeChild(viewer.firstChild);
	}
	//Cycle through the content and each time you hit an H1 begin a new slide div
	var slideNumber = 0;
	var slideHolder = document.createElement('DIV');
	slideHolder.id = "slideContainer";
	slideHolder.setAttribute('currentslide',0);
	while(viewer.childNodes.length > 0){
		//Create a new slide a append it to the slide holder
		if (viewer.firstChild.nodeName.toUpperCase() == "HR" && viewer.firstChild.className=="slideSeparator"){
			slideNumber++;
			var slide = document.createElement('DIV');
			slide.id = "slideNumber"+slideNumber;
			slide.className = "slide";
			if (slideNumber > 1) {
				//slideHolder.setAttribute('currentslide',0);
				slide.style.display='none';
			} else {
				slide.style.display='block';
			}
			slideHolder.appendChild(slide); 
			viewer.removeChild(viewer.firstChild);
		} else {
			if(viewer.firstChild.nodeName=="SPAN" && viewer.firstChild.className=="" && viewer.firstChild.hasChildNodes()) {
				var anchor=viewer.firstChild.nextSibling;
				for (var ii=0;ii<viewer.firstChild.childNodes.length;ii++) {
					var clone=viewer.firstChild.childNodes[ii].cloneNode(true);
					viewer.insertBefore(clone,anchor);
				}
				viewer.removeChild(viewer.firstChild);
			} else {
				slide.appendChild(viewer.firstChild);
			}
		}
	} 
	//Stick the slides back into the viewer
	viewer.appendChild(slideHolder);
	slideHolder.setAttribute('numberSlides',slideNumber);
	//Create the navigation bar
	var slidefooter = createTiddlyElement(viewer,"DIV","slideFooter","slideFooterOff");
	var navigator = createTiddlyElement(slidefooter,"SPAN","navigator");
	//Make it so that when the footer is hovered over the class will change to make it visible
	slidefooter.onmouseover = function () {slidefooter.className = "slideFooterOn"};
	slidefooter.onmouseout = function () {slidefooter.className = "slideFooterOff"};
	//Create the control button for the navigation 
	var onClickQuit = function(){config.macros.slideShow.endSlideShow();};
	createTiddlyButton(navigator,lingo.quit.text,lingo.quit.tooltip,onClickQuit);
	createTiddlyButton(navigator,lingo.firstSlide.text,lingo.firstSlide.tooltip,first_slide);
	createTiddlyButton(navigator,lingo.previousSlide.text,lingo.previousSlide.tooltip,previous_slide);
	createTiddlyButton(navigator,lingo.nextSlide.text,lingo.nextSlide.tooltip,next_slide);
	createTiddlyButton(navigator,lingo.lastSlide.text,lingo.lastSlide.tooltip,last_slide); 
	createTiddlyButton(navigator,lingo.resetClock.text,lingo.resetClock.tooltip,resetClock,"button","slideClock");
	var indexNumbers = createTiddlyElement(slidefooter,"SPAN","indexNumbers","indexNumbers","1/"+slideNumber)
	indexNumbers.onclick = showHideTOC;
	var toc = createTiddlyElement(slidefooter,"UL","toc");
	var ovl=1;
	for (var i=0;i<slideHolder.childNodes.length;i++) {
		if(!noOverlays) {
			var ovl=1;
			while(1){
				var className="Overlay"+ovl;
				var overlays=getElementsByClass(className,slideHolder.childNodes[i]);
				if(overlays.length>0){
					for(var j=0; j<overlays.length; j++) {overlays[j].className+=' nextOverlay';}
					ovl++;
				} else {break;}
			}
		}
		slideHolder.childNodes[i].setAttribute("numberOverlays",ovl-1);
		slideHolder.setAttribute("currentOverlay",0);
		//Loop through each slide and check the header's content
		var tocLabel = null; 
		for (var j=0;j<slideHolder.childNodes[i].childNodes.length;j++) {
			var node = slideHolder.childNodes[i].childNodes[j];
			if(node.nodeName=="H1" || node.nodeName=="H2" || node.nodeName=="H3" || node.nodeName=="H4") {
				var htstring = node.innerHTML;
				var stripped = htstring.replace(/(<([^>]+)>)/ig,"");
				tocLabel = abbreviateLabel(stripped);
				var tocLevel="tocLevel"+node.nodeName.charAt(1);
				var tocItem = createTiddlyElement(toc,"LI",null,tocLevel);
				var tocLink = createTiddlyElement(tocItem,"A",null,"tocItem",tocLabel);
				tocLink.setAttribute("slideNumber",i);
				tocLink.onclick=tocShowSlide;
			}
		}
	}
	//Input box to jump to s specific slide
	var tocItem = createTiddlyElement(toc,"LI",null,"tocJumpItem",config.macros.slideShow.messages.gotoLabel);
	var tocJumpInput = createTiddlyElement(tocItem,"INPUT","jumpInput");
	tocJumpInput.type="text";
	tocJumpInput.onkeyup=jumpInputToSlide;
}

var next_slide= function(e){GoToSlide(1);}
var first_slide= function(e){GoToSlide("f");}
var previous_slide= function(e){GoToSlide(-1);}
var last_slide= function(e){GoToSlide("l");}

function toggleSlideStyles(){
	var contentWrapper = document.getElementById('contentWrapper');
	if (contentWrapper.className == "slideShowMode"){
		contentWrapper.className = "";
		window.applyPageTemplate();
		setStylesheet("#backstageShow{display: block;}","SlideShowStyleSheet");
		changeStyleSheet();
	} else{
		contentWrapper.className = "slideShowMode";
		window.applyPageTemplate("SlideShowPageTemplate");
		setStylesheet(store.getRecursiveTiddlerText("SlideShowStyleSheet"),"SlideShowStyleSheet");
		if(slideShowStyleSheet) changeStyleSheet(slideShowStyleSheet);
	}
}

config.shadowTiddlers.SlideShowPageTemplate="<!--{{{-->\n<div id='displayArea'>\n<div id='tiddlerDisplay'></div>\n</div>\n<!--}}}-->";

config.shadowTiddlers.SlideShowViewTemplate="<!--{{{-->\n<div class='title' macro='view title'></div>\n<div class='viewer' macro='view text wikified'></div>\n<!--}}}-->";

config.shadowTiddlers.SlideShowStyleSheet = "/***\n!Slide Mode Styles\n***/\n/*{{{*/\n#backstageShow{\n display: none !important;\n}\n\n#contentWrapper.slideShowMode #slideContainer{\n display: block;\n}\n\n#contentWrapper.slideShowMode .Comment{\n display: none;\n}\n\n#contentWrapper.slideShowMode .nextOverlay{\n visibility: hidden;\n}\n\n#contentWrapper.slideShowMode .currentOverlay{\n visibility: visible;\n}\n\n#contentWrapper.slideShowMode .previousOverlay{\n visibility: visible;\n}\n\n#jump{\n text-align: right;\n}\n\n.slideFooterOff #navigator{\n visibility: hidden;\n}\n\n.slideFooterOn #navigator{\n visibility: visible;\n}\n\n#contentWrapper.slideShowMode #slideClock{\n cursor: pointer; margin: 0 5px 0 5px; border: 1px solid #db4\n}\n\n#contentWrapper.slideShowMode,\n #contentWrapper.slideShowMode #displayArea{\n width: 100%;\n font-size: 1.5em;\n margin: 0 !important;\n padding: 0;\n}\n\n#slideContainer{\n display: none;\n}\n\n.indexNumbers{\n cursor: pointer;\n}\n\n#navigator{\n visibility: hidden;\n bottom: 0;\n}\n\n#toc{\n display: none;\n position: absolute;\n font-size: .75em;\n bottom: 2em;\n right: 0;\n background: #fff;\n border: 1px solid #000;\n text-align: left;\n}\n\nul#toc, #toc li{\n margin: 0;\n padding: 0;\n list-style: none;\n line-height: 1em;\n}\n\n.tocJumpItem{\n margin-right: 2em;\n}\n\n.tocJumpItem input{\nmargin-right: 1em;\n border: 0;\n}\n\n#toc a,\n#toc a.button{\n display: block;\n padding: .1em;\n}\n\n#toc .tocLevel1{\nfont-size: .8em;\n}\n\n#toc .tocLevel2{\n margin-left: 1em;\n font-size: .75em;\n}\n\n#toc .tocLevel3{\n margin-left: 2em;\nfont-size: .75em;\n}\n\n#toc .tocLevel4{\n margin-left: 3em;\nfont-size: .65em;\n}\n\n#toc a{\n cursor: pointer;\n}\n\nh1{\n min-height: 1em;\n}\n\n.slide h1{\n min-height: 0;\n}\n\n/* The '>' selector is ignored by IE6 and earlier so the proper rules are given */\n#slideFooter{\n position: fixed;\n bottom: 2px;\n right: 2px;\n width: 100%;\n text-align: right;\n}\n\n/* This is a hack to trick IE6 and earlier to put the navbar on the bottom of the page */\n* html #slideFooter {\n position: absolute;\n width: 100%;\n text-align: right;\n right: auto; bottom: auto;\n left: expression( ( -20 - slideFooter.offsetWidth + ( document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth ) + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' );\n top: expression( ( -10 - slideFooter.offsetHeight + ( document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' );\n}\n\n\n\n/*}}}*/";

config.shadowTiddlers.SlideShowPluginDoc="The documentation is missing. It is available [[here|http://www.math.ist.utl.pt/~psoares/addons.html#SlideShowPluginDoc]].";
//}}}

/*{{{*/
* 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:7em; text-align:right; line-height:1.6em; padding:1.5em 0.5em 0.5em 0.5em; font-size:1.2em;}

#sidebar {position:absolute; right:3px; width:13em; font-size:0.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 13em 0em 11em;}

.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;}
/*}}}*/
! A reverse syllabus for MAST 667-015 S08
Listed below are the extra materials presented for each week in addition to the [[Lectures|Lecture Index]]. Literature references, project exercises, and tool presentations are offered to augment the scope of the information covered each week.
!!!
<html><div style="color: rgb(100, 100, 150); font-family: Monaco;"><big><b>14MAY:</html>''Project Summaries''
!!!
<html><div style="color: rgb(100, 100, 150); font-family: Monaco;"><big><b>07MAY:</html>''No Class''
!!!
<html><div style="color: rgb(100, 100, 150); font-family: Monaco;"><big><b>30APR:</html>''No Class''
!!!
<html><div style="color: rgb(100, 100, 150); font-family: Monaco;"><big><b>23APR:</html>1. [[Barthet 2008|00/Barthet-MATkEvolution-JME-2008.pdf]] //Evaluating Evolutionary Constraint on the Rapidly Evolving Gene matK Using Protein Composition// JME
2. Multivariate Statistics: Linear Discriminate Analysis
!!!
<html><div style="color: rgb(100, 100, 150); font-family: Monaco;"><big><b>16APR:</html>''No Class. UD mini-symposium //The Biology of Small RNA//'', 0900-1230h Roselle Center for the Arts.
!!!
<html><div style="color: rgb(100, 100, 150); font-family: Monaco;"><big><b>09APR:</html>1. ''R'' package analysis of the variance in AA frequencies WITHIN a genome.
2. What can we say about the AA composition of a core genome?
3. How do we quantitatively describe the "imprint" of natural selection within a genome?
4. [[Barthet 2008|00/Barthet-MATkEvolution-JME-2008.pdf]] //Evaluating Evolutionary Constraint on the Rapidly Evolving Gene matK Using Protein Composition// JME
!!!
<html><div style="color: rgb(100, 100, 150); font-family: Monaco;"><big><b>02APR:</html>''Spring Break''
!!!
<html><div style="color: rgb(100, 100, 150); font-family: Monaco;"><big><b>26MAR:</html>1. ''The Hunt for Red October:''  [[Lecture 05|05]]
2. AAscore: how different is amino acid usage within a genome?
3. Full presentation of cradle-to-grave project development . . . ''hypothesis to apotheosis''
!!!
<html><div style="color: rgb(100, 100, 150); font-family: Monaco;"><big><b>19MAR:</html>''No Class'' 
!!!
<html><div style="color: rgb(100, 100, 150); font-family: Monaco;"><big><b>12MAR:</html>1. Reference: [[Lombardot et al. 2007, BMC Bioinformatics|LombardotRef]]
2. Review Results: Amino Acid Freqs = AAresults
!!!
<html><div style="color: rgb(100, 100, 150); font-family: Monaco;"><big><b>05MAR:</html>1. [[Lecture 04|Lecture04-05MAR]] ''Amino Acid Freq Pipeline''
2. ''Biowolf Command summary'' Tools: [[Biowolf]]
3. ''Automatic SSH login to Biowolf'': Tools: SSHsetup
4. ''Next ~AAfreq exercise'': go to Projects: AAhunt
!!!
<html><div style="color: rgb(100, 100, 150); font-family: Monaco;"><big><b>27FEB:</html>1. [[Lecture 03|Lecture03-27FEB]] ''Analytical Pipeline''
2. We will be discussing these two papers and their "global" approach to identifying patterns of amino acid usage in an organism's proteome. 
3. [[Zeldovich et al. PLOS 2007|02/Zeldovich-PLOS2007.pdf]]
4. [[Kiraga et al. BMC Genomics 2007|02/Protein-IPselection.pdf]] //Discussion led by Tom Hanson//
5. Exercise: ''Amino Acid Frequencies for 620 microbial genomes'': go to AAFreq
!!!
<html><div style="color: rgb(100, 100, 150); font-family: Monaco;"><big><b>20FEB:</html>1. [[Lecture 02|Lecture02-20FEB]] ''Data Mining''
2. Exercise: ''FTP from ~GenBank'': go to GBftp
!!!
<html><div style="color: rgb(100, 100, 150); font-family: Monaco;"><big><b>13FEB:</html>1. [[Lecture 01|Lecture01-13FEB]] ''Information In Genomes''
!!!
<<formTiddler NewPluginTemplate>><data>{"description":"Show/hide right sidebar (SideBarOptions)","category":"Toggling page elements","twversion":"2.1","format":"Script","link":"http://www.tiddlytools.com","author":"Eric Shulman (~TiddlyTools)"}</data>
[[Biowolf]]
[[Ryan's Biowolf Unix Tips|RDbiowolf]]
GenBank
''CD-HIT''
[[SSH]]
SSHsetup
JEdit
''PERL''
[[PYTHON]]
''MatLab''
[[R|Rstats]]
BioPython
MatPlotLib
[[Komodo]] Script Editor
''Visual Molecular Dynamics, VMD''
[[GENOME DATA TABLE|00/GenBankData-16JAN.html]]
[[WISDOM]]
!!!
<html><span  style="float:right;background-color:#ffff66;"><a href="" class="button" title="Show/Hide SideBar" onclick="javascript:if(!document.getElementById('sidebar').style.display || document.getElementById('sidebar').style.display == 'block') { document.getElementById('sidebar').style.display = 'none'; document.getElementById('displayArea').style.marginRight = '1em'; } else { document.getElementById('sidebar').style.display = 'block'; document.getElementById('displayArea').style.marginRight = '15.5em'; } return false;">X<-|->O</a></span></html>
!!! RD: PDF output in R
For plotting I generally make the figure interactively (in an X11 window) then when it's the way I want it, then I use
{{{
	> dev.copy(pdf, 'myplot.pdf')
	> dev.off()
}}}
Took a while for me to figure this one out, but you have to explicitly turn the pdf device off with dev.off(), which I'm guessing finishes writing the file and closes it.

Sometimes I use the special function {{{dev.copy2eps('myplot.eps')}}} which DOESN'T need to be closed (for whatever reason). I've found that eps plots maintain the aspect ratio of the plot that I have on screen, but pdf plots reset to the default square axis.

!!! SG Correlograms
<html><img src="data/AAfreqCorrGram.png" style="height:300px"></html>
{{{
# import data table
d=read.table('AminoAcidFreqTable-29FEB.txt', sep='\t', header=T)

# assign amino acid frequencies to one variable
fAA=d[,2:21]

# plot correlogram
library(corrgram)
corrgram(fAA, order=TRUE, lower.panel=panel.pie, upper.panel=panel.shade,
text.panel=panel.txt, main="AAfreq")
}}}

Also check this site for info on [[CORRGRAM|http://www.statmethods.net/advgraphs/correlograms.html]]

!!!SGuida split data groups . . . . 
The Group variable can be used to separate dataframes:
{{{
R>  Group1 <- DataFileName[ which(DataFileName$Group=='1'), ] 
R>  Group2 <- DataFileName[ which(DataFileName$Group=='2'), ] 
}}}
Also, data can be sorted:
{{{
R> SortedData <- DataFileName[order(DataFileName$ColumnTitle) , ]
}}}
!!!
Time rushes over my neurons
as water over rocks in a mountain stream
on a refreshing beer commercial.
Moving too quickly for my mind to grasp,
like salmon evading a drunken circus bear,
who has escaped from captivity with no idea
how to survive on his own
(where do all the twinkies grow?)
-----
!!Pattern matching with a variable:
If GENfree is ['Colwelia','Acinetobacter',etc...]
[img[00-DailyNotes/note-python-regex.png]]
----