Skip to content

Commit

Permalink
PR changes, JS tidy up, comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jethror1 committed Jul 5, 2021
1 parent 8d0b6fa commit eb23f21
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
10 changes: 3 additions & 7 deletions bin/coverage_report_single.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ def style_cov_summary(self):
- cov_summary (df): df of gene coverage stats
- threshold_cols (list): list of threshold values
Returns:
- gene_stats (str): HTML formatted str of gene summary df
- gene_stats (list): HTML formatted str of gene summary df
- total_genes (int): total number of genes
"""
# rename columns for displaying in report
Expand Down Expand Up @@ -632,7 +632,7 @@ def style_snps_cov(self, snps_cov):
Args:
- snps_cov (df): df of snps above / below threshold
Returns:
- snps_cov (str): list of snps to render in report
- snps_cov (list): list of snps to render in report
- total_snps (int): total number of snps in df
"""
if not snps_cov.empty:
Expand Down Expand Up @@ -667,15 +667,11 @@ def style_snps_no_cov(snps_no_cov):
Args:
- snps_no_cov (df): df of snps with no coverage values
Returns:
- snps_no_cov (str): list of snps for rendering in report
- snps_no_cov (list): list of snps for rendering in report
- snps_out_panel (int): total number snps with no cov
"""
# if variants from vcf found that span exon boundaries
if not snps_no_cov.empty:
# manually add div and styling around rendered table, allows
# to be fully absent from the report if the table is empty
snps_no_cov.index = np.arange(1, len(snps_no_cov) + 1)

# get number of variants to display in report
snps_out_panel = len(snps_no_cov.index)

Expand Down
11 changes: 6 additions & 5 deletions data/templates/single_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ <h2> Coverage of Known Variants </h2>
// $total_snps is int passed from report script, set to JS snp_check var on writing to template to check against
var snp_check = $total_snps
if (snp_check == 0) {
document.getElementById('snps').style.display = "none";
document.getElementById('snps').style.display = "none";
}
</script>

Expand All @@ -354,7 +354,7 @@ <h2> Coverage of Known Variants </h2>
// $exon_issues is int passed from report script
var exon_check = $exon_issues
if (exon_check == 0) {
document.getElementById('low_exon_plots').style.display = "none";
document.getElementById('low_exon_plots').style.display = "none";
}
</script>

Expand All @@ -367,11 +367,12 @@ <h2> Coverage of Known Variants </h2>
for (i = 0; i < coll.length; i++) {
coll[i].addEventListener("click", function() {
this.classList.toggle("active");

var content = this.nextElementSibling;
if (content.style.maxHeight){
content.style.maxHeight = null;
if (content.style.maxHeight) {
content.style.maxHeight = null;
} else {
content.style.maxHeight = content.scrollHeight * 2 + "px";
content.style.maxHeight = content.scrollHeight * 2 + "px";
}
});
}
Expand Down

0 comments on commit eb23f21

Please sign in to comment.