aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorzsloan2022-08-12 14:33:46 +0000
committerzsloan2022-12-21 13:04:07 -0600
commit2f3a7be180ae62bd3417055a96801b66909e14ab (patch)
tree7609ad8f9413c40f7843bf1dd6e71009b1bd0f96 /wqflask
parent18cb113450b8ef17d1d1ca81062e05ce27657c00 (diff)
downloadgenenetwork2-2f3a7be180ae62bd3417055a96801b66909e14ab.tar.gz
Substitute mm10/hg38 with ref/source in display_mapping_results.py
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/marker_regression/display_mapping_results.py71
1 files changed, 36 insertions, 35 deletions
diff --git a/wqflask/wqflask/marker_regression/display_mapping_results.py b/wqflask/wqflask/marker_regression/display_mapping_results.py
index 16eaee24..434db19d 100644
--- a/wqflask/wqflask/marker_regression/display_mapping_results.py
+++ b/wqflask/wqflask/marker_regression/display_mapping_results.py
@@ -1356,41 +1356,42 @@ class DisplayMappingResults:
yPaddingTop = yTopOffset
for index, homology_dict in enumerate(self.homology):
- if self.dataset.group.species == "mouse":
- mm10_start = homology_dict["mm10_start"]
- mm10_end = homology_dict["mm10_end"]
- hg38_chr = homology_dict["hg38_chr"]
- hg38_strand = homology_dict["hg38_strand"]
- hg38_start = homology_dict["hg38_start"]
- hg38_end = homology_dict["hg38_end"]
- geneLength = (mm10_end - mm10_start) * 1000.0
- tenPercentLength = geneLength * 0.0001
-
- geneStartPix = xLeftOffset + \
- plotXScale * (float(mm10_start) - startMb)
- geneEndPix = xLeftOffset + plotXScale * \
- (float(mm10_end) - startMb) # at least one pixel
-
- if (geneEndPix < xLeftOffset):
- return # this gene is not on the screen
- elif (geneEndPix > xLeftOffset + plotWidth):
- geneEndPix = xLeftOffset + plotWidth # clip the last in-range gene
- if (geneStartPix > xLeftOffset + plotWidth):
- return # we are outside the valid on-screen range, so stop drawing genes
- elif (geneStartPix < xLeftOffset):
- geneStartPix = xLeftOffset # clip the first in-range gene
-
- # color the gene based on SNP density
- # found earlier, needs to be recomputed as snps are added
- # always apply colors now, even if SNP Track not checked - Zach 11/24/2010
-
- myColor = BLACK
-
- outlineColor = myColor
- fillColor = myColor
-
- TITLE = f"hg38: Chr {hg38_chr} from {hg38_start:.3f} to {hg38_end:.3f} Mb"
- HREF = f"http://genome.ucsc.edu/cgi-bin/hgTracks?db=hg38&position=chr{hg38_chr}:{int(hg38_start * 1000000)}-{int(hg38_end * 1000000)}"
+ ref_strand = homology_dict["ref_strand"]
+ ref_start = homology_dict["ref_start"]
+ ref_end = homology_dict["ref_end"]
+ query_chr = homology_dict["query_chr"]
+ query_strand = homology_dict["query_strand"]
+ query_start = homology_dict["query_start"]
+ query_end = homology_dict["query_end"]
+
+ geneLength = (ref_end - ref_start) * 1000.0
+ tenPercentLength = geneLength * 0.0001
+
+ geneStartPix = xLeftOffset + \
+ plotXScale * (float(ref_start) - startMb)
+ geneEndPix = xLeftOffset + plotXScale * \
+ (float(ref_end) - startMb) # at least one pixel
+
+ if (geneEndPix < xLeftOffset):
+ return # this gene is not on the screen
+ elif (geneEndPix > xLeftOffset + plotWidth):
+ geneEndPix = xLeftOffset + plotWidth # clip the last in-range gene
+ if (geneStartPix > xLeftOffset + plotWidth):
+ return # we are outside the valid on-screen range, so stop drawing genes
+ elif (geneStartPix < xLeftOffset):
+ geneStartPix = xLeftOffset # clip the first in-range gene
+
+ # color the gene based on SNP density
+ # found earlier, needs to be recomputed as snps are added
+ # always apply colors now, even if SNP Track not checked - Zach 11/24/2010
+
+ myColor = BLACK
+
+ outlineColor = myColor
+ fillColor = myColor
+
+ TITLE = f"hg38: Chr {hg38_chr} from {hg38_start:.3f} to {hg38_end:.3f} Mb"
+ HREF = f"http://genome.ucsc.edu/cgi-bin/hgTracks?db=hg38&position=chr{hg38_chr}:{int(hg38_start * 1000000)}-{int(hg38_end * 1000000)}"
# Draw Genes
geneYLocation = yPaddingTop + \