Team:Amsterdam/maarten/
From 2012.igem.org
(Difference between revisions)
Line 5: | Line 5: | ||
<html> | <html> | ||
<head> | <head> | ||
+ | <link rel="stylesheet" type="text/css" href="style.css" /> | ||
<script type="text/javascript" src="jquery-1.2.3.min.js"></script> | <script type="text/javascript" src="jquery-1.2.3.min.js"></script> | ||
+ | <link type="text/css" href="css/base.css" rel="stylesheet" /> | ||
+ | <link type="text/css" href="css/Sunburst.css" rel="stylesheet" /> | ||
+ | <script language="javascript" type="text/javascript" src="jit.js"></script> | ||
<script type='text/javascript'> | <script type='text/javascript'> | ||
Line 33: | Line 37: | ||
}; | }; | ||
- | + | function visualization(number){ | |
- | function | + | $('#infovis').empty() |
+ | json = JSON.parse(unescape($(':input[name=json'+number+']').val())) | ||
//init data | //init data | ||
//init Sunburst | //init Sunburst | ||
Line 58: | Line 63: | ||
type: 'Native', | type: 'Native', | ||
stylesClick: { | stylesClick: { | ||
- | 'color': '# | + | 'color': '#000000' |
}, | }, | ||
}, | }, | ||
Line 65: | Line 70: | ||
enable: true, | enable: true, | ||
onShow: function(tip, node) { | onShow: function(tip, node) { | ||
- | var html = "<div class=\"tip-title\">" + node. | + | var html = "<div class=\"tip-title\">" + node.data.description + "</div>"; |
var data = node.data; | var data = node.data; | ||
if("length" in data) { | if("length" in data) { | ||
Line 84: | Line 89: | ||
//and place it in the right column. | //and place it in the right column. | ||
var html = "<h4>" + node.name + "</h4>", data = node.data; | var html = "<h4>" + node.name + "</h4>", data = node.data; | ||
- | + | if("dna" in data) { | |
- | if(" | + | html += "<br /><br /><b>Sequence:</b><br /><pre>" + data.dna + "</pre>"; |
- | html += "<br /><br /><b> | + | |
} | } | ||
$jit.id('inner-details').innerHTML = html; | $jit.id('inner-details').innerHTML = html; | ||
Line 92: | Line 96: | ||
sb.tips.hide(); | sb.tips.hide(); | ||
//rotate | //rotate | ||
- | sb.rotate(node, animate? 'animate' : 'replot', { | + | //sb.rotate(node, animate? 'animate' : 'replot', { |
- | duration: 1000, | + | //duration: 1000, |
- | transition: $jit.Trans.Quart.easeInOut | + | //transition: $jit.Trans.Quart.easeInOut |
- | }); | + | //}); |
} | } | ||
}, | }, | ||
Line 103: | Line 107: | ||
onCreateLabel: function(domElement, node){ | onCreateLabel: function(domElement, node){ | ||
var labels = sb.config.Label.type, | var labels = sb.config.Label.type, | ||
- | aw = node.getData(' | + | aw = node.getData('length'); |
if (labels === 'HTML' && (node._depth < 2 || aw > 2000)) { | if (labels === 'HTML' && (node._depth < 2 || aw > 2000)) { | ||
domElement.innerHTML = node.name; | domElement.innerHTML = node.name; | ||
Line 349: | Line 353: | ||
} | } | ||
- | function | + | function genbankRestriction(targetSites){ |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
restrictionPlasmidOutput = staticGenbank('restriction_plasmid') | restrictionPlasmidOutput = staticGenbank('restriction_plasmid') | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
restrictionOrigin = memoryPlasmid.features[1].sequence | restrictionOrigin = memoryPlasmid.features[1].sequence | ||
for (key in targetSites){ | for (key in targetSites){ | ||
Line 454: | Line 406: | ||
restrictionPlasmidOutput+=newString+'<br>' | restrictionPlasmidOutput+=newString+'<br>' | ||
} | } | ||
- | |||
- | |||
- | |||
restrictionSiteWindow = window.open() | restrictionSiteWindow = window.open() | ||
restrictionSiteWindow.document.write(restrictionPlasmidOutput) | restrictionSiteWindow.document.write(restrictionPlasmidOutput) | ||
restrictionSiteWindow.focus() | restrictionSiteWindow.focus() | ||
+ | } | ||
+ | function genbankMemory(){ | ||
+ | memoryPlasmidOutput = staticGenbank('memory_plasmid') | ||
+ | for (item in memoryPlasmid.memoryObjects){ | ||
+ | for (key in memoryPlasmid.memoryObjects[item]){ | ||
+ | memoryPlasmidOutput += generateWhiteSpace(5) | ||
+ | memoryPlasmidOutput += 'misc_feature' | ||
+ | memoryPlasmidOutput += generateWhiteSpace(5) | ||
+ | memoryPlasmidOutput += memoryPlasmid.memoryObjects[item][key].start+'...'+memoryPlasmid.memoryObjects[item][key].end+'<br>' | ||
+ | memoryPlasmidOutput += generateWhiteSpace(10) | ||
+ | memoryPlasmidOutput += '/label='+memoryPlasmid.memoryObjects[item][key].description+'<br>' | ||
+ | } | ||
+ | |||
+ | } | ||
+ | origin = memoryPlasmid.dna | ||
+ | origin = origin.replace(/[atgc]{10}/g,'$& ').replace(/amp;/g,'').split(' ') | ||
+ | pos = 1 | ||
+ | newString = '' | ||
+ | memoryPlasmidOutput += 'ORIGIN<br>' | ||
+ | for (i=0;i<origin.length;i++){ | ||
+ | newString = newString+' '+origin[i] | ||
+ | if ((i+1)%6===0){ | ||
+ | whiteSpace = '' | ||
+ | for (j=0;j<9-pos.toString().length;j++){ | ||
+ | whiteSpace+= ' ' | ||
+ | } | ||
+ | newString = whiteSpace+pos + ' ' + newString | ||
+ | memoryPlasmidOutput+=newString+'<br>' | ||
+ | newString = '' | ||
+ | } else if ((i+1)%6==1){ | ||
+ | if (i!=0){ | ||
+ | pos+=60 | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | if (origin.length%6 != 0){ | ||
+ | newString = '' | ||
+ | whiteSpace = '' | ||
+ | for (j=0;j<9-pos.toString().length;j++){ | ||
+ | whiteSpace+= ' ' | ||
+ | } | ||
+ | newString+=whiteSpace+pos | ||
+ | for (i=0;i<(origin.length%6);i++){ | ||
+ | newString+=' '+origin[origin.length-origin.length%6+i] | ||
+ | } | ||
+ | memoryPlasmidOutput+=newString+'<br>' | ||
+ | } | ||
+ | |||
+ | myWindow=window.open() | ||
+ | myWindow.document.write(memoryPlasmidOutput) | ||
+ | myWindow.focus() | ||
+ | |||
} | } | ||
Line 642: | Line 643: | ||
continue | continue | ||
} else{ | } else{ | ||
- | featureArray[2] = new feature(memoryPlasmid.dna.length+1,memoryPlasmid.dna.length+zincFingers[j].sequence.length,'Zinc Finger',zincFingers[j].sequence,zincFingers[j].description,zincFingers[j]) | + | featureArray[2] = new feature(memoryPlasmid.dna.length+1,memoryPlasmid.dna.length+zincFingers[j].sequence.length,'Zinc Finger',zincFingers[j].sequence,'Zinc Finger '+zincFingers[j].description.split('|')[0],zincFingers[j]) |
memoryPlasmid.setDNA(memoryPlasmid.dna+zincFingers[j].sequence) | memoryPlasmid.setDNA(memoryPlasmid.dna+zincFingers[j].sequence) | ||
break | break | ||
Line 681: | Line 682: | ||
restrictionPlasmid.zfTarget = featureArray[1] | restrictionPlasmid.zfTarget = featureArray[1] | ||
} | } | ||
- | // | + | json = createJSONMemory(number) |
- | json = | + | //genbankMemory() |
- | + | $('#visualizationButtons').append('<input type="hidden" name="json'+number+'" value="'+escape(JSON.stringify(json))+'"/><input class="submit" type="submit" value="Memory Plasmid '+(number+1)+'" onclick="visualization('+number+');return false"/>'); | |
} | } | ||
function setup(){ | function setup(){ | ||
+ | $('#visualizationButtons').empty() | ||
+ | $('#infovis').empty() | ||
+ | $('#readout').empty() | ||
addForbiddenSequences() | addForbiddenSequences() | ||
sensors = document.plasmidForm.sensors.value.toLowerCase() | sensors = document.plasmidForm.sensors.value.toLowerCase() | ||
Line 695: | Line 699: | ||
j = 0 | j = 0 | ||
number = 0 | number = 0 | ||
+ | targetSites = new Array() | ||
for (sensor in sensorArray){ | for (sensor in sensorArray){ | ||
tempArray[j] = sensorArray[sensor] | tempArray[j] = sensorArray[sensor] | ||
Line 703: | Line 708: | ||
tempArray = new Array() | tempArray = new Array() | ||
j = 0 | j = 0 | ||
+ | for (item in memoryPlasmid.memoryObjects){ | ||
+ | site = new Object() | ||
+ | site.zincFingerDescription = memoryPlasmid.memoryObjects[item].zincFinger.featureObject.description | ||
+ | site.zincFinger = memoryPlasmid.memoryObjects[item].zincFinger.featureObject.target | ||
+ | site.zincFingerLength = site.zincFinger.length | ||
+ | site.methyltransferaseDescription = memoryPlasmid.memoryObjects[item].methyltransferase.featureObject.description | ||
+ | site.methyltransferase = memoryPlasmid.memoryObjects[item].methyltransferase.featureObject.target | ||
+ | site.methyltransferaseLength = site.methyltransferase.length | ||
+ | site.sensor = memoryPlasmid.memoryObjects[item].sensor.description | ||
+ | targetSites.push(site) | ||
+ | } | ||
} | } | ||
} | } | ||
if (j%5 !== 0){ | if (j%5 !== 0){ | ||
configuratePlasmid(tempArray,number) | configuratePlasmid(tempArray,number) | ||
+ | for (item in memoryPlasmid.memoryObjects){ | ||
+ | site = new Object() | ||
+ | site.zincFingerDescription = memoryPlasmid.memoryObjects[item].zincFinger.featureObject.description | ||
+ | site.zincFinger = memoryPlasmid.memoryObjects[item].zincFinger.featureObject.target | ||
+ | site.zincFingerLength = site.zincFinger.length | ||
+ | site.methyltransferaseDescription = memoryPlasmid.memoryObjects[item].methyltransferase.featureObject.description | ||
+ | site.methyltransferase = memoryPlasmid.memoryObjects[item].methyltransferase.featureObject.target | ||
+ | site.methyltransferaseLength = site.methyltransferase.length | ||
+ | site.sensor = memoryPlasmid.memoryObjects[item].sensor.description | ||
+ | targetSites.push(site) | ||
+ | } | ||
} | } | ||
+ | //genbankRestriction(targetSites) | ||
+ | json = createJSONRestriction(targetSites) | ||
+ | $('#visualizationButtons').append('<input type="hidden" name="json-1" value="'+escape(JSON.stringify(json))+'"/><input class="submit" type="submit" value="Restriction Plasmid" onclick="visualization(-1);return false"/>'); | ||
+ | $('#readout').append('<input type="textfield" name="readout" value=""/><input class="submit" type="submit" value="Submit" onClick="getReadout();return false"/>'); | ||
} | } | ||
- | function | + | function getReadout(){ |
- | + | inputArray = new Array() | |
- | + | json = JSON.parse(unescape($(':input[name=json-1]').val())) | |
- | + | inputs = $(':input[name=readout]').val() | |
- | + | inputArray = inputs.split(',') | |
- | + | totalLength = json.children[0].data.length | |
- | + | uncutArray = new Array() | |
- | + | i = 0 | |
- | + | for (child in json.children){ | |
- | + | totalLength+=json.children[child].data.length | |
- | + | if (json.children[child].data.description.indexOf('Methyltransferase') != -1){ | |
- | + | uncutArray[i] = [json.children[child].id,totalLength] | |
- | + | i++ | |
- | + | } | |
- | + | } | |
- | + | bandsArray = new Array () | |
- | + | j = 0 | |
- | + | for (item in uncutArray){ | |
- | + | i = 0 | |
- | + | tempBandArray = new Array() | |
- | + | tempBandArray[i] = [uncutArray[item][1],uncutArray[item][0]] | |
- | + | i++ | |
- | + | for (bandArray in bandsArray){ | |
- | + | for (band in bandsArray[bandArray]){ | |
- | + | tempBandArray[i] = [uncutArray[item][1] - bandsArray[bandArray][band][0],uncutArray[item][0]] | |
- | + | i++ | |
- | + | } | |
- | + | } | |
- | + | bandsArray[j] = tempBandArray | |
- | + | j++ | |
- | + | } | |
- | json | + | matchingBands = new Array() |
- | json | + | i = 0 |
- | json | + | for (input in inputArray){ |
- | json | + | difference = 100000000000 |
- | json | + | bandSize = inputArray[input] |
- | json | + | for (bandArray in bandsArray){ |
- | json | + | for (band in bandsArray[bandArray]){ |
- | json.children[0].children[0].children = [] | + | if (bandSize > bandsArray[bandArray][band][0]){ |
- | json | + | tempDifference = bandSize - bandsArray[bandArray][band][0] |
- | json | + | } else{ |
- | i = | + | tempDifference = bandsArray[bandArray][band][0] - bandSize |
- | + | } | |
- | for ( | + | if (tempDifference < difference){ |
- | json.children[ | + | matchingBand = bandsArray[bandArray][band][1] |
- | json | + | difference = tempDifference |
- | json | + | } |
- | type = memoryPlasmid.memoryObjects[memoryObject][ | + | } |
- | + | } | |
+ | matchingBands[i] = matchingBand | ||
+ | i++ | ||
+ | } | ||
+ | i = 0 | ||
+ | sensedSignals = new Array() | ||
+ | for (matchingBand in matchingBands){ | ||
+ | for (child in json.children){ | ||
+ | if (json.children[child].id == matchingBands[matchingBand]){ | ||
+ | sensedSignals[i] = json.children[child].data.sensor | ||
+ | i++ | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | for (signal in sensedSignals){ | ||
+ | $('#readout').append('<br>'+sensedSignals[signal]) | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function createJSONRestriction(targetSites){ | ||
+ | json = { | ||
+ | "children": [], | ||
+ | "data": { | ||
+ | "$type": "none", | ||
+ | }, | ||
+ | "id": "Source", | ||
+ | "name": "Restriction Plasmid" | ||
+ | }; | ||
+ | |||
+ | json.children[0] = {} | ||
+ | json.children[0].data = {} | ||
+ | json.children[0].data.description = memoryPlasmid.features[1].description | ||
+ | json.children[0].data.$color = '#B2ABF4' | ||
+ | json.children[0].data.length = memoryPlasmid.features[1].end - memoryPlasmid.features[1].start | ||
+ | json.children[0].data.$angularWidth = 1000 | ||
+ | json.children[0].data.type = memoryPlasmid.features[1].type | ||
+ | json.children[0].data.dna = memoryPlasmid.dna | ||
+ | json.children[0].children = [] | ||
+ | json.children[0].name = memoryPlasmid.features[1].description | ||
+ | json.children[0].id = memoryPlasmid.features[1].description | ||
+ | totalLength = memoryPlasmid.dna.length | ||
+ | i = 1 | ||
+ | for (item in targetSites){ | ||
+ | site = targetSites[item] | ||
+ | json.children[i] = {} | ||
+ | json.children[i].data = {} | ||
+ | json.children[i].children = [] | ||
+ | json.children[i].data.description = '120bp random DNA' | ||
+ | json.children[i].data.$color = '#FFFF00' | ||
+ | json.children[i].data.length = 120 | ||
+ | json.children[i].data.$angularWidth = 1000 | ||
+ | json.children[i].data.dna = randomDNA(120+i*10) | ||
+ | json.children[i].name = '120bp DNA' | ||
+ | json.children[i].id = i | ||
+ | i++ | ||
+ | json.children[i] = {} | ||
+ | json.children[i].data = {} | ||
+ | json.children[i].children = [] | ||
+ | json.children[i].data.description = site.zincFingerDescription | ||
+ | json.children[i].data.$color = '#FF0000' | ||
+ | json.children[i].data.length = site.zincFingerLength | ||
+ | json.children[i].data.$angularWidth = 1000 | ||
+ | json.children[i].data.dna = site.zincFinger | ||
+ | json.children[i].name = site.zincFingerDescription.split('|')[0]+'|'+site.zincFingerDescription.split('|')[1] | ||
+ | json.children[i].id = i | ||
+ | i++ | ||
+ | json.children[i] = {} | ||
+ | json.children[i].data = {} | ||
+ | json.children[i].children = [] | ||
+ | json.children[i].data.description = '120bp random DNA' | ||
+ | json.children[i].data.$color = '#FFFF00' | ||
+ | json.children[i].data.length = 120 | ||
+ | json.children[i].data.$angularWidth = 1000 | ||
+ | json.children[i].data.dna = randomDNA(120) | ||
+ | json.children[i].name = '120bp DNA' | ||
+ | json.children[i].id = i | ||
+ | i++ | ||
+ | json.children[i] = {} | ||
+ | json.children[i].data = {} | ||
+ | json.children[i].children = [] | ||
+ | json.children[i].data.description = 'Methyltransferase: '+site.methyltransferaseDescription | ||
+ | json.children[i].data.$color = '#0000CD' | ||
+ | json.children[i].data.length = site.methyltransferaseLength | ||
+ | json.children[i].data.$angularWidth = 1000 | ||
+ | json.children[i].data.dna = site.methyltransferase | ||
+ | json.children[i].data.sensor = site.sensor | ||
+ | json.children[i].name = site.methyltransferaseDescription.split('|')[0] | ||
+ | json.children[i].id = i | ||
+ | i++ | ||
+ | json.children[i] = {} | ||
+ | json.children[i].data = {} | ||
+ | json.children[i].children = [] | ||
+ | json.children[i].data.description = '120bp random DNA' | ||
+ | json.children[i].data.$color = '#FFFF00' | ||
+ | json.children[i].data.length = 120 | ||
+ | json.children[i].data.$angularWidth = 1000 | ||
+ | json.children[i].data.dna = randomDNA(120) | ||
+ | json.children[i].name = '120bp DNA' | ||
+ | json.children[i].id = i | ||
+ | i++ | ||
+ | json.children[i] = {} | ||
+ | json.children[i].data = {} | ||
+ | json.children[i].children = [] | ||
+ | json.children[i].data.description = site.zincFingerDescription | ||
+ | json.children[i].data.$color = '#FF0000' | ||
+ | json.children[i].data.length = site.zincFingerLength | ||
+ | json.children[i].data.$angularWidth = 1000 | ||
+ | json.children[i].data.dna = site.zincFinger | ||
+ | json.children[i].name = site.zincFingerDescription.split('|')[0]+'|'+site.zincFingerDescription.split('|')[1] | ||
+ | json.children[i].id = i | ||
+ | i++ | ||
+ | } | ||
+ | return json | ||
+ | } | ||
+ | |||
+ | function createJSONMemory(number){ | ||
+ | var json = {} | ||
+ | json = { | ||
+ | "children": [], | ||
+ | "data": { | ||
+ | "$type": "none", | ||
+ | }, | ||
+ | "id": "Source", | ||
+ | "name": "Memory Plasmid" | ||
+ | }; | ||
+ | |||
+ | json.children[0] = {} | ||
+ | json.children[0].data = {} | ||
+ | json.children[0].data.description = memoryPlasmid.features[1].description | ||
+ | json.children[0].data.$color = '#B2ABF4' | ||
+ | json.children[0].data.length = memoryPlasmid.features[1].end - memoryPlasmid.features[1].start | ||
+ | json.children[0].data.$angularWidth = 1000 | ||
+ | json.children[0].data.type = memoryPlasmid.features[1].type | ||
+ | json.children[0].data.dna = memoryPlasmid.dna | ||
+ | json.children[0].children = [] | ||
+ | json.children[0].name = memoryPlasmid.features[1].description | ||
+ | json.children[0].id = memoryPlasmid.features[1].description | ||
+ | i = 1 | ||
+ | for (memoryObject in memoryPlasmid.memoryObjects){ | ||
+ | for (item in memoryPlasmid.memoryObjects[memoryObject]){ | ||
+ | json.children[i] = {} | ||
+ | json.children[i].children = [] | ||
+ | json.children[i].data = {} | ||
+ | json.children[i].data.description = memoryPlasmid.memoryObjects[memoryObject][item].description | ||
+ | type = memoryPlasmid.memoryObjects[memoryObject][item].type | ||
if (type == 'Sensor'){ | if (type == 'Sensor'){ | ||
color = '#00FFFF' | color = '#00FFFF' | ||
Line 776: | Line 951: | ||
color = '#B2ABF4' | color = '#B2ABF4' | ||
} | } | ||
- | json | + | json.children[i].data.$color = color |
- | json | + | json.children[i].data.length = memoryPlasmid.memoryObjects[memoryObject][item].end - memoryPlasmid.memoryObjects[memoryObject][item].start |
- | json | + | json.children[i].data.$angularWidth = 1000 |
- | json | + | json.children[i].data.type = type |
- | json.children[ | + | json.children[i].data.dna = memoryPlasmid.memoryObjects[memoryObject][item].sequence |
- | json.children[ | + | json.children[i].id = i |
+ | if (memoryPlasmid.memoryObjects[memoryObject][item].description.length > 14){ | ||
+ | json.children[i].name = memoryPlasmid.memoryObjects[memoryObject][item].description.substring(0,14) | ||
+ | } else{ | ||
+ | json.children[i].name = memoryPlasmid.memoryObjects[memoryObject][item].description | ||
+ | } | ||
i++ | i++ | ||
} | } | ||
- | + | } | |
- | + | return json | |
+ | |||
//end | //end | ||
} | } | ||
Line 794: | Line 975: | ||
<div id="main-content"> | <div id="main-content"> | ||
{{Team:Amsterdam/toolForm}} | {{Team:Amsterdam/toolForm}} | ||
- | |||
</div> | </div> | ||
{{Team:Amsterdam/Foot}} | {{Team:Amsterdam/Foot}} |
Revision as of 18:36, 3 September 2012
Parts registry sensors: Madras | ||||
Parts registry sensors: Phage | ||||
Parts registry sensors: Metal sensitive | ||||
Parts registry sensors: Cell signalling | ||||