Skip to content

Commit

Permalink
Add curated gis support
Browse files Browse the repository at this point in the history
  • Loading branch information
Nolan Woods committed Sep 20, 2022
1 parent bd7d5e3 commit 87d4ba2
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 8 deletions.
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions src/css/linearplot.css
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,19 @@ g.root.node circle{
}

.islandpath, #islandpathLegend{
fill: red !important;
fill: #BB410A !important;
}

.sigi, #sigiLegend{
fill: blue !important;
fill: #0720C7 !important;
}

.blast, #blastLegend{
fill: #508714 !important;
fill: #3AD849 !important;
}

.curated, #curatedLegend{
fill: #BD5DEF !important;
}

.GIColourBody label{
Expand Down
11 changes: 11 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@
<input type="checkbox" name="blast" value="blast" id="blast-box" checked disabled>BLAST
</label>
</span>
<span id="curatedToggle">
<label>
<input type="checkbox" name="curated" value="curated" id="curated-box" checked disabled>Curated
</label>
</span>
</div>
</div>
</div>
Expand Down Expand Up @@ -127,6 +132,12 @@
</svg>
BLAST Genomic Island
</span>
<span id="curatedLegend" class="legendText">
<svg height="10" width="10">
<rect x="1" y="1" width="8" height="8" stroke-width="1"></rect>
</svg>
Curated Genomic Island
</span>

</div>
<div id="clusterLegend" class="clearfix" hidden>
Expand Down
16 changes: 12 additions & 4 deletions src/js/genomecomparevis.js
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,10 @@ export default function MultiVis(targetNode){
}
})
.append("title").text(function(gi) {
if(gi.cluster != null) { return "Click to open GI cluster " + gi.cluster + " view"; }
let title = "";
if (gi.query) { title += gi.query + "\n"; }
if(gi.cluster != null) { title += "Click to open GI cluster " + gi.cluster + " view"; }
return title;
});
});
});
Expand Down Expand Up @@ -624,6 +627,11 @@ export default function MultiVis(targetNode){
} else {
$(".blast").hide();
}
if ($(".GIColourBody :checkbox[name=curated]").is(":checked")) {
$(".curated").show();
} else {
$(".curated").hide();
}
};

this.GIColourToggle = function() {
Expand Down Expand Up @@ -718,9 +726,9 @@ export default function MultiVis(targetNode){
this.highlightCluster = function(clusterClass) {
$(clusterClass).attr("filter", "url(#shadow)");
//$(".sigi, .islandpath").hide();
var otherIslands = $("svg .genomicIslands polygon").not(clusterClass);
otherIslands.attr("fill-opacity", "0.4");
otherIslands.attr("stroke-opacity", "0");
//var otherIslands = $("svg .genomicIslands polygon").not(clusterClass);
//otherIslands.attr("fill-opacity", "0.4");
//otherIslands.attr("stroke-opacity", "0");
var genes = $(".CDS, .tRNA, .rRNA, .gene");
genes.attr("fill-opacity", "0.4");
genes.attr("stroke-opacity", "0");
Expand Down
8 changes: 7 additions & 1 deletion src/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ function loadVis(src) {
case 'blast':
program = 'blast';
break;
case 'curated':
program = 'curated';
break;
default:
program = 'merged';
break;
Expand All @@ -113,6 +116,8 @@ function loadVis(src) {
color = color ? color[1] : null;
let parent = /Parent=([^;\n]+)/.exec(row[8]);
parent = parent ? parent[1] : null;
let query = /Query=([^|;\n]+)/.exec(row[8]);
query = query ? query[1] : null;
sequence = container.backbone.getSequences().find(function (seq) {
return seq.sequenceId === row[0];
});
Expand All @@ -122,7 +127,8 @@ function loadVis(src) {
end: row[4],
cluster: cluster,
color: color,
parent: parent
parent: parent,
query: query,
});
break;
case 'match':
Expand Down

0 comments on commit 87d4ba2

Please sign in to comment.