Skip to content

Commit d2c2be1

Browse files
Colelymantrevormartinj7Snicker7mbowcut2
authored
Showing sgRNA sequences on hover in CRISPRessoPro (#432)
* Passing sgRNA sequences to regular and Batch D3 plots (#73) * Sam/try plots (#71) * Fix batch mode pandas warning. (#70) * refactor to call method on DataFrame, rather than Series. Removes warning. * Fix pandas future warning in CRISPRessoWGS --------- Co-authored-by: Cole Lyman <cole@colelyman.com> * Functional * Cole/fix status file name (#69) * Update config file logging messages This removes printing the exception (which is essentially a duplicate), and adds a condition if no config file was provided. Also changes `json` to `config` so that it is more clear. * Fix divide by zero when no amplicons are present in Batch mode * Don't append file_prefix to status file name * Place status files in output directories * Update tests branch for file_prefix addition * Load D3 and plotly figures with pro with multiple amplicons * Update batch * Fix bug in CRISPRessoCompare with pointing to report datas with file_prefix Before this fix, when using a file_prefix the second run that was compared would not be displayed as a data in the first figure of the report. * Import CRISPRessoPro instead of importing the version When installed via conda, the version is not available * Remove `get_amplicon_output` unused function from CRISPRessoCompare Also remove unused argparse import * Implement `get_matching_allele_files` in CRISPRessoCompare and accompanying unit tests * Allow for matching of multiple guides in the same amplicon * Fix pandas FutureWarning * Change test branch back to master --------- Co-authored-by: Sam <snic9004@gmail.com> * Try catch all futures * Fix test fail plots * Point test to try-plots * Fix d3 not showing and plotly mixing with matplotlib * Use logger for warnings and debug statements * Point tests back at master --------- Co-authored-by: mbowcut2 <55161542+mbowcut2@users.noreply.github.com> Co-authored-by: Cole Lyman <cole@colelyman.com> * Sam/fix plots (#72) * Fix batch mode pandas warning. (#70) * refactor to call method on DataFrame, rather than Series. Removes warning. * Fix pandas future warning in CRISPRessoWGS --------- Co-authored-by: Cole Lyman <cole@colelyman.com> * Functional * Cole/fix status file name (#69) * Update config file logging messages This removes printing the exception (which is essentially a duplicate), and adds a condition if no config file was provided. Also changes `json` to `config` so that it is more clear. * Fix divide by zero when no amplicons are present in Batch mode * Don't append file_prefix to status file name * Place status files in output directories * Update tests branch for file_prefix addition * Load D3 and plotly figures with pro with multiple amplicons * Update batch * Fix bug in CRISPRessoCompare with pointing to report datas with file_prefix Before this fix, when using a file_prefix the second run that was compared would not be displayed as a data in the first figure of the report. * Import CRISPRessoPro instead of importing the version When installed via conda, the version is not available * Remove `get_amplicon_output` unused function from CRISPRessoCompare Also remove unused argparse import * Implement `get_matching_allele_files` in CRISPRessoCompare and accompanying unit tests * Allow for matching of multiple guides in the same amplicon * Fix pandas FutureWarning * Change test branch back to master --------- Co-authored-by: Sam <snic9004@gmail.com> * Try catch all futures * Fix test fail plots * Fix d3 not showing and plotly mixing with matplotlib --------- Co-authored-by: mbowcut2 <55161542+mbowcut2@users.noreply.github.com> Co-authored-by: Cole Lyman <cole@colelyman.com> * Remove token from integration tests file * Provide sgRNA_sequences to plot_nucleotide_quilt plots * Passing sgRNA_sequences to plot * Refactor check for determining when to use CRISPREssoPro or matplotlib for Batch plots * Add max-height to Batch report samples * Change testing branch * Fix wrong check for large Batch plots * Update integration_tests.yml to point back at master --------- Co-authored-by: Samuel Nichols <Snic9004@gmail.com> Co-authored-by: mbowcut2 <55161542+mbowcut2@users.noreply.github.com> Co-authored-by: Cole Lyman <cole@colelyman.com> * Push new releases to ECR (#74) * Create aws_ecr.yml (#1) * Update aws_ecr.yml * Update aws_ecr.yml * Update aws_ecr.yml * Update aws_ecr.yml * Update aws_ecr.yml * Update aws_ecr.yml * Update aws_ecr.yml * Update aws_ecr.yml * Update aws_ecr.yml * Update aws_ecr.yml * Update aws_ecr.yml * Update aws_ecr.yml * Update aws_ecr.yml * Update aws_ecr.yml * Update aws_ecr.yml * Update aws_ecr.yml * Update aws_ecr.yml * Update aws_ecr.yml * Update aws_ecr.yml * Update aws_ecr.yml * Update aws_ecr.yml * Update aws_ecr.yml * us-east-1 * Update aws_ecr.yml * Update aws_ecr.yml * Update aws_ecr.yml * Update aws_ecr.yml * Update aws_ecr.yml * Fix d3 sgRNA sequences (#76) * Pass correct sgRNA_sequences to d3 plot * Pass correct sgRNA sequence to prime editor plot for d3 * Resize plotly (#75) * Sam/try plots (#71) * Fix batch mode pandas warning. (#70) * refactor to call method on DataFrame, rather than Series. Removes warning. * Fix pandas future warning in CRISPRessoWGS --------- Co-authored-by: Cole Lyman <cole@colelyman.com> * Functional * Cole/fix status file name (#69) * Update config file logging messages This removes printing the exception (which is essentially a duplicate), and adds a condition if no config file was provided. Also changes `json` to `config` so that it is more clear. * Fix divide by zero when no amplicons are present in Batch mode * Don't append file_prefix to status file name * Place status files in output directories * Update tests branch for file_prefix addition * Load D3 and plotly figures with pro with multiple amplicons * Update batch * Fix bug in CRISPRessoCompare with pointing to report datas with file_prefix Before this fix, when using a file_prefix the second run that was compared would not be displayed as a data in the first figure of the report. * Import CRISPRessoPro instead of importing the version When installed via conda, the version is not available * Remove `get_amplicon_output` unused function from CRISPRessoCompare Also remove unused argparse import * Implement `get_matching_allele_files` in CRISPRessoCompare and accompanying unit tests * Allow for matching of multiple guides in the same amplicon * Fix pandas FutureWarning * Change test branch back to master --------- Co-authored-by: Sam <snic9004@gmail.com> * Try catch all futures * Fix test fail plots * Point test to try-plots * Fix d3 not showing and plotly mixing with matplotlib * Use logger for warnings and debug statements * Point tests back at master --------- Co-authored-by: mbowcut2 <55161542+mbowcut2@users.noreply.github.com> Co-authored-by: Cole Lyman <cole@colelyman.com> * Sam/fix plots (#72) * Fix batch mode pandas warning. (#70) * refactor to call method on DataFrame, rather than Series. Removes warning. * Fix pandas future warning in CRISPRessoWGS --------- Co-authored-by: Cole Lyman <cole@colelyman.com> * Functional * Cole/fix status file name (#69) * Update config file logging messages This removes printing the exception (which is essentially a duplicate), and adds a condition if no config file was provided. Also changes `json` to `config` so that it is more clear. * Fix divide by zero when no amplicons are present in Batch mode * Don't append file_prefix to status file name * Place status files in output directories * Update tests branch for file_prefix addition * Load D3 and plotly figures with pro with multiple amplicons * Update batch * Fix bug in CRISPRessoCompare with pointing to report datas with file_prefix Before this fix, when using a file_prefix the second run that was compared would not be displayed as a data in the first figure of the report. * Import CRISPRessoPro instead of importing the version When installed via conda, the version is not available * Remove `get_amplicon_output` unused function from CRISPRessoCompare Also remove unused argparse import * Implement `get_matching_allele_files` in CRISPRessoCompare and accompanying unit tests * Allow for matching of multiple guides in the same amplicon * Fix pandas FutureWarning * Change test branch back to master --------- Co-authored-by: Sam <snic9004@gmail.com> * Try catch all futures * Fix test fail plots * Fix d3 not showing and plotly mixing with matplotlib --------- Co-authored-by: mbowcut2 <55161542+mbowcut2@users.noreply.github.com> Co-authored-by: Cole Lyman <cole@colelyman.com> * Remove token from integration tests file * Pass div id for plotly * Remove debug --------- Co-authored-by: mbowcut2 <55161542+mbowcut2@users.noreply.github.com> Co-authored-by: Cole Lyman <cole@colelyman.com> --------- Co-authored-by: Trevor Martin <60452953+trevormartinj7@users.noreply.github.com> Co-authored-by: Samuel Nichols <Snic9004@gmail.com> Co-authored-by: mbowcut2 <55161542+mbowcut2@users.noreply.github.com>
1 parent 1c50427 commit d2c2be1

File tree

8 files changed

+169
-19
lines changed

8 files changed

+169
-19
lines changed

.github/workflows/aws_ecr.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Push Docker image to Amazon ECR
2+
3+
on:
4+
release:
5+
types:
6+
- edited
7+
- released
8+
branches:
9+
- master
10+
11+
jobs:
12+
build-and-push:
13+
name: Build and Push Docker image
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v2
19+
20+
- id: get_version
21+
name: Get version
22+
uses: jannemattila/get-version-from-tag@v3
23+
24+
- name: Configure AWS credentials
25+
uses: aws-actions/configure-aws-credentials@v1
26+
with:
27+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
28+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
29+
aws-region: us-east-1
30+
31+
- name: Login to Amazon ECR
32+
id: login-ecr
33+
uses: aws-actions/amazon-ecr-login@v1
34+
35+
- name: Build, tag, and push the image to Amazon ECR
36+
id: build-image
37+
env:
38+
AWS_ACCOUNT: ${{ secrets.AWS_ACCOUNT_ID }}
39+
ECR_REPOSITORY: 'crispresso2'
40+
AWS_REGION: 'us-east-1'
41+
IMAGE_TAG: ${{ steps.get_version.outputs.version }}
42+
run: |
43+
# Build a docker container and push it to ECR
44+
docker build -t $AWS_ACCOUNT.dkr.ecr.$AWS_REGION.amazonaws.com/$ECR_REPOSITORY:$IMAGE_TAG .
45+
echo "Pushing image to ECR..."
46+
docker push $AWS_ACCOUNT.dkr.ecr.$AWS_REGION.amazonaws.com/$ECR_REPOSITORY:$IMAGE_TAG
47+
echo "::set-output name=image::$AWS_ACCOUNT.dkr.ecr.$AWS_REGION.amazonaws.com/$ECR_REPOSITORY:$IMAGE_TAG"

CRISPResso2/CRISPRessoAggregateCORE.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,12 +614,14 @@ def main():
614614
crispresso2_info['results']['general_plots']['allele_modification_heatmap_plot_titles'] = {}
615615
crispresso2_info['results']['general_plots']['allele_modification_heatmap_plot_labels'] = {}
616616
crispresso2_info['results']['general_plots']['allele_modification_heatmap_plot_datas'] = {}
617+
crispresso2_info['results']['general_plots']['allele_modification_heatmap_plot_divs'] = {}
617618

618619
crispresso2_info['results']['general_plots']['allele_modification_line_plot_names'] = []
619620
crispresso2_info['results']['general_plots']['allele_modification_line_plot_paths'] = {}
620621
crispresso2_info['results']['general_plots']['allele_modification_line_plot_titles'] = {}
621622
crispresso2_info['results']['general_plots']['allele_modification_line_plot_labels'] = {}
622623
crispresso2_info['results']['general_plots']['allele_modification_line_plot_datas'] = {}
624+
crispresso2_info['results']['general_plots']['allele_modification_line_plot_divs'] = {}
623625
if guides_all_same:
624626
sgRNA_intervals = [consensus_sgRNA_intervals] * modification_frequency_summary_df.shape[0]
625627
else:
@@ -645,11 +647,13 @@ def main():
645647
plot_name = 'CRISPRessoAggregate_percentage_of_{0}_across_alleles_{1}_heatmap'.format(modification_type.lower(), amplicon_name)
646648
plot_path = '{0}.html'.format(_jp(plot_name))
647649

650+
heatmap_div_id = '{0}-allele-modification-heatmap-{1}'.format(amplicon_name.lower(), modification_type.lower())
648651
allele_modification_heatmap_input = {
649652
'sample_values': modification_df,
650653
'sample_sgRNA_intervals': sgRNA_intervals,
651654
'plot_path': plot_path,
652655
'title': modification_type,
656+
'div_id': heatmap_div_id,
653657
}
654658
plot(
655659
CRISPRessoPlot.plot_allele_modification_heatmap,
@@ -671,15 +675,18 @@ def main():
671675
),
672676
),
673677
]
678+
crispresso2_info['results']['general_plots']['allele_modification_heatmap_plot_divs'][plot_name] = heatmap_div_id
674679

675680
plot_name = 'CRISPRessoAggregate_percentage_of_{0}_across_alleles_{1}_line'.format(modification_type.lower(), amplicon_name)
676681
plot_path = '{0}.html'.format(_jp(plot_name))
677682

683+
line_div_id = '{0}-allele-modification-line-{1}'.format(amplicon_name.lower(), modification_type.lower())
678684
allele_modification_line_input = {
679685
'sample_values': modification_df,
680686
'sample_sgRNA_intervals': sgRNA_intervals,
681687
'plot_path': plot_path,
682688
'title': modification_type,
689+
'div_id': line_div_id,
683690
}
684691
plot(
685692
CRISPRessoPlot.plot_allele_modification_line,
@@ -700,6 +707,7 @@ def main():
700707
),
701708
),
702709
]
710+
crispresso2_info['results']['general_plots']['allele_modification_line_plot_divs'][plot_name] = line_div_id
703711

704712
crispresso2_info['results']['general_plots']['window_nuc_pct_quilt_plot_names'] = window_nuc_pct_quilt_plot_names
705713
crispresso2_info['results']['general_plots']['nuc_pct_quilt_plot_names'] = nuc_pct_quilt_plot_names

CRISPResso2/CRISPRessoBatchCORE.py

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,33 @@ def check_library(library_name):
4949
np = check_library('numpy')
5050

5151

52+
def should_plot_large_plots(num_rows, c2pro_installed, use_matplotlib, large_plot_cutoff=300):
53+
"""Determine if large plots should be plotted.
54+
55+
Parameters
56+
----------
57+
num_rows : int
58+
Number of rows in the dataframe.
59+
c2pro_installed : bool
60+
Whether CRISPRessoPro is installed.
61+
use_matplotlib : bool
62+
Whether to use matplotlib when CRISPRessoPro is installed, i.e. value
63+
of `--use_matplotlib`.
64+
large_plot_cutoff : int, optional
65+
Number of samples at which to not plot large plots with matplotlib.
66+
Note that each sample has 6 rows in the datafame. Defaults to 300.
67+
68+
Returns
69+
-------
70+
bool
71+
Whether to plot large plots.
72+
"""
73+
return (
74+
(not use_matplotlib and c2pro_installed)
75+
or (num_rows / 6) < large_plot_cutoff
76+
)
77+
78+
5279
def main():
5380
try:
5481
start_time = datetime.now()
@@ -388,14 +415,14 @@ def main():
388415
crispresso2_info['results']['general_plots']['allele_modification_heatmap_plot_titles'] = {}
389416
crispresso2_info['results']['general_plots']['allele_modification_heatmap_plot_labels'] = {}
390417
crispresso2_info['results']['general_plots']['allele_modification_heatmap_plot_datas'] = {}
418+
crispresso2_info['results']['general_plots']['allele_modification_heatmap_plot_divs'] = {}
391419

392420
crispresso2_info['results']['general_plots']['allele_modification_line_plot_names'] = []
393421
crispresso2_info['results']['general_plots']['allele_modification_line_plot_paths'] = {}
394422
crispresso2_info['results']['general_plots']['allele_modification_line_plot_titles'] = {}
395423
crispresso2_info['results']['general_plots']['allele_modification_line_plot_labels'] = {}
396424
crispresso2_info['results']['general_plots']['allele_modification_line_plot_datas'] = {}
397-
398-
large_plot_cutoff = 300
425+
crispresso2_info['results']['general_plots']['allele_modification_line_plot_divs'] = {}
399426

400427
percent_complete_start, percent_complete_end = 90, 99
401428
if all_amplicons:
@@ -580,7 +607,7 @@ def main():
580607
sub_modification_percentage_summary_filename = _jp(amplicon_plot_name + 'Modification_percentage_summary_around_sgRNA_'+sgRNA+'.txt')
581608
sub_modification_percentage_summary_df.to_csv(sub_modification_percentage_summary_filename, sep='\t', index=None)
582609

583-
if not args.suppress_plots and not args.suppress_batch_summary_plots and (nucleotide_percentage_summary_df.shape[0] / 6) < large_plot_cutoff:
610+
if not args.suppress_plots and not args.suppress_batch_summary_plots and should_plot_large_plots(sub_nucleotide_percentage_summary_df.shape[0], C2PRO_INSTALLED, args.use_matplotlib):
584611
# plot for each guide
585612
# show all sgRNA's on the plot
586613
sub_sgRNA_intervals = []
@@ -614,6 +641,7 @@ def main():
614641
'fig_filename_root': f'{this_window_nuc_pct_quilt_plot_name}.json' if not args.use_matplotlib and C2PRO_INSTALLED else this_window_nuc_pct_quilt_plot_name,
615642
'save_also_png': save_png,
616643
'sgRNA_intervals': sub_sgRNA_intervals,
644+
'sgRNA_sequences': consensus_guides,
617645
'quantification_window_idxs': include_idxs,
618646
'custom_colors': custom_config['colors'],
619647
}
@@ -628,7 +656,7 @@ def main():
628656
crispresso2_info['results']['general_plots']['summary_plot_labels'][plot_name] = 'Composition of each base around the guide ' + sgRNA + ' for the amplicon ' + amplicon_name
629657
crispresso2_info['results']['general_plots']['summary_plot_datas'][plot_name] = [('Nucleotide frequencies', os.path.basename(nucleotide_frequency_summary_filename)), ('Modification frequencies', os.path.basename(modification_frequency_summary_filename))]
630658

631-
if args.base_editor_output and (sub_nucleotide_percentage_summary_df.shape[0] / 6) < large_plot_cutoff:
659+
if args.base_editor_output and should_plot_large_plots(sub_nucleotide_percentage_summary_df.shape[0], False, args.use_matplotlib):
632660
this_window_nuc_conv_plot_name = _jp(amplicon_plot_name + 'Nucleotide_conversion_map_around_sgRNA_'+sgRNA)
633661
conversion_map_input = {
634662
'nuc_pct_df': sub_nucleotide_percentage_summary_df,
@@ -656,14 +684,15 @@ def main():
656684
]
657685
# done with per-sgRNA plots
658686

659-
if not args.suppress_plots and not args.suppress_batch_summary_plots: # plot the whole region
687+
if not args.suppress_plots and not args.suppress_batch_summary_plots and should_plot_large_plots(nucleotide_percentage_summary_df.shape[0], C2PRO_INSTALLED, args.use_matplotlib): # plot the whole region
660688
this_nuc_pct_quilt_plot_name = _jp(amplicon_plot_name.replace('.', '') + 'Nucleotide_percentage_quilt')
661689
nucleotide_quilt_input = {
662690
'nuc_pct_df': nucleotide_percentage_summary_df,
663691
'mod_pct_df': modification_percentage_summary_df,
664692
'fig_filename_root': f'{this_nuc_pct_quilt_plot_name}.json' if not args.use_matplotlib and C2PRO_INSTALLED else this_nuc_pct_quilt_plot_name,
665693
'save_also_png': save_png,
666694
'sgRNA_intervals': consensus_sgRNA_intervals,
695+
'sgRNA_sequences': consensus_guides,
667696
'quantification_window_idxs': include_idxs,
668697
'custom_colors': custom_config['colors'],
669698
}
@@ -679,7 +708,7 @@ def main():
679708
crispresso2_info['results']['general_plots']['summary_plot_titles'][plot_name] = ''
680709
crispresso2_info['results']['general_plots']['summary_plot_labels'][plot_name] = 'Composition of each base for the amplicon ' + amplicon_name
681710
crispresso2_info['results']['general_plots']['summary_plot_datas'][plot_name] = [('Nucleotide frequencies', os.path.basename(nucleotide_frequency_summary_filename)), ('Modification frequencies', os.path.basename(modification_frequency_summary_filename))]
682-
if args.base_editor_output and (sub_nucleotide_percentage_summary_df.shape[0] / 6) < large_plot_cutoff:
711+
if args.base_editor_output and should_plot_large_plots(nucleotide_percentage_summary_df.shape[0], False, args.use_matplotlib):
683712
this_nuc_conv_plot_name = _jp(amplicon_plot_name + 'Nucleotide_conversion_map')
684713
conversion_map_input = {
685714
'nuc_pct_df': nucleotide_percentage_summary_df,
@@ -706,7 +735,7 @@ def main():
706735
crispresso2_info['results']['general_plots']['summary_plot_datas'][plot_name] = [('Nucleotide frequencies', os.path.basename(nucleotide_frequency_summary_filename)), ('Modification frequencies', os.path.basename(modification_frequency_summary_filename))]
707736

708737
else: # guides are not the same
709-
if not args.suppress_plots and not args.suppress_batch_summary_plots:
738+
if not args.suppress_plots and not args.suppress_batch_summary_plots and should_plot_large_plots(nucleotide_percentage_summary_df.shape[0], C2PRO_INSTALLED, args.use_matplotlib):
710739
this_nuc_pct_quilt_plot_name = _jp(amplicon_plot_name.replace('.', '') + 'Nucleotide_percentage_quilt')
711740
nucleotide_quilt_input = {
712741
'nuc_pct_df': nucleotide_percentage_summary_df,
@@ -724,7 +753,7 @@ def main():
724753
nuc_pct_quilt_plot_names.append(plot_name)
725754
crispresso2_info['results']['general_plots']['summary_plot_labels'][plot_name] = 'Composition of each base for the amplicon ' + amplicon_name
726755
crispresso2_info['results']['general_plots']['summary_plot_datas'][plot_name] = [('Nucleotide frequencies', os.path.basename(nucleotide_frequency_summary_filename)), ('Modification frequencies', os.path.basename(modification_frequency_summary_filename))]
727-
if args.base_editor_output and (sub_nucleotide_percentage_summary_df.shape[0] / 6) < large_plot_cutoff:
756+
if args.base_editor_output and should_plot_large_plots(nucleotide_percentage_summary_df.shape[0], False, args.use_matplotlib):
728757
this_nuc_conv_plot_name = _jp(amplicon_plot_name + 'Nucleotide_percentage_quilt')
729758
conversion_map_input = {
730759
'nuc_pct_df': nucleotide_percentage_summary_df,
@@ -745,7 +774,7 @@ def main():
745774
crispresso2_info['results']['general_plots']['summary_plot_datas'][plot_name] = [('Nucleotide frequencies', os.path.basename(nucleotide_frequency_summary_filename)), ('Modification frequencies', os.path.basename(modification_frequency_summary_filename))]
746775

747776
# allele modification frequency heatmap and line plots
748-
if C2PRO_INSTALLED and not args.use_matplotlib and not args.suppress_plots and not args.suppress_batch_summary_plots and (nucleotide_percentage_summary_df.shape[0] / 6) < large_plot_cutoff:
777+
if C2PRO_INSTALLED and not args.use_matplotlib and not args.suppress_plots and not args.suppress_batch_summary_plots:
749778
if guides_all_same:
750779
sgRNA_intervals = [consensus_sgRNA_intervals] * modification_frequency_summary_df.shape[0]
751780
else:
@@ -771,12 +800,13 @@ def main():
771800
plot_name = 'CRISPRessoBatch_percentage_of_{0}_across_alleles_{1}_heatmap'.format(modification_type.lower(), amplicon_name)
772801
plot_path = '{0}.html'.format(_jp(plot_name))
773802

803+
heatmap_div_id = '{0}-allele-modification-heatmap-{1}'.format(amplicon_name.lower(), modification_type.lower())
774804
allele_modification_heatmap_input = {
775805
'sample_values': modification_df,
776806
'sample_sgRNA_intervals': sgRNA_intervals,
777807
'plot_path': plot_path,
778808
'title': modification_type,
779-
'amplicon_name': amplicon_name,
809+
'div_id': heatmap_div_id,
780810
}
781811
debug('Plotting allele modification heatmap for {0}'.format(amplicon_name))
782812
plot(
@@ -799,16 +829,18 @@ def main():
799829
),
800830
),
801831
]
832+
crispresso2_info['results']['general_plots']['allele_modification_heatmap_plot_divs'][plot_name] = heatmap_div_id
802833

803834
plot_name = 'CRISPRessoBatch_percentage_of_{0}_across_alleles_{1}_line'.format(modification_type.lower(), amplicon_name)
804835
plot_path = '{0}.html'.format(_jp(plot_name))
805836

837+
line_div_id = '{0}-allele-modification-line-{1}'.format(amplicon_name.lower(), modification_type.lower())
806838
allele_modification_line_input = {
807839
'sample_values': modification_df,
808840
'sample_sgRNA_intervals': sgRNA_intervals,
809841
'plot_path': plot_path,
810842
'title': modification_type,
811-
'amplicon_name': amplicon_name,
843+
'div_id': line_div_id,
812844
}
813845
debug('Plotting allele modification line plot for {0}'.format(amplicon_name))
814846
plot(
@@ -831,6 +863,7 @@ def main():
831863
),
832864
),
833865
]
866+
crispresso2_info['results']['general_plots']['allele_modification_line_plot_divs'][plot_name] = line_div_id
834867
#end if amp_found_count > 0 (how many folders had information for this amplicon)
835868
#end per-amplicon analysis
836869

0 commit comments

Comments
 (0)