Skip to content

Commit

Permalink
XXX FIXME: strand
Browse files Browse the repository at this point in the history
  • Loading branch information
tsibley committed May 11, 2023
1 parent 4568d58 commit 0da0966
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/entropy/entropyD3.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ EntropyChart.prototype.update = function update({

/* convert amino acid X in gene Y to a nucleotide number */
EntropyChart.prototype._aaToNtCoord = function _aaToNtCoord(gene, aaPos) {
// XXX FIXME: strand
if (this.geneMap[gene].strand === "-") {
return this.geneMap[gene].end - aaPos * 3 + 1;
}
Expand Down Expand Up @@ -177,9 +178,12 @@ EntropyChart.prototype._drawZoomGenes = function _drawZoomGenes(annotations) {
const strokeCol = posInSequence < 1e6 ? "white" : "black"; /* black for large because otherwise disappear against background */
/* check if we've got 2 reading frames (genes on both the "+" & "-" strands) and if so then modify
the offset accordingly. If not, plot them all in the middle to save space */
// XXX FIXME: strand
// XXX FIXME: does this assume there are always strand==="+" annotations? I think so.
const genesOnBothStrands = !!annotations.filter((a) => a.strand === "-").length;
const readingFrameOffset = (strand) => {
if (genesOnBothStrands) {
// XXX FIXME: strand
return strand === "-" ? 20 : 0;
}
return 10;
Expand Down
3 changes: 3 additions & 0 deletions src/components/entropy/infoPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ const InfoPanel = ({hovered, width, height, mutType, showCounts, geneMap, t}) =>
styles.container.bottom = height - pos.y;
}

// XXX FIXME: strand
const isNegStrand = hovered.d.prot ? geneMap[hovered.d.prot].strand === "-" : null;

// XXX FIXME: strand
const nucPos = hovered.d.prot ?
mutType === "aa" ?
isNegStrand ? geneMap[hovered.d.prot].end - hovered.d.codon * 3 + 3 :
Expand All @@ -72,6 +74,7 @@ const InfoPanel = ({hovered, width, height, mutType, showCounts, geneMap, t}) =>
</div>
<p/>
<div>
// XXX FIXME: strand
{isNegStrand === null ? `` : isNegStrand ? t("Negative strand") : t("Positive strand")}
</div>
<p/>
Expand Down
1 change: 1 addition & 0 deletions src/util/entropyCreateStateFromJsons.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const getAnnotations = (jsonData) => {
prot: prot,
start: jsonData[prot].start - 1, // see above
end: jsonData[prot].end,
// XXX FIXME: strand?
strand: jsonData[prot].strand,
fill: genotypeColors[aaCount % 10]
});
Expand Down

0 comments on commit 0da0966

Please sign in to comment.