diff --git a/CRISPResso2/CRISPRessoAggregateCORE.py b/CRISPResso2/CRISPRessoAggregateCORE.py index 689bef98..b521dac7 100644 --- a/CRISPResso2/CRISPRessoAggregateCORE.py +++ b/CRISPResso2/CRISPRessoAggregateCORE.py @@ -17,10 +17,14 @@ import traceback from datetime import datetime from CRISPResso2 import CRISPRessoShared -from CRISPResso2 import CRISPRessoPlot from CRISPResso2.CRISPRessoReports import CRISPRessoReport from CRISPResso2.CRISPRessoMultiProcessing import get_max_processes, run_plot +if CRISPRessoShared.is_C2Pro_installed(): + from CRISPRessoPro import __version__ as CRISPRessoProVersion + C2PRO_INSTALLED = True +else: + C2PRO_INSTALLED = False import logging @@ -67,9 +71,18 @@ def main(): parser.add_argument('--debug', help='Show debug messages', action='store_true') parser.add_argument('-v', '--verbosity', type=int, help='Verbosity level of output to the console (1-4), 4 is the most verbose', default=3) + + # CRISPRessoPro params + parser.add_argument('--use_matplotlib', action='store_true', + help='Use matplotlib for plotting instead of plotly/d3 when CRISPRessoPro is installed') args = parser.parse_args() + if args.use_matplotlib or not CRISPRessoShared.is_C2Pro_installed(): + from CRISPResso2 import CRISPRessoPlot + else: + from CRISPRessoPro import plot as CRISPRessoPlot + CRISPRessoShared.set_console_log_level(logger, args.verbosity, args.debug) output_folder_name='CRISPRessoAggregate_on_%s' % args.name @@ -85,7 +98,7 @@ def main(): log_filename=_jp('CRISPRessoAggregate_RUNNING_LOG.txt') logger.addHandler(logging.FileHandler(log_filename)) - logger.addHandler(CRISPRessoShared.StatusHandler(_jp('CRISPRessoAggregate_status.txt'))) + logger.addHandler(CRISPRessoShared.StatusHandler(_jp('CRISPRessoAggregate_status.json'))) with open(log_filename, 'w+') as outfile: outfile.write('[Command used]:\n%s\n\n[Execution log]:\n' % ' '.join(sys.argv)) @@ -595,7 +608,7 @@ def main(): this_plot_suffix_int += 1 this_plot_suffix = "_" + str(this_plot_suffix_int) - if not args.suppress_plots: + if C2PRO_INSTALLED and not args.use_matplotlib and not args.suppress_plots: crispresso2_info['results']['general_plots']['allele_modification_heatmap_plot_names'] = [] crispresso2_info['results']['general_plots']['allele_modification_heatmap_plot_paths'] = {} crispresso2_info['results']['general_plots']['allele_modification_heatmap_plot_titles'] = {} diff --git a/CRISPResso2/CRISPRessoBatchCORE.py b/CRISPResso2/CRISPRessoBatchCORE.py index 9f95986d..291a017f 100644 --- a/CRISPResso2/CRISPRessoBatchCORE.py +++ b/CRISPResso2/CRISPRessoBatchCORE.py @@ -14,10 +14,15 @@ import traceback from datetime import datetime from CRISPResso2 import CRISPRessoShared -from CRISPResso2 import CRISPRessoPlot from CRISPResso2 import CRISPRessoMultiProcessing from CRISPResso2.CRISPRessoReports import CRISPRessoReport +if CRISPRessoShared.is_C2Pro_installed(): + from CRISPRessoPro import __version__ as CRISPRessoProVersion + C2PRO_INSTALLED = True +else: + C2PRO_INSTALLED = False + import logging logger = logging.getLogger(__name__) @@ -70,15 +75,7 @@ def main(): )) sys.exit() - parser = CRISPRessoShared.getCRISPRessoArgParser(parser_title = 'CRISPRessoBatch Parameters') - - #batch specific params - parser.add_argument('-bs', '--batch_settings', type=str, help='Settings file for batch. Must be tab-separated text file. The header row contains CRISPResso parameters (e.g., fastq_r1, fastq_r2, amplicon_seq, and other optional parameters). Each following row sets parameters for an additional batch.', required=True) - parser.add_argument('--skip_failed', help='Continue with batch analysis even if one sample fails', action='store_true') - parser.add_argument('--min_reads_for_inclusion', help='Minimum number of reads for a batch to be included in the batch summary', type=int, default=0) - parser.add_argument('-bo', '--batch_output_folder', help='Directory where batch analysis output will be stored') - parser.add_argument('--suppress_batch_summary_plots', help='Suppress batch summary plots - e.g. if many samples are run at once, the summary plots of all sub-runs may be too large. This parameter suppresses the production of these plots.', action='store_true') - parser.add_argument('--crispresso_command', help='CRISPResso command to call', default='CRISPResso') + parser = CRISPRessoShared.getCRISPRessoArgParser("Batch", parser_title = 'CRISPRessoBatch Parameters') args = parser.parse_args() @@ -86,12 +83,12 @@ def main(): debug_flag = args.debug - crispresso_options = CRISPRessoShared.get_crispresso_options() + crispresso_options = CRISPRessoShared.get_core_crispresso_options() options_to_ignore = {'name', 'output_folder', 'zip_output'} crispresso_options_for_batch = list(crispresso_options-options_to_ignore) CRISPRessoShared.check_file(args.batch_settings) - config = CRISPRessoShared.check_custom_config(args) + custom_config = CRISPRessoShared.check_custom_config(args) if args.zip_output and not args.place_report_in_output_folder: warn('Invalid arguement combination: If zip_output is True then place_report_in_output_folder must also be True. Setting place_report_in_output_folder to True.') @@ -116,6 +113,12 @@ def main(): _jp = lambda filename: os.path.join(OUTPUT_DIRECTORY, filename) #handy function to put a file in the output directory + if args.use_matplotlib or not C2PRO_INSTALLED: + from CRISPResso2 import CRISPRessoPlot + else: + from CRISPRessoPro import plot as CRISPRessoPlot + CRISPRessoPlot.setMatplotlibDefaults() + try: info('Creating Folder %s' % OUTPUT_DIRECTORY, {'percent_complete': 0}) os.makedirs(OUTPUT_DIRECTORY) @@ -124,7 +127,7 @@ def main(): log_filename = _jp('CRISPRessoBatch_RUNNING_LOG.txt') logger.addHandler(logging.FileHandler(log_filename)) - status_handler = CRISPRessoShared.StatusHandler(_jp('CRISPRessoBatch_status.txt')) + status_handler = CRISPRessoShared.StatusHandler(_jp('CRISPRessoBatch_status.json')) logger.addHandler(status_handler) with open(log_filename, 'w+') as outfile: @@ -179,7 +182,7 @@ def main(): batch_params[int_col] = batch_params[int_col].astype(int) # rename column "a" to "amplicon_seq", etc - batch_params.rename(index=str, columns=CRISPRessoShared.get_crispresso_options_lookup(), inplace=True) + batch_params.rename(index=str, columns=CRISPRessoShared.get_crispresso_options_lookup("Core"), inplace=True) batch_count = batch_params.shape[0] batch_params.index = range(batch_count) @@ -298,7 +301,6 @@ def main(): crispresso2_info['results']['batch_names_arr'] = batch_names_arr crispresso2_info['results']['batch_input_names'] = batch_input_names - CRISPRessoMultiProcessing.run_crispresso_cmds(crispresso_cmds, n_processes_for_batch, 'batch', args.skip_failed, start_end_percent=[10, 90]) run_datas = [] # crispresso2 info from each row @@ -393,6 +395,8 @@ def main(): crispresso2_info['results']['general_plots']['allele_modification_line_plot_labels'] = {} crispresso2_info['results']['general_plots']['allele_modification_line_plot_datas'] = {} + large_plot_cutoff = 300 + percent_complete_start, percent_complete_end = 90, 99 percent_complete_step = (percent_complete_end - percent_complete_start) / len(all_amplicons) # report for amplicons @@ -573,7 +577,7 @@ def main(): sub_modification_percentage_summary_filename = _jp(amplicon_plot_name + 'Modification_percentage_summary_around_sgRNA_'+sgRNA+'.txt') sub_modification_percentage_summary_df.to_csv(sub_modification_percentage_summary_filename, sep='\t', index=None) - if not args.suppress_plots and not args.suppress_batch_summary_plots: + if not args.suppress_plots and not args.suppress_batch_summary_plots and (nucleotide_percentage_summary_df.shape[0] / 6) < large_plot_cutoff: # plot for each guide # show all sgRNA's on the plot sub_sgRNA_intervals = [] @@ -604,11 +608,11 @@ def main(): nucleotide_quilt_input = { 'nuc_pct_df': sub_nucleotide_percentage_summary_df, 'mod_pct_df': sub_modification_percentage_summary_df, - 'fig_filename_root': this_window_nuc_pct_quilt_plot_name, + '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, 'save_also_png': save_png, 'sgRNA_intervals': sub_sgRNA_intervals, 'quantification_window_idxs': include_idxs, - 'custom_colors': config['colors'], + 'custom_colors': custom_config['colors'], } debug('Plotting nucleotide percentage quilt for amplicon {0}, sgRNA {1}'.format(amplicon_name, sgRNA)) plot( @@ -623,7 +627,7 @@ def main(): crispresso2_info['results']['general_plots']['summary_plot_labels'][plot_name] = 'Composition of each base around the guide ' + sgRNA + ' for the amplicon ' + amplicon_name 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))] - if args.base_editor_output: + if args.base_editor_output and (sub_nucleotide_percentage_summary_df.shape[0] / 6) < large_plot_cutoff: this_window_nuc_conv_plot_name = _jp(amplicon_plot_name + 'Nucleotide_conversion_map_around_sgRNA_'+sgRNA) conversion_map_input = { 'nuc_pct_df': sub_nucleotide_percentage_summary_df, @@ -633,7 +637,7 @@ def main(): 'save_also_png': save_png, 'sgRNA_intervals': sub_sgRNA_intervals, 'quantification_window_idxs': include_idxs, - 'custom_colors': config['colors'] + 'custom_colors': custom_config['colors'] } debug('Plotting nucleotide conversion map for amplicon {0}, sgRNA {1}'.format(amplicon_name, sgRNA)) plot( @@ -656,11 +660,11 @@ def main(): nucleotide_quilt_input = { 'nuc_pct_df': nucleotide_percentage_summary_df, 'mod_pct_df': modification_percentage_summary_df, - 'fig_filename_root': this_nuc_pct_quilt_plot_name, + '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, 'save_also_png': save_png, 'sgRNA_intervals': consensus_sgRNA_intervals, 'quantification_window_idxs': include_idxs, - 'custom_colors': config['colors'], + 'custom_colors': custom_config['colors'], } debug('Plotting nucleotide quilt for {0}'.format(amplicon_name)) plot( @@ -674,7 +678,7 @@ def main(): crispresso2_info['results']['general_plots']['summary_plot_titles'][plot_name] = '' crispresso2_info['results']['general_plots']['summary_plot_labels'][plot_name] = 'Composition of each base for the amplicon ' + amplicon_name 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))] - if args.base_editor_output: + if args.base_editor_output and (sub_nucleotide_percentage_summary_df.shape[0] / 6) < large_plot_cutoff: this_nuc_conv_plot_name = _jp(amplicon_plot_name + 'Nucleotide_conversion_map') conversion_map_input = { 'nuc_pct_df': nucleotide_percentage_summary_df, @@ -684,7 +688,7 @@ def main(): 'save_also_png': save_png, 'sgRNA_intervals': consensus_sgRNA_intervals, 'quantification_window_idxs': include_idxs, - 'custom_colors': config['colors'] + 'custom_colors': custom_config['colors'] } debug('Plotting nucleotide conversion map for {0}'.format(amplicon_name)) plot( @@ -706,20 +710,20 @@ def main(): nucleotide_quilt_input = { 'nuc_pct_df': nucleotide_percentage_summary_df, 'mod_pct_df': modification_percentage_summary_df, - 'fig_filename_root': this_nuc_pct_quilt_plot_name, + '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, 'save_also_png': save_png, - 'custom_colors': config['colors'], + 'custom_colors': custom_config['colors'], } debug('Plotting nucleotide quilt for {0}'.format(amplicon_name)) plot( - CRISPRessoPlot.plot_nucleotide_quilt, - nucleotide_quilt_input, - ) + CRISPRessoPlot.plot_nucleotide_quilt, + nucleotide_quilt_input, + ) plot_name = os.path.basename(this_nuc_pct_quilt_plot_name) nuc_pct_quilt_plot_names.append(plot_name) crispresso2_info['results']['general_plots']['summary_plot_labels'][plot_name] = 'Composition of each base for the amplicon ' + amplicon_name 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))] - if args.base_editor_output: + if args.base_editor_output and (sub_nucleotide_percentage_summary_df.shape[0] / 6) < large_plot_cutoff: this_nuc_conv_plot_name = _jp(amplicon_plot_name + 'Nucleotide_percentage_quilt') conversion_map_input = { 'nuc_pct_df': nucleotide_percentage_summary_df, @@ -727,7 +731,7 @@ def main(): 'conversion_nuc_from': args.conversion_nuc_from, 'conversion_nuc_to': args.conversion_nuc_to, 'save_also_png': save_png, - 'custom_colors': config['colors'] + 'custom_colors': custom_config['colors'] } debug('Plotting BE nucleotide conversion map for {0}'.format(amplicon_name)) plot( @@ -740,7 +744,7 @@ def main(): 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))] # allele modification frequency heatmap and line plots - if not args.suppress_plots and not args.suppress_batch_summary_plots: + 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: if guides_all_same: sgRNA_intervals = [consensus_sgRNA_intervals] * modification_frequency_summary_df.shape[0] else: diff --git a/CRISPResso2/CRISPRessoCORE.py b/CRISPResso2/CRISPRessoCORE.py index 99aa4838..9a032e85 100644 --- a/CRISPResso2/CRISPRessoCORE.py +++ b/CRISPResso2/CRISPRessoCORE.py @@ -30,7 +30,13 @@ from CRISPResso2 import CRISPRessoCOREResources from CRISPResso2.CRISPRessoReports import CRISPRessoReport from CRISPResso2 import CRISPRessoShared -from CRISPResso2 import CRISPRessoPlot + +if CRISPRessoShared.is_C2Pro_installed(): + from CRISPRessoPro import __version__ as CRISPRessoProVersion + C2PRO_INSTALLED = True +else: + C2PRO_INSTALLED = False + from CRISPResso2 import CRISPResso2Align from CRISPResso2 import CRISPRessoMultiProcessing @@ -81,13 +87,50 @@ def is_exe(fpath): return None -def check_program(binary_name,download_url=None): + +def check_program(binary_name, download_url=None, version_flag=None, version_regex=None, version=None): + """Check if a program is installed and accessible. + + Parameters + ---------- + binary_name : str + Name of the binary to check. + download_url : str, optional + URL to download the program from that is displayed if not installed. + version_flag : str, optional + Flag to pass to the program to get the version. + version_regex : str, optional + Regex to extract the version from the output of the program. + version : str, optional + Version to check against. + + Returns + ------- + None, will exit if program is not installed. + """ if not which(binary_name): - error('You need to install and have the command #####%s##### in your PATH variable to use CRISPResso!\n Please read the documentation!' % binary_name) + error('You need to install and have the command #####{0}##### in your PATH variable to use CRISPResso!\n Please read the documentation!'.format(binary_name)) if download_url: - error('You can download it here:%s' % download_url) + error('You can download it here: {0}'.format(download_url)) sys.exit(1) + if version_flag: + p = sb.Popen('{0} {1}'.format(binary_name, version_flag), shell=True, stdout=sb.PIPE, stderr=sb.STDOUT) + if binary_name == 'fastp': + p_output = p.communicate()[0].decode('utf-8') + else: + p_output = p.communicate()[1].decode('utf-8') + major_version, minor_version, patch_version = map(int, re.search(version_regex, p_output).groups()) + if major_version <= version[0] and minor_version <= version[1] and patch_version < version[2]: + error('You need to install version {0} of {1} to use CRISPResso!'.format(version, binary_name)) + error('You have version {0}.{1}.{2} installed'.format(major_version, minor_version, patch_version)) + if download_url: + error('You can download it here: {0}'.format(download_url)) + sys.exit(1) + + +check_fastp = lambda: check_program('fastp', download_url='http://opengene.org/fastp/fastp', version_flag='--version', version_regex=r'fastp (\d+)\.(\d+)\.(\d+)', version=(0, 19, 8)) + def get_avg_read_length_fastq(fastq_filename): cmd=('z' if fastq_filename.endswith('.gz') else '' ) +('cat < \"%s\"' % fastq_filename)+\ r''' | awk 'BN {n=0;s=0;} NR%4 == 2 {s+=length($0);n++;} END { printf("%d\n",s/n)}' ''' @@ -113,7 +156,6 @@ def get_n_reads_bam(bam_filename,bam_chr_loc=""): #end = time.time() #start = time.time() from matplotlib import font_manager as fm -CRISPRessoPlot.setMatplotlibDefaults() #end = time.time() #start = time.time() @@ -125,7 +167,6 @@ def get_n_reads_bam(bam_filename,bam_chr_loc=""): pd=check_library('pandas') np=check_library('numpy') -check_program('flash') #start = time.time() sns=check_library('seaborn') @@ -205,7 +246,7 @@ def get_cloned_include_idxs_from_quant_window_coordinates(quant_window_coordinat idxs[i] = -1 * abs(idxs[i]) for coord in split_quant_window_coordinates(quant_window_coordinates): include_idxs.extend(idxs[coord[0]:coord[1] + 1]) - + return list(filter(lambda x: x >= 0, include_idxs)) @@ -225,7 +266,7 @@ def get_pe_scaffold_search(prime_edited_ref_sequence, prime_editing_pegRNA_exten """ info('Processing pegRNA scaffold sequence...') #first, define the sequence we are looking for (extension plus the first base(s) of the scaffold) - scaffold_dna = CRISPRessoShared.reverse_complement(prime_editing_pegRNA_scaffold_seq) + scaffold_dna = CRISPRessoShared.reverse_complement(prime_editing_pegRNA_scaffold_seq.upper().replace('U','T')) extension_seq_dna_top_strand = prime_editing_pegRNA_extension_seq.upper().replace('U', 'T') prime_editing_extension_seq_dna = CRISPRessoShared.reverse_complement(extension_seq_dna_top_strand) @@ -341,6 +382,24 @@ def get_new_variant_object(args, fastq_seq, refs, ref_names, aln_matrix, pe_scaf payload['ref_name'] = best_match_name payload['aln_scores'] = aln_scores + + payload['irregular_ends'] = False + if best_match_s1s[idx][0] == '-' or best_match_s2s[idx][0] == '-' or best_match_s1s[idx][0] != best_match_s2s[idx][0]: + payload['irregular_ends'] = True + elif best_match_s1s[idx][-1] == '-' or best_match_s2s[idx][-1] == '-' or best_match_s1s[idx][-1] != best_match_s2s[idx][-1]: + payload['irregular_ends'] = True + + #Insertions out of quantification window + payload['insertions_outside_window'] = (len(payload['all_insertion_positions'])/2) - (len(payload['insertion_positions'])/2) + #Deletions out of quantification window + payload['deletions_outside_window'] = len(payload['all_deletion_coordinates']) - len(payload['deletion_coordinates']) + #Substitutions out of quantification window + payload['substitutions_outside_window'] = len(payload['all_substitution_positions']) - len(payload['substitution_positions']) + #Sums + payload['total_mods'] = (len(payload['all_insertion_positions'])/2) + len(payload['all_deletion_positions']) + len(payload['all_substitution_positions']) + payload['mods_in_window'] = payload['substitution_n'] + payload['deletion_n'] + payload['insertion_n'] + payload['mods_outside_window'] = payload['total_mods'] - payload['mods_in_window'] + # If there is an insertion/deletion/substitution in the quantification window, the read is modified. is_modified = False if not args.ignore_deletions and payload['deletion_n'] > 0: @@ -362,6 +421,7 @@ def get_new_variant_object(args, fastq_seq, refs, ref_names, aln_matrix, pe_scaf payload['aln_strand'] = best_match_strands[idx] new_variant['variant_'+best_match_name] = payload + new_variant['best_match_name'] = best_match_name new_variant['class_name'] = "&".join(class_names) @@ -397,7 +457,7 @@ def get_new_variant_object(args, fastq_seq, refs, ref_names, aln_matrix, pe_scaf def process_fastq(fastq_filename, variantCache, ref_names, refs, args): """process_fastq processes each of the reads contained in a fastq file, given a cache of pre-computed variants - fastqIn: name of fastq (e.g. output of FLASH) + fastqIn: name of fastq (e.g. output of fastp) This file can be gzipped or plain text variantCache: dict with keys: sequence @@ -468,13 +528,19 @@ def process_fastq(fastq_filename, variantCache, ref_names, refs, args): -allelic varaints if two variants are known to exist """ - N_TOT_READS = 0 N_CACHED_ALN = 0 # read was found in cache N_CACHED_NOTALN = 0 #read was found in 'not aligned' cache N_COMPUTED_ALN = 0 # not in cache, aligned to at least 1 sequence with min cutoff N_COMPUTED_NOTALN = 0 #not in cache, not aligned to any sequence with min cutoff + N_GLOBAL_SUBS = 0 #number of substitutions across all reads - indicator of sequencing quality + N_SUBS_OUTSIDE_WINDOW = 0 + N_MODS_IN_WINDOW = 0 #number of modifications found inside the quantification window + N_MODS_OUTSIDE_WINDOW = 0 #number of modifications found outside the quantification window + N_READS_IRREGULAR_ENDS = 0 #number of reads with modifications at the 0 or -1 position + READ_LENGTH = 0 + aln_matrix_loc = os.path.join(_ROOT, args.needleman_wunsch_aln_matrix_loc) CRISPRessoShared.check_file(aln_matrix_loc) aln_matrix = CRISPResso2Align.read_matrix(aln_matrix_loc) @@ -500,7 +566,6 @@ def process_fastq(fastq_filename, variantCache, ref_names, refs, args): info("Processing reads; N_TOT_READS: %d N_COMPUTED_ALN: %d N_CACHED_ALN: %d N_COMPUTED_NOTALN: %d N_CACHED_NOTALN: %d"%(N_TOT_READS, N_COMPUTED_ALN, N_CACHED_ALN, N_COMPUTED_NOTALN, N_CACHED_NOTALN)) N_TOT_READS+=1 - #if the sequence has been seen and can't be aligned, skip it if (fastq_seq in not_aln): N_CACHED_NOTALN += 1 @@ -509,6 +574,13 @@ def process_fastq(fastq_filename, variantCache, ref_names, refs, args): if (fastq_seq in variantCache): N_CACHED_ALN+=1 variantCache[fastq_seq]['count'] += 1 + match_name = "variant_" + variantCache[fastq_seq]['best_match_name'] + N_GLOBAL_SUBS += variantCache[fastq_seq][match_name]['substitution_n'] + variantCache[fastq_seq][match_name]['substitutions_outside_window'] + N_SUBS_OUTSIDE_WINDOW += variantCache[fastq_seq][match_name]['substitutions_outside_window'] + N_MODS_IN_WINDOW += variantCache[fastq_seq][match_name]['mods_in_window'] + N_MODS_OUTSIDE_WINDOW += variantCache[fastq_seq][match_name]['mods_outside_window'] + if variantCache[fastq_seq][match_name]['irregular_ends']: + N_READS_IRREGULAR_ENDS += 1 #otherwise, create a new variant object, and put it in the cache else: @@ -519,6 +591,16 @@ def process_fastq(fastq_filename, variantCache, ref_names, refs, args): else: N_COMPUTED_ALN+=1 variantCache[fastq_seq] = new_variant + match_name = "variant_" + new_variant['best_match_name'] + if READ_LENGTH == 0: + READ_LENGTH = len(new_variant[match_name]['aln_seq']) + N_GLOBAL_SUBS += new_variant[match_name]['substitution_n'] + new_variant[match_name]['substitutions_outside_window'] + N_SUBS_OUTSIDE_WINDOW += new_variant[match_name]['substitutions_outside_window'] + N_MODS_IN_WINDOW += new_variant[match_name]['mods_in_window'] + N_MODS_OUTSIDE_WINDOW += new_variant[match_name]['mods_outside_window'] + if new_variant[match_name]['irregular_ends']: + N_READS_IRREGULAR_ENDS += 1 + fastq_handle.close() @@ -527,10 +609,17 @@ def process_fastq(fastq_filename, variantCache, ref_names, refs, args): "N_CACHED_ALN" : N_CACHED_ALN, "N_CACHED_NOTALN" : N_CACHED_NOTALN, "N_COMPUTED_ALN" : N_COMPUTED_ALN, - "N_COMPUTED_NOTALN" : N_COMPUTED_NOTALN + "N_COMPUTED_NOTALN" : N_COMPUTED_NOTALN, + "N_GLOBAL_SUBS": N_GLOBAL_SUBS, + "N_SUBS_OUTSIDE_WINDOW": N_SUBS_OUTSIDE_WINDOW, + "N_MODS_IN_WINDOW": N_MODS_IN_WINDOW, + "N_MODS_OUTSIDE_WINDOW": N_MODS_OUTSIDE_WINDOW, + "N_READS_IRREGULAR_ENDS": N_READS_IRREGULAR_ENDS, + "READ_LENGTH": READ_LENGTH } return(aln_stats) + def process_bam(bam_filename, bam_chr_loc, output_bam, variantCache, ref_names, refs, args): """ process_bam processes each of the reads contained in a bam file, given a cache of pre-computed variants @@ -550,6 +639,13 @@ def process_bam(bam_filename, bam_chr_loc, output_bam, variantCache, ref_names, N_COMPUTED_ALN = 0 # not in cache, aligned to at least 1 sequence with min cutoff N_COMPUTED_NOTALN = 0 #not in cache, not aligned to any sequence with min cutoff + N_GLOBAL_SUBS = 0 #number of substitutions across all reads - indicator of sequencing quality + N_SUBS_OUTSIDE_WINDOW = 0 + N_MODS_IN_WINDOW = 0 #number of modifications found inside the quantification window + N_MODS_OUTSIDE_WINDOW = 0 #number of modifications found outside the quantification window + N_READS_IRREGULAR_ENDS = 0 #number of reads with modifications at the 0 or -1 position + READ_LENGTH = 0 + aln_matrix_loc = os.path.join(_ROOT, args.needleman_wunsch_aln_matrix_loc) CRISPRessoShared.check_file(aln_matrix_loc) aln_matrix = CRISPResso2Align.read_matrix(aln_matrix_loc) @@ -593,6 +689,13 @@ def process_bam(bam_filename, bam_chr_loc, output_bam, variantCache, ref_names, if (fastq_seq in variantCache): N_CACHED_ALN+=1 variantCache[fastq_seq]['count'] += 1 + match_name = "variant_" + variantCache[fastq_seq]['best_match_name'] + N_GLOBAL_SUBS += variantCache[fastq_seq][match_name]['substitution_n'] + variantCache[fastq_seq][match_name]['substitutions_outside_window'] + N_SUBS_OUTSIDE_WINDOW += variantCache[fastq_seq][match_name]['substitutions_outside_window'] + N_MODS_IN_WINDOW += variantCache[fastq_seq][match_name]['mods_in_window'] + N_MODS_OUTSIDE_WINDOW += variantCache[fastq_seq][match_name]['mods_outside_window'] + if variantCache[fastq_seq][match_name]['irregular_ends']: + N_READS_IRREGULAR_ENDS += 1 #sam_line_els[5] = variantCache[fastq_seq]['sam_cigar'] sam_line_els.append(variantCache[fastq_seq]['crispresso2_annotation']) sam_out.write("\t".join(sam_line_els)+"\n") @@ -654,6 +757,16 @@ def process_bam(bam_filename, bam_chr_loc, output_bam, variantCache, ref_names, variantCache[fastq_seq] = new_variant + match_name = 'variant_' + new_variant['best_match_name'] + if READ_LENGTH == 0: + READ_LENGTH = len(new_variant[match_name]['aln_seq']) + N_GLOBAL_SUBS += new_variant[match_name]['substitution_n'] + new_variant[match_name]['substitutions_outside_window'] + N_SUBS_OUTSIDE_WINDOW += new_variant[match_name]['substitutions_outside_window'] + N_MODS_IN_WINDOW += new_variant[match_name]['mods_in_window'] + N_MODS_OUTSIDE_WINDOW += new_variant[match_name]['mods_outside_window'] + if new_variant[match_name]['irregular_ends']: + N_READS_IRREGULAR_ENDS += 1 + output_sam = output_bam+".sam" cmd = 'samtools view -Sb '+output_sam + '>'+output_bam + ' && samtools index ' + output_bam bam_status=sb.call(cmd, shell=True) @@ -663,14 +776,21 @@ def process_bam(bam_filename, bam_chr_loc, output_bam, variantCache, ref_names, ) info("Finished reads; N_TOT_READS: %d N_COMPUTED_ALN: %d N_CACHED_ALN: %d N_COMPUTED_NOTALN: %d N_CACHED_NOTALN: %d"%(N_TOT_READS, N_COMPUTED_ALN, N_CACHED_ALN, N_COMPUTED_NOTALN, N_CACHED_NOTALN)) - aln_stats = {"N_TOT_READS": N_TOT_READS, - "N_CACHED_ALN": N_CACHED_ALN, - "N_CACHED_NOTALN": N_CACHED_NOTALN, - "N_COMPUTED_ALN": N_COMPUTED_ALN, - "N_COMPUTED_NOTALN": N_COMPUTED_NOTALN, + aln_stats = {"N_TOT_READS" : N_TOT_READS, + "N_CACHED_ALN" : N_CACHED_ALN, + "N_CACHED_NOTALN" : N_CACHED_NOTALN, + "N_COMPUTED_ALN" : N_COMPUTED_ALN, + "N_COMPUTED_NOTALN" : N_COMPUTED_NOTALN, + "N_GLOBAL_SUBS": N_GLOBAL_SUBS, + "N_SUBS_OUTSIDE_WINDOW": N_SUBS_OUTSIDE_WINDOW, + "N_MODS_IN_WINDOW": N_MODS_IN_WINDOW, + "N_MODS_OUTSIDE_WINDOW": N_MODS_OUTSIDE_WINDOW, + "N_READS_IRREGULAR_ENDS": N_READS_IRREGULAR_ENDS, + "READ_LENGTH": READ_LENGTH } return(aln_stats) + def process_fastq_write_out(fastq_input, fastq_output, variantCache, ref_names, refs, args): """ process_fastq_write_out processes each of the reads contained in a fastq input file, given a cache of pre-computed variants. All reads are read in, analyzed, and written to output with annotation @@ -689,6 +809,13 @@ def process_fastq_write_out(fastq_input, fastq_output, variantCache, ref_names, N_COMPUTED_ALN = 0 # not in cache, aligned to at least 1 sequence with min cutoff N_COMPUTED_NOTALN = 0 #not in cache, not aligned to any sequence with min cutoff + N_GLOBAL_SUBS = 0 #number of substitutions across all reads - indicator of sequencing quality + N_SUBS_OUTSIDE_WINDOW = 0 + N_MODS_IN_WINDOW = 0 #number of modifications found inside the quantification window + N_MODS_OUTSIDE_WINDOW = 0 #number of modifications found outside the quantification window + N_READS_IRREGULAR_ENDS = 0 #number of reads with modifications at the 0 or -1 position + READ_LENGTH = 0 + aln_matrix_loc = os.path.join(_ROOT, args.needleman_wunsch_aln_matrix_loc) CRISPRessoShared.check_file(aln_matrix_loc) aln_matrix = CRISPResso2Align.read_matrix(aln_matrix_loc) @@ -725,6 +852,13 @@ def process_fastq_write_out(fastq_input, fastq_output, variantCache, ref_names, elif fastq_seq in variantCache: #if the sequence is already associated with a variant in the variant cache, pull it out N_CACHED_ALN+=1 variantCache[fastq_seq]['count'] += 1 + match_name = "variant_" + variantCache[fastq_seq]['best_match_name'] + N_GLOBAL_SUBS += variantCache[fastq_seq][match_name]['substitution_n'] + variantCache[fastq_seq][match_name]['substitutions_outside_window'] + N_SUBS_OUTSIDE_WINDOW += variantCache[fastq_seq][match_name]['substitutions_outside_window'] + N_MODS_IN_WINDOW += variantCache[fastq_seq][match_name]['mods_in_window'] + N_MODS_OUTSIDE_WINDOW += variantCache[fastq_seq][match_name]['mods_outside_window'] + if variantCache[fastq_seq][match_name]['irregular_ends']: + N_READS_IRREGULAR_ENDS += 1 fastq_out_handle.write(fastq_id+fastq_seq+"\n"+fastq_plus+variantCache[fastq_seq]['crispresso2_annotation']+"\n"+fastq_qual) #otherwise, create a new variant object, and put it in the cache @@ -775,6 +909,15 @@ def process_fastq_write_out(fastq_input, fastq_output, variantCache, ref_names, fastq_out_handle.write(fastq_id+fastq_seq+"\n"+fastq_plus+crispresso2_annotation+"\n"+fastq_qual) variantCache[fastq_seq] = new_variant + match_name = 'variant_' + new_variant['best_match_name'] + if READ_LENGTH == 0: + READ_LENGTH = len(new_variant[match_name]['aln_seq']) + N_GLOBAL_SUBS += new_variant[match_name]['substitution_n'] + new_variant[match_name]['substitutions_outside_window'] + N_SUBS_OUTSIDE_WINDOW += new_variant[match_name]['substitutions_outside_window'] + N_MODS_IN_WINDOW += new_variant[match_name]['mods_in_window'] + N_MODS_OUTSIDE_WINDOW += new_variant[match_name]['mods_outside_window'] + if new_variant[match_name]['irregular_ends']: + N_READS_IRREGULAR_ENDS += 1 #last step of loop = read next line fastq_id = fastq_input_handle.readline() @@ -782,11 +925,17 @@ def process_fastq_write_out(fastq_input, fastq_output, variantCache, ref_names, fastq_out_handle.close() info("Finished reads; N_TOT_READS: %d N_COMPUTED_ALN: %d N_CACHED_ALN: %d N_COMPUTED_NOTALN: %d N_CACHED_NOTALN: %d"%(N_TOT_READS, N_COMPUTED_ALN, N_CACHED_ALN, N_COMPUTED_NOTALN, N_CACHED_NOTALN)) - aln_stats = {"N_TOT_READS": N_TOT_READS, - "N_CACHED_ALN": N_CACHED_ALN, - "N_CACHED_NOTALN": N_CACHED_NOTALN, - "N_COMPUTED_ALN": N_COMPUTED_ALN, - "N_COMPUTED_NOTALN": N_COMPUTED_NOTALN, + aln_stats = {"N_TOT_READS" : N_TOT_READS, + "N_CACHED_ALN" : N_CACHED_ALN, + "N_CACHED_NOTALN" : N_CACHED_NOTALN, + "N_COMPUTED_ALN" : N_COMPUTED_ALN, + "N_COMPUTED_NOTALN" : N_COMPUTED_NOTALN, + "N_GLOBAL_SUBS": N_GLOBAL_SUBS, + "N_SUBS_OUTSIDE_WINDOW": N_SUBS_OUTSIDE_WINDOW, + "N_MODS_IN_WINDOW": N_MODS_IN_WINDOW, + "N_MODS_OUTSIDE_WINDOW": N_MODS_OUTSIDE_WINDOW, + "N_READS_IRREGULAR_ENDS": N_READS_IRREGULAR_ENDS, + "READ_LENGTH": READ_LENGTH } return(aln_stats) @@ -818,6 +967,13 @@ def process_single_fastq_write_bam_out(fastq_input, bam_output, bam_header, vari N_COMPUTED_ALN = 0 # not in cache, aligned to at least 1 sequence with min cutoff N_COMPUTED_NOTALN = 0 # not in cache, not aligned to any sequence with min cutoff + N_GLOBAL_SUBS = 0 #number of substitutions across all reads - indicator of sequencing quality + N_SUBS_OUTSIDE_WINDOW = 0 + N_MODS_IN_WINDOW = 0 #number of modifications found inside the quantification window + N_MODS_OUTSIDE_WINDOW = 0 #number of modifications found outside the quantification window + N_READS_IRREGULAR_ENDS = 0 #number of reads with modifications at the 0 or -1 position + READ_LENGTH = 0 + aln_matrix_loc = os.path.join(_ROOT, args.needleman_wunsch_aln_matrix_loc) CRISPRessoShared.check_file(aln_matrix_loc) aln_matrix = CRISPResso2Align.read_matrix(aln_matrix_loc) @@ -861,6 +1017,13 @@ def process_single_fastq_write_bam_out(fastq_input, bam_output, bam_header, vari elif fastq_seq in variantCache: # if the sequence is already associated with a variant in the variant cache, pull it out N_CACHED_ALN += 1 variantCache[fastq_seq]['count'] += 1 + match_name = "variant_" + variantCache[fastq_seq]['best_match_name'] + N_GLOBAL_SUBS += variantCache[fastq_seq][match_name]['substitution_n'] + variantCache[fastq_seq][match_name]['substitutions_outside_window'] + N_SUBS_OUTSIDE_WINDOW += variantCache[fastq_seq][match_name]['substitutions_outside_window'] + N_MODS_IN_WINDOW += variantCache[fastq_seq][match_name]['mods_in_window'] + N_MODS_OUTSIDE_WINDOW += variantCache[fastq_seq][match_name]['mods_outside_window'] + if variantCache[fastq_seq][match_name]['irregular_ends']: + N_READS_IRREGULAR_ENDS += 1 new_sam_entry = variantCache[fastq_seq]['sam_entry'][:] new_sam_entry[0] = fastq_id new_sam_entry[10] = fastq_qual @@ -973,12 +1136,20 @@ def process_single_fastq_write_bam_out(fastq_input, bam_output, bam_header, vari sam_out_handle.write("\t".join(new_sam_entry)+"\n") # write cached alignment with modified read id and qual variantCache[fastq_seq] = new_variant + match_name = 'variant_' + new_variant['best_match_name'] + if READ_LENGTH == 0: + READ_LENGTH = len(new_variant[match_name]['aln_seq']) + N_GLOBAL_SUBS += new_variant[match_name]['substitution_n'] + new_variant[match_name]['substitutions_outside_window'] + N_SUBS_OUTSIDE_WINDOW += new_variant[match_name]['substitutions_outside_window'] + N_MODS_IN_WINDOW += new_variant[match_name]['mods_in_window'] + N_MODS_OUTSIDE_WINDOW += new_variant[match_name]['mods_outside_window'] + if new_variant[match_name]['irregular_ends']: + N_READS_IRREGULAR_ENDS += 1 #last step of loop = read next line fastq_id = fastq_input_handle.readline().strip()[1:] fastq_input_handle.close() sam_out_handle.close() - sort_and_index_cmd = 'samtools sort ' + sam_out + ' -o ' + bam_output + ' && samtools index ' + bam_output sort_bam_status = sb.call(sort_and_index_cmd, shell=True) if sort_bam_status: @@ -990,11 +1161,17 @@ def process_single_fastq_write_bam_out(fastq_input, bam_output, bam_header, vari os.remove(sam_out) info("Finished reads; N_TOT_READS: %d N_COMPUTED_ALN: %d N_CACHED_ALN: %d N_COMPUTED_NOTALN: %d N_CACHED_NOTALN: %d"%(N_TOT_READS, N_COMPUTED_ALN, N_CACHED_ALN, N_COMPUTED_NOTALN, N_CACHED_NOTALN)) - aln_stats = {"N_TOT_READS": N_TOT_READS, - "N_CACHED_ALN": N_CACHED_ALN, - "N_CACHED_NOTALN": N_CACHED_NOTALN, - "N_COMPUTED_ALN": N_COMPUTED_ALN, - "N_COMPUTED_NOTALN": N_COMPUTED_NOTALN, + aln_stats = {"N_TOT_READS" : N_TOT_READS, + "N_CACHED_ALN" : N_CACHED_ALN, + "N_CACHED_NOTALN" : N_CACHED_NOTALN, + "N_COMPUTED_ALN" : N_COMPUTED_ALN, + "N_COMPUTED_NOTALN" : N_COMPUTED_NOTALN, + "N_GLOBAL_SUBS": N_GLOBAL_SUBS, + "N_SUBS_OUTSIDE_WINDOW": N_SUBS_OUTSIDE_WINDOW, + "N_MODS_IN_WINDOW": N_MODS_IN_WINDOW, + "N_MODS_OUTSIDE_WINDOW": N_MODS_OUTSIDE_WINDOW, + "N_READS_IRREGULAR_ENDS": N_READS_IRREGULAR_ENDS, + "READ_LENGTH": READ_LENGTH } return(aln_stats) @@ -1092,7 +1269,7 @@ def print_stacktrace_if_debug(): sys.exit() - arg_parser = CRISPRessoShared.getCRISPRessoArgParser() + arg_parser = CRISPRessoShared.getCRISPRessoArgParser("Core") args = arg_parser.parse_args() CRISPRessoShared.set_console_log_level(logger, args.verbosity, args.debug) @@ -1125,7 +1302,7 @@ def print_stacktrace_if_debug(): with open(log_filename, 'w+') as outfile: outfile.write('CRISPResso version %s\n[Command used]:\n%s\n\n[Execution log]:\n' %(CRISPRessoShared.__version__, crispresso_cmd_to_write)) - logger.addHandler(CRISPRessoShared.StatusHandler(_jp('CRISPResso_status.txt'))) + logger.addHandler(CRISPRessoShared.StatusHandler(_jp('CRISPResso_status.json'))) aln_matrix_loc = os.path.join(_ROOT, "EDNAFULL") CRISPRessoShared.check_file(aln_matrix_loc) @@ -1159,7 +1336,7 @@ def print_stacktrace_if_debug(): if args.amplicon_seq is None and args.auto is False: arg_parser.print_help() - raise CRISPRessoShared.BadParameterException('Please provide an amplicon sequence for analysis using the --amplicon_seq parameter.') + raise CRISPRessoShared.BadParameterException('Please provide an amplicon sequence for analysis using the --amplicon_seq parameter or use the --auto parameter to automatically assign amplicon to most common read.') if (args.needleman_wunsch_gap_open > 0): raise CRISPRessoShared.BadParameterException("Needleman Wunsch gap open penalty must be <= 0") @@ -1167,6 +1344,13 @@ def print_stacktrace_if_debug(): raise CRISPRessoShared.BadParameterException("Needleman Wunsch gap extend penalty must be <= 0") + if args.use_matplotlib or not C2PRO_INSTALLED: + from CRISPResso2 import CRISPRessoPlot + else: + from CRISPRessoPro import plot as CRISPRessoPlot + CRISPRessoPlot.setMatplotlibDefaults() + + #create output directory crispresso2_info_file = os.path.join(OUTPUT_DIRECTORY, 'CRISPResso2_info.json') 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 @@ -1299,6 +1483,7 @@ def rreplace(s, old, new): info('Inferring reference amplicon sequence..', {'percent_complete': 1}) + check_fastp() auto_fastq_r1 = args.fastq_r1 #paths to fastq files for performing auto functions auto_fastq_r2 = args.fastq_r2 if args.bam_input != "": #if input is a bam, create temp files with reads for processing here @@ -1321,8 +1506,7 @@ def rreplace(s, old, new): fastq_r1=auto_fastq_r1, fastq_r2=auto_fastq_r2, number_of_reads_to_consider=number_of_reads_to_consider, - flash_command=args.flash_command, - max_paired_end_reads_overlap=args.max_paired_end_reads_overlap, + fastp_command=args.fastp_command, min_paired_end_reads_overlap=args.min_paired_end_reads_overlap, aln_matrix=aln_matrix, needleman_wunsch_gap_open=args.needleman_wunsch_gap_open, @@ -1350,8 +1534,7 @@ def rreplace(s, old, new): fastq_r1=auto_fastq_r1, fastq_r2=auto_fastq_r2, number_of_reads_to_consider=number_of_reads_to_consider, - flash_command=args.flash_command, - max_paired_end_reads_overlap=args.max_paired_end_reads_overlap, + fastp_command=args.fastp_command, min_paired_end_reads_overlap=args.min_paired_end_reads_overlap, exclude_bp_from_left=args.exclude_bp_from_left, exclude_bp_from_right=args.exclude_bp_from_right, @@ -1389,7 +1572,7 @@ def rreplace(s, old, new): ) else: #not auto - amplicon_seq_arr = args.amplicon_seq.split(",") + amplicon_seq_arr = list(map(lambda x: x.upper(), args.amplicon_seq.split(","))) amplicon_name_arr = args.amplicon_name.split(",") #split on commas, only accept empty values amplicon_min_alignment_score_arr = [float(x) for x in args.amplicon_min_alignment_score.split(",") if x] @@ -1665,20 +1848,17 @@ def get_prime_editing_guides(this_amp_seq, this_amp_name, ref0_seq, prime_edited #now that we're done with adding possible guides and amplicons, go through each amplicon and compute quantification windows info('Computing quantification windows', {'percent_complete': 2}) + if C2PRO_INSTALLED: + info(f'CRISPRessoPro v{CRISPRessoProVersion} installed', {'percent_complete': 3}) + else: + info(f'CRISPRessoPro not installed', {'percent_complete': 3}) found_guide_seq = [False]*len(guides) found_coding_seq = [False]*len(coding_seqs) - max_amplicon_len = 0 #for flash - min_amplicon_len = 99**99 #for flash - for idx, seq in enumerate(amplicon_seq_arr): this_seq = seq.strip().upper() this_seq_length = len(this_seq) - if this_seq_length > max_amplicon_len: - max_amplicon_len = this_seq_length - if this_seq_length < min_amplicon_len: - min_amplicon_len = this_seq_length this_name = 'Amplicon'+str(idx) if idx < len(amplicon_name_arr): @@ -2189,134 +2369,89 @@ def get_prime_editing_guides(this_amp_seq, this_amp_name, ref0_seq, prime_edited raise CRISPRessoShared.BadParameterException('Read trimming options are not available with bam input') elif args.fastq_r1 != '' and args.fastq_r2 == '': #single end reads if not args.trim_sequences: #no trimming or merging required - output_forward_filename=args.fastq_r1 + output_forward_filename = args.fastq_r1 else: + check_fastp() + info('Trimming sequences with fastp...') output_forward_filename=_jp('reads.trimmed.fq.gz') - #Trimming with trimmomatic - cmd='%s SE -phred33 %s %s %s >>%s 2>&1'\ - % (args.trimmomatic_command, args.fastq_r1, - output_forward_filename, - args.trimmomatic_options_string.replace('NexteraPE-PE.fa', 'TruSeq3-SE.fa'), - log_filename) - #print cmd - TRIMMOMATIC_STATUS=sb.call(cmd, shell=True) - - if TRIMMOMATIC_STATUS: - raise CRISPRessoShared.TrimmomaticException('TRIMMOMATIC failed to run, please check the log file.') - crispresso2_info['trimmomatic_command'] = cmd + cmd = '{command} -i {r1} -o {out} {options} --json {json_report} --html {html_report} >> {log} 2>&1'.format( + command=args.fastp_command, + r1=args.fastq_r1, + out=output_forward_filename, + options=args.fastp_options_string, + json_report=_jp('fastp_report.json'), + html_report=_jp('fastp_report.html'), + log=log_filename, + ) + fastp_status = sb.call(cmd, shell=True) + + if fastp_status: + raise CRISPRessoShared.FastpException('FASTP failed to run, please check the log file.') + crispresso2_info['fastp_command'] = cmd files_to_remove += [output_forward_filename] - processed_output_filename=output_forward_filename + info('Done!') + + processed_output_filename = output_forward_filename elif args.fastq_r1 != '' and args.fastq_r2 != '':#paired end reads + processed_output_filename = _jp('oet.extendedFrags.fastq.gz') + not_combined_1_filename = _jp('out.notCombined_1.fastq.gz') + not_combined_2_filename = _jp('out.notCombined_2.fastq.gz') + check_fastp() + info('Processing sequences with fastp...') if not args.trim_sequences: - output_forward_paired_filename=args.fastq_r1 - output_reverse_paired_filename=args.fastq_r2 - else: - info('Trimming sequences with Trimmomatic...') - output_forward_paired_filename=_jp('output_forward_paired.fq.gz') - output_forward_unpaired_filename=_jp('output_forward_unpaired.fq.gz') - output_reverse_paired_filename=_jp('output_reverse_paired.fq.gz') - output_reverse_unpaired_filename=_jp('output_reverse_unpaired.fq.gz') - - #Trimming with trimmomatic - cmd='%s PE -phred33 %s %s %s %s %s %s %s >>%s 2>&1'\ - % (args.trimmomatic_command, - args.fastq_r1, args.fastq_r2, output_forward_paired_filename, - output_forward_unpaired_filename, output_reverse_paired_filename, - output_reverse_unpaired_filename, args.trimmomatic_options_string, log_filename) - #print cmd - TRIMMOMATIC_STATUS=sb.call(cmd, shell=True) - if TRIMMOMATIC_STATUS: - raise CRISPRessoShared.TrimmomaticException('TRIMMOMATIC failed to run, please check the log file.') - crispresso2_info['trimmomatic_command'] = cmd - - files_to_remove += [output_forward_paired_filename] - files_to_remove += [output_reverse_paired_filename] - - info('Done!', {'percent_complete': 6}) - - #for paired-end reads, merge them - info('Estimating average read length...') - if args.debug: - info('Checking average read length from ' + output_forward_paired_filename) - if get_n_reads_fastq(output_forward_paired_filename): - avg_read_length=get_avg_read_length_fastq(output_forward_paired_filename) - if args.debug: - info('Average read length is ' + str(avg_read_length) + ' from ' + output_forward_paired_filename) + args.fastp_options_string += ' --disable_adapter_trimming --disable_trim_poly_g --disable_quality_filtering --disable_length_filtering' else: - raise CRISPRessoShared.NoReadsAfterQualityFilteringException('No reads survived the average or single bp quality filtering.') - - #Merging with Flash - info('Merging paired sequences with Flash...') - min_overlap = args.min_paired_end_reads_overlap - max_overlap = args.max_paired_end_reads_overlap - if args.stringent_flash_merging: - expected_max_overlap=2*avg_read_length - min_amplicon_len - expected_min_overlap=2*avg_read_length - max_amplicon_len - # print('avg read len: ' + str(avg_read_length)) - # print('expected_max_overlap' + str(expected_max_overlap)) - # print('expected_min_overlap' + str(expected_min_overlap)) - # print('min amplicon len:' + str(min_amplicon_len)) - # print('max amplicon len:' + str(max_amplicon_len)) - indel_overlap_tolerance = 10 # magic number bound on how many bp inserted/deleted in ~90% of reads (for flash) - #max overlap is either the entire read (avg_read_length) or the expected amplicon length + indel tolerance - max_overlap = max(10, min(avg_read_length, expected_max_overlap+indel_overlap_tolerance)) - #min overlap is either 4bp (as in crispresso1) or the expected amplicon length - indel tolerance - min_overlap = max(4, expected_min_overlap-indel_overlap_tolerance) - # print('max_overlap: ' + str(max_overlap)) - # print('min_overlap: ' + str(min_overlap)) - # if reads are longer than the amplicon, there is no way to tell flash to have them overlap like this.. - if avg_read_length > min_amplicon_len: - info('Warning: Reads are longer than amplicon.') - min_overlap = avg_read_length-10 - max_overlap = 2*avg_read_length - - output_prefix = "out" - if clean_file_prefix != "": - output_prefix = clean_file_prefix + "out" - cmd='%s "%s" "%s" --min-overlap %d --max-overlap %d --allow-outies -z -d %s -o %s >>%s 2>&1' %\ - (args.flash_command, - output_forward_paired_filename, - output_reverse_paired_filename, - min_overlap, - max_overlap, - OUTPUT_DIRECTORY, - output_prefix, - log_filename) - - info('Running FLASH command: ' + cmd) - crispresso2_info['flash_command'] = cmd - FLASH_STATUS=sb.call(cmd, shell=True) - if FLASH_STATUS: - raise CRISPRessoShared.FlashException('Flash failed to run, please check the log file.') - - flash_hist_filename=_jp('out.hist') - flash_histogram_filename=_jp('out.histogram') - flash_not_combined_1_filename=_jp('out.notCombined_1.fastq.gz') - flash_not_combined_2_filename=_jp('out.notCombined_2.fastq.gz') - - processed_output_filename=_jp('out.extendedFrags.fastq.gz') - if os.path.isfile(processed_output_filename) is False: - raise CRISPRessoShared.FlashException('Flash failed to produce merged reads file, please check the log file.') - - files_to_remove+=[processed_output_filename, flash_hist_filename, flash_histogram_filename,\ - flash_not_combined_1_filename, flash_not_combined_2_filename, _jp('out.hist.innie'), _jp('out.histogram.innie'), _jp('out.histogram.outie'), _jp('out.hist.outie')] - - if (args.force_merge_pairs): - old_flashed_filename = processed_output_filename + args.fastp_options_string += ' --detect_adapter_for_pe' + + fastp_cmd = '{command} -i {r1} -I {r2} --merge --merged_out {out_merged} --unpaired1 {unpaired1} --unpaired2 {unpaired2} --overlap_len_require {min_overlap} --thread {num_threads} --json {json_report} --html {html_report} {options} >> {log} 2>&1'.format( + command=args.fastp_command, + r1=args.fastq_r1, + r2=args.fastq_r2, + out_merged=processed_output_filename, + unpaired1=not_combined_1_filename, + unpaired2=not_combined_2_filename, + min_overlap=args.min_paired_end_reads_overlap, + num_threads=n_processes, + json_report=_jp('fastp_report.json'), + html_report=_jp('fastp_report.html'), + options=args.fastp_options_string, + log=log_filename, + ) + fastp_status = sb.call(fastp_cmd, shell=True) + if fastp_status: + raise CRISPRessoShared.FastpException('Fastp failed to run, please check the log file.') + crispresso2_info['running_info']['fastp_command'] = fastp_cmd + + if not os.path.isfile(processed_output_filename): + raise CRISPRessoShared.FastpException('Fastp failed to produce merged reads file, please check the log file.') + + info('Done!', {'percent_complete': 6}) + + files_to_remove += [ + processed_output_filename, + not_combined_1_filename, + not_combined_2_filename, + ] + + if args.force_merge_pairs: new_merged_filename=_jp('out.forcemerged_uncombined.fastq.gz') - num_reads_force_merged = CRISPRessoShared.force_merge_pairs(flash_not_combined_1_filename, flash_not_combined_2_filename, new_merged_filename) + num_reads_force_merged = CRISPRessoShared.force_merge_pairs(not_combined_1_filename, not_combined_2_filename, new_merged_filename) new_output_filename=_jp('out.forcemerged.fastq.gz') - merge_command = "cat %s %s > %s"%(processed_output_filename, new_merged_filename, new_output_filename) - MERGE_STATUS=sb.call(merge_command, shell=True) - if MERGE_STATUS: - raise FlashException('Force-merging read pairs failed to run, please check the log file.') + merge_command = "cat {0} {1} > {2}".format( + processed_output_filename, new_merged_filename, new_output_filename, + ) + merge_status = sb.call(merge_command, shell=True) + if merge_status: + raise CRISPRessoShared.FastpException('Force-merging read pairs failed to run, please check the log file.') + else: + info(f'Forced {num_reads_force_merged} read paisr together.') processed_output_filename = new_output_filename - files_to_remove+=[new_merged_filename] - files_to_remove+=[new_output_filename] + files_to_remove += [new_merged_filename] + files_to_remove += [new_output_filename] if args.debug: info('Wrote force-merged reads to ' + new_merged_filename) @@ -3432,7 +3567,7 @@ def save_count_vectors_to_file(vectors, vectorNames, refSeq, filename): info('Making Plots...') ############################################################################################################################################### save_png = True - config = CRISPRessoShared.check_custom_config(args) + custom_config = CRISPRessoShared.check_custom_config(args) if args.suppress_report: save_png = False @@ -3511,6 +3646,7 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ 'N_TOTAL': N_TOTAL, 'piechart_plot_root': plot_1b_root, 'barplot_plot_root': plot_1c_root, + 'custom_colors': custom_config['colors'], 'save_png': save_png } crispresso2_info['results']['general_plots']['plot_1b_root'] = os.path.basename(plot_1b_root) @@ -3653,17 +3789,18 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ mod_df_for_plot = modification_percentage_summary_df.copy() mod_df_for_plot.insert(0, 'Batch', ref_name) - plot_root = _jp('2a.'+ref_plot_name + 'Nucleotide_percentage_quilt') + plot_root = _jp('2a.'+ ref_plot_name + 'Nucleotide_percentage_quilt') + pro_output_name = f'plot_{os.path.basename(plot_root)}.json' plot_2a_input = { 'nuc_pct_df': nuc_df_for_plot, 'mod_pct_df': mod_df_for_plot, - 'fig_filename_root': plot_root, + 'fig_filename_root': f'{_jp(pro_output_name)}' if not args.use_matplotlib and C2PRO_INSTALLED else plot_root, 'save_also_png': save_png, 'sgRNA_intervals': sgRNA_intervals, 'sgRNA_names': sgRNA_names, 'sgRNA_mismatches': sgRNA_mismatches, 'quantification_window_idxs': include_idxs_list, - 'custom_colors': config["colors"], + 'custom_colors': custom_config["colors"], } debug('Plotting nucleotide quilt across amplicon') plot(CRISPRessoPlot.plot_nucleotide_quilt, plot_2a_input) @@ -3700,17 +3837,18 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ new_include_idx = [] for x in include_idxs_list: new_include_idx += [x - new_sel_cols_start] - plot_root = _jp('2b.'+ref_plot_name + 'Nucleotide_percentage_quilt_around_' + sgRNA_label) + plot_root = _jp('2b.'+ ref_plot_name + 'Nucleotide_percentage_quilt_around_' + sgRNA_label) + pro_output_name = f'plot_{os.path.basename(plot_root)}.json' plot_2b_input = { 'nuc_pct_df': nuc_df_for_plot.iloc[:, sel_cols], 'mod_pct_df': mod_df_for_plot.iloc[:, sel_cols], - 'fig_filename_root': plot_root, + 'fig_filename_root': f'{_jp(pro_output_name)}' if not args.use_matplotlib and C2PRO_INSTALLED else plot_root, 'save_also_png': save_png, 'sgRNA_intervals': new_sgRNA_intervals, 'sgRNA_names': sgRNA_names, 'sgRNA_mismatches': sgRNA_mismatches, 'quantification_window_idxs': new_include_idx, - 'custom_colors': config["colors"], + 'custom_colors': custom_config["colors"], } debug('Plotting nucleotide distribuition around {0} for {1}'.format(sgRNA_legend, ref_name)) plot(CRISPRessoPlot.plot_nucleotide_quilt, plot_2b_input) @@ -3762,6 +3900,7 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ ), 'plot_root': plot_root, 'save_also_png': save_png, + 'ref_name': ref_name, } debug('Plotting indel size distribution for {0}'.format(ref_name)) plot(CRISPRessoPlot.plot_indel_size_distribution, plot_3a_input) @@ -3843,6 +3982,8 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ 'xmax_ins': xmax_ins, 'xmax_mut': xmax_mut, 'save_also_png': save_png, + 'custom_colors': custom_config["colors"], + 'ref_name' : ref_name, } debug('Plotting frequency deletions/insertions for {0}'.format(ref_name)) plot(CRISPRessoPlot.plot_frequency_deletions_insertions, plot_3b_input) @@ -3888,7 +4029,7 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ ), }, 'plot_root': plot_root, - 'custom_colors': config["colors"], + 'custom_colors': custom_config["colors"], 'save_also_png': save_png, } debug('Plotting amplication modifications for {0}'.format(ref_name)) @@ -3918,7 +4059,7 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ 'Mutation position distribution', ref_name, ), 'plot_root': plot_root, - 'custom_colors': config["colors"], + 'custom_colors': custom_config["colors"], 'save_also_png': save_png, } debug('Plotting modification frequency for {0}'.format(ref_name)) @@ -3947,7 +4088,7 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ ), 'ref_name': ref_name, 'plot_root': plot_root, - 'custom_colors': config["colors"], + 'custom_colors': custom_config["colors"], 'save_also_png': save_png, } debug('Plotting quantification window locations for {0}'.format(ref_name)) @@ -3979,6 +4120,7 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ }, 'plot_root': plot_root, 'save_also_png': save_png, + 'ref_name': ref_name, } debug('Plotting position dependent indel for {0}'.format(ref_name)) plot( @@ -4004,7 +4146,7 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ 'n_total': N_TOTAL, 'ref_len': ref_len, 'ref_name': ref_names[0], - 'custom_colors': config["colors"], + 'custom_colors': custom_config["colors"], 'save_also_png': save_png, } if ref_name == ref_names[0]: @@ -4066,16 +4208,17 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ hdr_nucleotide_percentage_summary_df.rename(columns={'Batch':'Amplicon'}).to_csv(nuc_freq_filename,sep='\t',header=True,index=False) plot_root = _jp('4g.HDR_nucleotide_percentage_quilt') + pro_output_name = f'plot_{os.path.basename(plot_root)}.json' plot_4g_input = { 'nuc_pct_df': hdr_nucleotide_percentage_summary_df, 'mod_pct_df': hdr_modification_percentage_summary_df, - 'fig_filename_root': plot_root, + 'fig_filename_root': f'{_jp(pro_output_name)}' if not args.use_matplotlib and C2PRO_INSTALLED else plot_root, 'save_also_png': save_png, 'sgRNA_intervals': sgRNA_intervals, 'quantification_window_idxs': include_idxs_list, 'sgRNA_names': sgRNA_names, 'sgRNA_mismatches': sgRNA_mismatches, - 'custom_colors': config["colors"], + 'custom_colors': custom_config["colors"], } debug('Plotting HDR nucleotide quilt') plot(CRISPRessoPlot.plot_nucleotide_quilt, plot_4g_input) @@ -4124,6 +4267,7 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ 'ref_name': ref_name, 'plot_root': plot_root, 'save_also_png': save_png, + 'custom_colors': custom_config['colors'], } debug('Plotting frameshift analysis for {0}'.format(ref_name)) plot(CRISPRessoPlot.plot_frameshift_analysis, plot_5_input) @@ -4149,6 +4293,7 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ 'plot_root': plot_root, 'save_also_png': save_png, + 'ref_name': ref_name, } debug('Plotting frameshift frequency for {0}'.format(ref_name)) plot(CRISPRessoPlot.plot_frameshift_frequency, plot_6_input) @@ -4176,8 +4321,9 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ ref_name, ), 'plot_root': plot_root, - 'custom_colors': config["colors"], + 'custom_colors': custom_config["colors"], 'save_also_png': save_png, + 'ref_name': ref_name, } debug('Plotting non-coding mutation positions for {0}'.format(ref_name)) plot(CRISPRessoPlot.plot_non_coding_mutations, plot_7_input) @@ -4191,6 +4337,8 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ 'count_total': count_total, 'plot_root': plot_root, 'save_also_png': save_png, + 'ref_name': ref_name, + 'custom_colors': custom_config['colors'], } debug('Plotting potential splice sites') plot(CRISPRessoPlot.plot_potential_splice_sites, plot_8_input) @@ -4216,7 +4364,8 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ 'fig_filename_root': fig_filename_root, 'save_also_png': save_png, 'quantification_window_idxs': include_idxs_list, - 'custom_colors': config['colors'] + 'custom_colors': custom_config['colors'], + 'ref_name': ref_name, } debug('Plotting substitutions across reference for {0}'.format(ref_name)) plot(CRISPRessoPlot.plot_subs_across_ref, plot_10a_input) @@ -4235,7 +4384,7 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ ), 'fig_filename_root': fig_filename_root, 'save_also_png': save_png, - 'custom_colors': config['colors'] + 'custom_colors': custom_config['colors'] } debug('Plotting substitution frequency barplot for {0}'.format(ref_name)) plot(CRISPRessoPlot.plot_sub_freqs, plot_10b_input) @@ -4250,7 +4399,7 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ 'plot_title': get_plot_title_with_ref_name('Substitution frequency\nin quantification window', ref_name), 'fig_filename_root': fig_filename_root, 'save_also_png': save_png, - 'custom_colors': config['colors'] + 'custom_colors': custom_config['colors'] } debug('Plotting substitution frequency barplot in quantification window for {0}'.format(ref_name)) plot(CRISPRessoPlot.plot_sub_freqs, plot_10c_input) @@ -4333,6 +4482,7 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ 'reference_seq': ref_seq_around_cut, 'df_alleles': df_to_plot, 'fig_filename_root': fig_filename_root, + 'custom_colors': custom_config["colors"], 'MIN_FREQUENCY': args.min_frequency_alleles_around_cut_to_plot, 'MAX_N_ROWS': args.max_rows_alleles_around_cut_to_plot, 'SAVE_ALSO_PNG': save_png, @@ -4341,7 +4491,6 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ 'sgRNA_names': sgRNA_names, 'sgRNA_mismatches': sgRNA_mismatches, 'annotate_wildtype_allele': args.annotate_wildtype_allele, - 'custom_colors': config["colors"], } debug('Plotting allele distribution around cut for {0}'.format(ref_name)) plot(CRISPRessoPlot.plot_alleles_table, plot_9_input) @@ -4428,7 +4577,7 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ 'conversion_nuc_from': args.conversion_nuc_from, 'fig_filename_root': fig_filename_root, 'save_also_png': save_png, - 'custom_colors': config['colors'], + 'custom_colors': custom_config['colors'], } debug('Plotting conversion at {0}s around the {1} for {2}'.format(args.conversion_nuc_from, sgRNA_legend, ref_name)) plot( @@ -4448,7 +4597,7 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ 'conversion_nuc_from': args.conversion_nuc_from, 'fig_filename_root': fig_filename_root, 'save_also_png': save_png, - 'custom_colors': config['colors'] + 'custom_colors': custom_config['colors'] } debug('Plotting non-reference conversion at {0}s around the {1} for {2}'.format(args.conversion_nuc_from, sgRNA_legend, ref_name)) plot( @@ -4471,7 +4620,7 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ 'conversion_nuc_from': args.conversion_nuc_from, 'fig_filename_root': fig_filename_root, 'save_also_png': save_png, - 'custom_colors': config['colors'] + 'custom_colors': custom_config['colors'] } debug('Plotting scaled non-reference conversion at {0}s around the {1} for {2}'.format(args.conversion_nuc_from, sgRNA_legend, ref_name)) plot( @@ -4538,6 +4687,7 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ 'global_non_modified_non_frameshift': global_NON_MODIFIED_NON_FRAMESHIFT, 'plot_root': plot_root, 'save_also_png': save_png, + 'custom_colors': custom_config['colors'], } debug('Plotting global frameshift in-frame mutations pie chart', {'percent_complete': 90}) plot( @@ -4577,6 +4727,7 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ 'global_count_total': global_count_total, 'plot_root': plot_root, 'save_also_png': save_png, + 'custom_colors': custom_config['colors'], } debug('Plotting global potential splice sites pie chart', {'percent_complete': 94}) plot(CRISPRessoPlot.plot_impact_on_splice_sites, plot_8a_input) @@ -4592,7 +4743,7 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ scaffold_insertion_sizes_filename = "" if args.prime_editing_pegRNA_scaffold_seq != "": #first, define the sequence we are looking for (extension plus the first base(s) of the scaffold) - scaffold_dna_seq = CRISPRessoShared.reverse_complement(args.prime_editing_pegRNA_scaffold_seq) + scaffold_dna_seq = CRISPRessoShared.reverse_complement(args.prime_editing_pegRNA_scaffold_seq.upper().replace('U','T')) pe_seq = refs['Prime-edited']['sequence'] pe_scaffold_dna_info = get_pe_scaffold_search(pe_seq, args.prime_editing_pegRNA_extension_seq, args.prime_editing_pegRNA_scaffold_seq, args.prime_editing_pegRNA_scaffold_min_match_length) @@ -4655,16 +4806,17 @@ def get_scaffold_len(row, scaffold_start_loc, scaffold_seq): include_idxs_list = refs[ref_names[0]]['include_idxs'] plot_root = _jp('11a.Prime_editing_nucleotide_percentage_quilt') + pro_output_name = f'plot_{os.path.basename(plot_root)}.json' plot_11a_input = { 'nuc_pct_df': pe_nucleotide_percentage_summary_df, 'mod_pct_df': pe_modification_percentage_summary_df, - 'fig_filename_root': plot_root, + 'fig_filename_root': f'{_jp(pro_output_name)}' if not args.use_matplotlib and C2PRO_INSTALLED else plot_root, 'save_also_png': save_png, 'sgRNA_intervals': sgRNA_intervals, 'sgRNA_names': sgRNA_names, 'sgRNA_mismatches': sgRNA_mismatches, 'quantification_window_idxs': include_idxs_list, - 'custom_colors': config['colors'] + 'custom_colors': custom_config['colors'] } info('Plotting prime editing nucleotide percentage quilt', {'percent_complete': 96}) plot(CRISPRessoPlot.plot_nucleotide_quilt, plot_11a_input) @@ -4714,16 +4866,17 @@ def get_scaffold_len(row, scaffold_start_loc, scaffold_seq): for x in pe_include_idxs_list: new_include_idx += [x - new_sel_cols_start] plot_root = _jp('11b.Nucleotide_percentage_quilt_around_' + sgRNA_label) + pro_output_name = f'plot_{os.path.basename(plot_root)}.json' plot_11b_input = { 'nuc_pct_df': pe_nucleotide_percentage_summary_df.iloc[:, sel_cols], 'mod_pct_df': pe_modification_percentage_summary_df.iloc[:, sel_cols], - 'fig_filename_root': plot_root, + 'fig_filename_root': f'{_jp(pro_output_name)}' if not args.use_matplotlib and C2PRO_INSTALLED else plot_root, 'save_also_png': save_png, 'sgRNA_intervals': new_sgRNA_intervals, 'sgRNA_names': sgRNA_names, 'sgRNA_mismatches': sgRNA_mismatches, 'quantification_window_idxs': new_include_idx, - 'custom_colors': config['colors'] + 'custom_colors': custom_config['colors'] } info('Plotting nucleotide quilt', {'percent_complete': 97}) plot(CRISPRessoPlot.plot_nucleotide_quilt, plot_11b_input) @@ -4803,6 +4956,11 @@ def get_scaffold_len(row, scaffold_start_loc, scaffold_seq): crispresso2_info['running_info']['running_time'] = running_time crispresso2_info['running_info']['running_time_string'] = running_time_string + if args.disable_guardrails: + crispresso2_info['results']['guardrails_htmls'] = [] + else: + crispresso2_info['results']['guardrails_htmls'] = CRISPRessoShared.safety_check(crispresso2_info, aln_stats, custom_config['guardrails']) + if not args.suppress_report: if (args.place_report_in_output_folder): @@ -4833,13 +4991,9 @@ def get_scaffold_len(row, scaffold_start_loc, scaffold_seq): print_stacktrace_if_debug() error('sgRNA error, please check your input.\n\nERROR: %s' % e) sys.exit(2) - except CRISPRessoShared.TrimmomaticException as e: - print_stacktrace_if_debug() - error('Trimming error, please check your input.\n\nERROR: %s' % e) - sys.exit(4) - except CRISPRessoShared.FlashException as e: + except CRISPRessoShared.FastpException as e: print_stacktrace_if_debug() - error('Merging error, please check your input.\n\nERROR: %s' % e) + error('Merging or trimming error, please check your input.\n\nERROR: %s' % e) sys.exit(5) except CRISPRessoShared.BadParameterException as e: print_stacktrace_if_debug() diff --git a/CRISPResso2/CRISPRessoCOREResources.c b/CRISPResso2/CRISPRessoCOREResources.c index 9d3b6102..b312833b 100644 --- a/CRISPResso2/CRISPRessoCOREResources.c +++ b/CRISPResso2/CRISPRessoCOREResources.c @@ -1,21 +1,21 @@ -/* Generated by Cython 3.0.6 */ +/* Generated by Cython 3.0.9 */ /* BEGIN: Cython Metadata { "distutils": { "depends": [ - "/opt/conda/lib/python3.10/site-packages/numpy/core/include/numpy/arrayobject.h", - "/opt/conda/lib/python3.10/site-packages/numpy/core/include/numpy/arrayscalars.h", - "/opt/conda/lib/python3.10/site-packages/numpy/core/include/numpy/ndarrayobject.h", - "/opt/conda/lib/python3.10/site-packages/numpy/core/include/numpy/ndarraytypes.h", - "/opt/conda/lib/python3.10/site-packages/numpy/core/include/numpy/ufuncobject.h" + "/Users/cole/mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/core/include/numpy/arrayobject.h", + "/Users/cole/mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/core/include/numpy/arrayscalars.h", + "/Users/cole/mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/core/include/numpy/ndarrayobject.h", + "/Users/cole/mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/core/include/numpy/ndarraytypes.h", + "/Users/cole/mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/core/include/numpy/ufuncobject.h" ], "extra_compile_args": [ "-w", "-Ofast" ], "include_dirs": [ - "/opt/conda/lib/python3.10/site-packages/numpy/core/include" + "/Users/cole/mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/core/include" ], "name": "CRISPResso2.CRISPRessoCOREResources", "sources": [ @@ -50,10 +50,10 @@ END: Cython Metadata */ #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif -#define CYTHON_ABI "3_0_6" __PYX_EXTRA_ABI_MODULE_NAME +#define CYTHON_ABI "3_0_9" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." -#define CYTHON_HEX_VERSION 0x030006F0 +#define CYTHON_HEX_VERSION 0x030009F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof @@ -595,14 +595,14 @@ END: Cython Metadata */ PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 - PyObject *version_info; // borrowed + PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 - minor_version = 11; // we don't yet need to distinguish between versions > 11 + minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; @@ -660,7 +660,7 @@ END: Cython Metadata */ PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; - PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); // we don't have access to __pyx_empty_bytes here + PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 @@ -746,8 +746,13 @@ END: Cython Metadata */ typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else - #define __Pyx_PyCFunctionFast _PyCFunctionFast - #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords + #if PY_VERSION_HEX >= 0x030d00A4 + # define __Pyx_PyCFunctionFast PyCFunctionFast + # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords + #else + # define __Pyx_PyCFunctionFast _PyCFunctionFast + # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords + #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL @@ -1099,7 +1104,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif -#if PY_VERSION_HEX >= 0x030d00A1 +#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { @@ -1186,7 +1191,7 @@ static CYTHON_INLINE float __PYX_NAN() { #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ - { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } + { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } @@ -1300,24 +1305,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) -{ - const wchar_t *u_end = u; - while (*u_end++) ; - return (size_t)(u_end - u - 1); -} -#else -static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) -{ - const Py_UNICODE *u_end = u; - while (*u_end++) ; - return (size_t)(u_end - u - 1); -} -#endif #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) -#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) -#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) @@ -1367,7 +1355,7 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; - #else // Py < 3.12 + #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) @@ -1520,7 +1508,7 @@ static const char *__pyx_f[] = { /* #### Code section: numeric_typedefs ### */ -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":730 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":730 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -1529,7 +1517,7 @@ static const char *__pyx_f[] = { */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":731 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":731 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -1538,7 +1526,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":732 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":732 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -1547,7 +1535,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":733 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":733 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -1556,7 +1544,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":737 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":737 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< @@ -1565,7 +1553,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":738 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":738 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -1574,7 +1562,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":739 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":739 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -1583,7 +1571,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":740 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":740 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -1592,7 +1580,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":744 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":744 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< @@ -1601,7 +1589,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":745 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":745 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -1610,7 +1598,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":754 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":754 * # The int types are mapped a bit surprising -- * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t # <<<<<<<<<<<<<< @@ -1619,7 +1607,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_long __pyx_t_5numpy_int_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":755 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":755 * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< @@ -1628,7 +1616,7 @@ typedef npy_long __pyx_t_5numpy_int_t; */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":757 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":757 * ctypedef npy_longlong longlong_t * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< @@ -1637,7 +1625,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":758 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":758 * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< @@ -1646,7 +1634,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":760 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":760 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -1655,7 +1643,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":761 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":761 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -1664,7 +1652,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":763 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":763 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -1673,7 +1661,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":764 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":764 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -1682,7 +1670,7 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":765 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":765 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< @@ -1719,7 +1707,7 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do /*--- Type declarations ---*/ -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":767 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":767 * ctypedef npy_longdouble longdouble_t * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< @@ -1728,7 +1716,7 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":768 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":768 * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< @@ -1737,7 +1725,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":769 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":769 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< @@ -1746,7 +1734,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":771 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":771 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< @@ -1961,8 +1949,8 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else - #define __Pyx_Arg_NewRef_VARARGS(arg) arg // no-op - #define __Pyx_Arg_XDECREF_VARARGS(arg) // no-op - arg is borrowed + #define __Pyx_Arg_NewRef_VARARGS(arg) arg + #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL @@ -1978,8 +1966,9 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif - #define __Pyx_Arg_NewRef_FASTCALL(arg) arg // no-op, __Pyx_Arg_FASTCALL is direct and this needs - #define __Pyx_Arg_XDECREF_FASTCALL(arg) // no-op - arg was returned from array + #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs + to have the same reference counting */ + #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS @@ -2214,22 +2203,22 @@ static CYTHON_INLINE int __Pyx_IterFinish(void); static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* TypeImport.proto */ -#ifndef __PYX_HAVE_RT_ImportType_proto_3_0_6 -#define __PYX_HAVE_RT_ImportType_proto_3_0_6 +#ifndef __PYX_HAVE_RT_ImportType_proto_3_0_9 +#define __PYX_HAVE_RT_ImportType_proto_3_0_9 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L -#define __PYX_GET_STRUCT_ALIGNMENT_3_0_6(s) alignof(s) +#define __PYX_GET_STRUCT_ALIGNMENT_3_0_9(s) alignof(s) #else -#define __PYX_GET_STRUCT_ALIGNMENT_3_0_6(s) sizeof(void*) +#define __PYX_GET_STRUCT_ALIGNMENT_3_0_9(s) sizeof(void*) #endif -enum __Pyx_ImportType_CheckSize_3_0_6 { - __Pyx_ImportType_CheckSize_Error_3_0_6 = 0, - __Pyx_ImportType_CheckSize_Warn_3_0_6 = 1, - __Pyx_ImportType_CheckSize_Ignore_3_0_6 = 2 +enum __Pyx_ImportType_CheckSize_3_0_9 { + __Pyx_ImportType_CheckSize_Error_3_0_9 = 0, + __Pyx_ImportType_CheckSize_Warn_3_0_9 = 1, + __Pyx_ImportType_CheckSize_Ignore_3_0_9 = 2 }; -static PyTypeObject *__Pyx_ImportType_3_0_6(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_6 check_size); +static PyTypeObject *__Pyx_ImportType_3_0_9(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_9 check_size); #endif /* Import.proto */ @@ -2350,7 +2339,7 @@ typedef struct { #endif void *defaults; int defaults_pyobjects; - size_t defaults_size; // used by FusedFunction for copying defaults + size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; @@ -2747,6 +2736,7 @@ static const char __pyx_k_substitution_positions[] = "substitution_positions"; static const char __pyx_k_ResultsSlotsDict___init[] = "ResultsSlotsDict.__init__"; static const char __pyx_k_all_insertion_positions[] = "all_insertion_positions"; static const char __pyx_k_all_substitution_values[] = "all_substitution_values"; +static const char __pyx_k_all_deletion_coordinates[] = "all_deletion_coordinates"; static const char __pyx_k_find_indels_substitutions[] = "find_indels_substitutions"; static const char __pyx_k_ResultsSlotsDict___getitem[] = "ResultsSlotsDict.__getitem__"; static const char __pyx_k_ResultsSlotsDict___setitem[] = "ResultsSlotsDict.__setitem__"; @@ -2848,6 +2838,8 @@ typedef struct { PyObject *__pyx_n_s__4; PyObject *__pyx_n_s_a; PyObject *__pyx_n_s_al; + PyObject *__pyx_n_s_all_deletion_coordinates; + PyObject *__pyx_n_u_all_deletion_coordinates; PyObject *__pyx_n_s_all_deletion_positions; PyObject *__pyx_n_u_all_deletion_positions; PyObject *__pyx_n_s_all_insertion_left_positions; @@ -3056,6 +3048,8 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s__4); Py_CLEAR(clear_module_state->__pyx_n_s_a); Py_CLEAR(clear_module_state->__pyx_n_s_al); + Py_CLEAR(clear_module_state->__pyx_n_s_all_deletion_coordinates); + Py_CLEAR(clear_module_state->__pyx_n_u_all_deletion_coordinates); Py_CLEAR(clear_module_state->__pyx_n_s_all_deletion_positions); Py_CLEAR(clear_module_state->__pyx_n_u_all_deletion_positions); Py_CLEAR(clear_module_state->__pyx_n_s_all_insertion_left_positions); @@ -3242,6 +3236,8 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s__4); Py_VISIT(traverse_module_state->__pyx_n_s_a); Py_VISIT(traverse_module_state->__pyx_n_s_al); + Py_VISIT(traverse_module_state->__pyx_n_s_all_deletion_coordinates); + Py_VISIT(traverse_module_state->__pyx_n_u_all_deletion_coordinates); Py_VISIT(traverse_module_state->__pyx_n_s_all_deletion_positions); Py_VISIT(traverse_module_state->__pyx_n_u_all_deletion_positions); Py_VISIT(traverse_module_state->__pyx_n_s_all_insertion_left_positions); @@ -3458,6 +3454,8 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s__4 __pyx_mstate_global->__pyx_n_s__4 #define __pyx_n_s_a __pyx_mstate_global->__pyx_n_s_a #define __pyx_n_s_al __pyx_mstate_global->__pyx_n_s_al +#define __pyx_n_s_all_deletion_coordinates __pyx_mstate_global->__pyx_n_s_all_deletion_coordinates +#define __pyx_n_u_all_deletion_coordinates __pyx_mstate_global->__pyx_n_u_all_deletion_coordinates #define __pyx_n_s_all_deletion_positions __pyx_mstate_global->__pyx_n_s_all_deletion_positions #define __pyx_n_u_all_deletion_positions __pyx_mstate_global->__pyx_n_u_all_deletion_positions #define __pyx_n_s_all_insertion_left_positions __pyx_mstate_global->__pyx_n_s_all_insertion_left_positions @@ -3592,7 +3590,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19 /* #### Code section: module_code ### */ -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":245 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":245 * * @property * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<< @@ -3603,7 +3601,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self) { PyObject *__pyx_r; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":248 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":248 * """Returns a borrowed reference to the object owning the data/memory. * """ * return PyArray_BASE(self) # <<<<<<<<<<<<<< @@ -3613,7 +3611,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject __pyx_r = PyArray_BASE(__pyx_v_self); goto __pyx_L0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":245 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":245 * * @property * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<< @@ -3626,7 +3624,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":251 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":251 * * @property * cdef inline dtype descr(self): # <<<<<<<<<<<<<< @@ -3640,7 +3638,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray PyArray_Descr *__pyx_t_1; __Pyx_RefNannySetupContext("descr", 1); - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":254 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":254 * """Returns an owned reference to the dtype of the array. * """ * return PyArray_DESCR(self) # <<<<<<<<<<<<<< @@ -3653,7 +3651,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray __pyx_r = ((PyArray_Descr *)__pyx_t_1); goto __pyx_L0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":251 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":251 * * @property * cdef inline dtype descr(self): # <<<<<<<<<<<<<< @@ -3668,7 +3666,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":257 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":257 * * @property * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<< @@ -3679,7 +3677,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self) { int __pyx_r; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":260 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":260 * """Returns the number of dimensions in the array. * """ * return PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -3689,7 +3687,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx __pyx_r = PyArray_NDIM(__pyx_v_self); goto __pyx_L0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":257 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":257 * * @property * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<< @@ -3702,7 +3700,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":263 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":263 * * @property * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<< @@ -3713,7 +3711,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self) { npy_intp *__pyx_r; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":268 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":268 * Can return NULL for 0-dimensional arrays. * """ * return PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -3723,7 +3721,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObjec __pyx_r = PyArray_DIMS(__pyx_v_self); goto __pyx_L0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":263 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":263 * * @property * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<< @@ -3736,7 +3734,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObjec return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":271 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":271 * * @property * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<< @@ -3747,7 +3745,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObjec static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self) { npy_intp *__pyx_r; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":275 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":275 * The number of elements matches the number of dimensions of the array (ndim). * """ * return PyArray_STRIDES(self) # <<<<<<<<<<<<<< @@ -3757,7 +3755,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO __pyx_r = PyArray_STRIDES(__pyx_v_self); goto __pyx_L0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":271 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":271 * * @property * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<< @@ -3770,7 +3768,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":278 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":278 * * @property * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<< @@ -3781,7 +3779,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self) { npy_intp __pyx_r; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":281 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":281 * """Returns the total size (in number of elements) of the array. * """ * return PyArray_SIZE(self) # <<<<<<<<<<<<<< @@ -3791,7 +3789,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject * __pyx_r = PyArray_SIZE(__pyx_v_self); goto __pyx_L0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":278 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":278 * * @property * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<< @@ -3804,7 +3802,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject * return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":284 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":284 * * @property * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<< @@ -3815,7 +3813,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject * static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self) { char *__pyx_r; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":290 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":290 * of `PyArray_DATA()` instead, which returns a 'void*'. * """ * return PyArray_BYTES(self) # <<<<<<<<<<<<<< @@ -3825,7 +3823,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__p __pyx_r = PyArray_BYTES(__pyx_v_self); goto __pyx_L0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":284 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":284 * * @property * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<< @@ -3838,7 +3836,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__p return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":773 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":773 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -3855,7 +3853,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 1); - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":774 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":774 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -3869,7 +3867,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":773 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":773 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -3888,7 +3886,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":776 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":776 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -3905,7 +3903,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 1); - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":777 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":777 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -3919,7 +3917,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":776 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":776 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -3938,7 +3936,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":779 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":779 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -3955,7 +3953,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 1); - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":780 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":780 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -3969,7 +3967,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":779 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":779 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -3988,7 +3986,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":782 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":782 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -4005,7 +4003,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 1); - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":783 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":783 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -4019,7 +4017,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":782 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":782 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -4038,7 +4036,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":785 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":785 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -4055,7 +4053,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 1); - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":786 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":786 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -4069,7 +4067,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":785 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":785 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -4088,7 +4086,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":788 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":788 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -4102,7 +4100,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ int __pyx_t_1; __Pyx_RefNannySetupContext("PyDataType_SHAPE", 1); - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":789 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":789 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -4112,7 +4110,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d); if (__pyx_t_1) { - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":790 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":790 * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape # <<<<<<<<<<<<<< @@ -4124,7 +4122,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); goto __pyx_L0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":789 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":789 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -4133,7 +4131,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ */ } - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":792 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":792 * return d.subarray.shape * else: * return () # <<<<<<<<<<<<<< @@ -4147,7 +4145,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ goto __pyx_L0; } - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":788 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":788 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -4162,7 +4160,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":968 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":968 * int _import_umath() except -1 * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -4176,7 +4174,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a const char *__pyx_filename = NULL; int __pyx_clineno = 0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":969 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":969 * * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<< @@ -4185,7 +4183,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_INCREF(__pyx_v_base); - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":970 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":970 * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<< @@ -4194,7 +4192,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 970, __pyx_L1_error) - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":968 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":968 * int _import_umath() except -1 * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -4209,7 +4207,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __pyx_L0:; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":972 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":972 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -4224,7 +4222,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 1); - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":973 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":973 * * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) # <<<<<<<<<<<<<< @@ -4233,7 +4231,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ __pyx_v_base = PyArray_BASE(__pyx_v_arr); - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":974 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":974 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -4243,7 +4241,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = (__pyx_v_base == NULL); if (__pyx_t_1) { - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":975 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":975 * base = PyArray_BASE(arr) * if base is NULL: * return None # <<<<<<<<<<<<<< @@ -4254,7 +4252,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":974 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":974 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -4263,7 +4261,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ } - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":976 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":976 * if base is NULL: * return None * return base # <<<<<<<<<<<<<< @@ -4275,7 +4273,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = ((PyObject *)__pyx_v_base); goto __pyx_L0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":972 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":972 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -4290,7 +4288,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":980 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":980 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -4314,7 +4312,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_array", 1); - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":981 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":981 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -4330,7 +4328,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":982 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":982 * cdef inline int import_array() except -1: * try: * __pyx_import_array() # <<<<<<<<<<<<<< @@ -4339,7 +4337,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { */ __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 982, __pyx_L3_error) - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":981 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":981 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -4353,7 +4351,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":983 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":983 * try: * __pyx_import_array() * except Exception: # <<<<<<<<<<<<<< @@ -4368,7 +4366,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":984 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":984 * __pyx_import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< @@ -4383,7 +4381,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { } goto __pyx_L5_except_error; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":981 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":981 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -4399,7 +4397,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_L8_try_end:; } - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":980 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":980 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -4422,7 +4420,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":986 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":986 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -4446,7 +4444,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_umath", 1); - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":987 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":987 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -4462,7 +4460,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":988 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":988 * cdef inline int import_umath() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -4471,7 +4469,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { */ __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 988, __pyx_L3_error) - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":987 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":987 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -4485,7 +4483,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":989 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":989 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -4500,7 +4498,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":990 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":990 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -4515,7 +4513,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { } goto __pyx_L5_except_error; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":987 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":987 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -4531,7 +4529,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_L8_try_end:; } - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":986 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":986 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -4554,7 +4552,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":992 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":992 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -4578,7 +4576,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_ufunc", 1); - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":993 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":993 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -4594,7 +4592,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":994 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":994 * cdef inline int import_ufunc() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -4603,7 +4601,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { */ __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 994, __pyx_L3_error) - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":993 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":993 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -4617,7 +4615,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":995 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":995 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -4632,7 +4630,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":996 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":996 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -4647,7 +4645,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { } goto __pyx_L5_except_error; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":993 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":993 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -4663,7 +4661,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_L8_try_end:; } - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":992 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":992 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -4686,7 +4684,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":999 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":999 * * * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< @@ -4697,7 +4695,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) { int __pyx_r; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1011 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1011 * bool * """ * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<< @@ -4707,7 +4705,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type)); goto __pyx_L0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":999 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":999 * * * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< @@ -4720,7 +4718,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1014 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1014 * * * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< @@ -4731,7 +4729,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) { int __pyx_r; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1026 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1026 * bool * """ * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<< @@ -4741,7 +4739,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type)); goto __pyx_L0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1014 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1014 * * * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< @@ -4754,7 +4752,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1029 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1029 * * * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -4765,7 +4763,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) { npy_datetime __pyx_r; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1036 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1036 * also needed. That can be found using `get_datetime64_unit`. * """ * return (obj).obval # <<<<<<<<<<<<<< @@ -4775,7 +4773,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1029 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1029 * * * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -4788,7 +4786,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1039 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1039 * * * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -4799,7 +4797,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) { npy_timedelta __pyx_r; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1043 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1043 * returns the int64 value underlying scalar numpy timedelta64 object * """ * return (obj).obval # <<<<<<<<<<<<<< @@ -4809,7 +4807,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1039 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1039 * * * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -4822,7 +4820,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1046 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1046 * * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< @@ -4833,7 +4831,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) { NPY_DATETIMEUNIT __pyx_r; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1050 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1050 * returns the unit part of the dtype for a numpy datetime64 object. * """ * return (obj).obmeta.base # <<<<<<<<<<<<<< @@ -4841,7 +4839,7 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base); goto __pyx_L0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1046 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1046 * * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< @@ -4854,59 +4852,44 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec return __pyx_r; } -/* "CRISPResso2/CRISPRessoCOREResources.pyx":43 - * ) +/* "CRISPResso2/CRISPRessoCOREResources.pyx":18 + * re_find_indels = re.compile("(-*-)") * - * def __init__( # <<<<<<<<<<<<<< - * self, - * all_insertion_positions, + * @cython.boundscheck(False) # <<<<<<<<<<<<<< + * @cython.nonecheck(False) + * @cython.wraparound(False) */ /* Python wrapper */ -static PyObject *__pyx_pw_11CRISPResso2_23CRISPRessoCOREResources_16ResultsSlotsDict_1__init__(PyObject *__pyx_self, +static PyObject *__pyx_pw_11CRISPResso2_23CRISPRessoCOREResources_1find_indels_substitutions(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_11CRISPResso2_23CRISPRessoCOREResources_16ResultsSlotsDict_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11CRISPResso2_23CRISPRessoCOREResources_16ResultsSlotsDict_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_11CRISPResso2_23CRISPRessoCOREResources_16ResultsSlotsDict_1__init__(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_11CRISPResso2_23CRISPRessoCOREResources_1find_indels_substitutions = {"find_indels_substitutions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11CRISPResso2_23CRISPRessoCOREResources_1find_indels_substitutions, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_11CRISPResso2_23CRISPRessoCOREResources_1find_indels_substitutions(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { - PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_all_insertion_positions = 0; - PyObject *__pyx_v_all_insertion_left_positions = 0; - PyObject *__pyx_v_insertion_positions = 0; - PyObject *__pyx_v_insertion_coordinates = 0; - PyObject *__pyx_v_insertion_sizes = 0; - PyObject *__pyx_v_insertion_n = 0; - PyObject *__pyx_v_all_deletion_positions = 0; - PyObject *__pyx_v_deletion_positions = 0; - PyObject *__pyx_v_deletion_coordinates = 0; - PyObject *__pyx_v_deletion_sizes = 0; - PyObject *__pyx_v_deletion_n = 0; - PyObject *__pyx_v_all_substitution_positions = 0; - PyObject *__pyx_v_substitution_positions = 0; - PyObject *__pyx_v_all_substitution_values = 0; - PyObject *__pyx_v_substitution_values = 0; - PyObject *__pyx_v_substitution_n = 0; - PyObject *__pyx_v_ref_positions = 0; + PyObject *__pyx_v_read_seq_al = 0; + PyObject *__pyx_v_ref_seq_al = 0; + PyObject *__pyx_v__include_indx = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[18] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + __Pyx_RefNannySetupContext("find_indels_substitutions (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -4916,40 +4899,10 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_all_insertion_positions,&__pyx_n_s_all_insertion_left_positions,&__pyx_n_s_insertion_positions,&__pyx_n_s_insertion_coordinates,&__pyx_n_s_insertion_sizes,&__pyx_n_s_insertion_n,&__pyx_n_s_all_deletion_positions,&__pyx_n_s_deletion_positions,&__pyx_n_s_deletion_coordinates,&__pyx_n_s_deletion_sizes,&__pyx_n_s_deletion_n,&__pyx_n_s_all_substitution_positions,&__pyx_n_s_substitution_positions,&__pyx_n_s_all_substitution_values,&__pyx_n_s_substitution_values,&__pyx_n_s_substitution_n,&__pyx_n_s_ref_positions,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_read_seq_al,&__pyx_n_s_ref_seq_al,&__pyx_n_s_include_indx,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 18: values[17] = __Pyx_Arg_FASTCALL(__pyx_args, 17); - CYTHON_FALLTHROUGH; - case 17: values[16] = __Pyx_Arg_FASTCALL(__pyx_args, 16); - CYTHON_FALLTHROUGH; - case 16: values[15] = __Pyx_Arg_FASTCALL(__pyx_args, 15); - CYTHON_FALLTHROUGH; - case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); - CYTHON_FALLTHROUGH; - case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); - CYTHON_FALLTHROUGH; - case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); - CYTHON_FALLTHROUGH; - case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); - CYTHON_FALLTHROUGH; - case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); - CYTHON_FALLTHROUGH; - case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); - CYTHON_FALLTHROUGH; - case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); - CYTHON_FALLTHROUGH; - case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); - CYTHON_FALLTHROUGH; - case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); - CYTHON_FALLTHROUGH; - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); - CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); @@ -4962,231 +4915,51 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_read_seq_al)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 18, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_all_insertion_positions)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ref_seq_al)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 18, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 18, 18, 1); __PYX_ERR(0, 43, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("find_indels_substitutions", 1, 3, 3, 1); __PYX_ERR(0, 18, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_all_insertion_left_positions)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_include_indx)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 18, 18, 2); __PYX_ERR(0, 43, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_insertion_positions)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 18, 18, 3); __PYX_ERR(0, 43, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_insertion_coordinates)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 18, 18, 4); __PYX_ERR(0, 43, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 5: - if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_insertion_sizes)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 18, 18, 5); __PYX_ERR(0, 43, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 6: - if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_insertion_n)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 18, 18, 6); __PYX_ERR(0, 43, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 7: - if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_all_deletion_positions)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[7]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 18, 18, 7); __PYX_ERR(0, 43, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 8: - if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_deletion_positions)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[8]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 18, 18, 8); __PYX_ERR(0, 43, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 9: - if (likely((values[9] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_deletion_coordinates)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[9]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 18, 18, 9); __PYX_ERR(0, 43, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 10: - if (likely((values[10] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_deletion_sizes)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[10]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 18, 18, 10); __PYX_ERR(0, 43, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 11: - if (likely((values[11] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_deletion_n)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[11]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 18, 18, 11); __PYX_ERR(0, 43, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 12: - if (likely((values[12] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_all_substitution_positions)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[12]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 18, 18, 12); __PYX_ERR(0, 43, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 13: - if (likely((values[13] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_substitution_positions)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[13]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 18, 18, 13); __PYX_ERR(0, 43, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 14: - if (likely((values[14] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_all_substitution_values)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[14]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 18, 18, 14); __PYX_ERR(0, 43, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 15: - if (likely((values[15] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_substitution_values)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[15]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 18, 18, 15); __PYX_ERR(0, 43, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 16: - if (likely((values[16] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_substitution_n)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[16]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 18, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 18, 18, 16); __PYX_ERR(0, 43, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 17: - if (likely((values[17] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ref_positions)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[17]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 18, 18, 17); __PYX_ERR(0, 43, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("find_indels_substitutions", 1, 3, 3, 2); __PYX_ERR(0, 18, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 43, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "find_indels_substitutions") < 0)) __PYX_ERR(0, 18, __pyx_L3_error) } - } else if (unlikely(__pyx_nargs != 18)) { + } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); - values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); - values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); - values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); - values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); - values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); - values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); - values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); - values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); - values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); - values[15] = __Pyx_Arg_FASTCALL(__pyx_args, 15); - values[16] = __Pyx_Arg_FASTCALL(__pyx_args, 16); - values[17] = __Pyx_Arg_FASTCALL(__pyx_args, 17); - } - __pyx_v_self = values[0]; - __pyx_v_all_insertion_positions = values[1]; - __pyx_v_all_insertion_left_positions = values[2]; - __pyx_v_insertion_positions = values[3]; - __pyx_v_insertion_coordinates = values[4]; - __pyx_v_insertion_sizes = values[5]; - __pyx_v_insertion_n = values[6]; - __pyx_v_all_deletion_positions = values[7]; - __pyx_v_deletion_positions = values[8]; - __pyx_v_deletion_coordinates = values[9]; - __pyx_v_deletion_sizes = values[10]; - __pyx_v_deletion_n = values[11]; - __pyx_v_all_substitution_positions = values[12]; - __pyx_v_substitution_positions = values[13]; - __pyx_v_all_substitution_values = values[14]; - __pyx_v_substitution_values = values[15]; - __pyx_v_substitution_n = values[16]; - __pyx_v_ref_positions = values[17]; + } + __pyx_v_read_seq_al = values[0]; + __pyx_v_ref_seq_al = values[1]; + __pyx_v__include_indx = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 18, 18, __pyx_nargs); __PYX_ERR(0, 43, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("find_indels_substitutions", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 18, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5196,11 +4969,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("CRISPResso2.CRISPRessoCOREResources.ResultsSlotsDict.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("CRISPResso2.CRISPRessoCOREResources.find_indels_substitutions", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_16ResultsSlotsDict___init__(__pyx_self, __pyx_v_self, __pyx_v_all_insertion_positions, __pyx_v_all_insertion_left_positions, __pyx_v_insertion_positions, __pyx_v_insertion_coordinates, __pyx_v_insertion_sizes, __pyx_v_insertion_n, __pyx_v_all_deletion_positions, __pyx_v_deletion_positions, __pyx_v_deletion_coordinates, __pyx_v_deletion_sizes, __pyx_v_deletion_n, __pyx_v_all_substitution_positions, __pyx_v_substitution_positions, __pyx_v_all_substitution_values, __pyx_v_substitution_values, __pyx_v_substitution_n, __pyx_v_ref_positions); + __pyx_r = __pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_find_indels_substitutions(__pyx_self, __pyx_v_read_seq_al, __pyx_v_ref_seq_al, __pyx_v__include_indx); /* function exit code */ { @@ -5213,850 +4986,161 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_16ResultsSlotsDict___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_all_insertion_positions, PyObject *__pyx_v_all_insertion_left_positions, PyObject *__pyx_v_insertion_positions, PyObject *__pyx_v_insertion_coordinates, PyObject *__pyx_v_insertion_sizes, PyObject *__pyx_v_insertion_n, PyObject *__pyx_v_all_deletion_positions, PyObject *__pyx_v_deletion_positions, PyObject *__pyx_v_deletion_coordinates, PyObject *__pyx_v_deletion_sizes, PyObject *__pyx_v_deletion_n, PyObject *__pyx_v_all_substitution_positions, PyObject *__pyx_v_substitution_positions, PyObject *__pyx_v_all_substitution_values, PyObject *__pyx_v_substitution_values, PyObject *__pyx_v_substitution_n, PyObject *__pyx_v_ref_positions) { +static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_find_indels_substitutions(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_read_seq_al, PyObject *__pyx_v_ref_seq_al, PyObject *__pyx_v__include_indx) { + PyObject *__pyx_v_ref_positions = NULL; + PyObject *__pyx_v_all_substitution_positions = NULL; + PyObject *__pyx_v_substitution_positions = NULL; + PyObject *__pyx_v_all_substitution_values = NULL; + PyObject *__pyx_v_substitution_values = NULL; + PyObject *__pyx_v_all_deletion_positions = NULL; + PyObject *__pyx_v_all_deletion_coordinates = NULL; + PyObject *__pyx_v_deletion_positions = NULL; + PyObject *__pyx_v_deletion_coordinates = NULL; + PyObject *__pyx_v_deletion_sizes = NULL; + int __pyx_v_start_deletion; + PyObject *__pyx_v_all_insertion_positions = NULL; + PyObject *__pyx_v_all_insertion_left_positions = NULL; + PyObject *__pyx_v_insertion_positions = NULL; + PyObject *__pyx_v_insertion_coordinates = NULL; + PyObject *__pyx_v_insertion_sizes = NULL; + int __pyx_v_start_insertion; + size_t __pyx_v_seq_len; + PyObject *__pyx_v_include_indx_set = NULL; + CYTHON_UNUSED PyObject *__pyx_v_nucSet = NULL; + int __pyx_v_idx; + int __pyx_v_idx_c; + int __pyx_v_current_insertion_size; + PyObject *__pyx_v_c = NULL; + PyObject *__pyx_v_end_deletion = NULL; + size_t __pyx_v_substitution_n; + size_t __pyx_v_deletion_n; + size_t __pyx_v_insertion_n; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_t_11; + size_t __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":63 - * ref_positions - * ): - * self.all_insertion_positions = all_insertion_positions # <<<<<<<<<<<<<< - * self.all_insertion_left_positions = all_insertion_left_positions - * self.insertion_positions = insertion_positions - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_all_insertion_positions, __pyx_v_all_insertion_positions) < 0) __PYX_ERR(0, 63, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":64 - * ): - * self.all_insertion_positions = all_insertion_positions - * self.all_insertion_left_positions = all_insertion_left_positions # <<<<<<<<<<<<<< - * self.insertion_positions = insertion_positions - * self.insertion_coordinates = insertion_coordinates - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_all_insertion_left_positions, __pyx_v_all_insertion_left_positions) < 0) __PYX_ERR(0, 64, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":65 - * self.all_insertion_positions = all_insertion_positions - * self.all_insertion_left_positions = all_insertion_left_positions - * self.insertion_positions = insertion_positions # <<<<<<<<<<<<<< - * self.insertion_coordinates = insertion_coordinates - * self.insertion_sizes = insertion_sizes - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_insertion_positions, __pyx_v_insertion_positions) < 0) __PYX_ERR(0, 65, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":66 - * self.all_insertion_left_positions = all_insertion_left_positions - * self.insertion_positions = insertion_positions - * self.insertion_coordinates = insertion_coordinates # <<<<<<<<<<<<<< - * self.insertion_sizes = insertion_sizes - * self.insertion_n = insertion_n - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_insertion_coordinates, __pyx_v_insertion_coordinates) < 0) __PYX_ERR(0, 66, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":67 - * self.insertion_positions = insertion_positions - * self.insertion_coordinates = insertion_coordinates - * self.insertion_sizes = insertion_sizes # <<<<<<<<<<<<<< - * self.insertion_n = insertion_n - * self.all_deletion_positions = all_deletion_positions - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_insertion_sizes, __pyx_v_insertion_sizes) < 0) __PYX_ERR(0, 67, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":68 - * self.insertion_coordinates = insertion_coordinates - * self.insertion_sizes = insertion_sizes - * self.insertion_n = insertion_n # <<<<<<<<<<<<<< - * self.all_deletion_positions = all_deletion_positions - * self.deletion_positions = deletion_positions - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_insertion_n, __pyx_v_insertion_n) < 0) __PYX_ERR(0, 68, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":69 - * self.insertion_sizes = insertion_sizes - * self.insertion_n = insertion_n - * self.all_deletion_positions = all_deletion_positions # <<<<<<<<<<<<<< - * self.deletion_positions = deletion_positions - * self.deletion_coordinates = deletion_coordinates - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_all_deletion_positions, __pyx_v_all_deletion_positions) < 0) __PYX_ERR(0, 69, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":70 - * self.insertion_n = insertion_n - * self.all_deletion_positions = all_deletion_positions - * self.deletion_positions = deletion_positions # <<<<<<<<<<<<<< - * self.deletion_coordinates = deletion_coordinates - * self.deletion_sizes = deletion_sizes - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_deletion_positions, __pyx_v_deletion_positions) < 0) __PYX_ERR(0, 70, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":71 - * self.all_deletion_positions = all_deletion_positions - * self.deletion_positions = deletion_positions - * self.deletion_coordinates = deletion_coordinates # <<<<<<<<<<<<<< - * self.deletion_sizes = deletion_sizes - * self.deletion_n = deletion_n - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_deletion_coordinates, __pyx_v_deletion_coordinates) < 0) __PYX_ERR(0, 71, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":72 - * self.deletion_positions = deletion_positions - * self.deletion_coordinates = deletion_coordinates - * self.deletion_sizes = deletion_sizes # <<<<<<<<<<<<<< - * self.deletion_n = deletion_n - * self.all_substitution_positions = all_substitution_positions - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_deletion_sizes, __pyx_v_deletion_sizes) < 0) __PYX_ERR(0, 72, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":73 - * self.deletion_coordinates = deletion_coordinates - * self.deletion_sizes = deletion_sizes - * self.deletion_n = deletion_n # <<<<<<<<<<<<<< - * self.all_substitution_positions = all_substitution_positions - * self.substitution_positions = substitution_positions - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_deletion_n, __pyx_v_deletion_n) < 0) __PYX_ERR(0, 73, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":74 - * self.deletion_sizes = deletion_sizes - * self.deletion_n = deletion_n - * self.all_substitution_positions = all_substitution_positions # <<<<<<<<<<<<<< - * self.substitution_positions = substitution_positions - * self.all_substitution_values = all_substitution_values - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_all_substitution_positions, __pyx_v_all_substitution_positions) < 0) __PYX_ERR(0, 74, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":75 - * self.deletion_n = deletion_n - * self.all_substitution_positions = all_substitution_positions - * self.substitution_positions = substitution_positions # <<<<<<<<<<<<<< - * self.all_substitution_values = all_substitution_values - * self.substitution_values = substitution_values - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_substitution_positions, __pyx_v_substitution_positions) < 0) __PYX_ERR(0, 75, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":76 - * self.all_substitution_positions = all_substitution_positions - * self.substitution_positions = substitution_positions - * self.all_substitution_values = all_substitution_values # <<<<<<<<<<<<<< - * self.substitution_values = substitution_values - * self.substitution_n = substitution_n - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_all_substitution_values, __pyx_v_all_substitution_values) < 0) __PYX_ERR(0, 76, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":77 - * self.substitution_positions = substitution_positions - * self.all_substitution_values = all_substitution_values - * self.substitution_values = substitution_values # <<<<<<<<<<<<<< - * self.substitution_n = substitution_n - * self.ref_positions = ref_positions - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_substitution_values, __pyx_v_substitution_values) < 0) __PYX_ERR(0, 77, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":78 - * self.all_substitution_values = all_substitution_values - * self.substitution_values = substitution_values - * self.substitution_n = substitution_n # <<<<<<<<<<<<<< - * self.ref_positions = ref_positions - * self.ref_name = None - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_substitution_n, __pyx_v_substitution_n) < 0) __PYX_ERR(0, 78, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":79 - * self.substitution_values = substitution_values - * self.substitution_n = substitution_n - * self.ref_positions = ref_positions # <<<<<<<<<<<<<< - * self.ref_name = None - * self.aln_scores = None - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ref_positions, __pyx_v_ref_positions) < 0) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_RefNannySetupContext("find_indels_substitutions", 1); - /* "CRISPResso2/CRISPRessoCOREResources.pyx":80 - * self.substitution_n = substitution_n - * self.ref_positions = ref_positions - * self.ref_name = None # <<<<<<<<<<<<<< - * self.aln_scores = None - * self.classification = None + /* "CRISPResso2/CRISPRessoCOREResources.pyx":32 + * # aln A - T T T G G C C + * # 1 2 3 4-4 5 6 7 8 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__getitem__") < 0)) __PYX_ERR(0, 87, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 2)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - } - __pyx_v_self = values[0]; - __pyx_v_key = values[1]; - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 87, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("CRISPResso2.CRISPRessoCOREResources.ResultsSlotsDict.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_16ResultsSlotsDict_2__getitem__(__pyx_self, __pyx_v_self, __pyx_v_key); - - /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_16ResultsSlotsDict_2__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__getitem__", 1); - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":88 - * - * def __getitem__(self, key): - * return getattr(self, key) # <<<<<<<<<<<<<< - * - * def __setitem__(self, key, value): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetAttr(__pyx_v_self, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":87 - * self.aln_strand = None - * - * def __getitem__(self, key): # <<<<<<<<<<<<<< - * return getattr(self, key) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("CRISPResso2.CRISPRessoCOREResources.ResultsSlotsDict.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "CRISPResso2/CRISPRessoCOREResources.pyx":90 - * return getattr(self, key) - * - * def __setitem__(self, key, value): # <<<<<<<<<<<<<< - * setattr(self, key, value) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_11CRISPResso2_23CRISPRessoCOREResources_16ResultsSlotsDict_5__setitem__(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -static PyMethodDef __pyx_mdef_11CRISPResso2_23CRISPRessoCOREResources_16ResultsSlotsDict_5__setitem__ = {"__setitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11CRISPResso2_23CRISPRessoCOREResources_16ResultsSlotsDict_5__setitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_11CRISPResso2_23CRISPRessoCOREResources_16ResultsSlotsDict_5__setitem__(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_key = 0; - PyObject *__pyx_v_value = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[3] = {0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_value,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_key)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 90, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 90, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setitem__") < 0)) __PYX_ERR(0, 90, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 3)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - } - __pyx_v_self = values[0]; - __pyx_v_key = values[1]; - __pyx_v_value = values[2]; - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 90, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("CRISPResso2.CRISPRessoCOREResources.ResultsSlotsDict.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_16ResultsSlotsDict_4__setitem__(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_value); - - /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_16ResultsSlotsDict_4__setitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__setitem__", 1); - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":91 - * - * def __setitem__(self, key, value): - * setattr(self, key, value) # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_1 = PyObject_SetAttr(__pyx_v_self, __pyx_v_key, __pyx_v_value); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 91, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":90 - * return getattr(self, key) - * - * def __setitem__(self, key, value): # <<<<<<<<<<<<<< - * setattr(self, key, value) - * - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("CRISPResso2.CRISPRessoCOREResources.ResultsSlotsDict.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "CRISPResso2/CRISPRessoCOREResources.pyx":96 - * re_find_indels = re.compile("(-*-)") - * - * @cython.boundscheck(False) # <<<<<<<<<<<<<< - * @cython.nonecheck(False) - * @cython.wraparound(False) - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_11CRISPResso2_23CRISPRessoCOREResources_1find_indels_substitutions(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -static PyMethodDef __pyx_mdef_11CRISPResso2_23CRISPRessoCOREResources_1find_indels_substitutions = {"find_indels_substitutions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11CRISPResso2_23CRISPRessoCOREResources_1find_indels_substitutions, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_11CRISPResso2_23CRISPRessoCOREResources_1find_indels_substitutions(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_read_seq_al = 0; - PyObject *__pyx_v_ref_seq_al = 0; - PyObject *__pyx_v__include_indx = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[3] = {0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("find_indels_substitutions (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_read_seq_al,&__pyx_n_s_ref_seq_al,&__pyx_n_s_include_indx,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_read_seq_al)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ref_seq_al)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("find_indels_substitutions", 1, 3, 3, 1); __PYX_ERR(0, 96, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_include_indx)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("find_indels_substitutions", 1, 3, 3, 2); __PYX_ERR(0, 96, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "find_indels_substitutions") < 0)) __PYX_ERR(0, 96, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 3)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - } - __pyx_v_read_seq_al = values[0]; - __pyx_v_ref_seq_al = values[1]; - __pyx_v__include_indx = values[2]; - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("find_indels_substitutions", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 96, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("CRISPResso2.CRISPRessoCOREResources.find_indels_substitutions", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_find_indels_substitutions(__pyx_self, __pyx_v_read_seq_al, __pyx_v_ref_seq_al, __pyx_v__include_indx); - - /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_find_indels_substitutions(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_read_seq_al, PyObject *__pyx_v_ref_seq_al, PyObject *__pyx_v__include_indx) { - PyObject *__pyx_v_ref_positions = NULL; - PyObject *__pyx_v_all_substitution_positions = NULL; - PyObject *__pyx_v_substitution_positions = NULL; - PyObject *__pyx_v_all_substitution_values = NULL; - PyObject *__pyx_v_substitution_values = NULL; - PyObject *__pyx_v_all_deletion_positions = NULL; - PyObject *__pyx_v_deletion_positions = NULL; - PyObject *__pyx_v_deletion_coordinates = NULL; - PyObject *__pyx_v_deletion_sizes = NULL; - int __pyx_v_start_deletion; - PyObject *__pyx_v_all_insertion_positions = NULL; - PyObject *__pyx_v_all_insertion_left_positions = NULL; - PyObject *__pyx_v_insertion_positions = NULL; - PyObject *__pyx_v_insertion_coordinates = NULL; - PyObject *__pyx_v_insertion_sizes = NULL; - int __pyx_v_start_insertion; - size_t __pyx_v_seq_len; - PyObject *__pyx_v_include_indx_set = NULL; - CYTHON_UNUSED PyObject *__pyx_v_nucSet = NULL; - int __pyx_v_idx; - int __pyx_v_idx_c; - int __pyx_v_current_insertion_size; - PyObject *__pyx_v_c = NULL; - PyObject *__pyx_v_end_deletion = NULL; - size_t __pyx_v_substitution_n; - size_t __pyx_v_deletion_n; - size_t __pyx_v_insertion_n; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - int __pyx_t_3; - PyObject *(*__pyx_t_4)(PyObject *); - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; - int __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - int __pyx_t_10; - int __pyx_t_11; - size_t __pyx_t_12; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("find_indels_substitutions", 1); - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":110 - * # aln A - T T T G G C C - * # 1 2 3 4-4 5 6 7 8 = __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 135, __pyx_L1_error) #else - __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 135, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 58, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 135, __pyx_L1_error) #else - __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } @@ -6493,9 +5577,9 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_find_indels_su __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9)) __PYX_ERR(0, 149, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9)) __PYX_ERR(0, 72, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_8)) __PYX_ERR(0, 149, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_8)) __PYX_ERR(0, 72, __pyx_L1_error); __pyx_t_9 = 0; __pyx_t_8 = 0; __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_insertion_coordinates, __pyx_t_5); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 149, __pyx_L1_error) @@ -6783,7 +5867,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_find_indels_su * elif read_seq_al[idx_c] != '-' and start_deletion != -1: # this is the end of a deletion * end_deletion = ref_positions[idx_c] # <<<<<<<<<<<<<< * all_deletion_positions.extend(range(start_deletion, end_deletion)) - * if include_indx_set.intersection(range(start_deletion, end_deletion)): + * all_deletion_coordinates.append((start_deletion, end_deletion)) */ __pyx_t_5 = PyList_GET_ITEM(__pyx_v_ref_positions, __pyx_v_idx_c); __Pyx_INCREF(__pyx_t_5); @@ -6794,18 +5878,18 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_find_indels_su * elif read_seq_al[idx_c] != '-' and start_deletion != -1: # this is the end of a deletion * end_deletion = ref_positions[idx_c] * all_deletion_positions.extend(range(start_deletion, end_deletion)) # <<<<<<<<<<<<<< + * all_deletion_coordinates.append((start_deletion, end_deletion)) * if include_indx_set.intersection(range(start_deletion, end_deletion)): - * deletion_positions.extend(range(start_deletion, end_deletion)) */ __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_start_deletion); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5)) __PYX_ERR(0, 172, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5)) __PYX_ERR(0, 95, __pyx_L1_error); __Pyx_INCREF(__pyx_v_end_deletion); __Pyx_GIVEREF(__pyx_v_end_deletion); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_end_deletion)) __PYX_ERR(0, 172, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_end_deletion)) __PYX_ERR(0, 95, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); @@ -6816,98 +5900,118 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_find_indels_su /* "CRISPResso2/CRISPRessoCOREResources.pyx":173 * end_deletion = ref_positions[idx_c] * all_deletion_positions.extend(range(start_deletion, end_deletion)) - * if include_indx_set.intersection(range(start_deletion, end_deletion)): # <<<<<<<<<<<<<< + * all_deletion_coordinates.append((start_deletion, end_deletion)) # <<<<<<<<<<<<<< + * if include_indx_set.intersection(range(start_deletion, end_deletion)): * deletion_positions.extend(range(start_deletion, end_deletion)) - * deletion_coordinates.append((start_deletion, end_deletion)) */ __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_start_deletion); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5)) __PYX_ERR(0, 173, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5)) __PYX_ERR(0, 96, __pyx_L1_error); __Pyx_INCREF(__pyx_v_end_deletion); __Pyx_GIVEREF(__pyx_v_end_deletion); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_end_deletion)) __PYX_ERR(0, 173, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_end_deletion)) __PYX_ERR(0, 96, __pyx_L1_error); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 173, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_all_deletion_coordinates, __pyx_t_8); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_intersection, __pyx_v_include_indx_set, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 173, __pyx_L1_error) + + /* "CRISPResso2/CRISPRessoCOREResources.pyx":97 + * all_deletion_positions.extend(range(start_deletion, end_deletion)) + * all_deletion_coordinates.append((start_deletion, end_deletion)) + * if include_indx_set.intersection(range(start_deletion, end_deletion)): # <<<<<<<<<<<<<< + * deletion_positions.extend(range(start_deletion, end_deletion)) + * deletion_coordinates.append((start_deletion, end_deletion)) + */ + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_start_deletion); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_8); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8)) __PYX_ERR(0, 97, __pyx_L1_error); + __Pyx_INCREF(__pyx_v_end_deletion); + __Pyx_GIVEREF(__pyx_v_end_deletion); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_end_deletion)) __PYX_ERR(0, 97, __pyx_L1_error); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_5, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 173, __pyx_L1_error) + __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_intersection, __pyx_v_include_indx_set, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { - /* "CRISPResso2/CRISPRessoCOREResources.pyx":174 - * all_deletion_positions.extend(range(start_deletion, end_deletion)) + /* "CRISPResso2/CRISPRessoCOREResources.pyx":98 + * all_deletion_coordinates.append((start_deletion, end_deletion)) * if include_indx_set.intersection(range(start_deletion, end_deletion)): * deletion_positions.extend(range(start_deletion, end_deletion)) # <<<<<<<<<<<<<< * deletion_coordinates.append((start_deletion, end_deletion)) * deletion_sizes.append(end_deletion - start_deletion) */ - __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_start_deletion); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 174, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_start_deletion); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8)) __PYX_ERR(0, 174, __pyx_L1_error); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_5); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5)) __PYX_ERR(0, 98, __pyx_L1_error); __Pyx_INCREF(__pyx_v_end_deletion); __Pyx_GIVEREF(__pyx_v_end_deletion); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_end_deletion)) __PYX_ERR(0, 174, __pyx_L1_error); - __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_5, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_7 = __Pyx_PyList_Extend(__pyx_v_deletion_positions, __pyx_t_8); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 174, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_end_deletion)) __PYX_ERR(0, 98, __pyx_L1_error); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_7 = __Pyx_PyList_Extend(__pyx_v_deletion_positions, __pyx_t_5); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":175 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":99 * if include_indx_set.intersection(range(start_deletion, end_deletion)): * deletion_positions.extend(range(start_deletion, end_deletion)) * deletion_coordinates.append((start_deletion, end_deletion)) # <<<<<<<<<<<<<< * deletion_sizes.append(end_deletion - start_deletion) * start_deletion = -1 */ - __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_start_deletion); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 175, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_start_deletion); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8)) __PYX_ERR(0, 175, __pyx_L1_error); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 99, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_5); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5)) __PYX_ERR(0, 99, __pyx_L1_error); __Pyx_INCREF(__pyx_v_end_deletion); __Pyx_GIVEREF(__pyx_v_end_deletion); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_end_deletion)) __PYX_ERR(0, 175, __pyx_L1_error); - __pyx_t_8 = 0; - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_deletion_coordinates, __pyx_t_5); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 175, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_end_deletion)) __PYX_ERR(0, 99, __pyx_L1_error); + __pyx_t_5 = 0; + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_deletion_coordinates, __pyx_t_8); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 99, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":176 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":100 * deletion_positions.extend(range(start_deletion, end_deletion)) * deletion_coordinates.append((start_deletion, end_deletion)) * deletion_sizes.append(end_deletion - start_deletion) # <<<<<<<<<<<<<< * start_deletion = -1 * */ - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_start_deletion); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 176, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = PyNumber_Subtract(__pyx_v_end_deletion, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 176, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_start_deletion); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_deletion_sizes, __pyx_t_8); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 176, __pyx_L1_error) + __pyx_t_5 = PyNumber_Subtract(__pyx_v_end_deletion, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_deletion_sizes, __pyx_t_5); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":173 - * end_deletion = ref_positions[idx_c] + /* "CRISPResso2/CRISPRessoCOREResources.pyx":97 * all_deletion_positions.extend(range(start_deletion, end_deletion)) + * all_deletion_coordinates.append((start_deletion, end_deletion)) * if include_indx_set.intersection(range(start_deletion, end_deletion)): # <<<<<<<<<<<<<< * deletion_positions.extend(range(start_deletion, end_deletion)) * deletion_coordinates.append((start_deletion, end_deletion)) */ } - /* "CRISPResso2/CRISPRessoCOREResources.pyx":177 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":101 * deletion_coordinates.append((start_deletion, end_deletion)) * deletion_sizes.append(end_deletion - start_deletion) * start_deletion = -1 # <<<<<<<<<<<<<< @@ -6936,7 +6040,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_find_indels_su } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":179 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":103 * start_deletion = -1 * * if start_deletion != -1: # <<<<<<<<<<<<<< @@ -6946,12 +6050,12 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_find_indels_su __pyx_t_6 = (__pyx_v_start_deletion != -1L); if (__pyx_t_6) { - /* "CRISPResso2/CRISPRessoCOREResources.pyx":180 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":104 * * if start_deletion != -1: * end_deletion = ref_positions[seq_len - 1] # <<<<<<<<<<<<<< * all_deletion_positions.extend(range(start_deletion, end_deletion)) - * if include_indx_set.intersection(range(start_deletion, end_deletion)): + * all_deletion_coordinates.append((start_deletion, end_deletion)) */ __pyx_t_12 = (__pyx_v_seq_len - 1); __pyx_t_1 = PyList_GET_ITEM(__pyx_v_ref_positions, __pyx_t_12); @@ -6959,124 +6063,144 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_find_indels_su __Pyx_XDECREF_SET(__pyx_v_end_deletion, __pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":181 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":105 * if start_deletion != -1: * end_deletion = ref_positions[seq_len - 1] * all_deletion_positions.extend(range(start_deletion, end_deletion)) # <<<<<<<<<<<<<< + * all_deletion_coordinates.append((start_deletion, end_deletion)) * if include_indx_set.intersection(range(start_deletion, end_deletion)): - * deletion_positions.extend(range(start_deletion, end_deletion)) */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_start_deletion); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_start_deletion); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 181, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error); __Pyx_INCREF(__pyx_v_end_deletion); __Pyx_GIVEREF(__pyx_v_end_deletion); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_end_deletion)) __PYX_ERR(0, 181, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_end_deletion)) __PYX_ERR(0, 105, __pyx_L1_error); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_7 = __Pyx_PyList_Extend(__pyx_v_all_deletion_positions, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7 = __Pyx_PyList_Extend(__pyx_v_all_deletion_positions, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":182 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":106 * end_deletion = ref_positions[seq_len - 1] * all_deletion_positions.extend(range(start_deletion, end_deletion)) - * if include_indx_set.intersection(range(start_deletion, end_deletion)): # <<<<<<<<<<<<<< + * all_deletion_coordinates.append((start_deletion, end_deletion)) # <<<<<<<<<<<<<< + * if include_indx_set.intersection(range(start_deletion, end_deletion)): * deletion_positions.extend(range(start_deletion, end_deletion)) - * deletion_coordinates.append((start_deletion, end_deletion)) */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_start_deletion); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_start_deletion); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 182, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error); __Pyx_INCREF(__pyx_v_end_deletion); __Pyx_GIVEREF(__pyx_v_end_deletion); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_end_deletion)) __PYX_ERR(0, 182, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_end_deletion)) __PYX_ERR(0, 106, __pyx_L1_error); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_all_deletion_coordinates, __pyx_t_5); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 106, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "CRISPResso2/CRISPRessoCOREResources.pyx":107 + * all_deletion_positions.extend(range(start_deletion, end_deletion)) + * all_deletion_coordinates.append((start_deletion, end_deletion)) + * if include_indx_set.intersection(range(start_deletion, end_deletion)): # <<<<<<<<<<<<<< + * deletion_positions.extend(range(start_deletion, end_deletion)) + * deletion_coordinates.append((start_deletion, end_deletion)) + */ + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_start_deletion); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_intersection, __pyx_v_include_indx_set, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 182, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_5); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5)) __PYX_ERR(0, 107, __pyx_L1_error); + __Pyx_INCREF(__pyx_v_end_deletion); + __Pyx_GIVEREF(__pyx_v_end_deletion); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_end_deletion)) __PYX_ERR(0, 107, __pyx_L1_error); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_intersection, __pyx_v_include_indx_set, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 182, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_6) { - /* "CRISPResso2/CRISPRessoCOREResources.pyx":183 - * all_deletion_positions.extend(range(start_deletion, end_deletion)) + /* "CRISPResso2/CRISPRessoCOREResources.pyx":108 + * all_deletion_coordinates.append((start_deletion, end_deletion)) * if include_indx_set.intersection(range(start_deletion, end_deletion)): * deletion_positions.extend(range(start_deletion, end_deletion)) # <<<<<<<<<<<<<< * deletion_coordinates.append((start_deletion, end_deletion)) * deletion_sizes.append(end_deletion - start_deletion) */ - __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_start_deletion); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 183, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_start_deletion); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8)) __PYX_ERR(0, 183, __pyx_L1_error); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 108, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error); __Pyx_INCREF(__pyx_v_end_deletion); __Pyx_GIVEREF(__pyx_v_end_deletion); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_end_deletion)) __PYX_ERR(0, 183, __pyx_L1_error); - __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 183, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_end_deletion)) __PYX_ERR(0, 108, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7 = __Pyx_PyList_Extend(__pyx_v_deletion_positions, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __Pyx_PyList_Extend(__pyx_v_deletion_positions, __pyx_t_8); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 183, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":184 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":109 * if include_indx_set.intersection(range(start_deletion, end_deletion)): * deletion_positions.extend(range(start_deletion, end_deletion)) * deletion_coordinates.append((start_deletion, end_deletion)) # <<<<<<<<<<<<<< * deletion_sizes.append(end_deletion - start_deletion) * */ - __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_start_deletion); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 184, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_start_deletion); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8)) __PYX_ERR(0, 184, __pyx_L1_error); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error); __Pyx_INCREF(__pyx_v_end_deletion); __Pyx_GIVEREF(__pyx_v_end_deletion); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_end_deletion)) __PYX_ERR(0, 184, __pyx_L1_error); - __pyx_t_8 = 0; - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_deletion_coordinates, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 184, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_end_deletion)) __PYX_ERR(0, 109, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_deletion_coordinates, __pyx_t_5); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":185 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":110 * deletion_positions.extend(range(start_deletion, end_deletion)) * deletion_coordinates.append((start_deletion, end_deletion)) * deletion_sizes.append(end_deletion - start_deletion) # <<<<<<<<<<<<<< * * cdef size_t substitution_n = len(substitution_positions) */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_start_deletion); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_start_deletion); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyNumber_Subtract(__pyx_v_end_deletion, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = PyNumber_Subtract(__pyx_v_end_deletion, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 185, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_deletion_sizes, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_deletion_sizes, __pyx_t_8); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 185, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":182 - * end_deletion = ref_positions[seq_len - 1] + /* "CRISPResso2/CRISPRessoCOREResources.pyx":107 * all_deletion_positions.extend(range(start_deletion, end_deletion)) + * all_deletion_coordinates.append((start_deletion, end_deletion)) * if include_indx_set.intersection(range(start_deletion, end_deletion)): # <<<<<<<<<<<<<< * deletion_positions.extend(range(start_deletion, end_deletion)) * deletion_coordinates.append((start_deletion, end_deletion)) */ } - /* "CRISPResso2/CRISPRessoCOREResources.pyx":179 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":103 * start_deletion = -1 * * if start_deletion != -1: # <<<<<<<<<<<<<< @@ -7085,44 +6209,44 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_find_indels_su */ } - /* "CRISPResso2/CRISPRessoCOREResources.pyx":187 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":112 * deletion_sizes.append(end_deletion - start_deletion) * * cdef size_t substitution_n = len(substitution_positions) # <<<<<<<<<<<<<< * cdef size_t deletion_n = sum(deletion_sizes) * cdef size_t insertion_n = sum(insertion_sizes) */ - __pyx_t_2 = __Pyx_PyList_GET_SIZE(__pyx_v_substitution_positions); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyList_GET_SIZE(__pyx_v_substitution_positions); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 112, __pyx_L1_error) __pyx_v_substitution_n = __pyx_t_2; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":188 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":113 * * cdef size_t substitution_n = len(substitution_positions) * cdef size_t deletion_n = sum(deletion_sizes) # <<<<<<<<<<<<<< * cdef size_t insertion_n = sum(insertion_sizes) * */ - __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_v_deletion_sizes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 188, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_12 = __Pyx_PyInt_As_size_t(__pyx_t_8); if (unlikely((__pyx_t_12 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 188, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_v_deletion_sizes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_12 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_12 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 113, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_deletion_n = __pyx_t_12; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":189 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":114 * cdef size_t substitution_n = len(substitution_positions) * cdef size_t deletion_n = sum(deletion_sizes) * cdef size_t insertion_n = sum(insertion_sizes) # <<<<<<<<<<<<<< * * # return ResultsSlotsDict( */ - __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_v_insertion_sizes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 189, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_12 = __Pyx_PyInt_As_size_t(__pyx_t_8); if (unlikely((__pyx_t_12 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 189, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_v_insertion_sizes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_12 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_12 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_insertion_n = __pyx_t_12; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":214 - * # ) + /* "CRISPResso2/CRISPRessoCOREResources.pyx":116 + * cdef size_t insertion_n = sum(insertion_sizes) * * return { # <<<<<<<<<<<<<< * 'all_insertion_positions': all_insertion_positions, @@ -7130,151 +6254,160 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_find_indels_su */ __Pyx_XDECREF(__pyx_r); - /* "CRISPResso2/CRISPRessoCOREResources.pyx":215 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":117 * * return { * 'all_insertion_positions': all_insertion_positions, # <<<<<<<<<<<<<< * 'all_insertion_left_positions': all_insertion_left_positions, * 'insertion_positions': insertion_positions, */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(17); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 215, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_u_all_insertion_positions, __pyx_v_all_insertion_positions) < 0) __PYX_ERR(0, 215, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(18); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_all_insertion_positions, __pyx_v_all_insertion_positions) < 0) __PYX_ERR(0, 117, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":216 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":118 * return { * 'all_insertion_positions': all_insertion_positions, * 'all_insertion_left_positions': all_insertion_left_positions, # <<<<<<<<<<<<<< * 'insertion_positions': insertion_positions, * 'insertion_coordinates': insertion_coordinates, */ - if (PyDict_SetItem(__pyx_t_8, __pyx_n_u_all_insertion_left_positions, __pyx_v_all_insertion_left_positions) < 0) __PYX_ERR(0, 215, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_all_insertion_left_positions, __pyx_v_all_insertion_left_positions) < 0) __PYX_ERR(0, 117, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":217 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":119 * 'all_insertion_positions': all_insertion_positions, * 'all_insertion_left_positions': all_insertion_left_positions, * 'insertion_positions': insertion_positions, # <<<<<<<<<<<<<< * 'insertion_coordinates': insertion_coordinates, * 'insertion_sizes': insertion_sizes, */ - if (PyDict_SetItem(__pyx_t_8, __pyx_n_u_insertion_positions, __pyx_v_insertion_positions) < 0) __PYX_ERR(0, 215, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_insertion_positions, __pyx_v_insertion_positions) < 0) __PYX_ERR(0, 117, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":218 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":120 * 'all_insertion_left_positions': all_insertion_left_positions, * 'insertion_positions': insertion_positions, * 'insertion_coordinates': insertion_coordinates, # <<<<<<<<<<<<<< * 'insertion_sizes': insertion_sizes, * 'insertion_n': insertion_n, */ - if (PyDict_SetItem(__pyx_t_8, __pyx_n_u_insertion_coordinates, __pyx_v_insertion_coordinates) < 0) __PYX_ERR(0, 215, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_insertion_coordinates, __pyx_v_insertion_coordinates) < 0) __PYX_ERR(0, 117, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":219 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":121 * 'insertion_positions': insertion_positions, * 'insertion_coordinates': insertion_coordinates, * 'insertion_sizes': insertion_sizes, # <<<<<<<<<<<<<< * 'insertion_n': insertion_n, * */ - if (PyDict_SetItem(__pyx_t_8, __pyx_n_u_insertion_sizes, __pyx_v_insertion_sizes) < 0) __PYX_ERR(0, 215, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_insertion_sizes, __pyx_v_insertion_sizes) < 0) __PYX_ERR(0, 117, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":220 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":122 * 'insertion_coordinates': insertion_coordinates, * 'insertion_sizes': insertion_sizes, * 'insertion_n': insertion_n, # <<<<<<<<<<<<<< * * 'all_deletion_positions': all_deletion_positions, */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_insertion_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_u_insertion_n, __pyx_t_1) < 0) __PYX_ERR(0, 215, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_insertion_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 122, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_insertion_n, __pyx_t_5) < 0) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":222 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":124 * 'insertion_n': insertion_n, * * 'all_deletion_positions': all_deletion_positions, # <<<<<<<<<<<<<< + * 'all_deletion_coordinates': all_deletion_coordinates, * 'deletion_positions': deletion_positions, - * 'deletion_coordinates': deletion_coordinates, */ - if (PyDict_SetItem(__pyx_t_8, __pyx_n_u_all_deletion_positions, __pyx_v_all_deletion_positions) < 0) __PYX_ERR(0, 215, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_all_deletion_positions, __pyx_v_all_deletion_positions) < 0) __PYX_ERR(0, 117, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":223 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":125 * * 'all_deletion_positions': all_deletion_positions, + * 'all_deletion_coordinates': all_deletion_coordinates, # <<<<<<<<<<<<<< + * 'deletion_positions': deletion_positions, + * 'deletion_coordinates': deletion_coordinates, + */ + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_all_deletion_coordinates, __pyx_v_all_deletion_coordinates) < 0) __PYX_ERR(0, 117, __pyx_L1_error) + + /* "CRISPResso2/CRISPRessoCOREResources.pyx":126 + * 'all_deletion_positions': all_deletion_positions, + * 'all_deletion_coordinates': all_deletion_coordinates, * 'deletion_positions': deletion_positions, # <<<<<<<<<<<<<< * 'deletion_coordinates': deletion_coordinates, * 'deletion_sizes': deletion_sizes, */ - if (PyDict_SetItem(__pyx_t_8, __pyx_n_u_deletion_positions, __pyx_v_deletion_positions) < 0) __PYX_ERR(0, 215, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_deletion_positions, __pyx_v_deletion_positions) < 0) __PYX_ERR(0, 117, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":224 - * 'all_deletion_positions': all_deletion_positions, + /* "CRISPResso2/CRISPRessoCOREResources.pyx":127 + * 'all_deletion_coordinates': all_deletion_coordinates, * 'deletion_positions': deletion_positions, * 'deletion_coordinates': deletion_coordinates, # <<<<<<<<<<<<<< * 'deletion_sizes': deletion_sizes, * 'deletion_n': deletion_n, */ - if (PyDict_SetItem(__pyx_t_8, __pyx_n_u_deletion_coordinates, __pyx_v_deletion_coordinates) < 0) __PYX_ERR(0, 215, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_deletion_coordinates, __pyx_v_deletion_coordinates) < 0) __PYX_ERR(0, 117, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":225 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":128 * 'deletion_positions': deletion_positions, * 'deletion_coordinates': deletion_coordinates, * 'deletion_sizes': deletion_sizes, # <<<<<<<<<<<<<< * 'deletion_n': deletion_n, * */ - if (PyDict_SetItem(__pyx_t_8, __pyx_n_u_deletion_sizes, __pyx_v_deletion_sizes) < 0) __PYX_ERR(0, 215, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_deletion_sizes, __pyx_v_deletion_sizes) < 0) __PYX_ERR(0, 117, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":226 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":129 * 'deletion_coordinates': deletion_coordinates, * 'deletion_sizes': deletion_sizes, * 'deletion_n': deletion_n, # <<<<<<<<<<<<<< * * 'all_substitution_positions': all_substitution_positions, */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_deletion_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_u_deletion_n, __pyx_t_1) < 0) __PYX_ERR(0, 215, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_deletion_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_deletion_n, __pyx_t_5) < 0) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":228 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":131 * 'deletion_n': deletion_n, * * 'all_substitution_positions': all_substitution_positions, # <<<<<<<<<<<<<< * 'substitution_positions': substitution_positions, * 'all_substitution_values': np.array(all_substitution_values), */ - if (PyDict_SetItem(__pyx_t_8, __pyx_n_u_all_substitution_positions, __pyx_v_all_substitution_positions) < 0) __PYX_ERR(0, 215, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_all_substitution_positions, __pyx_v_all_substitution_positions) < 0) __PYX_ERR(0, 117, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":229 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":132 * * 'all_substitution_positions': all_substitution_positions, * 'substitution_positions': substitution_positions, # <<<<<<<<<<<<<< * 'all_substitution_values': np.array(all_substitution_values), * 'substitution_values': np.array(substitution_values), */ - if (PyDict_SetItem(__pyx_t_8, __pyx_n_u_substitution_positions, __pyx_v_substitution_positions) < 0) __PYX_ERR(0, 215, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_substitution_positions, __pyx_v_substitution_positions) < 0) __PYX_ERR(0, 117, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":230 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":133 * 'all_substitution_positions': all_substitution_positions, * 'substitution_positions': substitution_positions, * 'all_substitution_values': np.array(all_substitution_values), # <<<<<<<<<<<<<< * 'substitution_values': np.array(substitution_values), * 'substitution_n': substitution_n, */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 230, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_array); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 230, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_array); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = NULL; __pyx_t_3 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_5)) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9); + if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_3 = 1; @@ -7282,78 +6415,78 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_find_indels_su } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_all_substitution_values}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_3, 1+__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_all_substitution_values}; + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_3, 1+__pyx_t_3); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } - if (PyDict_SetItem(__pyx_t_8, __pyx_n_u_all_substitution_values, __pyx_t_1) < 0) __PYX_ERR(0, 215, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_all_substitution_values, __pyx_t_5) < 0) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":231 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":134 * 'substitution_positions': substitution_positions, * 'all_substitution_values': np.array(all_substitution_values), * 'substitution_values': np.array(substitution_values), # <<<<<<<<<<<<<< * 'substitution_n': substitution_n, - * + * 'ref_positions': ref_positions, */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 231, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 231, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_array); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; __pyx_t_3 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5); + if (unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); + __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_3 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_substitution_values}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_3, 1+__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_3, 1+__pyx_t_3); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - if (PyDict_SetItem(__pyx_t_8, __pyx_n_u_substitution_values, __pyx_t_1) < 0) __PYX_ERR(0, 215, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_substitution_values, __pyx_t_5) < 0) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":232 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":135 * 'all_substitution_values': np.array(all_substitution_values), * 'substitution_values': np.array(substitution_values), * 'substitution_n': substitution_n, # <<<<<<<<<<<<<< - * * 'ref_positions': ref_positions, + * } */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_substitution_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_u_substitution_n, __pyx_t_1) < 0) __PYX_ERR(0, 215, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_substitution_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 135, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_substitution_n, __pyx_t_5) < 0) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":234 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":136 + * 'substitution_values': np.array(substitution_values), * 'substitution_n': substitution_n, - * * 'ref_positions': ref_positions, # <<<<<<<<<<<<<< * } - * + * @cython.boundscheck(False) */ - if (PyDict_SetItem(__pyx_t_8, __pyx_n_u_ref_positions, __pyx_v_ref_positions) < 0) __PYX_ERR(0, 215, __pyx_L1_error) - __pyx_r = __pyx_t_8; - __pyx_t_8 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_ref_positions, __pyx_v_ref_positions) < 0) __PYX_ERR(0, 117, __pyx_L1_error) + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":96 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":18 * re_find_indels = re.compile("(-*-)") * * @cython.boundscheck(False) # <<<<<<<<<<<<<< @@ -7376,6 +6509,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_find_indels_su __Pyx_XDECREF(__pyx_v_all_substitution_values); __Pyx_XDECREF(__pyx_v_substitution_values); __Pyx_XDECREF(__pyx_v_all_deletion_positions); + __Pyx_XDECREF(__pyx_v_all_deletion_coordinates); __Pyx_XDECREF(__pyx_v_deletion_positions); __Pyx_XDECREF(__pyx_v_deletion_coordinates); __Pyx_XDECREF(__pyx_v_deletion_sizes); @@ -7393,9 +6527,9 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_find_indels_su return __pyx_r; } -/* "CRISPResso2/CRISPRessoCOREResources.pyx":238 - * - * +/* "CRISPResso2/CRISPRessoCOREResources.pyx":138 + * 'ref_positions': ref_positions, + * } * @cython.boundscheck(False) # <<<<<<<<<<<<<< * @cython.nonecheck(False) * @cython.wraparound(False) @@ -7460,7 +6594,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 138, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -7468,7 +6602,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 138, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("find_indels_substitutions_legacy", 1, 3, 3, 1); __PYX_ERR(0, 238, __pyx_L3_error) } @@ -7478,7 +6612,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 138, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("find_indels_substitutions_legacy", 1, 3, 3, 2); __PYX_ERR(0, 238, __pyx_L3_error) } @@ -7500,7 +6634,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("find_indels_substitutions_legacy", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 238, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("find_indels_substitutions_legacy", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 138, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -7580,7 +6714,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("find_indels_substitutions_legacy", 1); - /* "CRISPResso2/CRISPRessoCOREResources.pyx":243 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":145 * def find_indels_substitutions_legacy(read_seq_al, ref_seq_al, _include_indx): * * cdef char* sub_seq='' # <<<<<<<<<<<<<< @@ -7589,85 +6723,85 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s */ __pyx_v_sub_seq = ((char *)""); - /* "CRISPResso2/CRISPRessoCOREResources.pyx":260 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":162 * # aln A - T T T G G C C * # 1 2 3 4-4 5 6 7 8 = __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 268, __pyx_L1_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 169, __pyx_L1_error) #else - __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 268, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 169, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 268, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 169, __pyx_L1_error) #else - __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } @@ -7729,7 +6863,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 268, __pyx_L1_error) + else __PYX_ERR(0, 169, __pyx_L1_error) } break; } @@ -7740,128 +6874,128 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __pyx_v_idx_c = __pyx_t_2; __pyx_t_2 = (__pyx_t_2 + 1); - /* "CRISPResso2/CRISPRessoCOREResources.pyx":269 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":170 * idx=0 * for idx_c, c in enumerate(ref_seq_al): * if c in nucSet: # <<<<<<<<<<<<<< * ref_positions.append(idx) * if ref_seq_al[idx_c]!=read_seq_al[idx_c] and read_seq_al[idx_c] != '-' and read_seq_al[idx_c] != 'N': */ - __pyx_t_6 = (__Pyx_PySet_ContainsTF(__pyx_v_c, __pyx_v_nucSet, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 269, __pyx_L1_error) + __pyx_t_6 = (__Pyx_PySet_ContainsTF(__pyx_v_c, __pyx_v_nucSet, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 170, __pyx_L1_error) if (__pyx_t_6) { - /* "CRISPResso2/CRISPRessoCOREResources.pyx":270 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":171 * for idx_c, c in enumerate(ref_seq_al): * if c in nucSet: * ref_positions.append(idx) # <<<<<<<<<<<<<< * if ref_seq_al[idx_c]!=read_seq_al[idx_c] and read_seq_al[idx_c] != '-' and read_seq_al[idx_c] != 'N': * all_substitution_positions.append(idx) */ - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 270, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_ref_positions, __pyx_t_5); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 270, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_ref_positions, __pyx_t_5); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":271 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":172 * if c in nucSet: * ref_positions.append(idx) * if ref_seq_al[idx_c]!=read_seq_al[idx_c] and read_seq_al[idx_c] != '-' and read_seq_al[idx_c] != 'N': # <<<<<<<<<<<<<< * all_substitution_positions.append(idx) * all_substitution_values.append(read_seq_al[idx_c]) */ - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_ref_seq_al, __pyx_v_idx_c, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_ref_seq_al, __pyx_v_idx_c, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_read_seq_al, __pyx_v_idx_c, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_read_seq_al, __pyx_v_idx_c, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = PyObject_RichCompare(__pyx_t_5, __pyx_t_8, Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_9 = PyObject_RichCompare(__pyx_t_5, __pyx_t_8, Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_10) { } else { __pyx_t_6 = __pyx_t_10; goto __pyx_L7_bool_binop_done; } - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_read_seq_al, __pyx_v_idx_c, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_read_seq_al, __pyx_v_idx_c, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_t_9, __pyx_kp_u__3, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_t_9, __pyx_kp_u__3, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_10) { } else { __pyx_t_6 = __pyx_t_10; goto __pyx_L7_bool_binop_done; } - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_read_seq_al, __pyx_v_idx_c, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_read_seq_al, __pyx_v_idx_c, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_t_9, __pyx_n_u_N, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_t_9, __pyx_n_u_N, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_6 = __pyx_t_10; __pyx_L7_bool_binop_done:; if (__pyx_t_6) { - /* "CRISPResso2/CRISPRessoCOREResources.pyx":272 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":173 * ref_positions.append(idx) * if ref_seq_al[idx_c]!=read_seq_al[idx_c] and read_seq_al[idx_c] != '-' and read_seq_al[idx_c] != 'N': * all_substitution_positions.append(idx) # <<<<<<<<<<<<<< * all_substitution_values.append(read_seq_al[idx_c]) * if idx in _include_indx: */ - __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 272, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_all_substitution_positions, __pyx_t_9); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 272, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_all_substitution_positions, __pyx_t_9); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 173, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":273 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":174 * if ref_seq_al[idx_c]!=read_seq_al[idx_c] and read_seq_al[idx_c] != '-' and read_seq_al[idx_c] != 'N': * all_substitution_positions.append(idx) * all_substitution_values.append(read_seq_al[idx_c]) # <<<<<<<<<<<<<< * if idx in _include_indx: * substitution_positions.append(idx) */ - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_read_seq_al, __pyx_v_idx_c, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_read_seq_al, __pyx_v_idx_c, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_all_substitution_values, __pyx_t_9); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_all_substitution_values, __pyx_t_9); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":274 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":175 * all_substitution_positions.append(idx) * all_substitution_values.append(read_seq_al[idx_c]) * if idx in _include_indx: # <<<<<<<<<<<<<< * substitution_positions.append(idx) * substitution_values.append(read_seq_al[idx_c]) */ - __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 274, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_t_9, __pyx_v__include_indx, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 274, __pyx_L1_error) + __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_t_9, __pyx_v__include_indx, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_6) { - /* "CRISPResso2/CRISPRessoCOREResources.pyx":275 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":176 * all_substitution_values.append(read_seq_al[idx_c]) * if idx in _include_indx: * substitution_positions.append(idx) # <<<<<<<<<<<<<< * substitution_values.append(read_seq_al[idx_c]) * */ - __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_substitution_positions, __pyx_t_9); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_substitution_positions, __pyx_t_9); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":276 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":177 * if idx in _include_indx: * substitution_positions.append(idx) * substitution_values.append(read_seq_al[idx_c]) # <<<<<<<<<<<<<< * * idx+=1 */ - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_read_seq_al, __pyx_v_idx_c, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 276, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_read_seq_al, __pyx_v_idx_c, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_substitution_values, __pyx_t_9); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 276, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_substitution_values, __pyx_t_9); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":274 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":175 * all_substitution_positions.append(idx) * all_substitution_values.append(read_seq_al[idx_c]) * if idx in _include_indx: # <<<<<<<<<<<<<< @@ -7870,7 +7004,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s */ } - /* "CRISPResso2/CRISPRessoCOREResources.pyx":271 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":172 * if c in nucSet: * ref_positions.append(idx) * if ref_seq_al[idx_c]!=read_seq_al[idx_c] and read_seq_al[idx_c] != '-' and read_seq_al[idx_c] != 'N': # <<<<<<<<<<<<<< @@ -7879,7 +7013,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s */ } - /* "CRISPResso2/CRISPRessoCOREResources.pyx":278 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":179 * substitution_values.append(read_seq_al[idx_c]) * * idx+=1 # <<<<<<<<<<<<<< @@ -7888,7 +7022,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s */ __pyx_v_idx = (__pyx_v_idx + 1); - /* "CRISPResso2/CRISPRessoCOREResources.pyx":269 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":170 * idx=0 * for idx_c, c in enumerate(ref_seq_al): * if c in nucSet: # <<<<<<<<<<<<<< @@ -7898,7 +7032,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s goto __pyx_L5; } - /* "CRISPResso2/CRISPRessoCOREResources.pyx":281 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":182 * * else: * if idx==0: # <<<<<<<<<<<<<< @@ -7909,16 +7043,16 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __pyx_t_6 = (__pyx_v_idx == 0); if (__pyx_t_6) { - /* "CRISPResso2/CRISPRessoCOREResources.pyx":282 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":183 * else: * if idx==0: * ref_positions.append(-1) # <<<<<<<<<<<<<< * else: * ref_positions.append(-idx) */ - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_ref_positions, __pyx_int_neg_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 282, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_ref_positions, __pyx_int_neg_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 183, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":281 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":182 * * else: * if idx==0: # <<<<<<<<<<<<<< @@ -7928,7 +7062,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s goto __pyx_L11; } - /* "CRISPResso2/CRISPRessoCOREResources.pyx":284 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":185 * ref_positions.append(-1) * else: * ref_positions.append(-idx) # <<<<<<<<<<<<<< @@ -7936,16 +7070,16 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s * substitution_n = len(substitution_positions) */ /*else*/ { - __pyx_t_9 = __Pyx_PyInt_From_int((-__pyx_v_idx)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 284, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_From_int((-__pyx_v_idx)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_ref_positions, __pyx_t_9); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 284, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_ref_positions, __pyx_t_9); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __pyx_L11:; } __pyx_L5:; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":268 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":169 * nucSet = set(['A', 'T', 'C', 'G', 'N']) * idx=0 * for idx_c, c in enumerate(ref_seq_al): # <<<<<<<<<<<<<< @@ -7955,146 +7089,146 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":286 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":187 * ref_positions.append(-idx) * * substitution_n = len(substitution_positions) # <<<<<<<<<<<<<< * * #the remainder of positions are with reference to the original reference sequence indexes we calculated above */ - __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_v_substitution_positions); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_v_substitution_positions); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 187, __pyx_L1_error) __pyx_v_substitution_n = __pyx_t_3; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":289 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":190 * * #the remainder of positions are with reference to the original reference sequence indexes we calculated above * all_deletion_positions=[] # <<<<<<<<<<<<<< * deletion_positions=[] * deletion_coordinates=[] */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_all_deletion_positions = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":290 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":191 * #the remainder of positions are with reference to the original reference sequence indexes we calculated above * all_deletion_positions=[] * deletion_positions=[] # <<<<<<<<<<<<<< * deletion_coordinates=[] * deletion_sizes=[] */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_deletion_positions = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":291 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":192 * all_deletion_positions=[] * deletion_positions=[] * deletion_coordinates=[] # <<<<<<<<<<<<<< * deletion_sizes=[] * */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_deletion_coordinates = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":292 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":193 * deletion_positions=[] * deletion_coordinates=[] * deletion_sizes=[] # <<<<<<<<<<<<<< * * all_insertion_positions=[] */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_deletion_sizes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":294 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":195 * deletion_sizes=[] * * all_insertion_positions=[] # <<<<<<<<<<<<<< * all_insertion_left_positions=[] * insertion_positions=[] */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 294, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_all_insertion_positions = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":295 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":196 * * all_insertion_positions=[] * all_insertion_left_positions=[] # <<<<<<<<<<<<<< * insertion_positions=[] * insertion_coordinates = [] */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 295, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_all_insertion_left_positions = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":296 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":197 * all_insertion_positions=[] * all_insertion_left_positions=[] * insertion_positions=[] # <<<<<<<<<<<<<< * insertion_coordinates = [] * insertion_sizes=[] */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_insertion_positions = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":297 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":198 * all_insertion_left_positions=[] * insertion_positions=[] * insertion_coordinates = [] # <<<<<<<<<<<<<< * insertion_sizes=[] * */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_insertion_coordinates = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":298 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":199 * insertion_positions=[] * insertion_coordinates = [] * insertion_sizes=[] # <<<<<<<<<<<<<< * * include_indx_set = set(_include_indx) */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_insertion_sizes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":300 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":201 * insertion_sizes=[] * * include_indx_set = set(_include_indx) # <<<<<<<<<<<<<< * for p in re_find_indels.finditer(read_seq_al): * st,en=p.span() */ - __pyx_t_1 = PySet_New(__pyx_v__include_indx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error) + __pyx_t_1 = PySet_New(__pyx_v__include_indx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_include_indx_set = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":301 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":202 * * include_indx_set = set(_include_indx) * for p in re_find_indels.finditer(read_seq_al): # <<<<<<<<<<<<<< * st,en=p.span() * ref_st = 0 */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_re_find_indels); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 301, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_re_find_indels); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_finditer); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_finditer); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; @@ -8115,7 +7249,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_read_seq_al}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_2, 1+__pyx_t_2); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } @@ -8124,9 +7258,9 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 202, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -8135,28 +7269,28 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 301, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 202, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 202, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 301, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 202, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 202, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -8166,7 +7300,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 301, __pyx_L1_error) + else __PYX_ERR(0, 202, __pyx_L1_error) } break; } @@ -8175,14 +7309,14 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __Pyx_XDECREF_SET(__pyx_v_p, __pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":302 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":203 * include_indx_set = set(_include_indx) * for p in re_find_indels.finditer(read_seq_al): * st,en=p.span() # <<<<<<<<<<<<<< * ref_st = 0 * if st-1 > 0: */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s_span); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s_span); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_5 = NULL; __pyx_t_2 = 0; @@ -8202,7 +7336,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_2, 0+__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -8212,7 +7346,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 302, __pyx_L1_error) + __PYX_ERR(0, 203, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -8225,15 +7359,15 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_5); #else - __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); @@ -8241,7 +7375,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __Pyx_GOTREF(__pyx_t_9); index = 1; __pyx_t_5 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_5)) goto __pyx_L15_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(0, 302, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(0, 203, __pyx_L1_error) __pyx_t_12 = NULL; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L16_unpacking_done; @@ -8249,17 +7383,17 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 302, __pyx_L1_error) + __PYX_ERR(0, 203, __pyx_L1_error) __pyx_L16_unpacking_done:; } - __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_st = __pyx_t_2; __pyx_v_en = __pyx_t_13; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":303 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":204 * for p in re_find_indels.finditer(read_seq_al): * st,en=p.span() * ref_st = 0 # <<<<<<<<<<<<<< @@ -8269,7 +7403,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __Pyx_INCREF(__pyx_int_0); __Pyx_XDECREF_SET(__pyx_v_ref_st, __pyx_int_0); - /* "CRISPResso2/CRISPRessoCOREResources.pyx":304 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":205 * st,en=p.span() * ref_st = 0 * if st-1 > 0: # <<<<<<<<<<<<<< @@ -8279,7 +7413,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __pyx_t_6 = ((__pyx_v_st - 1) > 0); if (__pyx_t_6) { - /* "CRISPResso2/CRISPRessoCOREResources.pyx":305 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":206 * ref_st = 0 * if st-1 > 0: * ref_st = ref_positions[st] # <<<<<<<<<<<<<< @@ -8291,7 +7425,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __Pyx_DECREF_SET(__pyx_v_ref_st, __pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":304 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":205 * st,en=p.span() * ref_st = 0 * if st-1 > 0: # <<<<<<<<<<<<<< @@ -8300,30 +7434,30 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s */ } - /* "CRISPResso2/CRISPRessoCOREResources.pyx":306 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":207 * if st-1 > 0: * ref_st = ref_positions[st] * ref_en = idx-1 # <<<<<<<<<<<<<< * if en < len(ref_positions): * ref_en = ref_positions[en] */ - __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_idx - 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_idx - 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_ref_en, __pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":307 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":208 * ref_st = ref_positions[st] * ref_en = idx-1 * if en < len(ref_positions): # <<<<<<<<<<<<<< * ref_en = ref_positions[en] * all_deletion_positions.extend(range(ref_st,ref_en)) */ - __pyx_t_14 = __Pyx_PyList_GET_SIZE(__pyx_v_ref_positions); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 307, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_GET_SIZE(__pyx_v_ref_positions); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 208, __pyx_L1_error) __pyx_t_6 = (__pyx_v_en < __pyx_t_14); if (__pyx_t_6) { - /* "CRISPResso2/CRISPRessoCOREResources.pyx":308 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":209 * ref_en = idx-1 * if en < len(ref_positions): * ref_en = ref_positions[en] # <<<<<<<<<<<<<< @@ -8335,7 +7469,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __Pyx_DECREF_SET(__pyx_v_ref_en, __pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":307 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":208 * ref_st = ref_positions[st] * ref_en = idx-1 * if en < len(ref_positions): # <<<<<<<<<<<<<< @@ -8344,114 +7478,114 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s */ } - /* "CRISPResso2/CRISPRessoCOREResources.pyx":309 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":210 * if en < len(ref_positions): * ref_en = ref_positions[en] * all_deletion_positions.extend(range(ref_st,ref_en)) # <<<<<<<<<<<<<< * inc_del_pos = include_indx_set.intersection(range(ref_st,ref_en)) * if(len(inc_del_pos)>0): */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_ref_st); __Pyx_GIVEREF(__pyx_v_ref_st); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_ref_st)) __PYX_ERR(0, 309, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_ref_st)) __PYX_ERR(0, 210, __pyx_L1_error); __Pyx_INCREF(__pyx_v_ref_en); __Pyx_GIVEREF(__pyx_v_ref_en); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref_en)) __PYX_ERR(0, 309, __pyx_L1_error); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 309, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref_en)) __PYX_ERR(0, 210, __pyx_L1_error); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __Pyx_PyList_Extend(__pyx_v_all_deletion_positions, __pyx_t_5); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Extend(__pyx_v_all_deletion_positions, __pyx_t_5); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":310 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":211 * ref_en = ref_positions[en] * all_deletion_positions.extend(range(ref_st,ref_en)) * inc_del_pos = include_indx_set.intersection(range(ref_st,ref_en)) # <<<<<<<<<<<<<< * if(len(inc_del_pos)>0): * deletion_positions.extend(range(ref_st,ref_en)) */ - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 310, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_ref_st); __Pyx_GIVEREF(__pyx_v_ref_st); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_ref_st)) __PYX_ERR(0, 310, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_ref_st)) __PYX_ERR(0, 211, __pyx_L1_error); __Pyx_INCREF(__pyx_v_ref_en); __Pyx_GIVEREF(__pyx_v_ref_en); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_ref_en)) __PYX_ERR(0, 310, __pyx_L1_error); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_ref_en)) __PYX_ERR(0, 211, __pyx_L1_error); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_intersection, __pyx_v_include_indx_set, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 310, __pyx_L1_error) + __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_intersection, __pyx_v_include_indx_set, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_inc_del_pos, __pyx_t_5); __pyx_t_5 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":311 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":212 * all_deletion_positions.extend(range(ref_st,ref_en)) * inc_del_pos = include_indx_set.intersection(range(ref_st,ref_en)) * if(len(inc_del_pos)>0): # <<<<<<<<<<<<<< * deletion_positions.extend(range(ref_st,ref_en)) * deletion_coordinates.append((ref_st,ref_en)) */ - __pyx_t_14 = PyObject_Length(__pyx_v_inc_del_pos); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 311, __pyx_L1_error) + __pyx_t_14 = PyObject_Length(__pyx_v_inc_del_pos); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 212, __pyx_L1_error) __pyx_t_6 = (__pyx_t_14 > 0); if (__pyx_t_6) { - /* "CRISPResso2/CRISPRessoCOREResources.pyx":312 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":213 * inc_del_pos = include_indx_set.intersection(range(ref_st,ref_en)) * if(len(inc_del_pos)>0): * deletion_positions.extend(range(ref_st,ref_en)) # <<<<<<<<<<<<<< * deletion_coordinates.append((ref_st,ref_en)) * deletion_sizes.append(en-st) */ - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_ref_st); __Pyx_GIVEREF(__pyx_v_ref_st); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_ref_st)) __PYX_ERR(0, 312, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_ref_st)) __PYX_ERR(0, 213, __pyx_L1_error); __Pyx_INCREF(__pyx_v_ref_en); __Pyx_GIVEREF(__pyx_v_ref_en); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_ref_en)) __PYX_ERR(0, 312, __pyx_L1_error); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_ref_en)) __PYX_ERR(0, 213, __pyx_L1_error); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_7 = __Pyx_PyList_Extend(__pyx_v_deletion_positions, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Extend(__pyx_v_deletion_positions, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":313 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":214 * if(len(inc_del_pos)>0): * deletion_positions.extend(range(ref_st,ref_en)) * deletion_coordinates.append((ref_st,ref_en)) # <<<<<<<<<<<<<< * deletion_sizes.append(en-st) * */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_ref_st); __Pyx_GIVEREF(__pyx_v_ref_st); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_ref_st)) __PYX_ERR(0, 313, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_ref_st)) __PYX_ERR(0, 214, __pyx_L1_error); __Pyx_INCREF(__pyx_v_ref_en); __Pyx_GIVEREF(__pyx_v_ref_en); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref_en)) __PYX_ERR(0, 313, __pyx_L1_error); - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_deletion_coordinates, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 313, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref_en)) __PYX_ERR(0, 214, __pyx_L1_error); + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_deletion_coordinates, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 214, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":314 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":215 * deletion_positions.extend(range(ref_st,ref_en)) * deletion_coordinates.append((ref_st,ref_en)) * deletion_sizes.append(en-st) # <<<<<<<<<<<<<< * * deletion_n = np.sum(deletion_sizes) */ - __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_en - __pyx_v_st)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 314, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_en - __pyx_v_st)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_deletion_sizes, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 314, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_deletion_sizes, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":311 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":212 * all_deletion_positions.extend(range(ref_st,ref_en)) * inc_del_pos = include_indx_set.intersection(range(ref_st,ref_en)) * if(len(inc_del_pos)>0): # <<<<<<<<<<<<<< @@ -8460,7 +7594,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s */ } - /* "CRISPResso2/CRISPRessoCOREResources.pyx":301 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":202 * * include_indx_set = set(_include_indx) * for p in re_find_indels.finditer(read_seq_al): # <<<<<<<<<<<<<< @@ -8470,16 +7604,16 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":316 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":217 * deletion_sizes.append(en-st) * * deletion_n = np.sum(deletion_sizes) # <<<<<<<<<<<<<< * * for p in re_find_indels.finditer(ref_seq_al): */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sum); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 316, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sum); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -8500,23 +7634,23 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_deletion_sizes}; __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_13, 1+__pyx_t_13); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 316, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_v_deletion_n = __pyx_t_8; __pyx_t_8 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":318 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":219 * deletion_n = np.sum(deletion_sizes) * * for p in re_find_indels.finditer(ref_seq_al): # <<<<<<<<<<<<<< * st,en=p.span() * #sometimes insertions run off the end of the reference */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re_find_indels); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 318, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re_find_indels); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_finditer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_finditer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; @@ -8537,7 +7671,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_ref_seq_al}; __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_13, 1+__pyx_t_13); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 318, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } @@ -8546,9 +7680,9 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 219, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; for (;;) { @@ -8557,28 +7691,28 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 318, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 219, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 219, __pyx_L1_error) #else - __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 318, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 219, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 219, __pyx_L1_error) #else - __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif } @@ -8588,7 +7722,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 318, __pyx_L1_error) + else __PYX_ERR(0, 219, __pyx_L1_error) } break; } @@ -8597,14 +7731,14 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __Pyx_XDECREF_SET(__pyx_v_p, __pyx_t_8); __pyx_t_8 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":319 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":220 * * for p in re_find_indels.finditer(ref_seq_al): * st,en=p.span() # <<<<<<<<<<<<<< * #sometimes insertions run off the end of the reference * if st == 0: # if insertion happened before ref */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s_span); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s_span); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = NULL; __pyx_t_13 = 0; @@ -8624,7 +7758,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL}; __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_13, 0+__pyx_t_13); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 319, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -8634,7 +7768,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 319, __pyx_L1_error) + __PYX_ERR(0, 220, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -8647,15 +7781,15 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_9); #else - __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { Py_ssize_t index = -1; - __pyx_t_11 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_11 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); @@ -8663,7 +7797,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_9 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L23_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(0, 319, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(0, 220, __pyx_L1_error) __pyx_t_12 = NULL; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L24_unpacking_done; @@ -8671,17 +7805,17 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 319, __pyx_L1_error) + __PYX_ERR(0, 220, __pyx_L1_error) __pyx_L24_unpacking_done:; } - __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_st = __pyx_t_13; __pyx_v_en = __pyx_t_2; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":321 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":222 * st,en=p.span() * #sometimes insertions run off the end of the reference * if st == 0: # if insertion happened before ref # <<<<<<<<<<<<<< @@ -8691,7 +7825,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __pyx_t_6 = (__pyx_v_st == 0); if (__pyx_t_6) { - /* "CRISPResso2/CRISPRessoCOREResources.pyx":322 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":223 * #sometimes insertions run off the end of the reference * if st == 0: # if insertion happened before ref * continue # <<<<<<<<<<<<<< @@ -8700,7 +7834,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s */ goto __pyx_L21_continue; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":321 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":222 * st,en=p.span() * #sometimes insertions run off the end of the reference * if st == 0: # if insertion happened before ref # <<<<<<<<<<<<<< @@ -8709,18 +7843,18 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s */ } - /* "CRISPResso2/CRISPRessoCOREResources.pyx":323 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":224 * if st == 0: # if insertion happened before ref * continue * if en == len(ref_seq_al): # if insertion happened after ref # <<<<<<<<<<<<<< * continue * ref_st = ref_positions[st-1] */ - __pyx_t_14 = PyObject_Length(__pyx_v_ref_seq_al); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_14 = PyObject_Length(__pyx_v_ref_seq_al); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 224, __pyx_L1_error) __pyx_t_6 = (__pyx_v_en == __pyx_t_14); if (__pyx_t_6) { - /* "CRISPResso2/CRISPRessoCOREResources.pyx":324 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":225 * continue * if en == len(ref_seq_al): # if insertion happened after ref * continue # <<<<<<<<<<<<<< @@ -8729,7 +7863,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s */ goto __pyx_L21_continue; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":323 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":224 * if st == 0: # if insertion happened before ref * continue * if en == len(ref_seq_al): # if insertion happened after ref # <<<<<<<<<<<<<< @@ -8738,7 +7872,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s */ } - /* "CRISPResso2/CRISPRessoCOREResources.pyx":325 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":226 * if en == len(ref_seq_al): # if insertion happened after ref * continue * ref_st = ref_positions[st-1] # <<<<<<<<<<<<<< @@ -8751,7 +7885,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __Pyx_XDECREF_SET(__pyx_v_ref_st, __pyx_t_8); __pyx_t_8 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":326 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":227 * continue * ref_st = ref_positions[st-1] * ref_en = ref_positions[en] # <<<<<<<<<<<<<< @@ -8763,100 +7897,100 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __Pyx_XDECREF_SET(__pyx_v_ref_en, __pyx_t_8); __pyx_t_8 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":328 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":229 * ref_en = ref_positions[en] * * all_insertion_left_positions.append(ref_st) # <<<<<<<<<<<<<< * all_insertion_positions.append(ref_st) * all_insertion_positions.append(ref_en) */ - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_all_insertion_left_positions, __pyx_v_ref_st); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_all_insertion_left_positions, __pyx_v_ref_st); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 229, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":329 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":230 * * all_insertion_left_positions.append(ref_st) * all_insertion_positions.append(ref_st) # <<<<<<<<<<<<<< * all_insertion_positions.append(ref_en) * if(ref_st in _include_indx or ref_en in _include_indx): */ - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_all_insertion_positions, __pyx_v_ref_st); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_all_insertion_positions, __pyx_v_ref_st); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 230, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":330 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":231 * all_insertion_left_positions.append(ref_st) * all_insertion_positions.append(ref_st) * all_insertion_positions.append(ref_en) # <<<<<<<<<<<<<< * if(ref_st in _include_indx or ref_en in _include_indx): * insertion_coordinates.append((ref_st,ref_en)) */ - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_all_insertion_positions, __pyx_v_ref_en); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_all_insertion_positions, __pyx_v_ref_en); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 231, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":331 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":232 * all_insertion_positions.append(ref_st) * all_insertion_positions.append(ref_en) * if(ref_st in _include_indx or ref_en in _include_indx): # <<<<<<<<<<<<<< * insertion_coordinates.append((ref_st,ref_en)) * insertion_positions.append(ref_st) */ - __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_v_ref_st, __pyx_v__include_indx, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_v_ref_st, __pyx_v__include_indx, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 232, __pyx_L1_error) if (!__pyx_t_10) { } else { __pyx_t_6 = __pyx_t_10; goto __pyx_L28_bool_binop_done; } - __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_v_ref_en, __pyx_v__include_indx, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_v_ref_en, __pyx_v__include_indx, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 232, __pyx_L1_error) __pyx_t_6 = __pyx_t_10; __pyx_L28_bool_binop_done:; if (__pyx_t_6) { - /* "CRISPResso2/CRISPRessoCOREResources.pyx":332 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":233 * all_insertion_positions.append(ref_en) * if(ref_st in _include_indx or ref_en in _include_indx): * insertion_coordinates.append((ref_st,ref_en)) # <<<<<<<<<<<<<< * insertion_positions.append(ref_st) * insertion_positions.append(ref_en) */ - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 332, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_ref_st); __Pyx_GIVEREF(__pyx_v_ref_st); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_ref_st)) __PYX_ERR(0, 332, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_ref_st)) __PYX_ERR(0, 233, __pyx_L1_error); __Pyx_INCREF(__pyx_v_ref_en); __Pyx_GIVEREF(__pyx_v_ref_en); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_ref_en)) __PYX_ERR(0, 332, __pyx_L1_error); - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_insertion_coordinates, __pyx_t_8); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 332, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_ref_en)) __PYX_ERR(0, 233, __pyx_L1_error); + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_insertion_coordinates, __pyx_t_8); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":333 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":234 * if(ref_st in _include_indx or ref_en in _include_indx): * insertion_coordinates.append((ref_st,ref_en)) * insertion_positions.append(ref_st) # <<<<<<<<<<<<<< * insertion_positions.append(ref_en) * insertion_sizes.append(en-st) */ - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_insertion_positions, __pyx_v_ref_st); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_insertion_positions, __pyx_v_ref_st); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 234, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":334 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":235 * insertion_coordinates.append((ref_st,ref_en)) * insertion_positions.append(ref_st) * insertion_positions.append(ref_en) # <<<<<<<<<<<<<< * insertion_sizes.append(en-st) * */ - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_insertion_positions, __pyx_v_ref_en); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_insertion_positions, __pyx_v_ref_en); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 235, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":335 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":236 * insertion_positions.append(ref_st) * insertion_positions.append(ref_en) * insertion_sizes.append(en-st) # <<<<<<<<<<<<<< * * insertion_n = np.sum(insertion_sizes) */ - __pyx_t_8 = __Pyx_PyInt_From_int((__pyx_v_en - __pyx_v_st)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 335, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_int((__pyx_v_en - __pyx_v_st)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_insertion_sizes, __pyx_t_8); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 335, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_insertion_sizes, __pyx_t_8); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":331 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":232 * all_insertion_positions.append(ref_st) * all_insertion_positions.append(ref_en) * if(ref_st in _include_indx or ref_en in _include_indx): # <<<<<<<<<<<<<< @@ -8865,7 +7999,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s */ } - /* "CRISPResso2/CRISPRessoCOREResources.pyx":318 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":219 * deletion_n = np.sum(deletion_sizes) * * for p in re_find_indels.finditer(ref_seq_al): # <<<<<<<<<<<<<< @@ -8876,16 +8010,16 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":337 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":238 * insertion_sizes.append(en-st) * * insertion_n = np.sum(insertion_sizes) # <<<<<<<<<<<<<< * - * + * retDict = { */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 337, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_sum); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 337, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_sum); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; @@ -8906,7 +8040,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_insertion_sizes}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_2, 1+__pyx_t_2); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -8916,9 +8050,9 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s /* "CRISPResso2/CRISPRessoCOREResources.pyx":341 * * retDict = { - * 'all_insertion_positions':all_insertion_positions, # <<<<<<<<<<<<<< - * 'all_insertion_left_positions':all_insertion_left_positions, - * 'insertion_positions':insertion_positions, + * 'all_insertion_positions':all_insertion_positions, # <<<<<<<<<<<<<< + * 'all_insertion_left_positions':all_insertion_left_positions, + * 'insertion_positions':insertion_positions, */ __pyx_t_1 = __Pyx_PyDict_NewPresized(17); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -8926,118 +8060,118 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s /* "CRISPResso2/CRISPRessoCOREResources.pyx":342 * retDict = { - * 'all_insertion_positions':all_insertion_positions, - * 'all_insertion_left_positions':all_insertion_left_positions, # <<<<<<<<<<<<<< - * 'insertion_positions':insertion_positions, - * 'insertion_coordinates':insertion_coordinates, + * 'all_insertion_positions':all_insertion_positions, + * 'all_insertion_left_positions':all_insertion_left_positions, # <<<<<<<<<<<<<< + * 'insertion_positions':insertion_positions, + * 'insertion_coordinates':insertion_coordinates, */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_all_insertion_left_positions, __pyx_v_all_insertion_left_positions) < 0) __PYX_ERR(0, 341, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":343 - * 'all_insertion_positions':all_insertion_positions, - * 'all_insertion_left_positions':all_insertion_left_positions, - * 'insertion_positions':insertion_positions, # <<<<<<<<<<<<<< - * 'insertion_coordinates':insertion_coordinates, - * 'insertion_sizes':insertion_sizes, + /* "CRISPResso2/CRISPRessoCOREResources.pyx":243 + * 'all_insertion_positions':all_insertion_positions, + * 'all_insertion_left_positions':all_insertion_left_positions, + * 'insertion_positions':insertion_positions, # <<<<<<<<<<<<<< + * 'insertion_coordinates':insertion_coordinates, + * 'insertion_sizes':insertion_sizes, */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_insertion_positions, __pyx_v_insertion_positions) < 0) __PYX_ERR(0, 341, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":344 - * 'all_insertion_left_positions':all_insertion_left_positions, - * 'insertion_positions':insertion_positions, - * 'insertion_coordinates':insertion_coordinates, # <<<<<<<<<<<<<< - * 'insertion_sizes':insertion_sizes, - * 'insertion_n':insertion_n, + /* "CRISPResso2/CRISPRessoCOREResources.pyx":244 + * 'all_insertion_left_positions':all_insertion_left_positions, + * 'insertion_positions':insertion_positions, + * 'insertion_coordinates':insertion_coordinates, # <<<<<<<<<<<<<< + * 'insertion_sizes':insertion_sizes, + * 'insertion_n':insertion_n, */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_insertion_coordinates, __pyx_v_insertion_coordinates) < 0) __PYX_ERR(0, 341, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":345 - * 'insertion_positions':insertion_positions, - * 'insertion_coordinates':insertion_coordinates, - * 'insertion_sizes':insertion_sizes, # <<<<<<<<<<<<<< - * 'insertion_n':insertion_n, - * + /* "CRISPResso2/CRISPRessoCOREResources.pyx":245 + * 'insertion_positions':insertion_positions, + * 'insertion_coordinates':insertion_coordinates, + * 'insertion_sizes':insertion_sizes, # <<<<<<<<<<<<<< + * 'insertion_n':insertion_n, + * 'all_deletion_positions':all_deletion_positions, */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_insertion_sizes, __pyx_v_insertion_sizes) < 0) __PYX_ERR(0, 341, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":346 - * 'insertion_coordinates':insertion_coordinates, - * 'insertion_sizes':insertion_sizes, - * 'insertion_n':insertion_n, # <<<<<<<<<<<<<< + /* "CRISPResso2/CRISPRessoCOREResources.pyx":246 + * 'insertion_coordinates':insertion_coordinates, + * 'insertion_sizes':insertion_sizes, + * 'insertion_n':insertion_n, # <<<<<<<<<<<<<< + * 'all_deletion_positions':all_deletion_positions, * - * 'all_deletion_positions':all_deletion_positions, */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_insertion_n, __pyx_v_insertion_n) < 0) __PYX_ERR(0, 341, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":348 - * 'insertion_n':insertion_n, + /* "CRISPResso2/CRISPRessoCOREResources.pyx":247 + * 'insertion_sizes':insertion_sizes, + * 'insertion_n':insertion_n, + * 'all_deletion_positions':all_deletion_positions, # <<<<<<<<<<<<<< * - * 'all_deletion_positions':all_deletion_positions, # <<<<<<<<<<<<<< - * 'deletion_positions':deletion_positions, - * 'deletion_coordinates':deletion_coordinates, + * 'deletion_positions':deletion_positions, */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_all_deletion_positions, __pyx_v_all_deletion_positions) < 0) __PYX_ERR(0, 341, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":349 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":249 + * 'all_deletion_positions':all_deletion_positions, * - * 'all_deletion_positions':all_deletion_positions, - * 'deletion_positions':deletion_positions, # <<<<<<<<<<<<<< - * 'deletion_coordinates':deletion_coordinates, - * 'deletion_sizes':deletion_sizes, + * 'deletion_positions':deletion_positions, # <<<<<<<<<<<<<< + * 'deletion_coordinates':deletion_coordinates, + * 'deletion_sizes':deletion_sizes, */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_deletion_positions, __pyx_v_deletion_positions) < 0) __PYX_ERR(0, 341, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":350 - * 'all_deletion_positions':all_deletion_positions, - * 'deletion_positions':deletion_positions, - * 'deletion_coordinates':deletion_coordinates, # <<<<<<<<<<<<<< - * 'deletion_sizes':deletion_sizes, - * 'deletion_n':deletion_n, + /* "CRISPResso2/CRISPRessoCOREResources.pyx":250 + * + * 'deletion_positions':deletion_positions, + * 'deletion_coordinates':deletion_coordinates, # <<<<<<<<<<<<<< + * 'deletion_sizes':deletion_sizes, + * 'deletion_n':deletion_n, */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_deletion_coordinates, __pyx_v_deletion_coordinates) < 0) __PYX_ERR(0, 341, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":351 - * 'deletion_positions':deletion_positions, - * 'deletion_coordinates':deletion_coordinates, - * 'deletion_sizes':deletion_sizes, # <<<<<<<<<<<<<< - * 'deletion_n':deletion_n, + /* "CRISPResso2/CRISPRessoCOREResources.pyx":251 + * 'deletion_positions':deletion_positions, + * 'deletion_coordinates':deletion_coordinates, + * 'deletion_sizes':deletion_sizes, # <<<<<<<<<<<<<< + * 'deletion_n':deletion_n, * */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_deletion_sizes, __pyx_v_deletion_sizes) < 0) __PYX_ERR(0, 341, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":352 - * 'deletion_coordinates':deletion_coordinates, - * 'deletion_sizes':deletion_sizes, - * 'deletion_n':deletion_n, # <<<<<<<<<<<<<< + /* "CRISPResso2/CRISPRessoCOREResources.pyx":252 + * 'deletion_coordinates':deletion_coordinates, + * 'deletion_sizes':deletion_sizes, + * 'deletion_n':deletion_n, # <<<<<<<<<<<<<< * - * 'all_substitution_positions':all_substitution_positions, + * 'all_substitution_positions':all_substitution_positions, */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_deletion_n, __pyx_v_deletion_n) < 0) __PYX_ERR(0, 341, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":354 - * 'deletion_n':deletion_n, + /* "CRISPResso2/CRISPRessoCOREResources.pyx":254 + * 'deletion_n':deletion_n, * - * 'all_substitution_positions':all_substitution_positions, # <<<<<<<<<<<<<< - * 'substitution_positions':substitution_positions, - * 'all_substitution_values':np.array(all_substitution_values), + * 'all_substitution_positions':all_substitution_positions, # <<<<<<<<<<<<<< + * 'substitution_positions':substitution_positions, + * 'all_substitution_values':np.array(all_substitution_values), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_all_substitution_positions, __pyx_v_all_substitution_positions) < 0) __PYX_ERR(0, 341, __pyx_L1_error) /* "CRISPResso2/CRISPRessoCOREResources.pyx":355 * - * 'all_substitution_positions':all_substitution_positions, - * 'substitution_positions':substitution_positions, # <<<<<<<<<<<<<< - * 'all_substitution_values':np.array(all_substitution_values), - * 'substitution_values':np.array(substitution_values), + * 'all_substitution_positions':all_substitution_positions, + * 'substitution_positions':substitution_positions, # <<<<<<<<<<<<<< + * 'all_substitution_values':np.array(all_substitution_values), + * 'substitution_values':np.array(substitution_values), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_substitution_positions, __pyx_v_substitution_positions) < 0) __PYX_ERR(0, 341, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":356 - * 'all_substitution_positions':all_substitution_positions, - * 'substitution_positions':substitution_positions, - * 'all_substitution_values':np.array(all_substitution_values), # <<<<<<<<<<<<<< - * 'substitution_values':np.array(substitution_values), - * 'substitution_n':substitution_n, + /* "CRISPResso2/CRISPRessoCOREResources.pyx":256 + * 'all_substitution_positions':all_substitution_positions, + * 'substitution_positions':substitution_positions, + * 'all_substitution_values':np.array(all_substitution_values), # <<<<<<<<<<<<<< + * 'substitution_values':np.array(substitution_values), + * 'substitution_n':substitution_n, */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); @@ -9069,11 +8203,11 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_all_substitution_values, __pyx_t_9) < 0) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":357 - * 'substitution_positions':substitution_positions, - * 'all_substitution_values':np.array(all_substitution_values), - * 'substitution_values':np.array(substitution_values), # <<<<<<<<<<<<<< - * 'substitution_n':substitution_n, + /* "CRISPResso2/CRISPRessoCOREResources.pyx":257 + * 'substitution_positions':substitution_positions, + * 'all_substitution_values':np.array(all_substitution_values), + * 'substitution_values':np.array(substitution_values), # <<<<<<<<<<<<<< + * 'substitution_n':substitution_n, * */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 357, __pyx_L1_error) @@ -9106,22 +8240,22 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_substitution_values, __pyx_t_9) < 0) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":358 - * 'all_substitution_values':np.array(all_substitution_values), - * 'substitution_values':np.array(substitution_values), - * 'substitution_n':substitution_n, # <<<<<<<<<<<<<< + /* "CRISPResso2/CRISPRessoCOREResources.pyx":258 + * 'all_substitution_values':np.array(all_substitution_values), + * 'substitution_values':np.array(substitution_values), + * 'substitution_n':substitution_n, # <<<<<<<<<<<<<< * - * 'ref_positions':ref_positions, + * 'ref_positions':ref_positions, */ __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_substitution_n); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_substitution_n, __pyx_t_9) < 0) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":360 - * 'substitution_n':substitution_n, + /* "CRISPResso2/CRISPRessoCOREResources.pyx":260 + * 'substitution_n':substitution_n, * - * 'ref_positions':ref_positions, # <<<<<<<<<<<<<< + * 'ref_positions':ref_positions, # <<<<<<<<<<<<<< * } * return retDict */ @@ -9129,8 +8263,8 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __pyx_v_retDict = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":362 - * 'ref_positions':ref_positions, + /* "CRISPResso2/CRISPRessoCOREResources.pyx":262 + * 'ref_positions':ref_positions, * } * return retDict # <<<<<<<<<<<<<< * @@ -9141,9 +8275,9 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __pyx_r = __pyx_v_retDict; goto __pyx_L0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":238 - * - * + /* "CRISPResso2/CRISPRessoCOREResources.pyx":138 + * 'ref_positions': ref_positions, + * } * @cython.boundscheck(False) # <<<<<<<<<<<<<< * @cython.nonecheck(False) * @cython.wraparound(False) @@ -9252,7 +8386,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 365, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 265, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -9260,7 +8394,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 365, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 265, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("calculate_homology", 1, 2, 2, 1); __PYX_ERR(0, 365, __pyx_L3_error) } @@ -9280,7 +8414,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("calculate_homology", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 365, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calculate_homology", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 265, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -9473,6 +8607,8 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 1, 1}, {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, {&__pyx_n_s_al, __pyx_k_al, sizeof(__pyx_k_al), 0, 0, 1, 1}, + {&__pyx_n_s_all_deletion_coordinates, __pyx_k_all_deletion_coordinates, sizeof(__pyx_k_all_deletion_coordinates), 0, 0, 1, 1}, + {&__pyx_n_u_all_deletion_coordinates, __pyx_k_all_deletion_coordinates, sizeof(__pyx_k_all_deletion_coordinates), 0, 1, 0, 1}, {&__pyx_n_s_all_deletion_positions, __pyx_k_all_deletion_positions, sizeof(__pyx_k_all_deletion_positions), 0, 0, 1, 1}, {&__pyx_n_u_all_deletion_positions, __pyx_k_all_deletion_positions, sizeof(__pyx_k_all_deletion_positions), 0, 1, 0, 1}, {&__pyx_n_s_all_insertion_left_positions, __pyx_k_all_insertion_left_positions, sizeof(__pyx_k_all_insertion_left_positions), 0, 0, 1, 1}, @@ -9593,9 +8729,9 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 135, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 172, __pyx_L1_error) - __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 188, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 58, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 113, __pyx_L1_error) __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 984, __pyx_L1_error) return 0; __pyx_L1_error:; @@ -9607,7 +8743,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":984 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":984 * __pyx_import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< @@ -9618,7 +8754,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":990 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":990 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -9629,79 +8765,32 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "CRISPResso2/CRISPRessoCOREResources.pyx":18 - * class ResultsSlotsDict(): - * __slots__ = ( - * 'all_insertion_positions', # <<<<<<<<<<<<<< - * 'all_insertion_left_positions', - * 'insertion_positions', - */ - __pyx_tuple__5 = PyTuple_Pack(23, __pyx_n_u_all_insertion_positions, __pyx_n_u_all_insertion_left_positions, __pyx_n_u_insertion_positions, __pyx_n_u_insertion_coordinates, __pyx_n_u_insertion_sizes, __pyx_n_u_insertion_n, __pyx_n_u_all_deletion_positions, __pyx_n_u_deletion_positions, __pyx_n_u_deletion_coordinates, __pyx_n_u_deletion_sizes, __pyx_n_u_deletion_n, __pyx_n_u_all_substitution_positions, __pyx_n_u_substitution_positions, __pyx_n_u_all_substitution_values, __pyx_n_u_substitution_values, __pyx_n_u_substitution_n, __pyx_n_u_ref_positions, __pyx_n_u_ref_name, __pyx_n_u_aln_scores, __pyx_n_u_classification, __pyx_n_u_aln_seq, __pyx_n_u_aln_ref, __pyx_n_u_aln_strand); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 18, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":43 - * ) - * - * def __init__( # <<<<<<<<<<<<<< - * self, - * all_insertion_positions, - */ - __pyx_tuple__6 = PyTuple_Pack(18, __pyx_n_s_self, __pyx_n_s_all_insertion_positions, __pyx_n_s_all_insertion_left_positions, __pyx_n_s_insertion_positions, __pyx_n_s_insertion_coordinates, __pyx_n_s_insertion_sizes, __pyx_n_s_insertion_n, __pyx_n_s_all_deletion_positions, __pyx_n_s_deletion_positions, __pyx_n_s_deletion_coordinates, __pyx_n_s_deletion_sizes, __pyx_n_s_deletion_n, __pyx_n_s_all_substitution_positions, __pyx_n_s_substitution_positions, __pyx_n_s_all_substitution_values, __pyx_n_s_substitution_values, __pyx_n_s_substitution_n, __pyx_n_s_ref_positions); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 43, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__6); - __Pyx_GIVEREF(__pyx_tuple__6); - __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(18, 0, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_CRISPResso2_CRISPRessoCOREResour_2, __pyx_n_s_init, 43, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 43, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":87 - * self.aln_strand = None - * - * def __getitem__(self, key): # <<<<<<<<<<<<<< - * return getattr(self, key) - * - */ - __pyx_tuple__8 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_key); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 87, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); - __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_CRISPResso2_CRISPRessoCOREResour_2, __pyx_n_s_getitem, 87, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 87, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":90 - * return getattr(self, key) - * - * def __setitem__(self, key, value): # <<<<<<<<<<<<<< - * setattr(self, key, value) - * - */ - __pyx_tuple__10 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_value); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 90, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__10); - __Pyx_GIVEREF(__pyx_tuple__10); - __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_CRISPResso2_CRISPRessoCOREResour_2, __pyx_n_s_setitem, 90, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 90, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":94 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":16 * * * re_find_indels = re.compile("(-*-)") # <<<<<<<<<<<<<< * * @cython.boundscheck(False) */ - __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u__12); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 94, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__13); - __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u__5); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); - /* "CRISPResso2/CRISPRessoCOREResources.pyx":96 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":18 * re_find_indels = re.compile("(-*-)") * * @cython.boundscheck(False) # <<<<<<<<<<<<<< * @cython.nonecheck(False) * @cython.wraparound(False) */ - __pyx_tuple__14 = PyTuple_Pack(30, __pyx_n_s_read_seq_al, __pyx_n_s_ref_seq_al, __pyx_n_s_include_indx, __pyx_n_s_ref_positions, __pyx_n_s_all_substitution_positions, __pyx_n_s_substitution_positions, __pyx_n_s_all_substitution_values, __pyx_n_s_substitution_values, __pyx_n_s_all_deletion_positions, __pyx_n_s_deletion_positions, __pyx_n_s_deletion_coordinates, __pyx_n_s_deletion_sizes, __pyx_n_s_start_deletion, __pyx_n_s_all_insertion_positions, __pyx_n_s_all_insertion_left_positions, __pyx_n_s_insertion_positions, __pyx_n_s_insertion_coordinates, __pyx_n_s_insertion_sizes, __pyx_n_s_start_insertion, __pyx_n_s_seq_len, __pyx_n_s_include_indx_set, __pyx_n_s_nucSet, __pyx_n_s_idx, __pyx_n_s_idx_c, __pyx_n_s_current_insertion_size, __pyx_n_s_c, __pyx_n_s_end_deletion, __pyx_n_s_substitution_n, __pyx_n_s_deletion_n, __pyx_n_s_insertion_n); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 96, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__14); - __Pyx_GIVEREF(__pyx_tuple__14); - __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 30, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_CRISPResso2_CRISPRessoCOREResour_2, __pyx_n_s_find_indels_substitutions, 96, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_tuple__7 = PyTuple_Pack(31, __pyx_n_s_read_seq_al, __pyx_n_s_ref_seq_al, __pyx_n_s_include_indx, __pyx_n_s_ref_positions, __pyx_n_s_all_substitution_positions, __pyx_n_s_substitution_positions, __pyx_n_s_all_substitution_values, __pyx_n_s_substitution_values, __pyx_n_s_all_deletion_positions, __pyx_n_s_all_deletion_coordinates, __pyx_n_s_deletion_positions, __pyx_n_s_deletion_coordinates, __pyx_n_s_deletion_sizes, __pyx_n_s_start_deletion, __pyx_n_s_all_insertion_positions, __pyx_n_s_all_insertion_left_positions, __pyx_n_s_insertion_positions, __pyx_n_s_insertion_coordinates, __pyx_n_s_insertion_sizes, __pyx_n_s_start_insertion, __pyx_n_s_seq_len, __pyx_n_s_include_indx_set, __pyx_n_s_nucSet, __pyx_n_s_idx, __pyx_n_s_idx_c, __pyx_n_s_current_insertion_size, __pyx_n_s_c, __pyx_n_s_end_deletion, __pyx_n_s_substitution_n, __pyx_n_s_deletion_n, __pyx_n_s_insertion_n); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 31, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_CRISPResso2_CRISPRessoCOREResour, __pyx_n_s_find_indels_substitutions, 18, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 18, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":238 - * - * + /* "CRISPResso2/CRISPRessoCOREResources.pyx":138 + * 'ref_positions': ref_positions, + * } * @cython.boundscheck(False) # <<<<<<<<<<<<<< * @cython.nonecheck(False) * @cython.wraparound(False) @@ -9818,33 +8907,33 @@ static int __Pyx_modinit_type_import_code(void) { /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_6(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_9(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 - sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_6(PyTypeObject), + sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_9(PyTypeObject), #elif CYTHON_COMPILING_IN_LIMITED_API - sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_6(PyTypeObject), + sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_9(PyTypeObject), #else - sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_6(PyHeapTypeObject), + sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_9(PyHeapTypeObject), #endif - __Pyx_ImportType_CheckSize_Warn_3_0_6); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error) + __Pyx_ImportType_CheckSize_Warn_3_0_9); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_0_6(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_0_6(PyArray_Descr),__Pyx_ImportType_CheckSize_Ignore_3_0_6); if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 202, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_0_6(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_6(PyArrayIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_6); if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 225, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_0_6(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_6(PyArrayMultiIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_6); if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 229, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_0_6(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_6(PyArrayObject),__Pyx_ImportType_CheckSize_Ignore_3_0_6); if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 238, __pyx_L1_error) - __pyx_ptype_5numpy_generic = __Pyx_ImportType_3_0_6(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_6(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_6); if (!__pyx_ptype_5numpy_generic) __PYX_ERR(1, 809, __pyx_L1_error) - __pyx_ptype_5numpy_number = __Pyx_ImportType_3_0_6(__pyx_t_1, "numpy", "number", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_6(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_6); if (!__pyx_ptype_5numpy_number) __PYX_ERR(1, 811, __pyx_L1_error) - __pyx_ptype_5numpy_integer = __Pyx_ImportType_3_0_6(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_6(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_6); if (!__pyx_ptype_5numpy_integer) __PYX_ERR(1, 813, __pyx_L1_error) - __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_0_6(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_6(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_6); if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 815, __pyx_L1_error) - __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_0_6(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_6(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_6); if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 817, __pyx_L1_error) - __pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_0_6(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_6(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_6); if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 819, __pyx_L1_error) - __pyx_ptype_5numpy_floating = __Pyx_ImportType_3_0_6(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_6(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_6); if (!__pyx_ptype_5numpy_floating) __PYX_ERR(1, 821, __pyx_L1_error) - __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_0_6(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_6(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_6); if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 823, __pyx_L1_error) - __pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_0_6(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_6(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_6); if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 825, __pyx_L1_error) - __pyx_ptype_5numpy_character = __Pyx_ImportType_3_0_6(__pyx_t_1, "numpy", "character", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_6(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_6); if (!__pyx_ptype_5numpy_character) __PYX_ERR(1, 827, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_0_6(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_6(PyUFuncObject),__Pyx_ImportType_CheckSize_Ignore_3_0_6); if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 866, __pyx_L1_error) + __pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_0_9(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_0_9(PyArray_Descr),__Pyx_ImportType_CheckSize_Ignore_3_0_9); if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 202, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_0_9(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_9(PyArrayIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_9); if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 225, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_0_9(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_9(PyArrayMultiIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_9); if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 229, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_0_9(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_9(PyArrayObject),__Pyx_ImportType_CheckSize_Ignore_3_0_9); if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 238, __pyx_L1_error) + __pyx_ptype_5numpy_generic = __Pyx_ImportType_3_0_9(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_9(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_9); if (!__pyx_ptype_5numpy_generic) __PYX_ERR(1, 809, __pyx_L1_error) + __pyx_ptype_5numpy_number = __Pyx_ImportType_3_0_9(__pyx_t_1, "numpy", "number", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_9(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_9); if (!__pyx_ptype_5numpy_number) __PYX_ERR(1, 811, __pyx_L1_error) + __pyx_ptype_5numpy_integer = __Pyx_ImportType_3_0_9(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_9(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_9); if (!__pyx_ptype_5numpy_integer) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_0_9(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_9(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_9); if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 815, __pyx_L1_error) + __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_0_9(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_9(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_9); if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 817, __pyx_L1_error) + __pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_0_9(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_9(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_9); if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 819, __pyx_L1_error) + __pyx_ptype_5numpy_floating = __Pyx_ImportType_3_0_9(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_9(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_9); if (!__pyx_ptype_5numpy_floating) __PYX_ERR(1, 821, __pyx_L1_error) + __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_0_9(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_9(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_9); if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 823, __pyx_L1_error) + __pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_0_9(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_9(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_9); if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 825, __pyx_L1_error) + __pyx_ptype_5numpy_character = __Pyx_ImportType_3_0_9(__pyx_t_1, "numpy", "character", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_9(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_9); if (!__pyx_ptype_5numpy_character) __PYX_ERR(1, 827, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_0_9(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_9(PyUFuncObject),__Pyx_ImportType_CheckSize_Ignore_3_0_9); if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 866, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; @@ -10059,7 +9148,7 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_CRISPRessoCOREResources(PyObject * __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); - __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to CRISPRessoCOREResources pseudovariable */ + __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "CRISPRessoCOREResources" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } @@ -10173,106 +9262,38 @@ if (!__Pyx_RefNanny) { __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "CRISPResso2/CRISPRessoCOREResources.pyx":16 - * char * PyBytes_AS_STRING(PyObject *) - * - * class ResultsSlotsDict(): # <<<<<<<<<<<<<< - * __slots__ = ( - * 'all_insertion_positions', - */ - __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_ResultsSlotsDict, __pyx_n_s_ResultsSlotsDict, (PyObject *) NULL, __pyx_n_s_CRISPResso2_CRISPRessoCOREResour, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":18 - * class ResultsSlotsDict(): - * __slots__ = ( - * 'all_insertion_positions', # <<<<<<<<<<<<<< - * 'all_insertion_left_positions', - * 'insertion_positions', - */ - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_slots, __pyx_tuple__5) < 0) __PYX_ERR(0, 17, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":43 - * ) - * - * def __init__( # <<<<<<<<<<<<<< - * self, - * all_insertion_positions, - */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11CRISPResso2_23CRISPRessoCOREResources_16ResultsSlotsDict_1__init__, 0, __pyx_n_s_ResultsSlotsDict___init, NULL, __pyx_n_s_CRISPResso2_CRISPRessoCOREResour, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 43, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":87 - * self.aln_strand = None - * - * def __getitem__(self, key): # <<<<<<<<<<<<<< - * return getattr(self, key) - * - */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11CRISPResso2_23CRISPRessoCOREResources_16ResultsSlotsDict_3__getitem__, 0, __pyx_n_s_ResultsSlotsDict___getitem, NULL, __pyx_n_s_CRISPResso2_CRISPRessoCOREResour, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getitem, __pyx_t_3) < 0) __PYX_ERR(0, 87, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":90 - * return getattr(self, key) - * - * def __setitem__(self, key, value): # <<<<<<<<<<<<<< - * setattr(self, key, value) - * - */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11CRISPResso2_23CRISPRessoCOREResources_16ResultsSlotsDict_5__setitem__, 0, __pyx_n_s_ResultsSlotsDict___setitem, NULL, __pyx_n_s_CRISPResso2_CRISPRessoCOREResour, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_setitem, __pyx_t_3) < 0) __PYX_ERR(0, 90, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":16 - * char * PyBytes_AS_STRING(PyObject *) - * - * class ResultsSlotsDict(): # <<<<<<<<<<<<<< - * __slots__ = ( - * 'all_insertion_positions', - */ - __pyx_t_3 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_ResultsSlotsDict, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 16, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ResultsSlotsDict, __pyx_t_3) < 0) __PYX_ERR(0, 16, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":94 * * * re_find_indels = re.compile("(-*-)") # <<<<<<<<<<<<<< * * @cython.boundscheck(False) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_re); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_re); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_compile); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_compile); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_re_find_indels, __pyx_t_2) < 0) __PYX_ERR(0, 94, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_re_find_indels, __pyx_t_2) < 0) __PYX_ERR(0, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":96 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":18 * re_find_indels = re.compile("(-*-)") * * @cython.boundscheck(False) # <<<<<<<<<<<<<< * @cython.nonecheck(False) * @cython.wraparound(False) */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11CRISPResso2_23CRISPRessoCOREResources_1find_indels_substitutions, 0, __pyx_n_s_find_indels_substitutions, NULL, __pyx_n_s_CRISPResso2_CRISPRessoCOREResour, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11CRISPResso2_23CRISPRessoCOREResources_1find_indels_substitutions, 0, __pyx_n_s_find_indels_substitutions, NULL, __pyx_n_s_CRISPResso2_CRISPRessoCOREResour_2, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_find_indels_substitutions, __pyx_t_2) < 0) __PYX_ERR(0, 96, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_find_indels_substitutions, __pyx_t_2) < 0) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":238 - * - * + /* "CRISPResso2/CRISPRessoCOREResources.pyx":138 + * 'ref_positions': ref_positions, + * } * @cython.boundscheck(False) # <<<<<<<<<<<<<< * @cython.nonecheck(False) * @cython.wraparound(False) @@ -11094,11 +10115,11 @@ static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyO { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { - if (unlikely(eq < 0)) return NULL; // error + if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } - return NULL; // not found (no exception set) + return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { @@ -11211,7 +10232,7 @@ static int __Pyx_ParseOptionalKeywords( if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(value); // transfer ownership of value to values + Py_INCREF(value); Py_DECREF(key); #endif key = NULL; @@ -11230,7 +10251,7 @@ static int __Pyx_ParseOptionalKeywords( && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS - value = NULL; // ownership transferred to values + value = NULL; #endif break; } @@ -11262,7 +10283,7 @@ static int __Pyx_ParseOptionalKeywords( if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS - value = NULL; // ownership transferred to values + value = NULL; #endif break; } @@ -11494,9 +10515,10 @@ static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, in /* UnpackUnboundCMethod */ static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { + PyObject *result; PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args)); if (unlikely(!selfless_args)) return NULL; - PyObject *result = PyObject_Call(method, selfless_args, kwargs); + result = PyObject_Call(method, selfless_args, kwargs); Py_DECREF(selfless_args); return result; } @@ -11921,9 +10943,10 @@ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { + PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign - PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); + exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; @@ -11944,10 +10967,10 @@ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { } /* TypeImport */ -#ifndef __PYX_HAVE_RT_ImportType_3_0_6 -#define __PYX_HAVE_RT_ImportType_3_0_6 -static PyTypeObject *__Pyx_ImportType_3_0_6(PyObject *module, const char *module_name, const char *class_name, - size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_6 check_size) +#ifndef __PYX_HAVE_RT_ImportType_3_0_9 +#define __PYX_HAVE_RT_ImportType_3_0_9 +static PyTypeObject *__Pyx_ImportType_3_0_9(PyObject *module, const char *module_name, const char *class_name, + size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_9 check_size) { PyObject *result = 0; char warning[200]; @@ -12001,7 +11024,7 @@ static PyTypeObject *__Pyx_ImportType_3_0_6(PyObject *module, const char *module module_name, class_name, size, basicsize+itemsize); goto bad; } - if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_6 && + if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_9 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " @@ -12009,7 +11032,7 @@ static PyTypeObject *__Pyx_ImportType_3_0_6(PyObject *module, const char *module module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } - else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_6 && (size_t)basicsize > size) { + else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_9 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", @@ -13268,7 +12291,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, default: return NULL; } - return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); + return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { @@ -14014,7 +13037,7 @@ static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif - Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline + Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); @@ -15077,7 +14100,7 @@ __Pyx_PyType_GetName(PyTypeObject* tp) if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); - name = __Pyx_NewRef(__pyx_n_s__20); + name = __Pyx_NewRef(__pyx_n_s__13); } return name; } diff --git a/CRISPResso2/CRISPRessoCOREResources.pyx b/CRISPResso2/CRISPRessoCOREResources.pyx index 78a6dced..4b6a22f1 100644 --- a/CRISPResso2/CRISPRessoCOREResources.pyx +++ b/CRISPResso2/CRISPRessoCOREResources.pyx @@ -7,7 +7,6 @@ cdef extern from "stdlib.h": ctypedef unsigned int size_t size_t strlen(char* s) - cdef extern from "Python.h": ctypedef void PyObject int _PyBytes_Resize(PyObject **, size_t) @@ -74,6 +73,7 @@ def find_indels_substitutions(read_seq_al, ref_seq_al, _include_indx): substitution_values=[] all_deletion_positions = [] + all_deletion_coordinates = [] deletion_positions = [] deletion_coordinates = [] deletion_sizes = [] @@ -130,6 +130,7 @@ def find_indels_substitutions(read_seq_al, ref_seq_al, _include_indx): elif read_seq_al[idx_c] != '-' and start_deletion != -1: # this is the end of a deletion end_deletion = ref_positions[idx_c] all_deletion_positions.extend(range(start_deletion, end_deletion)) + all_deletion_coordinates.append((start_deletion, end_deletion)) if include_indx_set.intersection(range(start_deletion, end_deletion)): deletion_positions.extend(range(start_deletion, end_deletion)) deletion_coordinates.append((start_deletion, end_deletion)) @@ -139,6 +140,7 @@ def find_indels_substitutions(read_seq_al, ref_seq_al, _include_indx): if start_deletion != -1: end_deletion = ref_positions[seq_len - 1] all_deletion_positions.extend(range(start_deletion, end_deletion)) + all_deletion_coordinates.append((start_deletion, end_deletion)) if include_indx_set.intersection(range(start_deletion, end_deletion)): deletion_positions.extend(range(start_deletion, end_deletion)) deletion_coordinates.append((start_deletion, end_deletion)) @@ -180,6 +182,7 @@ def find_indels_substitutions(read_seq_al, ref_seq_al, _include_indx): 'insertion_n': insertion_n, 'all_deletion_positions': all_deletion_positions, + 'all_deletion_coordinates': all_deletion_coordinates, 'deletion_positions': deletion_positions, 'deletion_coordinates': deletion_coordinates, 'deletion_sizes': deletion_sizes, @@ -190,14 +193,13 @@ def find_indels_substitutions(read_seq_al, ref_seq_al, _include_indx): 'all_substitution_values': np.array(all_substitution_values), 'substitution_values': np.array(substitution_values), 'substitution_n': substitution_n, - 'ref_positions': ref_positions, } - - @cython.boundscheck(False) @cython.nonecheck(False) @cython.wraparound(False) + + def find_indels_substitutions_legacy(read_seq_al, ref_seq_al, _include_indx): cdef char* sub_seq='' @@ -222,7 +224,6 @@ def find_indels_substitutions_legacy(read_seq_al, ref_seq_al, _include_indx): substitution_positions=[] all_substitution_values=[] substitution_values=[] - nucSet = set(['A', 'T', 'C', 'G', 'N']) idx=0 for idx_c, c in enumerate(ref_seq_al): @@ -296,28 +297,27 @@ def find_indels_substitutions_legacy(read_seq_al, ref_seq_al, _include_indx): insertion_n = np.sum(insertion_sizes) - retDict = { - 'all_insertion_positions':all_insertion_positions, - 'all_insertion_left_positions':all_insertion_left_positions, - 'insertion_positions':insertion_positions, - 'insertion_coordinates':insertion_coordinates, - 'insertion_sizes':insertion_sizes, - 'insertion_n':insertion_n, - - 'all_deletion_positions':all_deletion_positions, - 'deletion_positions':deletion_positions, - 'deletion_coordinates':deletion_coordinates, - 'deletion_sizes':deletion_sizes, - 'deletion_n':deletion_n, - - 'all_substitution_positions':all_substitution_positions, - 'substitution_positions':substitution_positions, - 'all_substitution_values':np.array(all_substitution_values), - 'substitution_values':np.array(substitution_values), - 'substitution_n':substitution_n, - - 'ref_positions':ref_positions, + 'all_insertion_positions':all_insertion_positions, + 'all_insertion_left_positions':all_insertion_left_positions, + 'insertion_positions':insertion_positions, + 'insertion_coordinates':insertion_coordinates, + 'insertion_sizes':insertion_sizes, + 'insertion_n':insertion_n, + 'all_deletion_positions':all_deletion_positions, + + 'deletion_positions':deletion_positions, + 'deletion_coordinates':deletion_coordinates, + 'deletion_sizes':deletion_sizes, + 'deletion_n':deletion_n, + + 'all_substitution_positions':all_substitution_positions, + 'substitution_positions':substitution_positions, + 'all_substitution_values':np.array(all_substitution_values), + 'substitution_values':np.array(substitution_values), + 'substitution_n':substitution_n, + + 'ref_positions':ref_positions, } return retDict diff --git a/CRISPResso2/CRISPRessoCompareCORE.py b/CRISPResso2/CRISPRessoCompareCORE.py index b70892ec..abccdddd 100644 --- a/CRISPResso2/CRISPRessoCompareCORE.py +++ b/CRISPResso2/CRISPRessoCompareCORE.py @@ -10,7 +10,6 @@ import traceback import argparse from CRISPResso2 import CRISPRessoShared -from CRISPResso2 import CRISPRessoPlot from CRISPResso2.CRISPRessoReports import CRISPRessoReport import logging @@ -84,27 +83,16 @@ def main(): ''' compare_header = CRISPRessoShared.get_crispresso_header(description, compare_header) print(compare_header) - - parser = argparse.ArgumentParser(description='CRISPRessoCompare Parameters', formatter_class=argparse.ArgumentDefaultsHelpFormatter) - parser.add_argument('crispresso_output_folder_1', type=str, help='First output folder with CRISPResso analysis') - parser.add_argument('crispresso_output_folder_2', type=str, help='Second output folder with CRISPResso analysis') - - #OPTIONALS - parser.add_argument('-n', '--name', help='Output name', default='') - parser.add_argument('-n1', '--sample_1_name', help='Sample 1 name') - parser.add_argument('-n2', '--sample_2_name', help='Sample 2 name') - parser.add_argument('-o', '--output_folder', help='', default='') - parser.add_argument('--reported_qvalue_cutoff', help='Q-value cutoff for signifance in tests for differential editing. Each base position is tested (for insertions, deletions, substitutions, and all modifications) using Fisher\'s exact test, followed by Bonferonni correction. The number of bases with a significance below this threshold in the quantification window are counted and reported in the output summary.', type=float, default=0.05) - parser.add_argument('--min_frequency_alleles_around_cut_to_plot', type=float, help='Minimum %% reads required to report an allele in the alleles table plot.', default=0.2) - parser.add_argument('--max_rows_alleles_around_cut_to_plot', type=int, help='Maximum number of rows to report in the alleles table plot. ', default=50) - parser.add_argument('--suppress_report', help='Suppress output report', action='store_true') - parser.add_argument('--place_report_in_output_folder', help='If true, report will be written inside the CRISPResso output folder. By default, the report will be written one directory up from the report output.', action='store_true') - parser.add_argument('--zip_output', help="If set, the output will be placed in a zip folder.", action='store_true') - parser.add_argument('--debug', help='Show debug messages', action='store_true') - parser.add_argument('-v', '--verbosity', type=int, help='Verbosity level of output to the console (1-4)', default=3) + + parser = CRISPRessoShared.getCRISPRessoArgParser("Compare", parser_title = 'CRISPRessoCompare Parameters') args = parser.parse_args() + if args.use_matplotlib or not CRISPRessoShared.is_C2Pro_installed(): + from CRISPResso2 import CRISPRessoPlot + else: + from CRISPRessoPro import plot as CRISPRessoPlot + CRISPRessoShared.set_console_log_level(logger, args.verbosity, args.debug) debug_flag = args.debug @@ -154,7 +142,7 @@ def main(): log_filename = _jp('CRISPRessoCompare_RUNNING_LOG.txt') logger.addHandler(logging.FileHandler(log_filename)) - logger.addHandler(CRISPRessoShared.StatusHandler(_jp('CRISPRessoCompare_status.txt'))) + logger.addHandler(CRISPRessoShared.StatusHandler(_jp('CRISPRessoCompare_status.json'))) with open(log_filename, 'w+') as outfile: outfile.write('[Command used]:\nCRISPRessoCompare %s\n\n[Execution log]:\n' % ' '.join(sys.argv)) diff --git a/CRISPResso2/CRISPRessoMetaCORE.py b/CRISPResso2/CRISPRessoMetaCORE.py index e2e0b843..a0e3936e 100644 --- a/CRISPResso2/CRISPRessoMetaCORE.py +++ b/CRISPResso2/CRISPRessoMetaCORE.py @@ -13,7 +13,6 @@ import traceback import json from CRISPResso2 import CRISPRessoShared -from CRISPResso2 import CRISPRessoPlot from CRISPResso2 import CRISPRessoMultiProcessing from CRISPResso2.CRISPRessoReports import CRISPRessoReport @@ -87,7 +86,7 @@ def main(): ''' print(CRISPRessoShared.get_crispresso_header(description, meta_string)) - parser = CRISPRessoShared.getCRISPRessoArgParser(parser_title = 'CRISPRessoMeta Parameters') + parser = CRISPRessoShared.getCRISPRessoArgParser("Meta", parser_title = 'CRISPRessoMeta Parameters') #batch specific params parser.add_argument('--metadata', type=str, help='Metadata file according to NIST specification', required=True) @@ -96,11 +95,16 @@ def main(): args = parser.parse_args() + if args.use_matplotlib or not CRISPRessoShared.is_C2Pro_installed(): + from CRISPResso2 import CRISPRessoPlot + else: + from CRISPRessoPro import plot as CRISPRessoPlot + CRISPRessoShared.set_console_log_level(logger, args.verbosity, args.debug) debug_flag = args.debug - crispresso_options = CRISPRessoShared.get_crispresso_options() + crispresso_options = CRISPRessoShared.get_core_crispresso_options() options_to_ignore = {'name', 'output_folder'} crispresso_options_for_meta = list(crispresso_options-options_to_ignore) @@ -123,7 +127,7 @@ def main(): print('table:') print(meta_params) #rename column "a" to "amplicon_seq", etc - meta_params.rename(index=str, columns=CRISPRessoShared.get_crispresso_options_lookup(), inplace=True) + meta_params.rename(index=str, columns=CRISPRessoShared.get_crispresso_options_lookup("Core"), inplace=True) meta_count = meta_params.shape[0] meta_params.index = range(meta_count) @@ -229,7 +233,7 @@ def main(): log_filename=_jp('CRISPRessoMeta_RUNNING_LOG.txt') logger.addHandler(logging.FileHandler(log_filename)) - logger.addHandler(CRISPRessoShared.StatusHandler(_jp('CRISPRessoMeta_status.txt'))) + logger.addHandler(CRISPRessoShared.StatusHandler(_jp('CRISPRessoMeta_status.json'))) with open(log_filename, 'w+') as outfile: outfile.write('[Command used]:\n%s\n\n[Execution log]:\n' % ' '.join(sys.argv)) diff --git a/CRISPResso2/CRISPRessoPlot.py b/CRISPResso2/CRISPRessoPlot.py index 8da1d450..cc886b66 100644 --- a/CRISPResso2/CRISPRessoPlot.py +++ b/CRISPResso2/CRISPRessoPlot.py @@ -8,12 +8,12 @@ import numpy as np import pandas as pd import matplotlib +import json matplotlib.use('AGG') import matplotlib.pyplot as plt import matplotlib.patches as patches import matplotlib.cm as cm import matplotlib.gridspec as gridspec -import plotly.express as px from collections import defaultdict from copy import deepcopy import re @@ -95,7 +95,7 @@ def hex_to_rgb(value): lv = len(value) return tuple(int(value[i:i + lv // 3], 16) for i in range(0, lv, lv // 3)) -def plot_nucleotide_quilt(nuc_pct_df,mod_pct_df,fig_filename_root, custom_colors, save_also_png=False,sgRNA_intervals=None,min_text_pct=0.5,max_text_pct=0.95,quantification_window_idxs=None,sgRNA_names=None,sgRNA_mismatches=None,shade_unchanged=True,group_column='Batch'): +def plot_nucleotide_quilt(nuc_pct_df,mod_pct_df,fig_filename_root, custom_colors, save_also_png=False,sgRNA_intervals=None,min_text_pct=0.5,max_text_pct=0.95,quantification_window_idxs=None,sgRNA_names=None,sgRNA_mismatches=None,shade_unchanged=True,group_column='Batch', **kwargs): """ Plots a nucleotide quilt with each square showing the percentage of each base at that position in the reference nuc_pct_df: dataframe with percents of each base (ACTGN-) at each position @@ -240,7 +240,7 @@ def plot_nucleotide_quilt(nuc_pct_df,mod_pct_df,fig_filename_root, custom_colors plot_y_start = ref_y_start - 0.1 - if sgRNA_intervals and len(sgRNA_intervals) > 0: + if sgRNA_intervals: sgRNA_rows = get_rows_for_sgRNA_annotation(sgRNA_intervals, amp_len) num_sgRNA_rows = max(sgRNA_rows) + 1 sgRNA_y_height = num_sgRNA_rows * 0.3 @@ -332,6 +332,7 @@ def plot_indel_size_distribution( title, plot_root, save_also_png=False, + **kwargs, ): fig, ax = plt.subplots(figsize=(10, 10)) densityPct_0 = 0.0 @@ -381,7 +382,9 @@ def plot_frequency_deletions_insertions( xmax_del, xmax_ins, xmax_mut, + custom_colors, save_also_png=False, + **kwargs, ): y_values_mut = ref['y_values_mut'] x_bins_mut = ref['x_bins_mut'] @@ -517,6 +520,7 @@ def plot_amplicon_modifications( plot_root, custom_colors, save_also_png=False, + **kwargs, ): fig, ax = plt.subplots(figsize=(10, 10)) @@ -669,6 +673,7 @@ def plot_modification_frequency( plot_root, custom_colors, save_also_png=False, + **kwargs, ): fig, ax = plt.subplots(figsize=(10, 10)) @@ -838,6 +843,7 @@ def plot_quantification_window_locations( plot_root, custom_colors, save_also_png, + **kwargs, ): fig, ax = plt.subplots(figsize=(10, 10)) @@ -1005,6 +1011,7 @@ def plot_position_dependent_indels( plot_titles, plot_root, save_also_png, + **kwargs, ): fig, ax = plt.subplots(1, 2, figsize=(24, 10)) ax1 = ax[0] @@ -1110,6 +1117,7 @@ def plot_global_modifications_reference( plot_root, custom_colors, save_also_png=False, + **kwargs, ): fig, ax = plt.subplots(figsize=(10, 10)) ref1_all_insertion_positions = ref1_all_insertion_count_vectors @@ -1268,6 +1276,7 @@ def plot_frameshift_analysis( ref_name, plot_root, save_also_png=False, + **kwargs, ): """Plot 5: Plot a pie chart to plot_root showing classification of reads with regard to coding region for a specific reference sequence, also including a diagram of where the coding region is within the amplicon. @@ -1416,6 +1425,7 @@ def plot_frameshift_frequency( plot_titles, plot_root, save_also_png=False, + **kwargs, ): fig, ax = plt.subplots(1, 2, figsize=(22, 10)) ax1 = ax[0] @@ -1511,6 +1521,7 @@ def plot_global_frameshift_analysis( global_non_modified_non_frameshift, plot_root, save_also_png=False, + **kwargs, ): fig, ax = plt.subplots(figsize=(12, 12)) @@ -1547,6 +1558,7 @@ def plot_global_frameshift_in_frame_mutations( global_hists_inframe, plot_root, save_also_png=False, + **kwargs, ): fig, axs = plt.subplots(2, 1, figsize=(22, 10)) ax1 = axs[0] @@ -1643,6 +1655,7 @@ def plot_impact_on_splice_sites( global_count_total, plot_root, save_also_png=False, + **kwargs, ): fig, ax = plt.subplots(figsize=(12, 12)) patches, texts, autotexts = ax.pie( @@ -1682,6 +1695,7 @@ def plot_non_coding_mutations( plot_root, custom_colors, save_also_png=False, + **kwargs, ): fig, ax = plt.subplots(figsize=(10, 10)) ax.plot( @@ -1822,6 +1836,7 @@ def plot_potential_splice_sites( count_total, plot_root, save_also_png=False, + **kwargs, ): fig, ax = plt.subplots(figsize=(12, 12)) patches, texts, autotexts = ax.pie( @@ -1852,6 +1867,7 @@ def plot_scaffold_indel_lengths( df_scaffold_insertion_sizes, plot_root, save_also_png=False, + **kwargs, ): colors = ['b', 'g'] fig, ax = plt.subplots(figsize=(12, 6)) @@ -1996,7 +2012,7 @@ def add_sgRNA_to_ax(ax,sgRNA_intervals,sgRNA_y_start,sgRNA_y_height,amp_len,x_of else: ax.text(x_offset+min_sgRNA_x, this_sgRNA_y_start + this_sgRNA_y_height/2, 'sgRNA ', horizontalalignment='right', verticalalignment='center', fontsize=font_size) -def plot_conversion_map(nuc_pct_df,fig_filename_root,conversion_nuc_from,conversion_nuc_to,save_also_png,custom_colors,plotPct = 0.9,min_text_pct=0.3,max_text_pct=0.9,conversion_scale_max=None,sgRNA_intervals=None,quantification_window_idxs=None,sgRNA_names=None,sgRNA_mismatches=None): +def plot_conversion_map(nuc_pct_df,fig_filename_root,conversion_nuc_from,conversion_nuc_to,save_also_png,custom_colors,plotPct = 0.9,min_text_pct=0.3,max_text_pct=0.9,conversion_scale_max=None,sgRNA_intervals=None,quantification_window_idxs=None,sgRNA_names=None,sgRNA_mismatches=None,**kwargs): """ Plots a heatmap of conversion across several sequences :param nuc_pct_df combined df of multiple batches @@ -2168,7 +2184,7 @@ def plot_conversion_map(nuc_pct_df,fig_filename_root,conversion_nuc_from,convers plt.close(fig) -def plot_subs_across_ref(ref_len, ref_seq, ref_name, ref_count, all_substitution_base_vectors, plot_title, fig_filename_root, save_also_png, custom_colors, quantification_window_idxs=None): +def plot_subs_across_ref(ref_len, ref_seq, ref_name, ref_count, all_substitution_base_vectors, plot_title, fig_filename_root, save_also_png, custom_colors, quantification_window_idxs=None,**kwargs): """ Plots substitutions across the reference sequece - each position on the x axis reprsents a nucleotide in the reference bars at each x posion show the number of times the reference nucleotide was substituted for another reference @@ -2233,7 +2249,7 @@ def plot_subs_across_ref(ref_len, ref_seq, ref_name, ref_count, all_substitution fig.savefig(fig_filename_root + '.png', bbox_extra_artists=(lgd,), bbox_inches='tight') plt.close(fig) -def plot_sub_freqs(alt_nuc_counts, plot_title, fig_filename_root, save_also_png, custom_colors): +def plot_sub_freqs(alt_nuc_counts, plot_title, fig_filename_root, save_also_png, custom_colors,**kwargs): """ Plots histogram of substitution frequencies for each nucleotide (from nuc X to nuc Y) input: @@ -2263,7 +2279,7 @@ def plot_sub_freqs(alt_nuc_counts, plot_title, fig_filename_root, save_also_png, fig.savefig(fig_filename_root + '.png', bbox_inches='tight') plt.close(fig) -def plot_nuc_freqs(df_nuc_freq, tot_aln_reads, plot_title, fig_filename_root, save_also_png): +def plot_nuc_freqs(df_nuc_freq, tot_aln_reads, plot_title, fig_filename_root, save_also_png,**kwargs): """ Plots a heatmap of the percentage of reads that had each nucletide at each base in the reference Positions in the reference that have more than one allele can be spotted using this plot @@ -2279,7 +2295,7 @@ def plot_nuc_freqs(df_nuc_freq, tot_aln_reads, plot_title, fig_filename_root, sa plt.savefig(fig_filename_root + '.png', bbox_inches='tight') plt.close() -def plot_log_nuc_freqs(df_nuc_freq,tot_aln_reads,plot_title,fig_filename_root,save_also_png,quantification_window_idxs=None): +def plot_log_nuc_freqs(df_nuc_freq,tot_aln_reads,plot_title,fig_filename_root,save_also_png,quantification_window_idxs=None,**kwargs): """ Plots a heatmap of the percentage of reads that had each nucletide at each base in the reference Positions in the reference that have more than one allele can be spotted using this plot @@ -2317,7 +2333,7 @@ def plot_log_nuc_freqs(df_nuc_freq,tot_aln_reads,plot_title,fig_filename_root,sa plt.close(fig) -def plot_conversion_at_sel_nucs(df_subs, ref_name, ref_sequence, plot_title, conversion_nuc_from, fig_filename_root, save_also_png, custom_colors): +def plot_conversion_at_sel_nucs(df_subs, ref_name, ref_sequence, plot_title, conversion_nuc_from, fig_filename_root, save_also_png, custom_colors,**kwargs): ''' Plots the conversion at selected nucleotides Looks for the 'conversion_nuc_from' in the ref_sequence and sets those as 'selected nucleotides' @@ -2379,7 +2395,7 @@ def plot_conversion_at_sel_nucs(df_subs, ref_name, ref_sequence, plot_title, con fig.savefig(fig_filename_root+'.png', bbox_inches='tight', pad_inches=0.1) plt.close(fig) -def plot_conversion_at_sel_nucs_not_include_ref(df_subs, ref_name, ref_sequence, plot_title, conversion_nuc_from, fig_filename_root, save_also_png, custom_colors): +def plot_conversion_at_sel_nucs_not_include_ref(df_subs, ref_name, ref_sequence, plot_title, conversion_nuc_from, fig_filename_root, save_also_png, custom_colors, **kwargs): ''' Plots the conversion at selected nucleotides but ignores non-substitutions (for example at nucs that are 'C' in the reference, bars show the proportion of A T G (not C)) Looks for the 'conversion_nuc_from' in the ref_sequence and sets those as 'selected nucleotides' @@ -2451,7 +2467,7 @@ def plot_conversion_at_sel_nucs_not_include_ref(df_subs, ref_name, ref_sequence, fig.savefig(fig_filename_root+'.png', bbox_inches='tight', pad_inches=0.1) plt.close(fig) -def plot_conversion_at_sel_nucs_not_include_ref_scaled(df_subs, ref_name, ref_sequence, plot_title, conversion_nuc_from, fig_filename_root, save_also_png, custom_colors): +def plot_conversion_at_sel_nucs_not_include_ref_scaled(df_subs, ref_name, ref_sequence, plot_title, conversion_nuc_from, fig_filename_root, save_also_png, custom_colors, **kwargs): ''' Plots the conversion at selected nucleotides not including reference base, scaled by number of events Looks for the 'conversion_nuc_from' in the ref_sequence and sets those as 'selected nucleotides' @@ -2721,7 +2737,21 @@ def prep_alleles_table_compare(df_alleles, sample_name_1, sample_name_2, MAX_N_R return X, annot, y_labels, insertion_dict, per_element_annot_kws -def plot_alleles_heatmap(reference_seq,fig_filename_root,X,annot,y_labels,insertion_dict,per_element_annot_kws,SAVE_ALSO_PNG=False,plot_cut_point=True,sgRNA_intervals=None,sgRNA_names=None,sgRNA_mismatches=None,custom_colors=None): +def plot_alleles_heatmap( + reference_seq, + fig_filename_root, + X, + annot, + y_labels, + insertion_dict, + per_element_annot_kws, + custom_colors, + SAVE_ALSO_PNG=False, + plot_cut_point=True, + sgRNA_intervals=None, + sgRNA_names=None, + sgRNA_mismatches=None, + **kwargs): """ Plots alleles in a heatmap (nucleotides color-coded for easy visualization) input: @@ -2890,7 +2920,7 @@ def plot_alleles_heatmap(reference_seq,fig_filename_root,X,annot,y_labels,insert fig.savefig(fig_filename_root+'.png', bbox_inches='tight', bbox_extra_artists=(lgd,)) plt.close(fig) -def plot_alleles_heatmap_hist(reference_seq,fig_filename_root,X,annot,y_labels,insertion_dict,per_element_annot_kws,count_values,SAVE_ALSO_PNG=False,plot_cut_point=True,sgRNA_intervals=None,sgRNA_names=None,sgRNA_mismatches=None,custom_colors=None): +def plot_alleles_heatmap_hist(reference_seq,fig_filename_root,X,annot,y_labels,insertion_dict,per_element_annot_kws,count_values,custom_colors,SAVE_ALSO_PNG=False,plot_cut_point=True,sgRNA_intervals=None,sgRNA_names=None,sgRNA_mismatches=None,**kwargs): """ Plots alleles in a heatmap (nucleotides color-coded for easy visualization) input: @@ -3025,7 +3055,7 @@ def plot_alleles_heatmap_hist(reference_seq,fig_filename_root,X,annot,y_labels,i plt.savefig(fig_filename_root+'.png', bbox_inches='tight', bbox_extra_artists=(lgd,), pad_inches=0.1) plt.close() -def plot_alleles_table(reference_seq,df_alleles,fig_filename_root,MIN_FREQUENCY=0.5,MAX_N_ROWS=100,SAVE_ALSO_PNG=False,plot_cut_point=True,sgRNA_intervals=None,sgRNA_names=None,sgRNA_mismatches=None,custom_colors=None,annotate_wildtype_allele='****'): +def plot_alleles_table(reference_seq,df_alleles,fig_filename_root,custom_colors,MIN_FREQUENCY=0.5,MAX_N_ROWS=100,SAVE_ALSO_PNG=False,plot_cut_point=True,sgRNA_intervals=None,sgRNA_names=None,sgRNA_mismatches=None,annotate_wildtype_allele='****',**kwargs): """ plots an allele table for a dataframe with allele frequencies input: @@ -3047,9 +3077,9 @@ def plot_alleles_table(reference_seq,df_alleles,fig_filename_root,MIN_FREQUENCY= for ix, is_ref in enumerate(is_reference): if is_ref: y_labels[ix] += annotate_wildtype_allele - plot_alleles_heatmap(reference_seq, fig_filename_root, X, annot, y_labels, insertion_dict, per_element_annot_kws, SAVE_ALSO_PNG, plot_cut_point, sgRNA_intervals, sgRNA_names, sgRNA_mismatches, custom_colors) + plot_alleles_heatmap(reference_seq, fig_filename_root, X, annot, y_labels, insertion_dict, per_element_annot_kws, custom_colors, SAVE_ALSO_PNG, plot_cut_point, sgRNA_intervals, sgRNA_names, sgRNA_mismatches) -def plot_alleles_table_from_file(alleles_file_name,fig_filename_root,MIN_FREQUENCY=0.5,MAX_N_ROWS=100,SAVE_ALSO_PNG=False,plot_cut_point=True,sgRNA_intervals=None,sgRNA_names=None,sgRNA_mismatches=None,custom_colors=None,annotate_wildtype_allele=''): +def plot_alleles_table_from_file(alleles_file_name,fig_filename_root,custom_colors,MIN_FREQUENCY=0.5,MAX_N_ROWS=100,SAVE_ALSO_PNG=False,plot_cut_point=True,sgRNA_intervals=None,sgRNA_names=None,sgRNA_mismatches=None,annotate_wildtype_allele='',**kwargs): """ plots an allele table for a dataframe with allele frequencies infers the reference sequence by finding reference sequences without gaps (-) @@ -3083,9 +3113,9 @@ def plot_alleles_table_from_file(alleles_file_name,fig_filename_root,MIN_FREQUEN for ix, is_ref in enumerate(is_reference): if is_ref: y_labels[ix] += annotate_wildtype_allele - plot_alleles_heatmap(reference_seq, fig_filename_root, X, annot, y_labels, insertion_dict, per_element_annot_kws, SAVE_ALSO_PNG, plot_cut_point, sgRNA_intervals, sgRNA_names, sgRNA_mismatches, custom_colors) + plot_alleles_heatmap(reference_seq, fig_filename_root, X, annot, y_labels, insertion_dict, per_element_annot_kws, custom_colors, SAVE_ALSO_PNG, plot_cut_point, sgRNA_intervals, sgRNA_names, sgRNA_mismatches) -def plot_alleles_tables_from_folder(crispresso_output_folder,fig_filename_root,MIN_FREQUENCY=None,MAX_N_ROWS=None,SAVE_ALSO_PNG=False,custom_colors=None,plot_cut_point=True,sgRNA_intervals=None,sgRNA_names=None,sgRNA_mismatches=None): +def plot_alleles_tables_from_folder(crispresso_output_folder,fig_filename_root,custom_colors,MIN_FREQUENCY=None,MAX_N_ROWS=None,SAVE_ALSO_PNG=False,plot_cut_point=True,sgRNA_intervals=None,sgRNA_names=None,sgRNA_mismatches=None,**kwargs): """ plots an allele table for each sgRNA/amplicon in a CRISPresso run (useful for plotting after running using the plot harness) This function is only used for one-off plotting purposes and not for the general CRISPResso analysis @@ -3152,11 +3182,11 @@ def plot_alleles_tables_from_folder(crispresso_output_folder,fig_filename_root,M new_sgRNA_intervals += [(int_start - new_sel_cols_start - 1, int_end - new_sel_cols_start - 1)] X, annot, y_labels, insertion_dict, per_element_annot_kws, is_reference = prep_alleles_table(df_alleles, ref_seq_around_cut, MAX_N_ROWS, MIN_FREQUENCY) - plot_alleles_heatmap(ref_seq_around_cut, fig_filename_root+"_"+ref_name+"_"+sgRNA_label, X, annot, y_labels, insertion_dict, per_element_annot_kws, SAVE_ALSO_PNG, plot_cut_point, new_sgRNA_intervals, sgRNA_names, sgRNA_mismatches, custom_colors) + plot_alleles_heatmap(ref_seq_around_cut, fig_filename_root+"_"+ref_name+"_"+sgRNA_label, X, annot, y_labels, insertion_dict, per_element_annot_kws, custom_colors, SAVE_ALSO_PNG, plot_cut_point, new_sgRNA_intervals, sgRNA_names, sgRNA_mismatches) plot_count += 1 print('Plotted ' + str(plot_count) + ' plots') -def plot_alleles_table_compare(reference_seq,df_alleles,sample_name_1,sample_name_2,fig_filename_root,MIN_FREQUENCY=0.5,MAX_N_ROWS=100,SAVE_ALSO_PNG=False,plot_cut_point=True,sgRNA_intervals=None,sgRNA_names=None,sgRNA_mismatches=None,custom_colors=None): +def plot_alleles_table_compare(reference_seq,df_alleles,sample_name_1,sample_name_2,fig_filename_root,custom_colors=None,MIN_FREQUENCY=0.5,MAX_N_ROWS=100,SAVE_ALSO_PNG=False,plot_cut_point=True,sgRNA_intervals=None,sgRNA_names=None,sgRNA_mismatches=None,**kwargs): """ plots an allele table for a dataframe with allele frequencies from two CRISPResso runs input: @@ -3174,9 +3204,9 @@ def plot_alleles_table_compare(reference_seq,df_alleles,sample_name_1,sample_nam custom_colors: dict of colors to plot (e.g. colors['A'] = (1,0,0,0.4) # red,blue,green,alpha ) """ X, annot, y_labels, insertion_dict, per_element_annot_kws = prep_alleles_table_compare(df_alleles, sample_name_1, sample_name_2, MAX_N_ROWS, MIN_FREQUENCY) - plot_alleles_heatmap(reference_seq, fig_filename_root, X, annot, y_labels, insertion_dict, per_element_annot_kws, SAVE_ALSO_PNG, plot_cut_point, sgRNA_intervals, sgRNA_names, sgRNA_mismatches, custom_colors) + plot_alleles_heatmap(reference_seq, fig_filename_root, X, annot, y_labels, insertion_dict, per_element_annot_kws, custom_colors, SAVE_ALSO_PNG, plot_cut_point, sgRNA_intervals, sgRNA_names, sgRNA_mismatches) -def plot_nucleotide_quilt_from_folder(crispresso_output_folder,fig_filename_root,save_also_png=False,sgRNA_intervals=None,min_text_pct=0.5,max_text_pct=0.95,quantification_window_idxs=None,sgRNA_names=None,sgRNA_mismatches=None,shade_unchanged=True): +def plot_nucleotide_quilt_from_folder(crispresso_output_folder,fig_filename_root,save_also_png=False,sgRNA_intervals=None,min_text_pct=0.5,max_text_pct=0.95,quantification_window_idxs=None,sgRNA_names=None,sgRNA_mismatches=None,shade_unchanged=True,**kwargs): """ plots an allele table for each sgRNA/amplicon in a CRISPresso run (useful for plotting after running using the plot harness) This function is only used for one-off plotting purposes and not for the general CRISPResso analysis @@ -3252,7 +3282,7 @@ def plot_nucleotide_quilt_from_folder(crispresso_output_folder,fig_filename_root plot_count += 1 print('Plotted ' + str(plot_count) + ' plots') -def plot_unmod_mod_pcts(fig_filename_root,df_summary_quantification,save_png,cutoff=None,max_samples_to_include_unprocessed=20): +def plot_unmod_mod_pcts(fig_filename_root,df_summary_quantification,save_png,cutoff=None,max_samples_to_include_unprocessed=20,**kwargs): """ plots a stacked horizontal barplot for summarizing number of reads, and the percent that are modified and unmodified params: @@ -3311,7 +3341,7 @@ def plot_unmod_mod_pcts(fig_filename_root,df_summary_quantification,save_png,cut fig.savefig(fig_filename_root+'.png', bbox_inches='tight') plt.close(fig) -def plot_reads_total(fig_filename_root,df_summary_quantification,save_png,cutoff=None): +def plot_reads_total(fig_filename_root,df_summary_quantification,save_png,cutoff=None,**kwargs): """ plots a horizontal barplot for summarizing number of reads aligned to each sample """ @@ -3344,7 +3374,7 @@ def plot_reads_total(fig_filename_root,df_summary_quantification,save_png,cutoff def plot_read_barplot(N_READS_INPUT, N_READS_AFTER_PREPROCESSING, N_TOTAL, - plot_root, save_png + plot_root, save_png,**kwargs ): """Plot barplot of total, processed, and aligned reads. @@ -3399,7 +3429,7 @@ def plot_read_barplot(N_READS_INPUT, N_READS_AFTER_PREPROCESSING, N_TOTAL, def plot_class_piechart_and_barplot(class_counts_order, class_counts, ref_names, expected_hdr_amplicon_seq, N_TOTAL, - piechart_plot_root, barplot_plot_root, save_png): + piechart_plot_root, barplot_plot_root, custom_colors, save_png,**kwargs): """Plot a pie chart and barplot of class assignments for reads. Class assignments include: 'MODIFIED','UNMODIFIED','HDR',etc. @@ -3494,7 +3524,7 @@ def plot_class_piechart_and_barplot(class_counts_order, class_counts, ref_names, plt.close() -def plot_class_dsODN_piechart(sizes, labels, plot_root, save_also_png=False): +def plot_class_dsODN_piechart(sizes, labels, plot_root, save_also_png=False,**kwargs): fig, ax = plt.subplots(figsize=(12, 12)) patches, texts, autotexts =ax.pie(sizes, labels=labels, autopct='%1.2f%%') @@ -3519,6 +3549,7 @@ def plot_quantification_comparison_barchart( plot_titles, plot_path, save_also_png=False, + **kwargs ): fig, axs = plt.subplots(1, 2, figsize=(30, 15)) n_groups = 2 @@ -3597,6 +3628,7 @@ def plot_quantification_positions( plot_title, plot_path, save_also_png=False, + **kwargs, ): fig, axs = plt.subplots(2, 1, figsize=(20, 10)) ax1 = axs[0] @@ -3737,85 +3769,3 @@ def plot_quantification_positions( ) plt.close(fig) - - -def plot_allele_modification_heatmap( - sample_values, sample_sgRNA_intervals, plot_path, title, -): - fig = px.imshow( - sample_values, - labels={ - 'x': 'Amplicon Nucleotide (Position)', - 'y': 'Sample (Index)', - 'color': '{0} (%)'.format(title), - }, - aspect='auto', - ) - for sample_id, sgRNA_intervals in zip( - range(sample_values.shape[0]), sample_sgRNA_intervals, - ): - for sgRNA_interval in sgRNA_intervals: - fig.add_shape( - type='rect', - x0=sgRNA_interval[0], - y0=sample_id - 0.5, - x1=sgRNA_interval[1], - y1=sample_id + 0.5, - line={'color': 'Black'}, - ) - - fig.update_layout( - autosize=True, - ) - fig['layout']['yaxis']['scaleanchor'] = 'x' - fig['layout']['yaxis']['gridcolor'] = 'rgba(0, 0, 0, 0)' - fig['layout']['xaxis']['gridcolor'] = 'rgba(0, 0, 0, 0)' - return fig.write_html( - plot_path, - config={ - 'responsive': True, - 'displaylogo': False, - }, - include_plotlyjs='cdn', - full_html=False, - div_id='allele-modification-heatmap-{0}'.format(title.lower()), - ) - - -def plot_allele_modification_line( - sample_values, sample_sgRNA_intervals, plot_path, title, -): - fig = px.line(sample_values.transpose()) - sgRNA_intervals = set( - tuple(sgRNA_interval) - for sample_sgRNA_interval in sample_sgRNA_intervals - for sgRNA_interval in sample_sgRNA_interval - ) - for sgRNA_interval in sgRNA_intervals: - fig.add_shape( - type='rect', - x0=sgRNA_interval[0], - y0=0, - x1=sgRNA_interval[1], - y1=0.5, - fillcolor='Gray', - opacity=0.2, - line={'color': 'gray'}, - ) - - fig.update_layout( - autosize=True, - xaxis_title='Amplicon Nucleotide (Position)', - yaxis_title='{0} (%)'.format(title), - legend_title='Samples', - ) - return fig.write_html( - plot_path, - config={ - 'responsive': True, - 'displaylogo': False, - }, - include_plotlyjs='cdn', - full_html=False, - div_id='allele-modification-line-{0}'.format(title.lower()), - ) diff --git a/CRISPResso2/CRISPRessoPooledCORE.py b/CRISPResso2/CRISPRessoPooledCORE.py index d84b987e..8c63dc42 100644 --- a/CRISPResso2/CRISPRessoPooledCORE.py +++ b/CRISPResso2/CRISPRessoPooledCORE.py @@ -19,7 +19,7 @@ from CRISPResso2 import CRISPRessoShared from CRISPResso2 import CRISPRessoMultiProcessing from CRISPResso2.CRISPRessoReports import CRISPRessoReport -from CRISPResso2 import CRISPRessoPlot + import traceback import logging @@ -107,7 +107,7 @@ def summarize_region_fastq_chunk(input_arr): for input in input_arr: # print('doing region ' + str(input)) region_fastq, uncompressed_reference = input.split(" ") - #region format: REGION_chr8_1077_1198.fastq.gz + # region format: REGION_chr8_1077_1198.fastq.gz #But if the chr has underscores, it could look like this: # REGION_chr8_KI270812v1_alt_1077_1198.fastq.gz region_info = os.path.basename(region_fastq).replace('.fastq.gz', '').replace('.fastq', '').split('_') @@ -294,50 +294,18 @@ def main(): )) sys.exit() - parser = CRISPRessoShared.getCRISPRessoArgParser(parser_title = 'CRISPRessoPooled Parameters') - parser.add_argument('-f', '--amplicons_file', type=str, help='Amplicons description file. This file is a tab-delimited text file with up to 14 columns (2 required):\ - \namplicon_name: an identifier for the amplicon (must be unique).\ - \namplicon_seq: amplicon sequence used in the experiment.\ - \nguide_seq (OPTIONAL): sgRNA sequence used for this amplicon without the PAM sequence. Multiple guides can be given separated by commas and not spaces.\ - \nexpected_hdr_amplicon_seq (OPTIONAL): expected amplicon sequence in case of HDR.\ - \ncoding_seq (OPTIONAL): Subsequence(s) of the amplicon corresponding to coding sequences. If more than one separate them by commas and not spaces.\ - \nprime_editing_pegRNA_spacer_seq (OPTIONAL): pegRNA spacer sgRNA sequence used in prime editing. The spacer should not include the PAM sequence. The sequence should be given in the RNA 5\'->3\' order, so for Cas9, the PAM would be on the right side of the given sequence.\ - \nprime_editing_nicking_guide_seq (OPTIONAL): Nicking sgRNA sequence used in prime editing. The sgRNA should not include the PAM sequence. The sequence should be given in the RNA 5\'->3\' order, so for Cas9, the PAM would be on the right side of the sequence.\ - \nprime_editing_pegRNA_extension_seq (OPTIONAL): Extension sequence used in prime editing. The sequence should be given in the RNA 5\'->3\' order, such that the sequence starts with the RT template including the edit, followed by the Primer-binding site (PBS).\ - \nprime_editing_pegRNA_scaffold_seq (OPTIONAL): If given, reads containing any of this scaffold sequence before extension sequence (provided by --prime_editing_extension_seq) will be classified as \'Scaffold-incorporated\'. The sequence should be given in the 5\'->3\' order such that the RT template directly follows this sequence. A common value ends with \'GGCACCGAGUCGGUGC\'.\ - \nprime_editing_pegRNA_scaffold_min_match_length (OPTIONAL): Minimum number of bases matching scaffold sequence for the read to be counted as \'Scaffold-incorporated\'. If the scaffold sequence matches the reference sequence at the incorporation site, the minimum number of bases to match will be minimally increased (beyond this parameter) to disambiguate between prime-edited and scaffold-incorporated sequences.\ - \nprime_editing_override_prime_edited_ref_seq (OPTIONAL): If given, this sequence will be used as the prime-edited reference sequence. This may be useful if the prime-edited reference sequence has large indels or the algorithm cannot otherwise infer the correct reference sequence.\ - \nquantification_window_coordinates (OPTIONAL): Bp positions in the amplicon sequence specifying the quantification window. This parameter overrides values of the "--quantification_window_center", "-- cleavage_offset", "--window_around_sgrna" or "-- window_around_sgrna" values. Any indels/substitutions outside this window are excluded. Indexes are 0-based, meaning that the first nucleotide is position 0. Ranges are separated by the dash sign like "start-stop", and multiple ranges can be separated by the underscore (\_). A value of 0 disables this filter. (can be comma-separated list of values, corresponding to amplicon sequences given in --amplicon_seq e.g. 5-10,5-10_20-30 would specify the 5th-10th bp in the first reference and the 5th-10th and 20th-30th bp in the second reference) (default: None)\ - \nquantification_window_size (OPTIONAL): Defines the size (in bp) of the quantification window extending from the position specified by the "--cleavage_offset" or "--quantification_window_center" parameter in relation to the provided guide RNA sequence(s) (--sgRNA). Mutations within this number of bp from the quantification window center are used in classifying reads as modified or unmodified. A value of 0 disables this window and indels in the entire amplicon are considered. Default is 1, 1bp on each side of the cleavage position for a total length of 2bp.\ - \nquantification_window_center (OPTIONAL): Center of quantification window to use within respect to the 3\' end of the provided sgRNA sequence. Remember that the sgRNA sequence must be entered without the PAM. For cleaving nucleases, this is the predicted cleavage position. The default is -3 and is suitable for the Cas9 system. For alternate nucleases, other cleavage offsets may be appropriate, for example, if using Cpf1 this parameter would be set to 1. For base editors, this could be set to -17.', default='') - - #tool specific optional - parser.add_argument('--gene_annotations', type=str, help='Gene Annotation Table from UCSC Genome Browser Tables (http://genome.ucsc.edu/cgi-bin/hgTables?command=start), \ - please select as table "knownGene", as output format "all fields from selected table" and as file returned "gzip compressed"', default='') - # rationale for setting the default scores: - # --end-to-end - no clipping, match bonus -ma is set to 0 - # -N 0 number of mismatches allowed in seed alignment - # --np 0 where read (or ref have ambiguous character (N)) penalty is 0 - # -mp 3,2 mismatch penalty - set max mismatch to -3 to coincide with the gap extension penalty (2 is the default min mismatch penalty) - # --score-min L,-5,-3*(1-H) For a given homology score, we allow up to (1-H) mismatches (-3) or gap extensions (-3) and one gap open (-5). This score translates to -5 + -3(1-H)L where L is the sequence length - parser.add_argument('--bowtie2_options_string', type=str, help='Override options for the Bowtie2 alignment command. By default, this is " --end-to-end -N 0 --np 0 -mp 3,2 --score-min L,-5,-3(1-H)" where H is the default homology score.', default='') - parser.add_argument('--use_legacy_bowtie2_options_string', help='Use legacy (more stringent) Bowtie2 alignment parameters: " -k 1 --end-to-end -N 0 --np 0 ".', action='store_true') - parser.add_argument('--min_reads_to_use_region', type=float, help='Minimum number of reads that align to a region to perform the CRISPResso analysis', default=1000) - parser.add_argument('--skip_failed', help='Continue with pooled analysis even if one sample fails', action='store_true') - parser.add_argument('--skip_reporting_problematic_regions', help='Skip reporting of problematic regions. By default, when both amplicons (-f) and genome (-x) are provided, problematic reads that align to the genome but to positions other than where the amplicons align are reported as problematic', action='store_true') - parser.add_argument('--crispresso_command', help='CRISPResso command to call', default='CRISPResso') - parser.add_argument('--compile_postrun_references', help='If set, a file will be produced which compiles the reference sequences of frequent amplicons.', action='store_true') - parser.add_argument('--compile_postrun_reference_allele_cutoff', type=float, help='Only alleles with at least this percentage frequency in the population will be reported in the postrun analysis. This parameter is given as a percent, so 30 is 30%%.', default=30) - parser.add_argument('--alternate_alleles', type=str, help='Path to tab-separated file with alternate allele sequences for pooled experiments. This file has the columns "region_name","reference_seqs", and "reference_names" and gives the reference sequences of alternate alleles that will be passed to CRISPResso for each individual region for allelic analysis. Multiple reference alleles and reference names for a given region name are separated by commas (no spaces).', default='') - parser.add_argument('--limit_open_files_for_demux', help='If set, only one file will be opened during demultiplexing of read alignment locations. This will be slightly slower as the reads must be sorted, but may be necessary if the number of amplicons is greater than the number of files that can be opened due to OS constraints.', action='store_true') - parser.add_argument('--aligned_pooled_bam', type=str, help='Path to aligned input for CRISPRessoPooled processing. If this parameter is specified, the alignments in the given bam will be used to demultiplex reads. If this parameter is not set (default), input reads provided by --fastq_r1 (and optionally --fastq_r2) will be aligned to the reference genome using bowtie2. If the input bam is given, the corresponding reference fasta must also be given to extract reference genomic sequences via the parameter --bowtie2_index. Note that if the aligned reads are paired-end sequenced, they should already be merged into 1 read (e.g. via Flash) before alignment.', default=None) - parser.add_argument('--demultiplex_only_at_amplicons', help='If set, and an amplicon file (--amplicons_file) and reference sequence (--bowtie2_index) are provided, reads overlapping alignment positions of amplicons will be demultiplexed and assigned to that amplicon. If this flag is not set, the entire genome will be demultiplexed and reads with the same start and stop coordinates as an amplicon will be assigned to that amplicon.', action='store_true') + parser = CRISPRessoShared.getCRISPRessoArgParser("Pooled", parser_title = 'CRISPRessoPooled Parameters') args = parser.parse_args() + if args.use_matplotlib or not CRISPRessoShared.is_C2Pro_installed(): + from CRISPResso2 import CRISPRessoPlot + else: + from CRISPRessoPro import plot as CRISPRessoPlot + CRISPRessoShared.set_console_log_level(logger, args.verbosity, args.debug) - crispresso_options = CRISPRessoShared.get_crispresso_options() + crispresso_options = CRISPRessoShared.get_core_crispresso_options() options_to_ignore = {'fastq_r1', 'fastq_r2', 'amplicon_seq', 'amplicon_name', 'output_folder', 'name', 'zip_output', 'split_interleaved_input'} crispresso_options_for_pooled = list(crispresso_options-options_to_ignore) @@ -359,7 +327,7 @@ def main(): log_filename = _jp('CRISPRessoPooled_RUNNING_LOG.txt') logger.addHandler(logging.FileHandler(log_filename)) - logger.addHandler(CRISPRessoShared.StatusHandler(_jp('CRISPRessoPooled_status.txt'))) + logger.addHandler(CRISPRessoShared.StatusHandler(_jp('CRISPRessoPooled_status.json'))) if args.zip_output and not args.place_report_in_output_folder: logger.warn('Invalid arguement combination: If zip_output is True then place_report_in_output_folder must also be True. Setting place_report_in_output_folder to True.') @@ -533,87 +501,72 @@ def main(): CRISPRessoShared.force_symlink(os.path.abspath(args.fastq_r1), symlink_filename) output_forward_filename = symlink_filename else: + info('Trimming sequences with fastp...') output_forward_filename = _jp('reads.trimmed.fq.gz') - # Trimming with trimmomatic - info('Trimming sequences with Trimmomatic...', {'percent_complete': 7}) - cmd = '%s SE -phred33 %s %s %s >>%s 2>&1'\ - % (args.trimmomatic_command, args.fastq_r1, - output_forward_filename, - args.trimmomatic_options_string, - log_filename) - # print cmd - TRIMMOMATIC_STATUS = sb.call(cmd, shell=True) - - if TRIMMOMATIC_STATUS: - raise TrimmomaticException('TRIMMOMATIC failed to run, please check the log file.') + cmd = '{command} -i {r1} -o {out} {options} --json {json_report} --html {html_report} >> {log} 2>&1'.format( + command=args.fastp_command, + r1=args.fastq_r1, + out=output_forward_filename, + options=args.fastp_options_string, + json_report=_jp('fastp_report.json'), + html_report=_jp('fastp_report.html'), + log=log_filename, + ) + fastp_status = sb.call(cmd, shell=True) + + if fastp_status: + raise CRISPRessoShared.FastpException('FASTP failed to run, please check the log file.') + info('Done!', {'percent_complete': 7}) processed_output_filename = output_forward_filename else: # paired end reads case if not args.trim_sequences: - output_forward_paired_filename = args.fastq_r1 - output_reverse_paired_filename = args.fastq_r2 + args.fastp_options_string += ' --disable_adapter_trimming --disable_trim_poly_g --disable_quality_filtering --disable_length_filtering' else: - info('Trimming sequences with Trimmomatic...', {'percent_complete': 7}) - output_forward_paired_filename = _jp('output_forward_paired.fq.gz') - output_forward_unpaired_filename = _jp('output_forward_unpaired.fq.gz') - output_reverse_paired_filename = _jp('output_reverse_paired.fq.gz') - output_reverse_unpaired_filename = _jp('output_reverse_unpaired.fq.gz') - - # Trimming with trimmomatic - cmd = '%s PE -phred33 %s %s %s %s %s %s %s >>%s 2>&1'\ - % (args.trimmomatic_command, - args.fastq_r1, args.fastq_r2, output_forward_paired_filename, - output_forward_unpaired_filename, output_reverse_paired_filename, - output_reverse_unpaired_filename, args.trimmomatic_options_string, log_filename) - # print cmd - TRIMMOMATIC_STATUS = sb.call(cmd, shell=True) - if TRIMMOMATIC_STATUS: - raise TrimmomaticException('TRIMMOMATIC failed to run, please check the log file.') - - info('Done!') - - max_overlap_string = "" - min_overlap_string = "" - if args.max_paired_end_reads_overlap: - max_overlap_string = "--max-overlap " + str(args.max_paired_end_reads_overlap) - if args.min_paired_end_reads_overlap: - min_overlap_string = "--min-overlap " + str(args.min_paired_end_reads_overlap) - # Merging with Flash - info('Merging paired sequences with Flash...', {'percent_complete': 10}) - cmd = args.flash_command+' --allow-outies %s %s %s %s -z -d %s >>%s 2>&1' %\ - (output_forward_paired_filename, - output_reverse_paired_filename, - max_overlap_string, - min_overlap_string, - OUTPUT_DIRECTORY, log_filename) - - if args.debug: - info('Flash command: %s'%cmd) + args.fastp_options_string += ' --detect_adapter_for_pe' - FLASH_STATUS = sb.call(cmd, shell=True) - if FLASH_STATUS: - raise FlashException('Flash failed to run, please check the log file.') + processed_output_filename = _jp('out.extendedFrags.fastq.gz') + not_combined_1_filename = _jp('out.notCombined_1.fastq.gz') + not_combined_2_filename = _jp('out.notCombined_2.fastq.gz') + + info('Merging paired sequences with fastp...') + fastp_cmd = '{command} -i {r1} -I {r2} --merge --merged_out {out_merged} --unpaired1 {unpaired1} --unpaired2 {unpaired2} --overlap_len_require {min_overlap} --thread {num_threads} --json {json_report} --html {html_report} {options} >> {log} 2>&1'.format( + command=args.fastp_command, + r1=args.fastq_r1, + r2=args.fastq_r2, + out_merged=processed_output_filename, + unpaired1=not_combined_1_filename, + unpaired2=not_combined_2_filename, + min_overlap=args.min_paired_end_reads_overlap, + num_threads=n_processes_for_pooled, + json_report=_jp('fastp_report.json'), + html_report=_jp('fastp_report.html'), + options=args.fastp_options_string, + log=log_filename, + ) + fastp_status = sb.call(fastp_cmd, shell=True) - flash_hist_filename = _jp('out.hist') - flash_histogram_filename = _jp('out.histogram') - flash_not_combined_1_filename = _jp('out.notCombined_1.fastq.gz') - flash_not_combined_2_filename = _jp('out.notCombined_2.fastq.gz') + if args.debug: + info('Fastp command: {0}'.format(fastp_cmd)) - processed_output_filename = _jp('out.extendedFrags.fastq.gz') + if fastp_status: + raise CRISPRessoShared.FastpException('Fastp failed to run, please check the log file.') + crispresso2_info['running_info']['fastp_command'] = fastp_cmd if args.force_merge_pairs: - old_flashed_filename = processed_output_filename new_merged_filename = _jp('out.forcemerged_uncombined.fastq.gz') - num_reads_force_merged = CRISPRessoShared.force_merge_pairs(flash_not_combined_1_filename, flash_not_combined_2_filename, new_merged_filename) + num_reads_force_merged = CRISPRessoShared.force_merge_pairs(not_combined_1_filename, not_combined_2_filename, new_merged_filename) new_output_filename = _jp('out.forcemerged.fastq.gz') - merge_command = "cat %s %s > %s"%(processed_output_filename, new_merged_filename, new_output_filename) - MERGE_STATUS = sb.call(merge_command, shell=True) - if MERGE_STATUS: - raise FlashException('Force-merging read pairs failed to run, please check the log file.') + merge_command = "cat {0} {1} > {2}".format(processed_output_filename, new_merged_filename, new_output_filename) + merge_status = sb.call(merge_command, shell=True) + if merge_status: + raise CRISPRessoShared.FastpException('Force-merging read pairs failed to run, please check the log file.') + else: + info(f'Forced {num_reads_force_merged} read pairs together.') processed_output_filename = new_output_filename - info('Done!') + info('Done!', {'percent_complete': 7}) if can_finish_incomplete_run and 'count_input_reads' in crispresso2_info['running_info']['finished_steps']: (N_READS_INPUT, N_READS_AFTER_PREPROCESSING) = crispresso2_info['running_info']['finished_steps']['count_input_reads'] @@ -660,7 +613,7 @@ def main(): head_line = amplicons_fin.readline() header_els = head_line.split('\t') - head_lookup = CRISPRessoShared.get_crispresso_options_lookup() # dict of qwc -> quantification_window_coordinates + head_lookup = CRISPRessoShared.get_crispresso_options_lookup("Core") # dict of qwc -> quantification_window_coordinates # add legacy CRISPRessoPooled headers to the head_lookup # lowercase input header names for matching - they'll get fixed in the matching to default_input_amplicon_headers @@ -891,7 +844,6 @@ def main(): else: warn('Skipping amplicon [%s] because no reads align to it\n'% idx) - CRISPRessoMultiProcessing.run_crispresso_cmds(crispresso_cmds, n_processes_for_pooled, 'amplicon', args.skip_failed, start_end_percent=(16, 80)) # Initialize array to track failed runs failed_batch_arr = [] diff --git a/CRISPResso2/CRISPRessoPooledWGSCompareCORE.py b/CRISPResso2/CRISPRessoPooledWGSCompareCORE.py index abac3cea..09cdd33f 100644 --- a/CRISPResso2/CRISPRessoPooledWGSCompareCORE.py +++ b/CRISPResso2/CRISPRessoPooledWGSCompareCORE.py @@ -231,7 +231,7 @@ def main(): log_filename = _jp('CRISPRessoPooledWGSCompare_RUNNING_LOG.txt') logger.addHandler(logging.FileHandler(log_filename)) - logger.addHandler(CRISPRessoShared.StatusHandler(_jp('CRISPRessoPooledWGSCompare_status.txt'))) + logger.addHandler(CRISPRessoShared.StatusHandler(_jp('CRISPRessoPooledWGSCompare_status.json'))) with open(log_filename, 'w+') as outfile: outfile.write( diff --git a/CRISPResso2/CRISPRessoReports/CRISPRessoReport.py b/CRISPResso2/CRISPRessoReports/CRISPRessoReport.py index c1e11c7c..c4c17fd7 100644 --- a/CRISPResso2/CRISPRessoReports/CRISPRessoReport.py +++ b/CRISPResso2/CRISPRessoReports/CRISPRessoReport.py @@ -5,10 +5,23 @@ ''' import os -from jinja2 import Environment, FileSystemLoader +from jinja2 import Environment, FileSystemLoader, PackageLoader, ChoiceLoader from jinja_partials import generate_render_partial, render_partial from CRISPResso2 import CRISPRessoShared +if CRISPRessoShared.is_C2Pro_installed(): + from CRISPRessoPro import __version__ as CRISPRessoProVersion + C2PRO_INSTALLED = True +else: + C2PRO_INSTALLED = False + + +def get_jinja_loader(_ROOT): + if CRISPRessoShared.is_C2Pro_installed(): + return Environment(loader=ChoiceLoader([FileSystemLoader(os.path.join(_ROOT, 'CRISPRessoReports', 'templates')), PackageLoader('CRISPRessoPro', 'templates')])) + else: + return Environment(loader=FileSystemLoader(os.path.join(_ROOT, 'CRISPRessoReports', 'templates'))) + def render_template(template_name, jinja2_env, **data): """Render a template with partials. @@ -36,6 +49,7 @@ def custom_partial_render(partial_template_name, **partial_data): ), is_default_user=False, is_web=False, + C2PRO_INSTALLED=C2PRO_INSTALLED, ) return template.render(**partial_data) return render_partial( @@ -59,8 +73,8 @@ def make_report_from_folder(crispresso_report_file, crispresso_folder, _ROOT): make_report(run_data, crispresso_report_file, crispresso_folder, _ROOT) -def add_fig_if_exists(fig_name, fig_root, fig_title, fig_caption, fig_data, - amplicon_fig_names, amplicon_figures, crispresso_folder): +def add_fig_if_exists(fig, fig_name, fig_root, fig_title, fig_caption, fig_data, + amplicon_fig_names, amplicon_figures, crispresso_folder, d3_nuc_quilt_names): """ Helper function to add figure if the file exists if fig at filename exists, @@ -69,8 +83,9 @@ def add_fig_if_exists(fig_name, fig_root, fig_title, fig_caption, fig_data, # fullpath=os.path.join(crispresso_folder,fig_root+'.png') pngfullpath = os.path.join(crispresso_folder, fig_root + '.png') htmlfullpath = os.path.join(crispresso_folder, fig_root + '.html') + jsonfullpath = os.path.join(crispresso_folder, f'plot_{fig_root}.json') # print('adding file ' + fig_root + ' at ' + fullpath) - if os.path.exists(pngfullpath) or os.path.exists(htmlfullpath): + if os.path.exists(pngfullpath) or os.path.exists(htmlfullpath) or os.path.exists(jsonfullpath): amplicon_fig_names.append(fig_name) # amplicon_fig_locs[fig_name]=os.path.basename(fig_root+'.png') amplicon_figures['locs'][fig_name] = os.path.basename(fig_root) @@ -86,6 +101,14 @@ def add_fig_if_exists(fig_name, fig_root, fig_title, fig_caption, fig_data, html_string += html.read() html_string += "" amplicon_figures['htmls'][fig_name] = html_string + elif os.path.exists(jsonfullpath) and C2PRO_INSTALLED: + root_name = fig_root.replace('.', '_').replace('-', '_') + d3_nuc_quilt_names.append(f"nuc_quilt_{root_name}") + with open(jsonfullpath) as fig_json_fh: + amplicon_figures['htmls'][fig_name] = f""" +
+ + """ def assemble_figs(run_data, crispresso_folder): @@ -93,15 +116,16 @@ def assemble_figs(run_data, crispresso_folder): Helper function create the data structre for the figures """ figures = {'names': {}, 'locs': {}, 'titles': {}, 'captions': {}, 'datas': {}, 'htmls': {}, 'sgRNA_based_names': {}} + d3_nuc_quilt_names = [] global_fig_names = [] for fig in ['1a', '1b', '1c', '1d', '5a', '6a', '8a', '11c']: fig_name = 'plot_' + fig if fig_name + '_root' in run_data['results']['general_plots']: - add_fig_if_exists(fig_name, run_data['results']['general_plots'][fig_name + '_root'], 'Figure ' + fig, + add_fig_if_exists(fig, fig_name, run_data['results']['general_plots'][fig_name + '_root'], 'Figure ' + fig, run_data['results']['general_plots'][fig_name + '_caption'], run_data['results']['general_plots'][fig_name + '_data'], - global_fig_names, figures, crispresso_folder) + global_fig_names, figures, crispresso_folder, d3_nuc_quilt_names) amplicons = [] for amplicon_name in run_data['results']['ref_names']: @@ -112,11 +136,11 @@ def assemble_figs(run_data, crispresso_folder): '11a']: fig_name = 'plot_' + fig if fig_name + '_root' in run_data['results']['refs'][amplicon_name]: - add_fig_if_exists(fig_name, run_data['results']['refs'][amplicon_name][fig_name + '_root'], + add_fig_if_exists(fig, fig_name, run_data['results']['refs'][amplicon_name][fig_name + '_root'], 'Figure ' + fig_name, run_data['results']['refs'][amplicon_name][fig_name + '_caption'], run_data['results']['refs'][amplicon_name][fig_name + '_data'], - global_fig_names, amplicon_figures, crispresso_folder) + global_fig_names, amplicon_figures, crispresso_folder, d3_nuc_quilt_names) this_sgRNA_based_fig_names = {} for fig in ['2b', '9', '10d', '10e', '10f', '10g', '11b']: @@ -125,10 +149,10 @@ def assemble_figs(run_data, crispresso_folder): if 'plot_' + fig + '_roots' in run_data['results']['refs'][amplicon_name]: for idx, plot_root in enumerate(run_data['results']['refs'][amplicon_name]['plot_' + fig + '_roots']): fig_name = "plot_" + fig + "_" + str(idx) - add_fig_if_exists(fig_name, plot_root, 'Figure ' + fig_name + ' sgRNA ' + str(idx + 1), + add_fig_if_exists(fig, fig_name, plot_root, 'Figure ' + fig_name + ' sgRNA ' + str(idx + 1), run_data['results']['refs'][amplicon_name]['plot_' + fig + '_captions'][idx], run_data['results']['refs'][amplicon_name]['plot_' + fig + '_datas'][idx], - this_fig_names, amplicon_figures, crispresso_folder) + this_fig_names, amplicon_figures, crispresso_folder, d3_nuc_quilt_names) this_sgRNA_based_fig_names[fig] = this_fig_names figures['names'][amplicon_name] = amplicon_figures['names'] @@ -139,7 +163,7 @@ def assemble_figs(run_data, crispresso_folder): figures['captions'][amplicon_name] = amplicon_figures['captions'] figures['datas'][amplicon_name] = amplicon_figures['datas'] figures['htmls'][amplicon_name] = amplicon_figures['htmls'] - data = {'amplicons': amplicons, 'figures': figures} + data = {'amplicons': amplicons, 'figures': figures, 'nuc_quilt_names': d3_nuc_quilt_names} return data @@ -166,9 +190,10 @@ def make_report(run_data, crispresso_report_file, crispresso_folder, _ROOT): 'run_data': run_data, 'report_display_name': report_display_name, 'crispresso_data_path': crispresso_data_path, + 'nuc_quilt_names': data['nuc_quilt_names'], } - j2_env = Environment(loader=FileSystemLoader(os.path.join(_ROOT, 'CRISPRessoReports', 'templates'))) + j2_env = get_jinja_loader(_ROOT) # dest_dir = os.path.dirname(crispresso_report_file) # shutil.copy2(os.path.join(_ROOT,'templates','CRISPResso_justcup.png'),dest_dir) @@ -176,7 +201,7 @@ def make_report(run_data, crispresso_report_file, crispresso_folder, _ROOT): with open(crispresso_report_file, 'w', encoding="utf-8") as outfile: outfile.write(render_template( - 'report.html', j2_env, report_data=report_data, + 'report.html', j2_env, report_data=report_data, C2PRO_INSTALLED=C2PRO_INSTALLED, )) @@ -259,6 +284,15 @@ def make_batch_report_from_folder(crispressoBatch_report_file, crispresso2_info, with open(line_plot_path, encoding="utf-8") as fh: allele_modification_line_plot['htmls'][line_plot_name] = fh.read() + summary_plot_htmls = {} + for plot_name in window_nuc_pct_quilts + nuc_pct_quilts: + if os.path.exists(os.path.join(batch_folder, f'{plot_name}.json')): + with open(os.path.join(batch_folder, f'{plot_name}.json')) as window_nuc_pct_json_fh: + summary_plot_htmls[plot_name] = f""" +
+ + """ + #find path between the report and the data (if the report is in another directory vs in the same directory as the data) crispresso_data_path = os.path.relpath(batch_folder, os.path.dirname(crispressoBatch_report_file)) if crispresso_data_path == ".": @@ -302,6 +336,7 @@ def make_batch_report_from_folder(crispressoBatch_report_file, crispresso2_info, 'titles': summary_plot_titles, 'labels': summary_plot_labels, 'datas': summary_plot_datas, + 'htmls': summary_plot_htmls, }, window_nuc_pct_quilts=window_nuc_pct_quilts, nuc_pct_quilts=nuc_pct_quilts, @@ -490,9 +525,8 @@ def fill_default(dictionary, key, default_type=list): if key not in dictionary: dictionary[key] = default_type() - j2_env = Environment( - loader=FileSystemLoader(os.path.join(_ROOT, 'CRISPRessoReports', 'templates')), - ) + j2_env = get_jinja_loader(_ROOT) + j2_env.filters['dirname'] = dirname if crispresso_tool == 'batch': template = 'batchReport.html' @@ -538,6 +572,7 @@ def fill_default(dictionary, key, default_type=list): 'titles': [], 'labels': [], 'datas': [], + 'htmls': [], } for html in sub_html_files: @@ -556,7 +591,7 @@ def fill_default(dictionary, key, default_type=list): 'titles': summary_plots['titles'], 'labels': summary_plots['labels'], 'datas': summary_plots['datas'], - 'htmls': [], + 'htmls': summary_plots['htmls'] if 'htmls' in summary_plots else [], 'crispresso_data_path': crispresso_data_path, }, run_names=run_names, @@ -575,6 +610,7 @@ def fill_default(dictionary, key, default_type=list): allele_modification_line_plot_titles=allele_modification_line_plot['titles'], allele_modification_line_plot_labels=allele_modification_line_plot['labels'], allele_modification_line_plot_datas=allele_modification_line_plot['datas'], + C2PRO_INSTALLED=C2PRO_INSTALLED, )) diff --git a/CRISPResso2/CRISPRessoReports/templates/batchReport.html b/CRISPResso2/CRISPRessoReports/templates/batchReport.html index 49a6c9ea..fe4a0200 100644 --- a/CRISPResso2/CRISPRessoReports/templates/batchReport.html +++ b/CRISPResso2/CRISPRessoReports/templates/batchReport.html @@ -76,8 +76,12 @@
Nucleotide percentages around guides
{% for plot_name in window_nuc_pct_quilts %} -
{{report_data['titles'][plot_name]}}
- {{ render_partial('shared/partials/fig_summaries.html', report_data=report_data, plot_name=plot_name) }} +
{{report_data['titles'][plot_name]}}
+ {% if plot_name in report_data['htmls'] %} + {{ report_data['htmls'][plot_name]|safe }} + {% else %} + {{ render_partial('shared/partials/fig_summaries.html', report_data=report_data, plot_name=plot_name) }} + {% endif %} {% endfor %}
@@ -90,8 +94,12 @@
Nucleotide percentages in the entire amplicon
{% for plot_name in nuc_pct_quilts %} -
{{report_data['titles'][plot_name]}}
- {{ render_partial('shared/partials/fig_summaries.html', report_data=report_data, plot_name=plot_name) }} +
{{report_data['titles'][plot_name]}}
+ {% if plot_name in report_data['htmls'] %} + {{ report_data['htmls'][plot_name]|safe }} + {% else %} + {{ render_partial('shared/partials/fig_summaries.html', report_data=report_data, plot_name=plot_name) }} + {% endif %} {% endfor %}
@@ -257,4 +265,8 @@
{{allele_modification_heatmap_plot_titles[heatmap_plot_name]}}
{% endblock %} {% block foot %} +{% if C2PRO_INSTALLED %} + + {{ render_partial('partials/batch_d3.html', nucleotide_quilt_slugs=(window_nuc_pct_quilts + nuc_pct_quilts))}} +{% endif %} {% endblock %} diff --git a/CRISPResso2/CRISPRessoReports/templates/layout.html b/CRISPResso2/CRISPRessoReports/templates/layout.html index a028254c..f7a616a4 100644 --- a/CRISPResso2/CRISPRessoReports/templates/layout.html +++ b/CRISPResso2/CRISPRessoReports/templates/layout.html @@ -9,7 +9,6 @@ - - +{% if C2PRO_INSTALLED %} + +{% endif %} {% endblock %} {% block content %} diff --git a/CRISPResso2/CRISPRessoReports/templates/report.html b/CRISPResso2/CRISPRessoReports/templates/report.html index 9214d168..0650b56f 100644 --- a/CRISPResso2/CRISPRessoReports/templates/report.html +++ b/CRISPResso2/CRISPRessoReports/templates/report.html @@ -73,7 +73,9 @@ } } - +{% if C2PRO_INSTALLED %} + +{% endif %} {% endblock %} {% block content %} @@ -86,6 +88,7 @@ {% if report_data['report_display_name'] != '' %}
{{report_data['report_display_name']}}
{% endif %} + {{ render_partial('shared/partials/guardrail_warnings.html', report_data=report_data) }}
CRISPResso2 run information