Skip to content

Commit

Permalink
Merge branch 'master' into cole/add-flexiguide-alignment-parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Colelyman committed Sep 26, 2024
2 parents 9946ce2 + 1d4f2ef commit 3082bd5
Show file tree
Hide file tree
Showing 23 changed files with 1,418 additions and 922 deletions.
23 changes: 21 additions & 2 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ jobs:
CACHE_NUMBER: 0
with:
path: /usr/share/miniconda/envs/test_env
key:
conda-${{ runner.os }}--${{ runner.arch }}--${{ steps.get-date.outputs.today }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('.github/envs/test_env.yml') }}
key: conda-${{ runner.os }}--${{ runner.arch }}--${{ steps.get-date.outputs.today }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('.github/envs/test_env.yml') }}

- name: Update Conda Env
run: |
Expand Down Expand Up @@ -80,6 +79,21 @@ jobs:
run: |
make prime-editor test print
- name: Run BAM Input
if: success() || failure()
run: |
make bam test print
- name: Run BAM Output
if: success() || failure()
run: |
make bam-out test print
- name: Run BAM Genome Output
if: success() || failure()
run: |
make bam-out-genome test print
- name: Run Batch
if: success() || failure()
run: |
Expand Down Expand Up @@ -114,3 +128,8 @@ jobs:
if: success() || failure()
run: |
make compare test print
- name: Run Aggregate
if: success() || failure()
run: |
make aggregate test print
29 changes: 22 additions & 7 deletions CRISPResso2/CRISPRessoAggregateCORE.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ def main():
crispresso2_info = {'running_info': {}, 'results': {'alignment_stats': {}, 'general_plots': {}}} #keep track of all information for this run to be pickled and saved at the end of the run
crispresso2_info['running_info']['version'] = CRISPRessoShared.__version__
crispresso2_info['running_info']['args'] = deepcopy(args)
crispresso2_info['running_info']['command_used'] = ' '.join(sys.argv)

crispresso2_info['running_info']['log_filename'] = os.path.basename(log_filename)

Expand Down Expand Up @@ -227,7 +228,7 @@ def main():

if successfully_imported_count > 0:

crispresso2_folders = crispresso2_folder_infos.keys()
crispresso2_folders = list(sorted(crispresso2_folder_infos.keys()))
crispresso2_folder_names = {}
crispresso2_folder_htmls = {}#file_loc->html folder loc
quilt_plots_to_show = {} # name->{'href':path to report, 'img': png}
Expand Down Expand Up @@ -515,8 +516,10 @@ def main():
'fig_filename_root': this_window_nuc_pct_quilt_plot_name,
'save_also_png': save_png,
'sgRNA_intervals': sub_sgRNA_intervals,
'sgRNA_sequences': consensus_guides,
'quantification_window_idxs': include_idxs,
'group_column': 'Folder',
'custom_colors': None,
}
plot(
CRISPRessoPlot.plot_nucleotide_quilt,
Expand Down Expand Up @@ -550,8 +553,10 @@ def main():
'fig_filename_root': this_nuc_pct_quilt_plot_name,
'save_also_png': save_png,
'sgRNA_intervals': consensus_sgRNA_intervals,
'sgRNA_sequences': consensus_guides,
'quantification_window_idxs': include_idxs,
'group_column': 'Folder',
'custom_colors': None,
}
plot(
CRISPRessoPlot.plot_nucleotide_quilt,
Expand Down Expand Up @@ -589,8 +594,10 @@ def main():
'fig_filename_root': this_nuc_pct_quilt_plot_name,
'save_also_png': save_png,
'sgRNA_intervals': consensus_sgRNA_intervals,
'sgRNA_sequences': consensus_guides,
'quantification_window_idxs': consensus_include_idxs,
'group_column': 'Folder',
'custom_colors': None,
}
plot(
CRISPRessoPlot.plot_nucleotide_quilt,
Expand Down Expand Up @@ -654,6 +661,7 @@ def main():
'plot_path': plot_path,
'title': modification_type,
'div_id': heatmap_div_id,
'amplicon_name': amplicon_name,
}
plot(
CRISPRessoPlot.plot_allele_modification_heatmap,
Expand Down Expand Up @@ -687,6 +695,7 @@ def main():
'plot_path': plot_path,
'title': modification_type,
'div_id': line_div_id,
'amplicon_name': amplicon_name,
}
plot(
CRISPRessoPlot.plot_allele_modification_line,
Expand Down Expand Up @@ -779,7 +788,7 @@ def main():

header = 'Name\tUnmodified%\tModified%\tReads_total\tReads_aligned\tUnmodified\tModified\tDiscarded\tInsertions\tDeletions\tSubstitutions\tOnly Insertions\tOnly Deletions\tOnly Substitutions\tInsertions and Deletions\tInsertions and Substitutions\tDeletions and Substitutions\tInsertions Deletions and Substitutions'
header_els = header.split("\t")
df_summary_quantification=pd.DataFrame(quantification_summary, columns=header_els)
df_summary_quantification=pd.DataFrame(quantification_summary, columns=header_els).sort_values(by=['Name'])
samples_quantification_summary_filename = _jp('CRISPRessoAggregate_quantification_of_editing_frequency.txt') #this file has one line for each run (sum of all amplicons)
df_summary_quantification.fillna('NA').to_csv(samples_quantification_summary_filename, sep='\t', index=None)
crispresso2_info['results']['alignment_stats']['samples_quantification_summary_filename'] = os.path.basename(samples_quantification_summary_filename)
Expand Down Expand Up @@ -841,11 +850,17 @@ def main():
report_filename = OUTPUT_DIRECTORY+'.html'
if (args.place_report_in_output_folder):
report_filename = _jp("CRISPResso2Aggregate_report.html")
CRISPRessoReport.make_aggregate_report(crispresso2_info, args.name,
report_filename, OUTPUT_DIRECTORY,
_ROOT, crispresso2_folders,
crispresso2_folder_htmls,
quilt_plots_to_show)
CRISPRessoReport.make_aggregate_report(
crispresso2_info,
args.name,
report_filename,
OUTPUT_DIRECTORY,
_ROOT,
crispresso2_folders,
crispresso2_folder_htmls,
logger,
compact_plots_to_show=quilt_plots_to_show,
)
crispresso2_info['running_info']['report_location'] = report_filename
crispresso2_info['running_info']['report_filename'] = os.path.basename(report_filename)
else: #no files successfully imported
Expand Down
Loading

0 comments on commit 3082bd5

Please sign in to comment.