Team:Harvard/ZF Binding Site Finder
From 2011.igem.org
(Difference between revisions)
Line 1: | Line 1: | ||
+ | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | <head> | ||
Line 59: | Line 60: | ||
</style> | </style> | ||
+ | <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
Line 101: | Line 103: | ||
} | } | ||
+ | |||
+ | $.validator.addMethod( | ||
+ | "ntpCheck", | ||
+ | function(value, element, regexp) { | ||
+ | var re = new RegExp(regexp); | ||
+ | return this.optional(element) || re.test(value); | ||
+ | }, | ||
+ | "You must enter a valid sequence of nine nucleotides containing G,T,C,A, or N." | ||
+ | ); | ||
Line 110: | Line 121: | ||
//get zinc finger arrays for searching | //get zinc finger arrays for searching | ||
- | var bottomzf = $("# | + | var bottomzf = $("#bottominput").val().toUpperCase(); |
- | var topzf = $("# | + | var topzf = $("#topinput").val().toUpperCase(); |
- | + | ||
- | + | ||
- | + | ||
var ntpCheck = /[GCTAN]{9}/; | var ntpCheck = /[GCTAN]{9}/; | ||
- | + | $("#results").html("what's up!"); | |
- | + | /* | |
- | /* if (!(bottomzf.match(ntpCheck)&& | + | if (!(bottomzf.match(ntpCheck)&& |
topzf.match(ntpCheck)&& | topzf.match(ntpCheck)&& | ||
(bottomzf.length=="9")&& | (bottomzf.length=="9")&& | ||
Line 128: | Line 136: | ||
} | } | ||
*/ | */ | ||
+ | |||
+ | $("#bottominput #topinput").rules("add", { regex: "[GCTAN]{9}" }) | ||
+ | |||
+ | //transform bottom zf to reverse complement | ||
+ | bottomzf = reverseComplement(bottomzf); | ||
+ | |||
+ | alert(bottomzf); | ||
+ | alert(topzf); | ||
+ | |||
+ | |||
+ | /* | ||
+ | //start building regular expression from ZF fingers | ||
+ | var siteExp = "(" + bottomzf.replace(/n/gi,"\\w"); | ||
+ | |||
+ | //add in x NTPs between first and second finger | ||
+ | var nucgap = document.getElementById("gap").value; | ||
+ | for(i=0;i<nucgap;i++){ | ||
+ | siteExp = siteExp + "\\w"; | ||
+ | } | ||
+ | |||
+ | //finish building regular expression | ||
+ | siteExp = siteExp + topzf.replace(/n/gi,"\\w") + "){1}"; | ||
+ | |||
+ | //construct regular expression and find all instances of desired sequence in the test sequence | ||
+ | var array1 = new RegExp(siteExp, "gi"); | ||
+ | var array2 = testseq.match(array1); | ||
+ | |||
+ | //error message if no sequences found | ||
+ | if(testseq.search(array1) == -1) | ||
+ | { | ||
+ | document.getElementById("results").innerHTML = "No results found."; | ||
+ | //if results are found, build table to display results | ||
+ | } else { | ||
+ | |||
+ | var revComp = ""; | ||
+ | var seqtwo = ""; | ||
+ | |||
+ | table = "<table><tr><td colspan='4'><b>Zinc Finger Binding Site Candidates</b></td></tr><td><b>Location</b></td><td><b>Bottom Sequence</b></td><td><b>Top Sequence</b></td><td><b>Entire Sequence (top strand perspective)</b></td>"; | ||
+ | |||
+ | for(i=0;i<array2.length;i++) | ||
+ | { | ||
+ | array1.test(testseq); | ||
+ | |||
+ | table = table + "<tr>"; | ||
+ | //subtract 18 nucleotides, nucgap inter-ZF nucleotides, +1 for index correction for location of binding site | ||
+ | table = table + "<td>" + (array1.lastIndex - 18 - nucgap) + "</td>"; | ||
+ | seqbottom = reverseComplement(array2[i].substring(0,9)); | ||
+ | table = table + "<td>" + seqbottom + "</td>"; | ||
+ | table = table + "<td>" + array2[i].substring(array2[i].length - 9,array2[i].length) + "</td>"; | ||
+ | table = table + "<td>" + array2[i] + "</td>"; | ||
+ | table = table + "</tr>"; | ||
+ | } | ||
+ | |||
+ | table = table + "</table><br /><br />" | ||
+ | |||
+ | document.getElementById("results").innerHTML = table; | ||
+ | } | ||
+ | */ | ||
}); | }); | ||
Line 169: | Line 235: | ||
<option value="\w\w\w">NNN</option> | <option value="\w\w\w">NNN</option> | ||
</select><br /> | </select><br /> | ||
- | <input type="text" id=" | + | <input type="text" id="bottominput" value="Input NTPs here" class="graytext" /> |
</td> | </td> | ||
<td width="40%"> | <td width="40%"> | ||
Line 194: | Line 260: | ||
<option value="\w\w\w">NNN</option> | <option value="\w\w\w">NNN</option> | ||
</select><br /> | </select><br /> | ||
- | <input type="text" id=" | + | <input type="text" id="topinput" value="Input NTPs here" class="graytext" /> |
</td> | </td> | ||
<td width="20%"> | <td width="20%"> | ||
Line 207: | Line 273: | ||
<tr><td colspan="3"> | <tr><td colspan="3"> | ||
<input type="button" value="Test (drop down menu)" onClick="findSites();" /> | <input type="button" value="Test (drop down menu)" onClick="findSites();" /> | ||
- | <input type="button" id="findcustom" value="Test custom input" /> | + | <input type="button" id="findcustom" value="Test custom input" onClick="findCustom();" /> |
<input type="button" value="Show me ALL binding sites!" onClick="findAllSites();" id="allsites"/> | <input type="button" value="Show me ALL binding sites!" onClick="findAllSites();" id="allsites"/> | ||
</td></tr> | </td></tr> |
Revision as of 03:47, 9 July 2011
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">