Skip to content

Commit

Permalink
Do not duplicate plotly javascript
Browse files Browse the repository at this point in the history
  • Loading branch information
sminot committed Feb 5, 2024
1 parent c2e6193 commit 33aedb6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bin/bin_metagenomes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ def write_image(
for i in [1, 2, 4, 5, 6]
}
)
fig.write_html(f"{output_fp}.html")
fig.write_html(f"{output_fp}.html", include_plotlyjs="cdn")
for ext in ['png', 'pdf']:
fig.write_image(
f"{output_fp}.{ext}",
Expand Down
10 changes: 5 additions & 5 deletions templates/concatenate_alignments.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def gene_frequency_bars(aln: pd.DataFrame):
labels=dict(sseqid="Number of Genomes", index="Gene"),
title="Gene Detection Frequency"
)
fig.write_html("gene_frequency_bars.html")
fig.write_html("gene_frequency_bars.html", include_plotlyjs="cdn")


def genome_frequency_bars(aln: pd.DataFrame):
Expand All @@ -113,7 +113,7 @@ def genome_frequency_bars(aln: pd.DataFrame):
labels=dict(genome="Number of Genes", index="Genome"),
title="Genome Size Distribution"
)
fig.write_html("genome_frequency_bars.html")
fig.write_html("genome_frequency_bars.html", include_plotlyjs="cdn")


def alignment_qc_metrics(aln: pd.DataFrame):
Expand Down Expand Up @@ -141,7 +141,7 @@ def alignment_qc_metrics(aln: pd.DataFrame):
title="Gene Detection QC Metrics",
color_continuous_scale=colorscale
)
fig.write_html("alignment_qc_metrics.html")
fig.write_html("alignment_qc_metrics.html", include_plotlyjs="cdn")


def alignment_heatmap(aln: pd.DataFrame):
Expand All @@ -164,7 +164,7 @@ def alignment_heatmap(aln: pd.DataFrame):
color_continuous_scale="Blues",
labels=dict(sseqid="Gene", genome="Genome")
)
fig.write_html("alignment_heatmap.html")
fig.write_html("alignment_heatmap.html", include_plotlyjs="cdn")


def gene_frequency_genome_size(aln: pd.DataFrame):
Expand Down Expand Up @@ -213,7 +213,7 @@ def gene_frequency_genome_size(aln: pd.DataFrame):
),
hover_data=["genome"]
)
fig.write_html("gene_frequency_genome_size.html")
fig.write_html("gene_frequency_genome_size.html", include_plotlyjs="cdn")


def sort(df: pd.DataFrame, method="average", metric="euclidean"):
Expand Down

0 comments on commit 33aedb6

Please sign in to comment.