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 31e6fa6a..1570adba 100644 --- a/CRISPResso2/CRISPRessoCOREResources.c +++ b/CRISPResso2/CRISPRessoCOREResources.c @@ -1,21 +1,21 @@ -/* Generated by Cython 3.0.0 */ +/* Generated by Cython 3.0.9 */ /* BEGIN: Cython Metadata { "distutils": { "depends": [ - "/home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/core/include/numpy/arrayobject.h", - "/home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/core/include/numpy/arrayscalars.h", - "/home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/core/include/numpy/ndarrayobject.h", - "/home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/core/include/numpy/ndarraytypes.h", - "/home/snichol2/micromamba/envs/c2/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": [ - "/home/snichol2/micromamba/envs/c2/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": [ @@ -45,10 +45,15 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else -#define CYTHON_ABI "3_0_0" +#if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API +#define __PYX_EXTRA_ABI_MODULE_NAME "limited" +#else +#define __PYX_EXTRA_ABI_MODULE_NAME "" +#endif +#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 0x030000F0 +#define CYTHON_HEX_VERSION 0x030009F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof @@ -81,6 +86,7 @@ END: Cython Metadata */ #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif +#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ @@ -147,8 +153,9 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 - #undef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 0 + #ifndef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 @@ -200,6 +207,10 @@ END: Cython Metadata */ #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(CYTHON_LIMITED_API) + #ifdef Py_LIMITED_API + #undef __PYX_LIMITED_VERSION_HEX + #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API + #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 @@ -247,7 +258,7 @@ END: Cython Metadata */ #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 1 + #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 @@ -256,7 +267,7 @@ END: Cython Metadata */ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif -#elif defined(PY_NOGIL) +#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 @@ -469,6 +480,14 @@ END: Cython Metadata */ # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif +#ifndef CYTHON_USE_CPP_STD_MOVE + #if defined(__cplusplus) && (\ + __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) + #define CYTHON_USE_CPP_STD_MOVE 1 + #else + #define CYTHON_USE_CPP_STD_MOVE 0 + #endif +#endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ @@ -568,59 +587,91 @@ END: Cython Metadata */ #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type -#if PY_VERSION_HEX >= 0x030B00A1 - static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, +#if CYTHON_COMPILING_IN_LIMITED_API + static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { - PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL; - PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *empty=NULL; - const char *fn_cstr=NULL; - const char *name_cstr=NULL; - PyCodeObject *co=NULL, *result=NULL; + PyObject *exception_table = NULL; + PyObject *types_module=NULL, *code_type=NULL, *result=NULL; + #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 + PyObject *version_info; + PyObject *py_minor_version = NULL; + #endif + long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); - if (!(kwds=PyDict_New())) goto end; - if (!(argcount=PyLong_FromLong(a))) goto end; - if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end; - if (!(posonlyargcount=PyLong_FromLong(p))) goto end; - if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end; - if (!(kwonlyargcount=PyLong_FromLong(k))) goto end; - if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end; - if (!(nlocals=PyLong_FromLong(l))) goto end; - if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end; - if (!(stacksize=PyLong_FromLong(s))) goto end; - if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end; - if (!(flags=PyLong_FromLong(f))) goto end; - if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end; - if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end; - if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end; - if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end; - if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto end; - if (!(empty = PyTuple_New(0))) goto end; - result = (PyCodeObject*) PyObject_Call(replace, empty, kwds); + #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 + minor_version = 11; + #else + if (!(version_info = PySys_GetObject("version_info"))) goto end; + if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; + minor_version = PyLong_AsLong(py_minor_version); + Py_DECREF(py_minor_version); + if (minor_version == -1 && PyErr_Occurred()) goto end; + #endif + if (!(types_module = PyImport_ImportModule("types"))) goto end; + if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; + if (minor_version <= 7) { + (void)p; + result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); + } else if (minor_version <= 10) { + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); + } else { + if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, + c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); + } end: - Py_XDECREF((PyObject*) co); - Py_XDECREF(kwds); - Py_XDECREF(argcount); - Py_XDECREF(posonlyargcount); - Py_XDECREF(kwonlyargcount); - Py_XDECREF(nlocals); - Py_XDECREF(stacksize); - Py_XDECREF(replace); - Py_XDECREF(empty); + Py_XDECREF(code_type); + Py_XDECREF(exception_table); + Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } + #ifndef CO_OPTIMIZED + #define CO_OPTIMIZED 0x0001 + #endif + #ifndef CO_NEWLOCALS + #define CO_NEWLOCALS 0x0002 + #endif + #ifndef CO_VARARGS + #define CO_VARARGS 0x0004 + #endif + #ifndef CO_VARKEYWORDS + #define CO_VARKEYWORDS 0x0008 + #endif + #ifndef CO_ASYNC_GENERATOR + #define CO_ASYNC_GENERATOR 0x0200 + #endif + #ifndef CO_GENERATOR + #define CO_GENERATOR 0x0020 + #endif + #ifndef CO_COROUTINE + #define CO_COROUTINE 0x0080 + #endif +#elif PY_VERSION_HEX >= 0x030B0000 + static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyCodeObject *result; + PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); + if (!empty_bytes) return NULL; + result = + #if PY_VERSION_HEX >= 0x030C0000 + PyUnstable_Code_NewWithPosOnlyArgs + #else + PyCode_NewWithPosOnlyArgs + #endif + (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); + Py_DECREF(empty_bytes); + return result; + } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) @@ -695,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 @@ -720,7 +776,32 @@ END: Cython Metadata */ #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif -#if PY_VERSION_HEX < 0x030900B1 +#if PY_MAJOR_VERSION >= 0x030900B1 +#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) +#else +#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) +#endif +#define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) +#elif !CYTHON_COMPILING_IN_LIMITED_API +#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) +#endif +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) +static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { + return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; +} +#endif +static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { +#if CYTHON_COMPILING_IN_LIMITED_API + return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; +#else + return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; +#endif +} +#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) +#if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else @@ -746,6 +827,8 @@ END: Cython Metadata */ #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x030d00A1 + #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 @@ -821,7 +904,7 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { } #endif #endif -#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() @@ -833,7 +916,7 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && CYTHON_USE_UNICODE_INTERNALS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); @@ -870,9 +953,14 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) +#else + #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) +#endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ - PyTypeObject *type = Py_TYPE(obj);\ + PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ @@ -996,9 +1084,34 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) -#else + #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) + #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) + #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) + #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) + #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) +#else + #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) + #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) + #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) + #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) + #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) + #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) + #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) + #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) +#endif +#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) { + PyObject *module = PyImport_AddModule(name); + Py_XINCREF(module); + return module; + } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject @@ -1078,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; } @@ -1161,9 +1274,10 @@ static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif +static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); -#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize @@ -1191,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) @@ -1258,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) @@ -1279,6 +1376,7 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +#include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; @@ -1329,6 +1427,7 @@ static int __Pyx_init_sys_getdefaultencoding_params(void) { #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; @@ -1376,7 +1475,7 @@ static const char *__pyx_filename; #if !defined(CYTHON_CCOMPLEX) #if defined(__cplusplus) #define CYTHON_CCOMPLEX 1 - #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__)) + #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__) && !defined(_MSC_VER)) #define CYTHON_CCOMPLEX 1 #else #define CYTHON_CCOMPLEX 0 @@ -1402,9 +1501,14 @@ static const char *__pyx_f[] = { "type.pxd", }; /* #### Code section: utility_code_proto_before_types ### */ +/* ForceInitThreads.proto */ +#ifndef __PYX_FORCE_INIT_THREADS + #define __PYX_FORCE_INIT_THREADS 0 +#endif + /* #### Code section: numeric_typedefs ### */ -/* "../../../../../../home/snichol2/micromamba/envs/c2/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 # <<<<<<<<<<<<<< @@ -1413,7 +1517,7 @@ static const char *__pyx_f[] = { */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "../../../../../../home/snichol2/micromamba/envs/c2/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 # <<<<<<<<<<<<<< @@ -1422,7 +1526,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "../../../../../../home/snichol2/micromamba/envs/c2/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 # <<<<<<<<<<<<<< @@ -1431,7 +1535,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "../../../../../../home/snichol2/micromamba/envs/c2/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 # <<<<<<<<<<<<<< @@ -1440,7 +1544,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "../../../../../../home/snichol2/micromamba/envs/c2/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 # <<<<<<<<<<<<<< @@ -1449,7 +1553,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "../../../../../../home/snichol2/micromamba/envs/c2/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 # <<<<<<<<<<<<<< @@ -1458,7 +1562,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "../../../../../../home/snichol2/micromamba/envs/c2/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 # <<<<<<<<<<<<<< @@ -1467,7 +1571,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "../../../../../../home/snichol2/micromamba/envs/c2/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 # <<<<<<<<<<<<<< @@ -1476,7 +1580,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "../../../../../../home/snichol2/micromamba/envs/c2/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 # <<<<<<<<<<<<<< @@ -1485,7 +1589,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "../../../../../../home/snichol2/micromamba/envs/c2/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 # <<<<<<<<<<<<<< @@ -1494,7 +1598,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "../../../../../../home/snichol2/micromamba/envs/c2/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 # <<<<<<<<<<<<<< @@ -1503,7 +1607,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_long __pyx_t_5numpy_int_t; -/* "../../../../../../home/snichol2/micromamba/envs/c2/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 # <<<<<<<<<<<<<< @@ -1512,7 +1616,7 @@ typedef npy_long __pyx_t_5numpy_int_t; */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "../../../../../../home/snichol2/micromamba/envs/c2/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 # <<<<<<<<<<<<<< @@ -1521,7 +1625,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "../../../../../../home/snichol2/micromamba/envs/c2/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 # <<<<<<<<<<<<<< @@ -1530,7 +1634,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "../../../../../../home/snichol2/micromamba/envs/c2/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 # <<<<<<<<<<<<<< @@ -1539,7 +1643,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "../../../../../../home/snichol2/micromamba/envs/c2/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 # <<<<<<<<<<<<<< @@ -1548,7 +1652,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "../../../../../../home/snichol2/micromamba/envs/c2/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 # <<<<<<<<<<<<<< @@ -1557,7 +1661,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "../../../../../../home/snichol2/micromamba/envs/c2/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 # <<<<<<<<<<<<<< @@ -1566,7 +1670,7 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "../../../../../../home/snichol2/micromamba/envs/c2/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 # <<<<<<<<<<<<<< @@ -1603,7 +1707,7 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do /*--- Type declarations ---*/ -/* "../../../../../../home/snichol2/micromamba/envs/c2/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 # <<<<<<<<<<<<<< @@ -1612,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; -/* "../../../../../../home/snichol2/micromamba/envs/c2/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 # <<<<<<<<<<<<<< @@ -1621,7 +1725,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "../../../../../../home/snichol2/micromamba/envs/c2/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 # <<<<<<<<<<<<<< @@ -1630,7 +1734,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "../../../../../../home/snichol2/micromamba/envs/c2/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 # <<<<<<<<<<<<<< @@ -1834,7 +1938,20 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ -#define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) +#if CYTHON_AVOID_BORROWED_REFS + #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) +#elif CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) +#else + #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) +#endif +#if CYTHON_AVOID_BORROWED_REFS + #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 + #define __Pyx_Arg_XDECREF_VARARGS(arg) +#endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) @@ -1844,15 +1961,24 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 + CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); + #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 + 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 #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS + #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) + #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else @@ -1880,7 +2006,11 @@ static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 + L->ob_item[len] = x; + #else PyList_SET_ITEM(list, len, x); + #endif __Pyx_SET_SIZE(list, len + 1); return 0; } @@ -1926,7 +2056,7 @@ static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, in /* ListExtend.proto */ static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) { -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 PyObject* none = _PyList_Extend((PyListObject*)L, v); if (unlikely(!none)) return -1; @@ -1969,7 +2099,7 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" -#if PY_VERSION_HEX >= 0x030b00a6 +#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif @@ -2061,22 +2191,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_0 -#define __PYX_HAVE_RT_ImportType_proto_3_0_0 +#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_0(s) alignof(s) +#define __PYX_GET_STRUCT_ALIGNMENT_3_0_9(s) alignof(s) #else -#define __PYX_GET_STRUCT_ALIGNMENT_3_0_0(s) sizeof(void*) +#define __PYX_GET_STRUCT_ALIGNMENT_3_0_9(s) sizeof(void*) #endif -enum __Pyx_ImportType_CheckSize_3_0_0 { - __Pyx_ImportType_CheckSize_Error_3_0_0 = 0, - __Pyx_ImportType_CheckSize_Warn_3_0_0 = 1, - __Pyx_ImportType_CheckSize_Ignore_3_0_0 = 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_0(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_0 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 */ @@ -2107,7 +2237,22 @@ static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec #endif /* PyMethodNew.proto */ -#if PY_MAJOR_VERSION >= 3 +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + typesModule = PyImport_ImportModule("types"); + if (!typesModule) return NULL; + methodType = PyObject_GetAttrString(typesModule, "MethodType"); + Py_DECREF(typesModule); + if (!methodType) return NULL; + result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); + Py_DECREF(methodType); + return result; +} +#elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) @@ -2131,7 +2276,7 @@ static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, _ #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) -#if PY_VERSION_HEX < 0x030900B1 +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else @@ -2145,7 +2290,10 @@ static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, _ #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { -#if PY_VERSION_HEX < 0x030900B1 +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject_HEAD + PyObject *func; +#elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; @@ -2153,7 +2301,7 @@ typedef struct { #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif -#if PY_VERSION_HEX < 0x030500A0 +#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; @@ -2163,12 +2311,12 @@ typedef struct { PyObject *func_globals; PyObject *func_code; PyObject *func_closure; -#if PY_VERSION_HEX < 0x030900B1 +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #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; @@ -2176,9 +2324,13 @@ typedef struct { PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; +#undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) -#define __Pyx_IsCyOrPyCFunction(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) +#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); +#undef __Pyx_IsSameCFunction +#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, @@ -2391,7 +2543,8 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ -static int __Pyx_check_binary_version(void); +static unsigned long __Pyx_get_runtime_version(void); +static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); @@ -2514,6 +2667,7 @@ static const char __pyx_k_current_insertion_size[] = "current_insertion_size"; static const char __pyx_k_substitution_positions[] = "substitution_positions"; 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_all_substitution_positions[] = "all_substitution_positions"; static const char __pyx_k_all_insertion_left_positions[] = "all_insertion_left_positions"; @@ -2606,6 +2760,8 @@ typedef struct { PyObject *__pyx_kp_u__5; 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; @@ -2775,6 +2931,8 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_kp_u__5); 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); @@ -2922,6 +3080,8 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_kp_u__5); 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); @@ -3099,6 +3259,8 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_kp_u__5 __pyx_mstate_global->__pyx_kp_u__5 #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 @@ -3198,7 +3360,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 /* #### Code section: module_code ### */ -/* "../../../../../../home/snichol2/micromamba/envs/c2/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: # <<<<<<<<<<<<<< @@ -3209,7 +3371,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; - /* "../../../../../../home/snichol2/micromamba/envs/c2/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) # <<<<<<<<<<<<<< @@ -3219,7 +3381,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject __pyx_r = PyArray_BASE(__pyx_v_self); goto __pyx_L0; - /* "../../../../../../home/snichol2/micromamba/envs/c2/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: # <<<<<<<<<<<<<< @@ -3232,7 +3394,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject return __pyx_r; } -/* "../../../../../../home/snichol2/micromamba/envs/c2/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): # <<<<<<<<<<<<<< @@ -3244,9 +3406,9 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray PyArray_Descr *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyArray_Descr *__pyx_t_1; - __Pyx_RefNannySetupContext("descr", 0); + __Pyx_RefNannySetupContext("descr", 1); - /* "../../../../../../home/snichol2/micromamba/envs/c2/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) # <<<<<<<<<<<<<< @@ -3259,7 +3421,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray __pyx_r = ((PyArray_Descr *)__pyx_t_1); goto __pyx_L0; - /* "../../../../../../home/snichol2/micromamba/envs/c2/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): # <<<<<<<<<<<<<< @@ -3274,7 +3436,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray return __pyx_r; } -/* "../../../../../../home/snichol2/micromamba/envs/c2/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: # <<<<<<<<<<<<<< @@ -3285,7 +3447,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; - /* "../../../../../../home/snichol2/micromamba/envs/c2/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) # <<<<<<<<<<<<<< @@ -3295,7 +3457,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx __pyx_r = PyArray_NDIM(__pyx_v_self); goto __pyx_L0; - /* "../../../../../../home/snichol2/micromamba/envs/c2/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: # <<<<<<<<<<<<<< @@ -3308,7 +3470,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx return __pyx_r; } -/* "../../../../../../home/snichol2/micromamba/envs/c2/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: # <<<<<<<<<<<<<< @@ -3319,7 +3481,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; - /* "../../../../../../home/snichol2/micromamba/envs/c2/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) # <<<<<<<<<<<<<< @@ -3329,7 +3491,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObjec __pyx_r = PyArray_DIMS(__pyx_v_self); goto __pyx_L0; - /* "../../../../../../home/snichol2/micromamba/envs/c2/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: # <<<<<<<<<<<<<< @@ -3342,7 +3504,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObjec return __pyx_r; } -/* "../../../../../../home/snichol2/micromamba/envs/c2/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: # <<<<<<<<<<<<<< @@ -3353,7 +3515,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; - /* "../../../../../../home/snichol2/micromamba/envs/c2/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) # <<<<<<<<<<<<<< @@ -3363,7 +3525,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO __pyx_r = PyArray_STRIDES(__pyx_v_self); goto __pyx_L0; - /* "../../../../../../home/snichol2/micromamba/envs/c2/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: # <<<<<<<<<<<<<< @@ -3376,7 +3538,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO return __pyx_r; } -/* "../../../../../../home/snichol2/micromamba/envs/c2/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: # <<<<<<<<<<<<<< @@ -3387,7 +3549,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; - /* "../../../../../../home/snichol2/micromamba/envs/c2/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) # <<<<<<<<<<<<<< @@ -3397,7 +3559,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject * __pyx_r = PyArray_SIZE(__pyx_v_self); goto __pyx_L0; - /* "../../../../../../home/snichol2/micromamba/envs/c2/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: # <<<<<<<<<<<<<< @@ -3410,7 +3572,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject * return __pyx_r; } -/* "../../../../../../home/snichol2/micromamba/envs/c2/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: # <<<<<<<<<<<<<< @@ -3421,7 +3583,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; - /* "../../../../../../home/snichol2/micromamba/envs/c2/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) # <<<<<<<<<<<<<< @@ -3431,7 +3593,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__p __pyx_r = PyArray_BYTES(__pyx_v_self); goto __pyx_L0; - /* "../../../../../../home/snichol2/micromamba/envs/c2/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: # <<<<<<<<<<<<<< @@ -3444,7 +3606,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__p return __pyx_r; } -/* "../../../../../../home/snichol2/micromamba/envs/c2/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): # <<<<<<<<<<<<<< @@ -3459,9 +3621,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); + __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 1); - /* "../../../../../../home/snichol2/micromamba/envs/c2/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) # <<<<<<<<<<<<<< @@ -3475,7 +3637,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../../../home/snichol2/micromamba/envs/c2/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): # <<<<<<<<<<<<<< @@ -3494,7 +3656,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "../../../../../../home/snichol2/micromamba/envs/c2/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): # <<<<<<<<<<<<<< @@ -3509,9 +3671,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); + __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 1); - /* "../../../../../../home/snichol2/micromamba/envs/c2/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) # <<<<<<<<<<<<<< @@ -3525,7 +3687,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../../../home/snichol2/micromamba/envs/c2/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): # <<<<<<<<<<<<<< @@ -3544,7 +3706,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "../../../../../../home/snichol2/micromamba/envs/c2/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): # <<<<<<<<<<<<<< @@ -3559,9 +3721,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); + __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 1); - /* "../../../../../../home/snichol2/micromamba/envs/c2/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) # <<<<<<<<<<<<<< @@ -3575,7 +3737,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../../../home/snichol2/micromamba/envs/c2/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): # <<<<<<<<<<<<<< @@ -3594,7 +3756,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "../../../../../../home/snichol2/micromamba/envs/c2/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): # <<<<<<<<<<<<<< @@ -3609,9 +3771,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); + __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 1); - /* "../../../../../../home/snichol2/micromamba/envs/c2/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) # <<<<<<<<<<<<<< @@ -3625,7 +3787,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../../../home/snichol2/micromamba/envs/c2/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): # <<<<<<<<<<<<<< @@ -3644,7 +3806,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "../../../../../../home/snichol2/micromamba/envs/c2/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): # <<<<<<<<<<<<<< @@ -3659,9 +3821,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); + __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 1); - /* "../../../../../../home/snichol2/micromamba/envs/c2/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) # <<<<<<<<<<<<<< @@ -3675,7 +3837,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../../../home/snichol2/micromamba/envs/c2/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): # <<<<<<<<<<<<<< @@ -3694,7 +3856,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "../../../../../../home/snichol2/micromamba/envs/c2/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): # <<<<<<<<<<<<<< @@ -3706,9 +3868,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; - __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); + __Pyx_RefNannySetupContext("PyDataType_SHAPE", 1); - /* "../../../../../../home/snichol2/micromamba/envs/c2/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): # <<<<<<<<<<<<<< @@ -3718,7 +3880,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d); if (__pyx_t_1) { - /* "../../../../../../home/snichol2/micromamba/envs/c2/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 # <<<<<<<<<<<<<< @@ -3730,7 +3892,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); goto __pyx_L0; - /* "../../../../../../home/snichol2/micromamba/envs/c2/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): # <<<<<<<<<<<<<< @@ -3739,7 +3901,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ */ } - /* "../../../../../../home/snichol2/micromamba/envs/c2/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 () # <<<<<<<<<<<<<< @@ -3753,7 +3915,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ goto __pyx_L0; } - /* "../../../../../../home/snichol2/micromamba/envs/c2/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): # <<<<<<<<<<<<<< @@ -3768,7 +3930,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ return __pyx_r; } -/* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":967 +/* "../../../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): # <<<<<<<<<<<<<< @@ -3777,14 +3939,12 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ */ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { - __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("set_array_base", 0); - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":968 + /* "../../../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! # <<<<<<<<<<<<<< @@ -3793,16 +3953,16 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_INCREF(__pyx_v_base); - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":969 + /* "../../../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) # <<<<<<<<<<<<<< * * cdef inline object get_array_base(ndarray arr): */ - __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 969, __pyx_L1_error) + __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) - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":967 + /* "../../../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): # <<<<<<<<<<<<<< @@ -3815,10 +3975,9 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __pyx_L1_error:; __Pyx_AddTraceback("numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; - __Pyx_RefNannyFinishContext(); } -/* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":971 +/* "../../../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): # <<<<<<<<<<<<<< @@ -3831,9 +3990,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; - __Pyx_RefNannySetupContext("get_array_base", 0); + __Pyx_RefNannySetupContext("get_array_base", 1); - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":972 + /* "../../../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) # <<<<<<<<<<<<<< @@ -3842,7 +4001,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ __pyx_v_base = PyArray_BASE(__pyx_v_arr); - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":973 + /* "../../../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: # <<<<<<<<<<<<<< @@ -3852,7 +4011,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = (__pyx_v_base == NULL); if (__pyx_t_1) { - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":974 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":975 * base = PyArray_BASE(arr) * if base is NULL: * return None # <<<<<<<<<<<<<< @@ -3863,7 +4022,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":973 + /* "../../../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: # <<<<<<<<<<<<<< @@ -3872,7 +4031,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ } - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":975 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":976 * if base is NULL: * return None * return base # <<<<<<<<<<<<<< @@ -3884,7 +4043,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = ((PyObject *)__pyx_v_base); goto __pyx_L0; - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":971 + /* "../../../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): # <<<<<<<<<<<<<< @@ -3899,7 +4058,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py return __pyx_r; } -/* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":979 +/* "../../../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: # <<<<<<<<<<<<<< @@ -3921,9 +4080,9 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("import_array", 0); + __Pyx_RefNannySetupContext("import_array", 1); - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":980 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":981 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -3939,16 +4098,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":981 + /* "../../../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() # <<<<<<<<<<<<<< * except Exception: * raise ImportError("numpy.core.multiarray failed to import") */ - __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 981, __pyx_L3_error) + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 982, __pyx_L3_error) - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":980 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":981 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -3962,7 +4121,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":982 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":983 * try: * __pyx_import_array() * except Exception: # <<<<<<<<<<<<<< @@ -3972,27 +4131,27 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 982, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 983, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":983 + /* "../../../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") # <<<<<<<<<<<<<< * * cdef inline int import_umath() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 983, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 984, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 983, __pyx_L5_except_error) + __PYX_ERR(1, 984, __pyx_L5_except_error) } goto __pyx_L5_except_error; - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":980 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":981 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -4008,7 +4167,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_L8_try_end:; } - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":979 + /* "../../../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: # <<<<<<<<<<<<<< @@ -4031,7 +4190,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { return __pyx_r; } -/* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":985 +/* "../../../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: # <<<<<<<<<<<<<< @@ -4053,9 +4212,9 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("import_umath", 0); + __Pyx_RefNannySetupContext("import_umath", 1); - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":986 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":987 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -4071,16 +4230,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":987 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":988 * cdef inline int import_umath() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< * except Exception: * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 987, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 988, __pyx_L3_error) - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":986 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":987 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -4094,7 +4253,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":988 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":989 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -4104,27 +4263,27 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 989, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":989 + /* "../../../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") # <<<<<<<<<<<<<< * * cdef inline int import_ufunc() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 989, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 990, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 989, __pyx_L5_except_error) + __PYX_ERR(1, 990, __pyx_L5_except_error) } goto __pyx_L5_except_error; - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":986 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":987 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -4140,7 +4299,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_L8_try_end:; } - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":985 + /* "../../../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: # <<<<<<<<<<<<<< @@ -4163,7 +4322,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { return __pyx_r; } -/* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":991 +/* "../../../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: # <<<<<<<<<<<<<< @@ -4185,9 +4344,9 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("import_ufunc", 0); + __Pyx_RefNannySetupContext("import_ufunc", 1); - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":992 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":993 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -4203,16 +4362,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":993 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":994 * cdef inline int import_ufunc() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< * except Exception: * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 993, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 994, __pyx_L3_error) - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":992 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":993 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -4226,7 +4385,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":994 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":995 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -4236,27 +4395,27 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 995, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":995 + /* "../../../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") # <<<<<<<<<<<<<< * * */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 996, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 995, __pyx_L5_except_error) + __PYX_ERR(1, 996, __pyx_L5_except_error) } goto __pyx_L5_except_error; - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":992 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":993 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -4272,7 +4431,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_L8_try_end:; } - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":991 + /* "../../../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: # <<<<<<<<<<<<<< @@ -4295,7 +4454,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { return __pyx_r; } -/* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":998 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":999 * * * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< @@ -4305,10 +4464,8 @@ 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; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("is_timedelta64_object", 0); - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1010 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1011 * bool * """ * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<< @@ -4318,7 +4475,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; - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":998 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":999 * * * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< @@ -4328,11 +4485,10 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ /* function exit code */ __pyx_L0:; - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1013 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1014 * * * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< @@ -4342,10 +4498,8 @@ 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; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("is_datetime64_object", 0); - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1025 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1026 * bool * """ * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<< @@ -4355,7 +4509,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; - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1013 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1014 * * * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< @@ -4365,11 +4519,10 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o /* function exit code */ __pyx_L0:; - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1028 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1029 * * * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -4380,7 +4533,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; - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1035 + /* "../../../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 # <<<<<<<<<<<<<< @@ -4390,7 +4543,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1028 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1029 * * * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -4403,7 +4556,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * return __pyx_r; } -/* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1038 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1039 * * * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -4414,7 +4567,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; - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1042 + /* "../../../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 # <<<<<<<<<<<<<< @@ -4424,7 +4577,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1038 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1039 * * * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -4437,7 +4590,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject return __pyx_r; } -/* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1045 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1046 * * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< @@ -4448,7 +4601,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; - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1049 + /* "../../../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 # <<<<<<<<<<<<<< @@ -4456,7 +4609,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; - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1045 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1046 * * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< @@ -4469,7 +4622,7 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec return __pyx_r; } -/* "CRISPResso2/CRISPRessoCOREResources.pyx":19 +/* "CRISPResso2/CRISPRessoCOREResources.pyx":18 * re_find_indels = re.compile("(-*-)") * * @cython.boundscheck(False) # <<<<<<<<<<<<<< @@ -4497,18 +4650,26 @@ PyObject *__pyx_args, PyObject *__pyx_kwds PyObject *__pyx_v_ref_seq_al = 0; PyObject *__pyx_v__include_indx = 0; #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + 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}; - PyObject* values[3] = {0,0,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -4524,27 +4685,36 @@ 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_read_seq_al)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L3_error) + 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, 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_ref_seq_al)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L3_error) + 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, 18, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("find_indels_substitutions", 1, 3, 3, 1); __PYX_ERR(0, 19, __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_include_indx)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L3_error) + 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, 18, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("find_indels_substitutions", 1, 3, 3, 2); __PYX_ERR(0, 19, __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, "find_indels_substitutions") < 0)) __PYX_ERR(0, 19, __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 != 3)) { goto __pyx_L5_argtuple_error; @@ -4557,10 +4727,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_v_ref_seq_al = values[1]; __pyx_v__include_indx = values[2]; } - goto __pyx_L4_argument_unpacking_done; + goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("find_indels_substitutions", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 19, __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:; + { + 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; @@ -4568,6 +4746,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __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; } @@ -4579,6 +4763,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_find_indels_su 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; @@ -4617,83 +4802,95 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_find_indels_su int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("find_indels_substitutions", 0); + __Pyx_RefNannySetupContext("find_indels_substitutions", 1); - /* "CRISPResso2/CRISPRessoCOREResources.pyx":33 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":32 * # aln A - T T T G G C C * # 1 2 3 4-4 5 6 7 8 = PyList_GET_SIZE(__pyx_t_1)) break; + { + 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, 58, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __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, 58, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 58, __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 { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + { + 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, 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, 58, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 58, __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 } @@ -5137,9 +5347,9 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_find_indels_su __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9)) __PYX_ERR(0, 72, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_8); + 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, 72, __pyx_L1_error) @@ -5427,7 +5637,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); @@ -5438,18 +5648,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, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); + 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); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_end_deletion); + 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, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); @@ -5460,98 +5670,118 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_find_indels_su /* "CRISPResso2/CRISPRessoCOREResources.pyx":96 * 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, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); + 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); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_end_deletion); + 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, 96, __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, 96, __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, 96, __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":97 - * 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, 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_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); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8); + __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); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_end_deletion); - __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_7 = __Pyx_PyList_Extend(__pyx_v_deletion_positions, __pyx_t_8); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 97, __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":98 + /* "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, 98, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 98, __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); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8); + __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); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_end_deletion); - __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, 98, __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":99 + /* "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, 99, __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, 99, __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, 99, __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":96 - * 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":100 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":101 * deletion_coordinates.append((start_deletion, end_deletion)) * deletion_sizes.append(end_deletion - start_deletion) * start_deletion = -1 # <<<<<<<<<<<<<< @@ -5580,7 +5810,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_find_indels_su } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":102 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":103 * start_deletion = -1 * * if start_deletion != -1: # <<<<<<<<<<<<<< @@ -5590,12 +5820,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":103 + /* "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); @@ -5603,124 +5833,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":104 + /* "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, 104, __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, 104, __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); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); + 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); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_end_deletion); + 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, 104, __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, 104, __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":105 + /* "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, 105, __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, 105, __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); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); + 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); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_end_deletion); + 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, 105, __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, 105, __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, 105, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_6) { - /* "CRISPResso2/CRISPRessoCOREResources.pyx":106 - * 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, 106, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __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); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8); + __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); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_end_deletion); - __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, 106, __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, 106, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":107 + /* "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, 107, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __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); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8); + __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); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_end_deletion); - __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, 107, __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":108 + /* "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, 108, __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, 108, __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, 108, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":105 - * 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":102 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":103 * start_deletion = -1 * * if start_deletion != -1: # <<<<<<<<<<<<<< @@ -5729,43 +5979,43 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_find_indels_su */ } - /* "CRISPResso2/CRISPRessoCOREResources.pyx":110 + /* "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 = PyList_GET_SIZE(__pyx_v_substitution_positions); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 110, __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":111 + /* "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, 111, __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, 111, __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":112 + /* "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 { */ - __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_v_insertion_sizes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 112, __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, 112, __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":114 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":116 * cdef size_t insertion_n = sum(insertion_sizes) * * return { # <<<<<<<<<<<<<< @@ -5774,226 +6024,239 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_find_indels_su */ __Pyx_XDECREF(__pyx_r); - /* "CRISPResso2/CRISPRessoCOREResources.pyx":115 + /* "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, 115, __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, 115, __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":116 + /* "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, 115, __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":117 + /* "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, 115, __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":118 + /* "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, 115, __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":119 + /* "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, 115, __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":120 + /* "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, 120, __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, 115, __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":122 + /* "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, 115, __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":123 + /* "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, 115, __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":124 - * '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, 115, __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":125 + /* "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, 115, __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":126 + /* "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, 126, __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, 115, __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":128 + /* "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, 115, __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":129 + /* "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, 115, __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":130 + /* "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, 130, __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, 130, __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 && unlikely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_5)) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_9))) { + __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; } } + #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, 130, __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, 115, __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":131 + /* "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, 131, __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, 131, __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 && unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5); + #if CYTHON_UNPACK_METHODS + 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, 131, __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, 115, __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":132 + /* "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, 132, __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, 115, __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":134 + /* "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, 115, __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":19 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":18 * re_find_indels = re.compile("(-*-)") * * @cython.boundscheck(False) # <<<<<<<<<<<<<< @@ -6016,6 +6279,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); @@ -6034,8 +6298,8 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_find_indels_su } /* "CRISPResso2/CRISPRessoCOREResources.pyx":138 - * - * + * 'ref_positions': ref_positions, + * } * @cython.boundscheck(False) # <<<<<<<<<<<<<< * @cython.nonecheck(False) * @cython.wraparound(False) @@ -6061,18 +6325,26 @@ PyObject *__pyx_args, PyObject *__pyx_kwds PyObject *__pyx_v_ref_seq_al = 0; PyObject *__pyx_v__include_indx = 0; #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + 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_legacy (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}; - PyObject* values[3] = {0,0,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -6088,19 +6360,28 @@ 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_read_seq_al)) != 0)) kw_args--; + 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, 138, __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)) kw_args--; + 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, 138, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("find_indels_substitutions_legacy", 1, 3, 3, 1); __PYX_ERR(0, 138, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_include_indx)) != 0)) kw_args--; + 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, 138, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("find_indels_substitutions_legacy", 1, 3, 3, 2); __PYX_ERR(0, 138, __pyx_L3_error) @@ -6121,10 +6402,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_v_ref_seq_al = values[1]; __pyx_v__include_indx = values[2]; } - goto __pyx_L4_argument_unpacking_done; + goto __pyx_L6_skip; __pyx_L5_argtuple_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:; + { + 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_legacy", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; @@ -6132,6 +6421,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_substitutions_legacy(__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; } @@ -6187,9 +6482,9 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("find_indels_substitutions_legacy", 0); + __Pyx_RefNannySetupContext("find_indels_substitutions_legacy", 1); - /* "CRISPResso2/CRISPRessoCOREResources.pyx":143 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":145 * def find_indels_substitutions_legacy(read_seq_al, ref_seq_al, _include_indx): * * cdef char* sub_seq='' # <<<<<<<<<<<<<< @@ -6198,85 +6493,85 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s */ __pyx_v_sub_seq = ((char *)""); - /* "CRISPResso2/CRISPRessoCOREResources.pyx":160 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":162 * # aln A - T T T G G C C * # 1 2 3 4-4 5 6 7 8 = PyList_GET_SIZE(__pyx_t_1)) break; + { + 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, 169, __pyx_L1_error) + #endif + if (__pyx_t_3 >= __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, 168, __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 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 168, __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 { - if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + { + 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, 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, 168, __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 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 168, __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 } @@ -6325,7 +6633,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, 168, __pyx_L1_error) + else __PYX_ERR(0, 169, __pyx_L1_error) } break; } @@ -6336,128 +6644,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":169 + /* "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, 169, __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":170 + /* "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, 170, __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, 170, __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":171 + /* "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, 171, __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, 171, __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, 171, __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, 171, __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, 171, __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, 171, __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, 171, __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, 171, __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":172 + /* "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, 172, __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, 172, __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":173 + /* "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, 173, __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, 173, __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":174 + /* "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, 174, __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, 174, __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":175 + /* "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, 175, __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, 175, __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":176 + /* "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, 176, __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, 176, __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":174 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":175 * all_substitution_positions.append(idx) * all_substitution_values.append(read_seq_al[idx_c]) * if idx in _include_indx: # <<<<<<<<<<<<<< @@ -6466,7 +6774,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s */ } - /* "CRISPResso2/CRISPRessoCOREResources.pyx":171 + /* "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': # <<<<<<<<<<<<<< @@ -6475,7 +6783,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s */ } - /* "CRISPResso2/CRISPRessoCOREResources.pyx":178 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":179 * substitution_values.append(read_seq_al[idx_c]) * * idx+=1 # <<<<<<<<<<<<<< @@ -6484,7 +6792,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s */ __pyx_v_idx = (__pyx_v_idx + 1); - /* "CRISPResso2/CRISPRessoCOREResources.pyx":169 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":170 * idx=0 * for idx_c, c in enumerate(ref_seq_al): * if c in nucSet: # <<<<<<<<<<<<<< @@ -6494,7 +6802,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s goto __pyx_L5; } - /* "CRISPResso2/CRISPRessoCOREResources.pyx":181 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":182 * * else: * if idx==0: # <<<<<<<<<<<<<< @@ -6505,16 +6813,16 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __pyx_t_6 = (__pyx_v_idx == 0); if (__pyx_t_6) { - /* "CRISPResso2/CRISPRessoCOREResources.pyx":182 + /* "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, 182, __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":181 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":182 * * else: * if idx==0: # <<<<<<<<<<<<<< @@ -6524,7 +6832,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s goto __pyx_L11; } - /* "CRISPResso2/CRISPRessoCOREResources.pyx":184 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":185 * ref_positions.append(-1) * else: * ref_positions.append(-idx) # <<<<<<<<<<<<<< @@ -6532,16 +6840,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, 184, __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, 184, __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":168 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":169 * nucSet = set(['A', 'T', 'C', 'G', 'N']) * idx=0 * for idx_c, c in enumerate(ref_seq_al): # <<<<<<<<<<<<<< @@ -6551,151 +6859,152 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":186 + /* "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 = PyList_GET_SIZE(__pyx_v_substitution_positions); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 186, __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":189 + /* "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, 189, __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":190 + /* "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, 190, __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":191 + /* "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, 191, __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":192 + /* "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, 192, __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":194 + /* "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, 194, __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":195 + /* "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, 195, __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":196 + /* "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, 196, __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":197 + /* "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, 197, __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":198 + /* "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, 198, __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":200 + /* "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, 200, __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":201 + /* "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, 201, __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, 201, __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; __pyx_t_2 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { + #if CYTHON_UNPACK_METHODS + 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_8); @@ -6705,39 +7014,53 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __pyx_t_2 = 1; } } + #endif { 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, 201, __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; } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_8 = __pyx_t_1; __Pyx_INCREF(__pyx_t_8); __pyx_t_3 = 0; + __pyx_t_8 = __pyx_t_1; __Pyx_INCREF(__pyx_t_8); + __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, 201, __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, 201, __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 (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_8))) { - if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_8)) break; + { + 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, 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, 201, __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 = PySequence_ITEM(__pyx_t_8, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __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 { - if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_8)) break; + { + 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, 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, 201, __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 = PySequence_ITEM(__pyx_t_8, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __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 } @@ -6747,7 +7070,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, 201, __pyx_L1_error) + else __PYX_ERR(0, 202, __pyx_L1_error) } break; } @@ -6756,18 +7079,19 @@ 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":202 + /* "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, 202, __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; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); @@ -6777,11 +7101,12 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __pyx_t_2 = 1; } } + #endif { - PyObject *__pyx_callargs[1] = {__pyx_t_5, }; + 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, 202, __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; } @@ -6791,7 +7116,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, 202, __pyx_L1_error) + __PYX_ERR(0, 203, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -6804,15 +7129,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, 202, __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, 202, __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, 202, __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); @@ -6820,7 +7145,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, 202, __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; @@ -6828,17 +7153,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, 202, __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, 202, __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, 202, __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":203 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":204 * for p in re_find_indels.finditer(read_seq_al): * st,en=p.span() * ref_st = 0 # <<<<<<<<<<<<<< @@ -6848,7 +7173,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":204 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":205 * st,en=p.span() * ref_st = 0 * if st-1 > 0: # <<<<<<<<<<<<<< @@ -6858,7 +7183,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":205 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":206 * ref_st = 0 * if st-1 > 0: * ref_st = ref_positions[st] # <<<<<<<<<<<<<< @@ -6870,7 +7195,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":204 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":205 * st,en=p.span() * ref_st = 0 * if st-1 > 0: # <<<<<<<<<<<<<< @@ -6879,30 +7204,30 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s */ } - /* "CRISPResso2/CRISPRessoCOREResources.pyx":206 + /* "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, 206, __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":207 + /* "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 = PyList_GET_SIZE(__pyx_v_ref_positions); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 207, __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":208 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":209 * ref_en = idx-1 * if en < len(ref_positions): * ref_en = ref_positions[en] # <<<<<<<<<<<<<< @@ -6914,7 +7239,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":207 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":208 * ref_st = ref_positions[st] * ref_en = idx-1 * if en < len(ref_positions): # <<<<<<<<<<<<<< @@ -6923,114 +7248,114 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s */ } - /* "CRISPResso2/CRISPRessoCOREResources.pyx":209 + /* "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, 209, __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); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_ref_st); + 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); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref_en); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 209, __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, 209, __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":210 + /* "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, 210, __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); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_ref_st); + 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); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_ref_en); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __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, 210, __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":211 + /* "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, 211, __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":212 + /* "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, 212, __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); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_ref_st); + 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); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_ref_en); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __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, 212, __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":213 + /* "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, 213, __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); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_ref_st); + 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); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref_en); - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_deletion_coordinates, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 213, __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":214 + /* "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, 214, __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, 214, __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":211 + /* "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): # <<<<<<<<<<<<<< @@ -7039,7 +7364,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s */ } - /* "CRISPResso2/CRISPRessoCOREResources.pyx":201 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":202 * * include_indx_set = set(_include_indx) * for p in re_find_indels.finditer(read_seq_al): # <<<<<<<<<<<<<< @@ -7049,21 +7374,22 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":216 + /* "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, 216, __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, 216, __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; __pyx_t_13 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); @@ -7073,32 +7399,34 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __pyx_t_13 = 1; } } + #endif { 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, 216, __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":218 + /* "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, 218, __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, 218, __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; __pyx_t_13 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); @@ -7108,39 +7436,53 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __pyx_t_13 = 1; } } + #endif { 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, 218, __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; } if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) { - __pyx_t_1 = __pyx_t_8; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; + __pyx_t_1 = __pyx_t_8; __Pyx_INCREF(__pyx_t_1); + __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, 218, __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, 218, __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 (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_1))) { - if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; + { + 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, 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, 218, __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 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 218, __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 { - if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + { + 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, 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, 218, __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 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 218, __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 } @@ -7150,7 +7492,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, 218, __pyx_L1_error) + else __PYX_ERR(0, 219, __pyx_L1_error) } break; } @@ -7159,18 +7501,19 @@ 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":219 + /* "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, 219, __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; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); @@ -7180,11 +7523,12 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __pyx_t_13 = 1; } } + #endif { - PyObject *__pyx_callargs[1] = {__pyx_t_9, }; + 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, 219, __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; } @@ -7194,7 +7538,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, 219, __pyx_L1_error) + __PYX_ERR(0, 220, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -7207,15 +7551,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, 219, __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, 219, __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, 219, __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); @@ -7223,7 +7567,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, 219, __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; @@ -7231,17 +7575,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, 219, __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, 219, __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, 219, __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":221 + /* "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 # <<<<<<<<<<<<<< @@ -7251,7 +7595,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __pyx_t_6 = (__pyx_v_st == 0); if (__pyx_t_6) { - /* "CRISPResso2/CRISPRessoCOREResources.pyx":222 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":223 * #sometimes insertions run off the end of the reference * if st == 0: # if insertion happened before ref * continue # <<<<<<<<<<<<<< @@ -7260,7 +7604,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s */ goto __pyx_L21_continue; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":221 + /* "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 # <<<<<<<<<<<<<< @@ -7269,18 +7613,18 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s */ } - /* "CRISPResso2/CRISPRessoCOREResources.pyx":223 + /* "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, 223, __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":224 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":225 * continue * if en == len(ref_seq_al): # if insertion happened after ref * continue # <<<<<<<<<<<<<< @@ -7289,7 +7633,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s */ goto __pyx_L21_continue; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":223 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":224 * if st == 0: # if insertion happened before ref * continue * if en == len(ref_seq_al): # if insertion happened after ref # <<<<<<<<<<<<<< @@ -7298,7 +7642,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s */ } - /* "CRISPResso2/CRISPRessoCOREResources.pyx":225 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":226 * if en == len(ref_seq_al): # if insertion happened after ref * continue * ref_st = ref_positions[st-1] # <<<<<<<<<<<<<< @@ -7311,7 +7655,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":226 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":227 * continue * ref_st = ref_positions[st-1] * ref_en = ref_positions[en] # <<<<<<<<<<<<<< @@ -7323,100 +7667,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":228 + /* "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, 228, __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":229 + /* "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, 229, __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":230 + /* "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, 230, __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":231 + /* "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, 231, __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, 231, __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":232 + /* "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, 232, __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); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_ref_st); + 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); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_ref_en); - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_insertion_coordinates, __pyx_t_8); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 232, __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":233 + /* "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, 233, __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":234 + /* "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, 234, __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":235 + /* "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, 235, __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, 235, __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":231 + /* "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): # <<<<<<<<<<<<<< @@ -7425,7 +7769,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s */ } - /* "CRISPResso2/CRISPRessoCOREResources.pyx":218 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":219 * deletion_n = np.sum(deletion_sizes) * * for p in re_find_indels.finditer(ref_seq_al): # <<<<<<<<<<<<<< @@ -7436,21 +7780,22 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":237 + /* "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, 237, __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, 237, __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; __pyx_t_2 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); @@ -7460,11 +7805,12 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __pyx_t_2 = 1; } } + #endif { 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, 237, __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; } @@ -7474,9 +7820,9 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s /* "CRISPResso2/CRISPRessoCOREResources.pyx":241 * * 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, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -7484,118 +7830,118 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s /* "CRISPResso2/CRISPRessoCOREResources.pyx":242 * 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, 241, __pyx_L1_error) /* "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, + * '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, 241, __pyx_L1_error) /* "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, + * '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, 241, __pyx_L1_error) /* "CRISPResso2/CRISPRessoCOREResources.pyx":245 - * 'insertion_positions':insertion_positions, - * 'insertion_coordinates':insertion_coordinates, - * 'insertion_sizes':insertion_sizes, # <<<<<<<<<<<<<< - * 'insertion_n':insertion_n, - * + * '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, 241, __pyx_L1_error) /* "CRISPResso2/CRISPRessoCOREResources.pyx":246 - * 'insertion_coordinates':insertion_coordinates, - * 'insertion_sizes':insertion_sizes, - * 'insertion_n':insertion_n, # <<<<<<<<<<<<<< + * '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, 241, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":248 - * '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, 241, __pyx_L1_error) /* "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, 241, __pyx_L1_error) /* "CRISPResso2/CRISPRessoCOREResources.pyx":250 - * 'all_deletion_positions':all_deletion_positions, - * 'deletion_positions':deletion_positions, - * 'deletion_coordinates':deletion_coordinates, # <<<<<<<<<<<<<< - * 'deletion_sizes':deletion_sizes, - * 'deletion_n':deletion_n, + * + * '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, 241, __pyx_L1_error) /* "CRISPResso2/CRISPRessoCOREResources.pyx":251 - * 'deletion_positions':deletion_positions, - * 'deletion_coordinates':deletion_coordinates, - * 'deletion_sizes':deletion_sizes, # <<<<<<<<<<<<<< - * 'deletion_n':deletion_n, + * '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, 241, __pyx_L1_error) /* "CRISPResso2/CRISPRessoCOREResources.pyx":252 - * 'deletion_coordinates':deletion_coordinates, - * 'deletion_sizes':deletion_sizes, - * 'deletion_n':deletion_n, # <<<<<<<<<<<<<< + * '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, 241, __pyx_L1_error) /* "CRISPResso2/CRISPRessoCOREResources.pyx":254 - * 'deletion_n':deletion_n, + * '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, 241, __pyx_L1_error) /* "CRISPResso2/CRISPRessoCOREResources.pyx":255 * - * '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, 241, __pyx_L1_error) /* "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, + * '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, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); @@ -7604,7 +7950,8 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; __pyx_t_2 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); @@ -7614,6 +7961,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __pyx_t_2 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_all_substitution_values}; __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_2, 1+__pyx_t_2); @@ -7626,10 +7974,10 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "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, + * '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, 257, __pyx_L1_error) @@ -7639,7 +7987,8 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_2 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); @@ -7649,6 +7998,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __pyx_t_2 = 1; } } + #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_substitution_values}; __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_2, 1+__pyx_t_2); @@ -7661,11 +8011,11 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "CRISPResso2/CRISPRessoCOREResources.pyx":258 - * 'all_substitution_values':np.array(all_substitution_values), - * 'substitution_values':np.array(substitution_values), - * 'substitution_n':substitution_n, # <<<<<<<<<<<<<< + * '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, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); @@ -7673,9 +8023,9 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "CRISPResso2/CRISPRessoCOREResources.pyx":260 - * 'substitution_n':substitution_n, + * 'substitution_n':substitution_n, * - * 'ref_positions':ref_positions, # <<<<<<<<<<<<<< + * 'ref_positions':ref_positions, # <<<<<<<<<<<<<< * } * return retDict */ @@ -7684,7 +8034,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __pyx_t_1 = 0; /* "CRISPResso2/CRISPRessoCOREResources.pyx":262 - * 'ref_positions':ref_positions, + * 'ref_positions':ref_positions, * } * return retDict # <<<<<<<<<<<<<< * @@ -7696,8 +8046,8 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s goto __pyx_L0; /* "CRISPResso2/CRISPRessoCOREResources.pyx":138 - * - * + * 'ref_positions': ref_positions, + * } * @cython.boundscheck(False) # <<<<<<<<<<<<<< * @cython.nonecheck(False) * @cython.wraparound(False) @@ -7769,18 +8119,26 @@ PyObject *__pyx_args, PyObject *__pyx_kwds PyObject *__pyx_v_a = 0; PyObject *__pyx_v_b = 0; #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("calculate_homology (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_a,&__pyx_n_s_b,0}; - PyObject* values[2] = {0,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -7794,12 +8152,18 @@ 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_a)) != 0)) kw_args--; + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 265, __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_b)) != 0)) kw_args--; + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_b)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 265, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("calculate_homology", 1, 2, 2, 1); __PYX_ERR(0, 265, __pyx_L3_error) @@ -7818,10 +8182,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_v_a = values[0]; __pyx_v_b = values[1]; } - goto __pyx_L4_argument_unpacking_done; + goto __pyx_L6_skip; __pyx_L5_argtuple_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:; + { + 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.calculate_homology", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; @@ -7829,6 +8201,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_4calculate_homology(__pyx_self, __pyx_v_a, __pyx_v_b); /* 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; } @@ -7850,7 +8228,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_4calculate_hom int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("calculate_homology", 0); + __Pyx_RefNannySetupContext("calculate_homology", 1); /* "CRISPResso2/CRISPRessoCOREResources.pyx":266 * @@ -7995,6 +8373,8 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_kp_u__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0, 0}, {&__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}, @@ -8089,8 +8469,8 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __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, 111, __pyx_L1_error) - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 983, __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:; return -1; @@ -8101,54 +8481,54 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":983 + /* "../../../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") # <<<<<<<<<<<<<< * * cdef inline int import_umath() except -1: */ - __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 983, __pyx_L1_error) + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 984, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "../../../../../../home/snichol2/micromamba/envs/c2/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":989 + /* "../../../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") # <<<<<<<<<<<<<< * * cdef inline int import_ufunc() except -1: */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 989, __pyx_L1_error) + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 990, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "CRISPResso2/CRISPRessoCOREResources.pyx":17 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":16 * * * re_find_indels = re.compile("(-*-)") # <<<<<<<<<<<<<< * * @cython.boundscheck(False) */ - __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u__5); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 17, __pyx_L1_error) + __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":19 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":18 * re_find_indels = re.compile("(-*-)") * * @cython.boundscheck(False) # <<<<<<<<<<<<<< * @cython.nonecheck(False) * @cython.wraparound(False) */ - __pyx_tuple__7 = 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__7)) __PYX_ERR(0, 19, __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, 30, 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, 19, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 19, __pyx_L1_error) + __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":138 - * - * + * 'ref_positions': ref_positions, + * } * @cython.boundscheck(False) # <<<<<<<<<<<<<< * @cython.nonecheck(False) * @cython.wraparound(False) @@ -8198,7 +8578,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { * numpy._import_array */ #ifdef NPY_FEATURE_VERSION -#if !NO_IMPORT_ARRAY +#ifndef NO_IMPORT_ARRAY if (unlikely(_import_array() == -1)) { PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import " "(auto-generated because you didn't call 'numpy.import_array()' after cimporting numpy; " @@ -8265,33 +8645,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_0(__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_0(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_0(PyTypeObject), + sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_9(PyTypeObject), #else - sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyHeapTypeObject), + sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_9(PyHeapTypeObject), #endif - __Pyx_ImportType_CheckSize_Warn_3_0_0); 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_0(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyArray_Descr),__Pyx_ImportType_CheckSize_Ignore_3_0_0); if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 202, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyArrayIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_0); if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 225, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyArrayMultiIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_0); if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 229, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyArrayObject),__Pyx_ImportType_CheckSize_Ignore_3_0_0); if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 238, __pyx_L1_error) - __pyx_ptype_5numpy_generic = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_generic) __PYX_ERR(1, 809, __pyx_L1_error) - __pyx_ptype_5numpy_number = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "number", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_number) __PYX_ERR(1, 811, __pyx_L1_error) - __pyx_ptype_5numpy_integer = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_integer) __PYX_ERR(1, 813, __pyx_L1_error) - __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 815, __pyx_L1_error) - __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 817, __pyx_L1_error) - __pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 819, __pyx_L1_error) - __pyx_ptype_5numpy_floating = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_floating) __PYX_ERR(1, 821, __pyx_L1_error) - __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 823, __pyx_L1_error) - __pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 825, __pyx_L1_error) - __pyx_ptype_5numpy_character = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "character", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_0); if (!__pyx_ptype_5numpy_character) __PYX_ERR(1, 827, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_0_0(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_0(PyUFuncObject),__Pyx_ImportType_CheckSize_Ignore_3_0_0); if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 865, __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; @@ -8506,7 +8886,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; } @@ -8518,10 +8898,8 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_CRISPRessoCOREResources(PyObject * CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); - __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_b); - __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_cython_runtime); + __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); @@ -8533,7 +8911,7 @@ if (!__Pyx_RefNanny) { } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_CRISPRessoCOREResources(void)", 0); - if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif @@ -8621,39 +8999,39 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_d, __pyx_n_s_re, __pyx_t_2) < 0) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":17 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":16 * * * 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, 17, __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, 17, __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__6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __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, 17, __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":19 + /* "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_2, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __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, 19, __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":138 - * - * + * 'ref_positions': ref_positions, + * } * @cython.boundscheck(False) # <<<<<<<<<<<<<< * @cython.nonecheck(False) * @cython.wraparound(False) @@ -8812,6 +9190,8 @@ static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObjec tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); + Py_XDECREF(type); + Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; @@ -8869,14 +9249,20 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject #endif /* PyObjectGetAttrStrNoError */ +#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } +#endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; +#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 + (void) PyObject_GetOptionalAttr(obj, attr_name, &result); + return result; +#else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { @@ -8888,6 +9274,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, P __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; +#endif } /* GetBuiltinName */ @@ -9088,8 +9475,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); + #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) + return NULL; + #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { @@ -9461,13 +9853,31 @@ 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) { + Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); + PyObject *dict; + dict = PyDict_New(); + if (unlikely(!dict)) + return NULL; + for (i=0; i= PyTuple_GET_SIZE(kwds)) break; + Py_ssize_t size; +#if CYTHON_ASSUME_SAFE_MACROS + size = PyTuple_GET_SIZE(kwds); +#else + size = PyTuple_Size(kwds); + if (size < 0) goto bad; +#endif + if (pos >= size) break; +#if CYTHON_AVOID_BORROWED_REFS + key = __Pyx_PySequence_ITEM(kwds, pos); + if (!key) goto bad; +#elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); +#else + key = PyTuple_GetItem(kwds, pos); + if (!key) goto bad; +#endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; +#if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(key); +#endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; +#if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(value); + Py_DECREF(key); +#endif + key = NULL; + value = NULL; continue; } +#if !CYTHON_AVOID_BORROWED_REFS + Py_INCREF(key); +#endif + Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { @@ -9548,6 +9988,9 @@ static int __Pyx_ParseOptionalKeywords( if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; +#if CYTHON_AVOID_BORROWED_REFS + value = NULL; +#endif break; } name++; @@ -9577,6 +10020,9 @@ static int __Pyx_ParseOptionalKeywords( if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; +#if CYTHON_AVOID_BORROWED_REFS + value = NULL; +#endif break; } name++; @@ -9603,6 +10049,8 @@ static int __Pyx_ParseOptionalKeywords( goto invalid_keyword; } } + Py_XDECREF(key); + Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); @@ -9622,6 +10070,8 @@ static int __Pyx_ParseOptionalKeywords( function_name, key); #endif bad: + Py_XDECREF(key); + Py_XDECREF(value); return -1; } @@ -9713,7 +10163,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, } } #else - if (is_list || PySequence_Check(o)) { + if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif @@ -9776,9 +10226,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; } @@ -9798,7 +10249,7 @@ static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { #if PY_MAJOR_VERSION >= 3 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) #else - if (likely(!PyCFunction_Check(method))) + if (likely(!__Pyx_CyOrPyCFunction_Check(method))) #endif { PyMethodDescrObject *descr = (PyMethodDescrObject*) method; @@ -9806,9 +10257,7 @@ static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); } else #endif -#if defined(CYTHON_COMPILING_IN_PYPY) -#elif PY_VERSION_HEX >= 0x03090000 - if (PyCFunction_CheckExact(method)) +#if CYTHON_COMPILING_IN_PYPY #else if (PyCFunction_Check(method)) #endif @@ -9934,9 +10383,15 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; + #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { + return NULL; + } + #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && @@ -10011,10 +10466,15 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; - cfunc = PyCFunction_GET_FUNCTION(func); - self = PyCFunction_GET_SELF(func); + cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); + self = __Pyx_CyOrPyCFunction_GET_SELF(func); + #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) + return NULL; + #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { @@ -10027,42 +10487,33 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject #endif /* PyObjectFastCall */ +#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; - PyObject *result; + PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); - PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]); + if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); + bad: Py_DECREF(argstuple); return result; } +#endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { -#if defined(__Pyx_CyFunction_USED) && defined(NDEBUG) - if (__Pyx_IsCyOrPyCFunction(func)) -#else - if (PyCFunction_Check(func)) -#endif - { - if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { - return __Pyx_PyObject_CallMethO(func, NULL); - } - } + if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) + return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { - if (PyCFunction_Check(func)) - { - if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { - return __Pyx_PyObject_CallMethO(func, args[0]); - } - } + if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) + return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 @@ -10086,21 +10537,31 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj } #endif #endif - #if CYTHON_VECTORCALL - vectorcallfunc f = _PyVectorcall_Function(func); - if (f) { - return f(func, args, (size_t)nargs, kwargs); - } - #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL - if (__Pyx_CyFunction_CheckExact(func)) { - __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); - if (f) return f(func, args, (size_t)nargs, kwargs); + if (kwargs == NULL) { + #if CYTHON_VECTORCALL + #if PY_VERSION_HEX < 0x03090000 + vectorcallfunc f = _PyVectorcall_Function(func); + #else + vectorcallfunc f = PyVectorcall_Function(func); + #endif + if (f) { + return f(func, args, (size_t)nargs, NULL); + } + #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL + if (__Pyx_CyFunction_CheckExact(func)) { + __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); + if (f) return f(func, args, (size_t)nargs, NULL); + } + #endif } - #endif if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } + #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API + return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); + #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); + #endif } /* PyObjectCallOneArg */ @@ -10144,7 +10605,7 @@ static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { @@ -10193,9 +10654,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; @@ -10216,10 +10678,10 @@ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { } /* TypeImport */ -#ifndef __PYX_HAVE_RT_ImportType_3_0_0 -#define __PYX_HAVE_RT_ImportType_3_0_0 -static PyTypeObject *__Pyx_ImportType_3_0_0(PyObject *module, const char *module_name, const char *class_name, - size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_0 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]; @@ -10273,7 +10735,7 @@ static PyTypeObject *__Pyx_ImportType_3_0_0(PyObject *module, const char *module module_name, class_name, size, basicsize+itemsize); goto bad; } - if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_0 && + 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. " @@ -10281,7 +10743,7 @@ static PyTypeObject *__Pyx_ImportType_3_0_0(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_0 && (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", @@ -10318,14 +10780,9 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { { #if PY_MAJOR_VERSION >= 3 if (level == -1) { - if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) { - #if CYTHON_COMPILING_IN_LIMITED_API - module = PyImport_ImportModuleLevelObject( - name, empty_dict, empty_dict, from_list, 1); - #else + if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); - #endif if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; @@ -10344,14 +10801,9 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else - #if CYTHON_COMPILING_IN_LIMITED_API - module = PyImport_ImportModuleLevelObject( - name, empty_dict, empty_dict, from_list, level); - #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif - #endif } } bad: @@ -10566,10 +11018,7 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { - PyObject *abi_module = PyImport_AddModule((char*) __PYX_ABI_MODULE_NAME); - if (unlikely(!abi_module)) return NULL; - Py_INCREF(abi_module); - return abi_module; + return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ @@ -10730,8 +11179,22 @@ static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, _ #endif /* CythonFunctionShared */ +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { + if (__Pyx_CyFunction_Check(func)) { + return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; + } else if (PyCFunction_Check(func)) { + return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; + } + return 0; +} +#else +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { + return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; +} +#endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { -#if PY_VERSION_HEX < 0x030900B1 +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); @@ -10746,6 +11209,10 @@ __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { +#if CYTHON_COMPILING_IN_LIMITED_API + op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); + if (unlikely(!op->func_doc)) return NULL; +#else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); @@ -10758,6 +11225,7 @@ __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) Py_INCREF(Py_None); return Py_None; } +#endif } Py_INCREF(op->func_doc); return op->func_doc; @@ -10778,7 +11246,9 @@ __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { -#if PY_MAJOR_VERSION >= 3 +#if CYTHON_COMPILING_IN_LIMITED_API + op->func_name = PyObject_GetAttrString(op->func, "__name__"); +#elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); @@ -10897,10 +11367,10 @@ __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else - op->defaults_tuple = PySequence_ITEM(res, 0); + op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { - op->defaults_kwdict = PySequence_ITEM(res, 1); + op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif @@ -11009,7 +11479,15 @@ __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); +#if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); +#else + if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { + Py_DECREF(marker); + Py_DECREF(fromlist); + return NULL; + } +#endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; @@ -11025,6 +11503,18 @@ __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject * +__Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { + CYTHON_UNUSED_VAR(context); + return PyObject_GetAttrString(op->func, "__module__"); +} +static int +__Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + return PyObject_SetAttrString(op->func, "__module__", value); +} +#endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, @@ -11044,20 +11534,27 @@ static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, +#if CYTHON_COMPILING_IN_LIMITED_API + {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, +#endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { +#if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, +#endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else +#if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif -#if PY_VERSION_HEX < 0x030500A0 +#endif +#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, @@ -11080,30 +11577,40 @@ static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; -#if PY_VERSION_HEX < 0x030500A0 +#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { +#if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; +#endif if (unlikely(op == NULL)) return NULL; +#if CYTHON_COMPILING_IN_LIMITED_API + op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); + if (unlikely(!op->func)) return NULL; +#endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; +#if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; +#endif Py_XINCREF(closure); op->func_closure = closure; +#if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; +#endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; -#if PY_VERSION_HEX < 0x030900B1 +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; @@ -11149,13 +11656,18 @@ static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); +#if CYTHON_COMPILING_IN_LIMITED_API + Py_CLEAR(m->func); +#else Py_CLEAR(((PyCFunctionObject*)m)->m_module); +#endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); +#if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else @@ -11164,6 +11676,7 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } +#endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); @@ -11194,14 +11707,20 @@ static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); +#if CYTHON_COMPILING_IN_LIMITED_API + Py_VISIT(m->func); +#else Py_VISIT(((PyCFunctionObject*)m)->m_module); +#endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); +#if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); +#endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); @@ -11225,10 +11744,22 @@ __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *f = ((__pyx_CyFunctionObject*)func)->func; + PyObject *py_name = NULL; + PyCFunction meth; + int flags; + meth = PyCFunction_GetFunction(f); + if (unlikely(!meth)) return NULL; + flags = PyCFunction_GetFlags(f); + if (unlikely(flags < 0)) return NULL; +#else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; + int flags = f->m_ml->ml_flags; +#endif Py_ssize_t size; - switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); @@ -11237,24 +11768,43 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { +#if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); +#else + size = PyTuple_Size(arg); + if (unlikely(size < 0)) return NULL; +#endif if (likely(size == 0)) return (*meth)(self, NULL); +#if CYTHON_COMPILING_IN_LIMITED_API + py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); + if (!py_name) return NULL; + PyErr_Format(PyExc_TypeError, + "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + py_name, size); + Py_DECREF(py_name); +#else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); +#endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { +#if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); +#else + size = PyTuple_Size(arg); + if (unlikely(size < 0)) return NULL; +#endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else - arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) @@ -11262,9 +11812,18 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py #endif return result; } +#if CYTHON_COMPILING_IN_LIMITED_API + py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); + if (!py_name) return NULL; + PyErr_Format(PyExc_TypeError, + "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + py_name, size); + Py_DECREF(py_name); +#else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); +#endif return NULL; } break; @@ -11272,12 +11831,28 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } +#if CYTHON_COMPILING_IN_LIMITED_API + py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); + if (!py_name) return NULL; + PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", + py_name); + Py_DECREF(py_name); +#else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); +#endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { - return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); + PyObject *self, *result; +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else + self = ((PyCFunctionObject*)func)->m_self; +#endif + result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); + return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; @@ -11297,7 +11872,12 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P Py_ssize_t argc; PyObject *new_args; PyObject *self; +#if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); +#else + argc = PyTuple_Size(args); + if (unlikely(!argc) < 0) return NULL; +#endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; @@ -11422,7 +12002,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) { @@ -11510,7 +12090,7 @@ static PyTypeObject __pyx_CyFunctionType_type = { #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif -#ifdef _Py_TPFLAGS_HAVE_VECTORCALL +#if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, @@ -11742,20 +12322,93 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { #include "compile.h" #include "frameobject.h" #include "traceback.h" -#if PY_VERSION_HEX >= 0x030b00a6 +#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API +static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, + PyObject *firstlineno, PyObject *name) { + PyObject *replace = NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; + replace = PyObject_GetAttrString(code, "replace"); + if (likely(replace)) { + PyObject *result; + result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); + Py_DECREF(replace); + return result; + } + PyErr_Clear(); + #if __PYX_LIMITED_VERSION_HEX < 0x030780000 + { + PyObject *compiled = NULL, *result = NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; + compiled = Py_CompileString( + "out = type(code)(\n" + " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" + " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" + " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" + " code.co_lnotab)\n", "", Py_file_input); + if (!compiled) return NULL; + result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); + Py_DECREF(compiled); + if (!result) PyErr_Print(); + Py_DECREF(result); + result = PyDict_GetItemString(scratch_dict, "out"); + if (result) Py_INCREF(result); + return result; + } + #else + return NULL; + #endif +} static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { + PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; + PyObject *replace = NULL, *getframe = NULL, *frame = NULL; + PyObject *exc_type, *exc_value, *exc_traceback; + int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } - _PyTraceback_Add(funcname, filename, py_line); + PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); + code_object = Py_CompileString("_getframe()", filename, Py_eval_input); + if (unlikely(!code_object)) goto bad; + py_py_line = PyLong_FromLong(py_line); + if (unlikely(!py_py_line)) goto bad; + py_funcname = PyUnicode_FromString(funcname); + if (unlikely(!py_funcname)) goto bad; + dict = PyDict_New(); + if (unlikely(!dict)) goto bad; + { + PyObject *old_code_object = code_object; + code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); + Py_DECREF(old_code_object); + } + if (unlikely(!code_object)) goto bad; + getframe = PySys_GetObject("_getframe"); + if (unlikely(!getframe)) goto bad; + if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; + frame = PyEval_EvalCode(code_object, dict, dict); + if (unlikely(!frame) || frame == Py_None) goto bad; + success = 1; + bad: + PyErr_Restore(exc_type, exc_value, exc_traceback); + Py_XDECREF(code_object); + Py_XDECREF(py_py_line); + Py_XDECREF(py_funcname); + Py_XDECREF(dict); + Py_XDECREF(replace); + if (success) { + PyTraceBack_Here( + (struct _frame*)frame); + } + Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( @@ -11808,7 +12461,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); @@ -12357,7 +13010,7 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #endif if (likely(v)) { int ret = -1; -#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) +#if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, @@ -12493,8 +13146,34 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); +#else + PyObject *from_bytes, *result = NULL; + PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); + if (!from_bytes) return NULL; + py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); + if (!py_bytes) goto limited_bad; + order_str = PyUnicode_FromString(little ? "little" : "big"); + if (!order_str) goto limited_bad; + arg_tuple = PyTuple_Pack(2, py_bytes, order_str); + if (!arg_tuple) goto limited_bad; + if (!is_unsigned) { + kwds = PyDict_New(); + if (!kwds) goto limited_bad; + if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + } + result = PyObject_Call(from_bytes, arg_tuple, kwds); + limited_bad: + Py_XDECREF(kwds); + Py_XDECREF(arg_tuple); + Py_XDECREF(order_str); + Py_XDECREF(py_bytes); + Py_XDECREF(from_bytes); + return result; +#endif } } @@ -12668,7 +13347,7 @@ static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { #endif if (likely(v)) { int ret = -1; -#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) +#if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, @@ -12804,8 +13483,34 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); +#else + PyObject *from_bytes, *result = NULL; + PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); + if (!from_bytes) return NULL; + py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); + if (!py_bytes) goto limited_bad; + order_str = PyUnicode_FromString(little ? "little" : "big"); + if (!order_str) goto limited_bad; + arg_tuple = PyTuple_Pack(2, py_bytes, order_str); + if (!arg_tuple) goto limited_bad; + if (!is_unsigned) { + kwds = PyDict_New(); + if (!kwds) goto limited_bad; + if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + } + result = PyObject_Call(from_bytes, arg_tuple, kwds); + limited_bad: + Py_XDECREF(kwds); + Py_XDECREF(arg_tuple); + Py_XDECREF(order_str); + Py_XDECREF(py_bytes); + Py_XDECREF(from_bytes); + return result; +#endif } } @@ -12818,7 +13523,8 @@ __Pyx_PyType_GetName(PyTypeObject* tp) __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); - Py_XSETREF(name, __Pyx_NewRef(__pyx_n_s__13)); + Py_XDECREF(name); + name = __Pyx_NewRef(__pyx_n_s__13); } return name; } @@ -12994,7 +13700,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #endif if (likely(v)) { int ret = -1; -#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) +#if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, @@ -13214,41 +13920,50 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj #endif /* CheckBinaryVersion */ -static int __Pyx_check_binary_version(void) { - char ctversion[5]; - int same=1, i, found_dot; - const char* rt_from_call = Py_GetVersion(); - PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); - found_dot = 0; - for (i = 0; i < 4; i++) { - if (!ctversion[i]) { - same = (rt_from_call[i] < '0' || rt_from_call[i] > '9'); - break; +static unsigned long __Pyx_get_runtime_version(void) { +#if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4 + return Py_Version & ~0xFFUL; +#else + const char* rt_version = Py_GetVersion(); + unsigned long version = 0; + unsigned long factor = 0x01000000UL; + unsigned int digit = 0; + int i = 0; + while (factor) { + while ('0' <= rt_version[i] && rt_version[i] <= '9') { + digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); + ++i; } - if (rt_from_call[i] != ctversion[i]) { - same = 0; + version += factor * digit; + if (rt_version[i] != '.') break; - } + digit = 0; + factor >>= 8; + ++i; } - if (!same) { - char rtversion[5] = {'\0'}; + return version; +#endif +} +static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { + const unsigned long MAJOR_MINOR = 0xFFFF0000UL; + if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) + return 0; + if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) + return 1; + { char message[200]; - for (i=0; i<4; ++i) { - if (rt_from_call[i] == '.') { - if (found_dot) break; - found_dot = 1; - } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') { - break; - } - rtversion[i] = rt_from_call[i]; - } PyOS_snprintf(message, sizeof(message), - "compile time version %s of module '%.100s' " - "does not match runtime version %s", - ctversion, __Pyx_MODULE_NAME, rtversion); + "compile time Python version %d.%d " + "of module '%.100s' " + "%s " + "runtime version %d.%d", + (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), + __Pyx_MODULE_NAME, + (allow_newer) ? "was newer than" : "does not match", + (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) + ); return PyErr_WarnEx(NULL, message, 1); } - return 0; } /* InitStrings */ @@ -13294,8 +14009,24 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { return 0; } +#include +static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { + size_t len = strlen(s); + if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { + PyErr_SetString(PyExc_OverflowError, "byte string is too long"); + return -1; + } + return (Py_ssize_t) len; +} static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { - return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); + Py_ssize_t len = __Pyx_ssize_strlen(c_str); + if (unlikely(len < 0)) return NULL; + return __Pyx_PyUnicode_FromStringAndSize(c_str, len); +} +static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { + Py_ssize_t len = __Pyx_ssize_strlen(c_str); + if (unlikely(len < 0)) return NULL; + return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; diff --git a/CRISPResso2/CRISPRessoCOREResources.pyx b/CRISPResso2/CRISPRessoCOREResources.pyx index 3eb98383..272a95f6 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) @@ -37,6 +36,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 = [] @@ -93,6 +93,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)) @@ -102,6 +103,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)) @@ -120,6 +122,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, @@ -130,14 +133,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='' @@ -162,7 +164,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): @@ -236,28 +237,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