-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
do a little cleaning and add usual doc
- Loading branch information
Showing
9 changed files
with
84 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v0.1 : 12/11 Creation , Olivier Sallou <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
All the code hereby is licensed under the CeCILL license (http://www.cecill.info/licences/Licence_CeCILL_V2-en.html) which is a GNU GPL equivalent for the French law. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
* Requirements * | ||
|
||
This software needs a web server with PHP enabled for additional features loading and image save function. | ||
The rest of the software is pure web (HTML+Javascript). | ||
|
||
The img/tmp directory must be writable by the web server to create images when "save alignment image" is selected. | ||
Images in directory can be safely cleaned by a cron task to remove old images. | ||
|
||
* Configuration * | ||
|
||
If a seqcrawler server is available to extract additional features, then configuration must be updated | ||
in features.php, the URL need to be adapted to the seqcrawler server. | ||
|
||
In the other case, useFeatures must be set to 0 in js/uiseqblast.js | ||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
/** | ||
* Library for index.html, managing a blast alignement display | ||
* | ||
* Author: Olivier Sallou <[email protected]> | ||
* | ||
*/ | ||
|
||
|
||
|
||
|
||
/** | ||
* Return a specific iteration from iterations | ||
*/ | ||
|
@@ -52,19 +62,39 @@ function drawSequences(min,max) { | |
|
||
var from = sequence["from"]; | ||
var to = sequence["to"]; | ||
/* | ||
min<------------------------------->max | ||
----- case1 | ||
----------------- case2 | ||
------------- case3 | ||
----------------------------------------------- case4 | ||
---- case5 | ||
------- case6 | ||
*/ | ||
|
||
if((from>=min && from<=max)&&(to>=min && to<=max)) { | ||
// case1 : complete sequence is between min and max | ||
context.fillText(sequence["seq"], xPos+Xseq+from-min, yPos); | ||
} | ||
else if(from>=min && from<=max) { | ||
// case2 | ||
context.fillText(sequence["seq"].substring(0,max-from), xPos+Xseq+from-min, yPos); | ||
} | ||
else if(to>=min && to<=max) { | ||
context.fillText(sequence["seq"].substring(min-from,max-min), xPos+Xseq, yPos); | ||
// case3 | ||
//context.fillText(sequence["seq"].substring(min-from,max-min), xPos+Xseq, yPos); | ||
context.fillText(sequence["seq"].substring(min-from), xPos+Xseq, yPos); | ||
} | ||
else if(from<=min && to>=max) { | ||
// case 4 | ||
context.fillText(sequence["seq"].substring(min-from,max-from), xPos+Xseq, yPos); | ||
} | ||
// if none match, case 5 and 6, nothing to display for sequence | ||
yPos+=step; | ||
} | ||
yPos=10; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,19 @@ | ||
/** | ||
* Library for sequence.html, managing a Hit alignement display and additional features extraction | ||
* | ||
* Author: Olivier Sallou <[email protected]> | ||
* | ||
*/ | ||
|
||
/** | ||
* Configuration | ||
*/ | ||
useFeatures = 1; | ||
|
||
|
||
/** | ||
* Clear the canvas | ||
*/ | ||
function clearCanvas() { | ||
context.save(); | ||
context.fillStyle = "white"; | ||
|
@@ -6,6 +22,9 @@ function clearCanvas() { | |
} | ||
|
||
|
||
/** | ||
* Draw Hsps for the selected Hit between min and max position | ||
*/ | ||
function drawSequences(min,max) { | ||
clearCanvas(); | ||
max = parseInt(max); | ||
|
@@ -92,12 +111,15 @@ for (var i=0;i<sequences.length;i++) | |
context.fillText(sequence["seq"].substring(min-from,max-from), xPos+Xseq, yPos); | ||
} | ||
yPos+=step; | ||
addFeatures(sequence,max,min); | ||
if(useFeatures==1) { addFeatures(sequence,max,min); } | ||
|
||
} | ||
yPos=20; | ||
} | ||
|
||
/** | ||
* Draw a filler (blank) | ||
*/ | ||
function drawFiller(x) { | ||
var empty=""; | ||
for(var j=0;j<x;j++) { | ||
|
@@ -107,6 +129,9 @@ function drawFiller(x) { | |
return empty; | ||
} | ||
|
||
/** | ||
* Draw feature in canvas with input parameters | ||
*/ | ||
function drawFeature(x,y,size,text,title) { | ||
var empty=drawFiller(x); | ||
var spaced=""; | ||
|
@@ -122,6 +147,9 @@ function drawFeature(x,y,size,text,title) { | |
} | ||
} | ||
|
||
/** | ||
* Add features aligned with sequence alignment between min and max positions | ||
*/ | ||
function addFeatures(sequence,max,min) { | ||
if(sequence["features"]!=null) { | ||
for (var i=0;i<sequence["features"].length;i++) { | ||
|
@@ -157,7 +185,9 @@ function addFeatures(sequence,max,min) { | |
context.fillStyle="black"; | ||
} | ||
|
||
|
||
/** | ||
* Load XML file from input URL, extract Hit from hitnum parameter and load additional features with a call to features.php | ||
*/ | ||
function getXML(xmlUrl) { | ||
|
||
$.ajax( { | ||
|
@@ -185,7 +215,7 @@ $.ajax( { | |
|
||
if(hspnum==$.getURLParam("hspnum")) { | ||
$("#documentDetails" ).html('<p class="wait"><img title="loading" alt="loading" src="img/waiting.gif"/></p>'); | ||
$("#documentDetails" ).dialog({ title: 'Loading, please wait' , width : '200px' }); | ||
$("#documentDetails" ).dialog({ title: 'Loading features, please wait' , width : '200px' }); | ||
$.get("features.php?id="+accession+"&from="+$(this).find('Hsp_hit-from').text()+"&to="+$(this).find('Hsp_hit-to').text(), | ||
function(jsonFeatures){ | ||
$("#documentDetails" ).dialog( "close" ); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters