From 7c0fe373fb85ed331e5e869f5e762085d3582a9d Mon Sep 17 00:00:00 2001 From: Cole Lyman Date: Fri, 5 Apr 2024 16:36:16 -0600 Subject: [PATCH] Fastp, args as data, guardrails, and PE fix (#415) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Change CRISPResso_status.txt format to JSON (#46) * Bug Fix - 367 (#35) * - Fixed references to ref_names_for_pe * removed extra tabs * trying to match empty line, no tabs * - changed references to ref_names[0] * Mckay/pd warnings (#45) * refactor errors='ignore' to try except * refactored integer slice to iloc[] * moved to_numeric try except to function * Refactor to_numeric_ignore_errors to to_numeric_ignore_columns This change is slightly cleaner because it addresses the root issue that some columns are strings (and can therefore not be converted to numeric types). Now if an error does occur when converting the dfs to numeric types it won't be swallowed up. * Add documentation to to_numeric_ignore_columns --------- Co-authored-by: Cole Lyman --------- Co-authored-by: Cole Lyman * add json read for status file * changed Formatter to json format * fixed json access variable name: message * changed perentage_complete to numeric * changed status file to .json * Create integration_tests.yml * Simplify name * CRISPRESSO2_DIR environment variable * Up one dir * ls workspace * Install CRISPResso and ydiff * Clone repo instead of checkout * submodule * ls * CRISPResso2_copy * ls * Update env * Simplify * Pull from githubactions branch * Pull githubactions repo * Checkout githubactions * Run tests individually * Pin plotly version * Run all tests even if one fails * Test on another branch * Switch branch with token * Update integration_tests.yml * New makefile commands * changed file to .json * changed status to json file * Make JSON human readable by adding new lines * GitHub actions integration tests (#48) * GitHub actions clean (#40) * Create pytest.yml * Create pylint.yml * Create .pylintrc * Create test_env.yml * Full path * Remove conda install * Replace path * Pytest tests * pip -e * Create integration_tests.yml * Simplify name * CRISPRESSO2_DIR environment variable * Up one dir * ls workspace * Install CRISPResso and ydiff * Clone repo instead of checkout * submodule * ls * CRISPResso2_copy * ls * Update env * Simplify * Pull from githubactions branch * Pull githubactions repo * Checkout githubactions * Mckay/pd warnings (#45) * refactor errors='ignore' to try except * refactored integer slice to iloc[] * moved to_numeric try except to function * Refactor to_numeric_ignore_errors to to_numeric_ignore_columns This change is slightly cleaner because it addresses the root issue that some columns are strings (and can therefore not be converted to numeric types). Now if an error does occur when converting the dfs to numeric types it won't be swallowed up. * Add documentation to to_numeric_ignore_columns --------- Co-authored-by: Cole Lyman * Run tests individually * Pin plotly version * Run all tests even if one fails * Test on another branch * Switch branch with token * Update integration_tests.yml * Introduce pandas sorting in CRISPRessoCompare (#47) * New makefile commands * Fix interleaved fastq input in CRISPRessoPooled and suppress CRISPRessoWGS params (#42) * Extract out split_interleaved_fastq function to CRISPRessoShared * Implement splitting interleaved fastq files in CRISPRessoPooled * Suppress split_interleaved_input from CRISPRessoWGS parameters * Suppress other parameters in CRISPRessoWGS * Move where interleaved fastq files are split to be trimmed properly * Bug Fix - 367 (#35) * - Fixed references to ref_names_for_pe * removed extra tabs * trying to match empty line, no tabs * - changed references to ref_names[0] * Mckay/pd warnings (#45) * refactor errors='ignore' to try except * refactored integer slice to iloc[] * moved to_numeric try except to function * Refactor to_numeric_ignore_errors to to_numeric_ignore_columns This change is slightly cleaner because it addresses the root issue that some columns are strings (and can therefore not be converted to numeric types). Now if an error does occur when converting the dfs to numeric types it won't be swallowed up. * Add documentation to to_numeric_ignore_columns --------- Co-authored-by: Cole Lyman --------- Co-authored-by: Cole Lyman * On push no branches * On push no branches * All in one file * Fix yml errors * Rename jobs * Remove old workflow files * Remove paths * Run jobs in parallel --------- Co-authored-by: mbowcut2 <55161542+mbowcut2@users.noreply.github.com> Co-authored-by: Cole Lyman * Move read filtering to after merging in CRISPResso (#39) * Move read filtering to after merging This is in an effort to be consistent with the behavior and results of CRISPRessoPooled. * Properly assign the correct file names for read filtering * Add space around operators * GitHub actions on pr (#51) * Run integration tests on pull_request * Run pytest on pull_request * Run pylint on pull_request * Run tests on PR only when opening PR (#53) * Update reports (#52) * Update report changes * Switch branch of integration test repo * Remove extraneous `crispresso_data_path` * Point integration tests back to master * point to test branch * pointed CI config to testing branch * Update integration_tests.yml point to master --------- Co-authored-by: Cole Lyman Co-authored-by: Samuel Nichols * Trevor/fastp integration (#50) * Update check_program to check versions and create check_fastq function * Update fastq arg, implement fastp in get_most_frequent_reads * Bump version to 2.3.0 * Deprecate Flash and Trimmomatic parameters, and update fastp params * Update guess_amplicons and guess_guides to remove max_paired_end_reads_overlap * Implement trimming of single end reads * Merge (and trim) reads in CRISPRessoCORE with fastp * Modify error handling to account for fastp errors * Replace flash and trimmomatic with fastp in Docker dependencies * Update LICENSE.txt with fastp info * Remove min and max amplicon length (no longer needed) * Mckay/pd warnings (#45) * refactor errors='ignore' to try except * refactored integer slice to iloc[] * moved to_numeric try except to function * Refactor to_numeric_ignore_errors to to_numeric_ignore_columns This change is slightly cleaner because it addresses the root issue that some columns are strings (and can therefore not be converted to numeric types). Now if an error does occur when converting the dfs to numeric types it won't be swallowed up. * Add documentation to to_numeric_ignore_columns --------- Co-authored-by: Cole Lyman * Implement trimming with fastp in CRISPRessoPooled * Implemend merging (and trimming) with fastp in CRISPRessoPooled * Fixed minor fastp errors * Move read filtering to after merging in CRISPResso (#39) * Move read filtering to after merging This is in an effort to be consistent with the behavior and results of CRISPRessoPooled. * Properly assign the correct file names for read filtering * Add space around operators * GitHub actions on pr (#51) * Run integration tests on pull_request * Run pytest on pull_request * Run pylint on pull_request * Run tests on PR only when opening PR (#53) * Update reports (#52) * Update report changes * Switch branch of integration test repo * Remove extraneous `crispresso_data_path` * Point integration tests back to master * Update where the test point to * Fix 'Prime-edited' key not found (#32) * Move 'Prime-edited' amplicon name check By moving this, it will check if there is an amplicon named 'Prime-edited' (which is a reserved name) even if the `prime_editing_pegRNA_extension_seq` parameter is empty. * Only search for scaffold integration when pegRNA extension seq is provided * Remove spaces at the end of lines * Docker size (#49) * Bug Fix - 367 (#35) * - Fixed references to ref_names_for_pe * removed extra tabs * trying to match empty line, no tabs * - changed references to ref_names[0] * Mckay/pd warnings (#45) * refactor errors='ignore' to try except * refactored integer slice to iloc[] * moved to_numeric try except to function * Refactor to_numeric_ignore_errors to to_numeric_ignore_columns This change is slightly cleaner because it addresses the root issue that some columns are strings (and can therefore not be converted to numeric types). Now if an error does occur when converting the dfs to numeric types it won't be swallowed up. * Add documentation to to_numeric_ignore_columns --------- Co-authored-by: Cole Lyman --------- Co-authored-by: Cole Lyman * GitHub actions integration tests (#48) * GitHub actions clean (#40) * Create pytest.yml * Create pylint.yml * Create .pylintrc * Create test_env.yml * Full path * Remove conda install * Replace path * Pytest tests * pip -e * Create integration_tests.yml * Simplify name * CRISPRESSO2_DIR environment variable * Up one dir * ls workspace * Install CRISPResso and ydiff * Clone repo instead of checkout * submodule * ls * CRISPResso2_copy * ls * Update env * Simplify * Pull from githubactions branch * Pull githubactions repo * Checkout githubactions * Mckay/pd warnings (#45) * refactor errors='ignore' to try except * refactored integer slice to iloc[] * moved to_numeric try except to function * Refactor to_numeric_ignore_errors to to_numeric_ignore_columns This change is slightly cleaner because it addresses the root issue that some columns are strings (and can therefore not be converted to numeric types). Now if an error does occur when converting the dfs to numeric types it won't be swallowed up. * Add documentation to to_numeric_ignore_columns --------- Co-authored-by: Cole Lyman * Run tests individually * Pin plotly version * Run all tests even if one fails * Test on another branch * Switch branch with token * Update integration_tests.yml * Introduce pandas sorting in CRISPRessoCompare (#47) * New makefile commands * Fix interleaved fastq input in CRISPRessoPooled and suppress CRISPRessoWGS params (#42) * Extract out split_interleaved_fastq function to CRISPRessoShared * Implement splitting interleaved fastq files in CRISPRessoPooled * Suppress split_interleaved_input from CRISPRessoWGS parameters * Suppress other parameters in CRISPRessoWGS * Move where interleaved fastq files are split to be trimmed properly * Bug Fix - 367 (#35) * - Fixed references to ref_names_for_pe * removed extra tabs * trying to match empty line, no tabs * - changed references to ref_names[0] * Mckay/pd warnings (#45) * refactor errors='ignore' to try except * refactored integer slice to iloc[] * moved to_numeric try except to function * Refactor to_numeric_ignore_errors to to_numeric_ignore_columns This change is slightly cleaner because it addresses the root issue that some columns are strings (and can therefore not be converted to numeric types). Now if an error does occur when converting the dfs to numeric types it won't be swallowed up. * Add documentation to to_numeric_ignore_columns --------- Co-authored-by: Cole Lyman --------- Co-authored-by: Cole Lyman * On push no branches * On push no branches * All in one file * Fix yml errors * Rename jobs * Remove old workflow files * Remove paths * Run jobs in parallel --------- Co-authored-by: mbowcut2 <55161542+mbowcut2@users.noreply.github.com> Co-authored-by: Cole Lyman * 3.4->2.08 * Put ttf-mscorefonts-installer back above apt-get clean * restore slash, replace fastp with trimmomatic and flash, add autoremove step --------- Co-authored-by: mbowcut2 <55161542+mbowcut2@users.noreply.github.com> Co-authored-by: Cole Lyman * initial readme modifications * Updated readme to remove deprecated commands, updated help text to reflect new version and fastp * Pointing test branch back at master --------- Co-authored-by: Cole Lyman Co-authored-by: mbowcut2 <55161542+mbowcut2@users.noreply.github.com> Co-authored-by: Samuel Nichols * Guardrails clean history (#34) * Include guardrail functions * Add CRISPRessoReports subtree * Refactor to use CRISPRessoReports module * Include guardrail functions * Functional guardrails, needs reports update * Add guardrail partial * fix guardrials partial * Bug Fix - 367 (#35) * - Fixed references to ref_names_for_pe * removed extra tabs * trying to match empty line, no tabs * - changed references to ref_names[0] * Mckay/pd warnings (#45) * refactor errors='ignore' to try except * refactored integer slice to iloc[] * moved to_numeric try except to function * Refactor to_numeric_ignore_errors to to_numeric_ignore_columns This change is slightly cleaner because it addresses the root issue that some columns are strings (and can therefore not be converted to numeric types). Now if an error does occur when converting the dfs to numeric types it won't be swallowed up. * Add documentation to to_numeric_ignore_columns --------- Co-authored-by: Cole Lyman --------- Co-authored-by: Cole Lyman * GitHub actions integration tests (#48) * GitHub actions clean (#40) * Create pytest.yml * Create pylint.yml * Create .pylintrc * Create test_env.yml * Full path * Remove conda install * Replace path * Pytest tests * pip -e * Create integration_tests.yml * Simplify name * CRISPRESSO2_DIR environment variable * Up one dir * ls workspace * Install CRISPResso and ydiff * Clone repo instead of checkout * submodule * ls * CRISPResso2_copy * ls * Update env * Simplify * Pull from githubactions branch * Pull githubactions repo * Checkout githubactions * Mckay/pd warnings (#45) * refactor errors='ignore' to try except * refactored integer slice to iloc[] * moved to_numeric try except to function * Refactor to_numeric_ignore_errors to to_numeric_ignore_columns This change is slightly cleaner because it addresses the root issue that some columns are strings (and can therefore not be converted to numeric types). Now if an error does occur when converting the dfs to numeric types it won't be swallowed up. * Add documentation to to_numeric_ignore_columns --------- Co-authored-by: Cole Lyman * Run tests individually * Pin plotly version * Run all tests even if one fails * Test on another branch * Switch branch with token * Update integration_tests.yml * Introduce pandas sorting in CRISPRessoCompare (#47) * New makefile commands * Fix interleaved fastq input in CRISPRessoPooled and suppress CRISPRessoWGS params (#42) * Extract out split_interleaved_fastq function to CRISPRessoShared * Implement splitting interleaved fastq files in CRISPRessoPooled * Suppress split_interleaved_input from CRISPRessoWGS parameters * Suppress other parameters in CRISPRessoWGS * Move where interleaved fastq files are split to be trimmed properly * Bug Fix - 367 (#35) * - Fixed references to ref_names_for_pe * removed extra tabs * trying to match empty line, no tabs * - changed references to ref_names[0] * Mckay/pd warnings (#45) * refactor errors='ignore' to try except * refactored integer slice to iloc[] * moved to_numeric try except to function * Refactor to_numeric_ignore_errors to to_numeric_ignore_columns This change is slightly cleaner because it addresses the root issue that some columns are strings (and can therefore not be converted to numeric types). Now if an error does occur when converting the dfs to numeric types it won't be swallowed up. * Add documentation to to_numeric_ignore_columns --------- Co-authored-by: Cole Lyman --------- Co-authored-by: Cole Lyman * On push no branches * On push no branches * All in one file * Fix yml errors * Rename jobs * Remove old workflow files * Remove paths * Run jobs in parallel --------- Co-authored-by: mbowcut2 <55161542+mbowcut2@users.noreply.github.com> Co-authored-by: Cole Lyman * Update C cythonized files * Add exact numbers to guardrails printouts * Remove extraneous whitespace from CRISPRessoCOREResources.pyx * Fix calculation of `total_mods` from being negative The issue was that `all_deletion_coordinates` just tells you how many deletions were present, but not how long the deletion is. * Changes to message * Remove old tag * Point tests at guardrails * Restore C2 pro check * Save message with guardrail name * Point tests repo at master --------- Co-authored-by: Cole Lyman Co-authored-by: mbowcut2 <55161542+mbowcut2@users.noreply.github.com> * Fix case sensitivity in Prime Editing mode (#54) * Move read filtering to after merging in CRISPResso (#39) * Move read filtering to after merging This is in an effort to be consistent with the behavior and results of CRISPRessoPooled. * Properly assign the correct file names for read filtering * Add space around operators * GitHub actions on pr (#51) * Run integration tests on pull_request * Run pytest on pull_request * Run pylint on pull_request * Run tests on PR only when opening PR (#53) * Update reports (#52) * Update report changes * Switch branch of integration test repo * Remove extraneous `crispresso_data_path` * Point integration tests back to master * Make all amplicons in amplicon_seq_arr uppercase This fixes https://github.com/pinellolab/CRISPResso2/issues/396 * Allow RNA values to be provided for prime_editing_pegRNA_scaffold_seq * Fix 'Prime-edited' key not found (#32) * Move 'Prime-edited' amplicon name check By moving this, it will check if there is an amplicon named 'Prime-edited' (which is a reserved name) even if the `prime_editing_pegRNA_extension_seq` parameter is empty. * Only search for scaffold integration when pegRNA extension seq is provided * Remove spaces at the end of lines * Docker size (#49) * Bug Fix - 367 (#35) * - Fixed references to ref_names_for_pe * removed extra tabs * trying to match empty line, no tabs * - changed references to ref_names[0] * Mckay/pd warnings (#45) * refactor errors='ignore' to try except * refactored integer slice to iloc[] * moved to_numeric try except to function * Refactor to_numeric_ignore_errors to to_numeric_ignore_columns This change is slightly cleaner because it addresses the root issue that some columns are strings (and can therefore not be converted to numeric types). Now if an error does occur when converting the dfs to numeric types it won't be swallowed up. * Add documentation to to_numeric_ignore_columns --------- Co-authored-by: Cole Lyman --------- Co-authored-by: Cole Lyman * GitHub actions integration tests (#48) * GitHub actions clean (#40) * Create pytest.yml * Create pylint.yml * Create .pylintrc * Create test_env.yml * Full path * Remove conda install * Replace path * Pytest tests * pip -e * Create integration_tests.yml * Simplify name * CRISPRESSO2_DIR environment variable * Up one dir * ls workspace * Install CRISPResso and ydiff * Clone repo instead of checkout * submodule * ls * CRISPResso2_copy * ls * Update env * Simplify * Pull from githubactions branch * Pull githubactions repo * Checkout githubactions * Mckay/pd warnings (#45) * refactor errors='ignore' to try except * refactored integer slice to iloc[] * moved to_numeric try except to function * Refactor to_numeric_ignore_errors to to_numeric_ignore_columns This change is slightly cleaner because it addresses the root issue that some columns are strings (and can therefore not be converted to numeric types). Now if an error does occur when converting the dfs to numeric types it won't be swallowed up. * Add documentation to to_numeric_ignore_columns --------- Co-authored-by: Cole Lyman * Run tests individually * Pin plotly version * Run all tests even if one fails * Test on another branch * Switch branch with token * Update integration_tests.yml * Introduce pandas sorting in CRISPRessoCompare (#47) * New makefile commands * Fix interleaved fastq input in CRISPRessoPooled and suppress CRISPRessoWGS params (#42) * Extract out split_interleaved_fastq function to CRISPRessoShared * Implement splitting interleaved fastq files in CRISPRessoPooled * Suppress split_interleaved_input from CRISPRessoWGS parameters * Suppress other parameters in CRISPRessoWGS * Move where interleaved fastq files are split to be trimmed properly * Bug Fix - 367 (#35) * - Fixed references to ref_names_for_pe * removed extra tabs * trying to match empty line, no tabs * - changed references to ref_names[0] * Mckay/pd warnings (#45) * refactor errors='ignore' to try except * refactored integer slice to iloc[] * moved to_numeric try except to function * Refactor to_numeric_ignore_errors to to_numeric_ignore_columns This change is slightly cleaner because it addresses the root issue that some columns are strings (and can therefore not be converted to numeric types). Now if an error does occur when converting the dfs to numeric types it won't be swallowed up. * Add documentation to to_numeric_ignore_columns --------- Co-authored-by: Cole Lyman --------- Co-authored-by: Cole Lyman * On push no branches * On push no branches * All in one file * Fix yml errors * Rename jobs * Remove old workflow files * Remove paths * Run jobs in parallel --------- Co-authored-by: mbowcut2 <55161542+mbowcut2@users.noreply.github.com> Co-authored-by: Cole Lyman * 3.4->2.08 * Put ttf-mscorefonts-installer back above apt-get clean * restore slash, replace fastp with trimmomatic and flash, add autoremove step --------- Co-authored-by: mbowcut2 <55161542+mbowcut2@users.noreply.github.com> Co-authored-by: Cole Lyman * Guardrails clean history (#34) * Include guardrail functions * Add CRISPRessoReports subtree * Refactor to use CRISPRessoReports module * Include guardrail functions * Functional guardrails, needs reports update * Add guardrail partial * fix guardrials partial * Bug Fix - 367 (#35) * - Fixed references to ref_names_for_pe * removed extra tabs * trying to match empty line, no tabs * - changed references to ref_names[0] * Mckay/pd warnings (#45) * refactor errors='ignore' to try except * refactored integer slice to iloc[] * moved to_numeric try except to function * Refactor to_numeric_ignore_errors to to_numeric_ignore_columns This change is slightly cleaner because it addresses the root issue that some columns are strings (and can therefore not be converted to numeric types). Now if an error does occur when converting the dfs to numeric types it won't be swallowed up. * Add documentation to to_numeric_ignore_columns --------- Co-authored-by: Cole Lyman --------- Co-authored-by: Cole Lyman * GitHub actions integration tests (#48) * GitHub actions clean (#40) * Create pytest.yml * Create pylint.yml * Create .pylintrc * Create test_env.yml * Full path * Remove conda install * Replace path * Pytest tests * pip -e * Create integration_tests.yml * Simplify name * CRISPRESSO2_DIR environment variable * Up one dir * ls workspace * Install CRISPResso and ydiff * Clone repo instead of checkout * submodule * ls * CRISPResso2_copy * ls * Update env * Simplify * Pull from githubactions branch * Pull githubactions repo * Checkout githubactions * Mckay/pd warnings (#45) * refactor errors='ignore' to try except * refactored integer slice to iloc[] * moved to_numeric try except to function * Refactor to_numeric_ignore_errors to to_numeric_ignore_columns This change is slightly cleaner because it addresses the root issue that some columns are strings (and can therefore not be converted to numeric types). Now if an error does occur when converting the dfs to numeric types it won't be swallowed up. * Add documentation to to_numeric_ignore_columns --------- Co-authored-by: Cole Lyman * Run tests individually * Pin plotly version * Run all tests even if one fails * Test on another branch * Switch branch with token * Update integration_tests.yml * Introduce pandas sorting in CRISPRessoCompare (#47) * New makefile commands * Fix interleaved fastq input in CRISPRessoPooled and suppress CRISPRessoWGS params (#42) * Extract out split_interleaved_fastq function to CRISPRessoShared * Implement splitting interleaved fastq files in CRISPRessoPooled * Suppress split_interleaved_input from CRISPRessoWGS parameters * Suppress other parameters in CRISPRessoWGS * Move where interleaved fastq files are split to be trimmed properly * Bug Fix - 367 (#35) * - Fixed references to ref_names_for_pe * removed extra tabs * trying to match empty line, no tabs * - changed references to ref_names[0] * Mckay/pd warnings (#45) * refactor errors='ignore' to try except * refactored integer slice to iloc[] * moved to_numeric try except to function * Refactor to_numeric_ignore_errors to to_numeric_ignore_columns This change is slightly cleaner because it addresses the root issue that some columns are strings (and can therefore not be converted to numeric types). Now if an error does occur when converting the dfs to numeric types it won't be swallowed up. * Add documentation to to_numeric_ignore_columns --------- Co-authored-by: Cole Lyman --------- Co-authored-by: Cole Lyman * On push no branches * On push no branches * All in one file * Fix yml errors * Rename jobs * Remove old workflow files * Remove paths * Run jobs in parallel --------- Co-authored-by: mbowcut2 <55161542+mbowcut2@users.noreply.github.com> Co-authored-by: Cole Lyman * Update C cythonized files * Add exact numbers to guardrails printouts * Remove extraneous whitespace from CRISPRessoCOREResources.pyx * Fix calculation of `total_mods` from being negative The issue was that `all_deletion_coordinates` just tells you how many deletions were present, but not how long the deletion is. * Changes to message * Remove old tag * Point tests at guardrails * Restore C2 pro check * Save message with guardrail name * Point tests repo at master --------- Co-authored-by: Cole Lyman Co-authored-by: mbowcut2 <55161542+mbowcut2@users.noreply.github.com> --------- Co-authored-by: Samuel Nichols Co-authored-by: mbowcut2 <55161542+mbowcut2@users.noreply.github.com> Co-authored-by: trevormartinj7 * Batch d3 clean (#55) * imports C2Pro plots if available * added --use_matplotlib flag * added C2Pro matched api funciton signatures * added api args for plotly * added **kwargs * renamed config to custom_config, more specificity * added backend flag for plotly kaleido * added pro_installed boolean for templates, added plotly dependency to report templates * Squashed commit of the following: commit c909ea3b34e87ce637e00dac075d2bb2f8bfb954 Author: McKay Date: Thu Feb 15 15:55:23 2024 -0700 added plotly dependency for pro commit 76b3601f6a0144f100266153f1c999e0c5de65de Author: Samuel Nichols Date: Fri Jan 12 09:56:19 2024 -0700 Squashed commit of the following: commit 603f2eff9d1aa21ae95f3e134da303b8018d3a33 Author: Samuel Nichols Date: Fri Jan 12 09:48:20 2024 -0700 fix guardrials partial commit 22fc03183a8070c30dfb74d5c23575ac19019855 Author: Samuel Nichols Date: Fri Jan 12 08:54:01 2024 -0700 Add guardrail partial commit e55f6b21972b578261bc5a864ce1d653d98f9e34 Author: Samuel Nichols Date: Mon Jan 8 07:50:59 2024 -0700 Functional guardrails, needs reports update commit 6e968e9699ed59a47d88191d03768e042d8b60a4 Merge: 32b49685 e948ce10 Author: Samuel Nichols Date: Mon Dec 18 13:34:36 2023 -0700 Merge branch 'guardrails-clean-history' of https://github.com/edilytics/CRISPResso2 into guardrails-clean-history commit 32b49685da320501dad2b0ebbb57887b66220ba8 Author: Samuel Nichols Date: Fri Dec 15 15:27:04 2023 -0700 Include guardrail functions commit 4e309cf6f732565d635de3d4c5d074ada3027e2d Author: Cole Lyman Date: Mon Dec 18 10:51:55 2023 -0700 Refactor to use CRISPRessoReports module commit e648dc087c0055bc5d2fca13c64071a371dea941 Author: Cole Lyman Date: Mon Dec 18 10:51:11 2023 -0700 Add CRISPRessoReports subtree commit e948ce107ebb0d1d99010ed12e937f34b5e607d4 Author: Samuel Nichols Date: Fri Dec 15 15:27:04 2023 -0700 Include guardrail functions commit d33c748871a625facfe8d792e29c77ab9779138f Author: Kendell Clement Date: Tue Nov 7 16:31:06 2023 -0700 Include parameter --assign_ambiguous_alignments_to_first_reference in readme commit a1435f7f491a6a61434f3051e39f39a4c9bf1edc Author: Kendell Clement Date: Wed Oct 11 17:17:30 2023 -0600 Enable quantification by sgRNA (#348) This PR includes: - storing the sgRNA-specific editing locations in the crispresso2_info object. Previously, each amplicon would record the indices of quantification windows across the guide, but not for individual guides. This stores the information for each guide in crispresso2_info['results']['refs'][reference_name]['sgRNA_include_idxs'] - a script (count_sgRNA_specific_edits.py) to parse through an allele table output from a completed CRISPResso run (`--write_detailed_allele_table` flag required) to count edits in each sgRNA separately. I don't have a good double-edited sample handy, but it can be run on the demo HDR data [hdr.fastq.gz](http://crispresso.pinellolab.org/static/demo/hdr.fastq.gz) using the command: ``` CRISPResso -r1 hdr.fastq.gz -a acatttgcttctgacacaactgtgttcactagcaacctcaaacagacaccatggtgcatctgactcctgTggagaagtctgccgttactgccctgtggggcaaggtgaacgtggatgaagttggtggtgaggccctgggcaggttggtatcaaggtta -e acatttgcttctgacacaactgtgttcactagcaacctcaaacagacaccatggtgcaCctgactccGgaggagaagtctgccgttactgcGctgtggggcaaggtgaacgtggatgaagttggtggtgaggccctgggcaggttggtatcaaggtta -c atggtgcatctgactcctgTggagaagtctgccgttactgccctgtggggcaaggtgaacgtggatgaagttggtggtgaggccctgggcag -g TGCACCATGGTGTCTGTTTG,GATGAAGTTGGTGGTGAGGCCC --write_detailed_allele_table -n hdr3 -p max -gn guide1,guide2 ``` ``` python CRISPResso2/scripts/count_sgRNA_specific_edits.py -f CRISPResso_on_hdr3 ``` This produces: ``` Processed 25000 alleles Reference: Reference (2391/23415 modified reads) UNMODIFIED: 21024 MODIFIED guide1: 2359 MODIFIED guide2: 32 Reference: HDR (856/1577 modified reads) UNMODIFIED: 721 MODIFIED guide1: 854 MODIFIED guide1 + guide2: 1 MODIFIED guide2: 1 ``` commit 2e3da02fdbed2fa8ae02a277763d65a502459827 Author: Cole Lyman Date: Tue Oct 10 15:29:08 2023 -0600 changed tuple to list for matplotlib change (#31) (#346) Co-authored-by: mbowcut2 <55161542+mbowcut2@users.noreply.github.com> commit cd3c332135fe4db0f9218e3d87263d5c65838ed9 Author: Kendell Clement Date: Sun Oct 1 01:54:46 2023 -0600 rename script to camel case commit 7c719d65fb36ac7654db9040f226564ea28fcab9 Author: Kendell Clement Date: Sun Oct 1 01:53:44 2023 -0600 Add new script for counting high quality bases commit f97cd2795e89464bcc9321ccfdbca3e6af2bcb4f Author: Kendell Clement Date: Thu Sep 14 15:15:30 2023 -0600 Prime editing alignment params (#336) Adds two parameters to control alignment of pegRNA components: --prime_editing_gap_open_penalty and --prime_editing_gap_extend_penalty. CRISPResso checks to see whether the pegRNA spacer and extension sequence are in the correct orientation, but sometimes they could align in the incorrect orientation with a higher score (e.g. via insertion of multiple gaps, whereas a single long gap would be preferred). Introducing these two parameters allows users to adjust the alignment parameters specifically for these prime-editing checks without adjusting the global alignment parameters which will be applied to reads that are aligned to the WT reference/prime-editing reference sequences. The new prime_editing_gap_open_penalty is set to -50, a higher gap open penalty than the default needleman_wunsch_gap_open penalty (-20). This commit breaks backward-reproducibility, but mostly in the checking of pegRNA component orientation - so previously some CRISPResso runs would have failed and produced an error, but now they will (hopefully) succeed. To achieve complete backward reproducibility, add the flag --prime_editing_gap_open_penalty -20 to runs. commit 64cbf36dae85cffa2c15e73f2a7ee8aa1077d917 Author: Cole Lyman Date: Thu Sep 7 16:43:30 2023 -0600 Fix samtools piping (#325) * Remove samtools pipe stderr to stdout Sometimes some of the libraries that samtools depends on don't have the correct version information, and as such samtools will report this to stderr when run. Because we pipe the output of samtools, we expect it to be valid SAM format, but when these library version messages are reported, it breaks CRISPRessoWGS. * Remove extra spacing at end of lines and add missing comma in WGS * Log stderr from samtools in CRISPRessoWGS commit 8feff4101f27406d9d88ace97d31a518276bff3f Author: Cole Lyman Date: Fri Sep 1 09:43:56 2023 -0600 Replace link to CRISPResso schematic with raw URL in README (#329) * Replace link to CRISPResso schematic with raw URL * Add new lines to the beginning of unordered lists commit 2e9e6bff5bcc536d5e2ba1440d1ab96d9d47efd6 Author: Kendell Clement Date: Thu Aug 10 00:52:12 2023 -0600 Try to unbreak CircleCI commit ae5b95246cb0f6d66c4cbfb50cf8f5a9626b0827 Author: Kendell Clement Date: Thu Aug 10 00:17:27 2023 -0600 Center command line text messages commit 4d9c71ecf2248c9bb1e10430178dc318b6621c8b Author: Kendell Clement Date: Thu Aug 10 00:17:07 2023 -0600 Fix bug in prime-editing scaffold-incorporation plotting If read is too short, scaffold incorporation detection will fail because it will check beyond the length of the read. commit 2b36a1a5c35e8a93516ce8baf464595615e0f402 Author: Kendell Clement Date: Wed Aug 9 15:29:48 2023 -0600 CRISPRessoPooled --compile_postrun_references bug fixes commit 3e04d1d402bcf95edd39fc7c8c9af61bb380f9db Author: Kendell Clement Date: Tue Aug 8 23:30:15 2023 -0600 Fix missing ' in Pooled --demultiplex_only_at_amplicons commit 06af527f9e2020c5cf251e7f1cec0b1eca1c1664 Author: Cole Lyman Date: Mon Jul 24 10:47:46 2023 -0600 Sort pandas dataframes by # of reads and sequences so that the order is consistent (#316) * Make sorting stable * Including c files * Sort by #Reads instead of %Reads to avoid floating point errors --------- Co-authored-by: Samuel Nichols commit de05533b3511a84f3b6b14fc2ef64db041613261 Author: Cole Lyman Date: Thu Jul 6 13:54:45 2023 -0600 Fix multiprocessing lambda pickling (#311) * Fix running plots in parallel The reason the plots were running slower before this change is because I was calling the plot function, not passing it to `submit`. So it was essentially running in serial, but worse because it was still spinning up/down the processes. * Fix multiprocessing lambda pickling (#20) * Refactor process_futures to be a dict This makes debugging much easier because you can associate the arguments to the future with the results. * Fix the pickling error when running in multiprocessing Only top-level functions (not lambdas) can be pickled to use in multiprocessing pools, thus the lambdas are converted to a regular function. * Further fixes to pickling multiprocessing error (#21) * Refactor process_futures to be a dict This makes debugging much easier because you can associate the arguments to the future with the results. * Fix the pickling error when running in multiprocessing Only top-level functions (not lambdas) can be pickled to use in multiprocessing pools, thus the lambdas are converted to a regular function. * Use Counter instead of defaultdict in CRISPRessoCORE * Update process_futures to dict in Batch and Aggregate commit ebb016dff46c280dce8c3c09e8ac0e0cc25d4d74 Author: Kendell Clement Date: Mon Jul 3 17:12:09 2023 -0600 Enable CRISPRessoPooled multiprocessing when os allows multi-thread file append commit 7285da0e987b77b72c8885bb35940e0f50c146bd Author: Kendell Clement Date: Fri Jun 23 16:50:33 2023 -0600 Fix print bug for invalid fastq commit 9acdeac67441f9a1d55ac94b153bcb68fb89b92c Author: kclem Date: Wed Jun 21 16:03:48 2023 -0600 Slugify before creating filename - replaces invalid characters in batch names with _ commit f97e29c67de4c80b8d6b9cf334f363be4b514ade Author: Cole Lyman Date: Wed Jun 21 14:43:43 2023 -0600 Add verbosity argument to CRISPRessoAggregate (#18) fixes #306 (#307) * Add verbosity argument to CRISPRessoAggregate (#18) * Allow for amplicon and guide seqs to be some variant of NA in batch (#19) This was discovered when attempting to infer amplicon sequences in batch mode on the web interface, NAs were supplied for the amplicon sequences to the sub CRISPResso commands. commit 32e1e9797da5c3033cdc588e92f06b8813961953 Author: Mark Clement Date: Wed Jun 21 14:01:00 2023 -0600 Allow for interrogation of overlapping sgRNA sites commit 7248ba8c4deee125ad1ec12fdf1294a84d5f6f93 Author: Kendell Clement Date: Mon Jun 12 12:16:47 2023 -0600 Check input fastq file format Asserts input format of fastq files - including if gzipped files are missing the gz suffix. commit 83c8ab8f462e7d8c1d04c08c1a398b874f517251 Author: Kendell Clement Date: Mon Jun 5 13:41:55 2023 -0600 Fix CRISPRessoArgParser commit 14a2c8577f566e1b72d5f4e72cd6cd22079610be Author: Kendell Clement Date: Mon Jun 5 13:29:31 2023 -0600 Cosmetic updates for command-line use - version bump to 2.2.13 - If no args are provided, the command line version will print out an abbreviated help message - parameters can be excluded from CRISPRessoArgParser commit 1cd54bc1d03360c3d8121ba9e66b3589fe1cf252 Author: Cole Lyman Date: Thu May 11 14:31:47 2023 -0600 Fix multiprocessing error, don't start pool when only using single thread (#302) * Update README to have consistent use of `--base_editor_output` (#16) * Add files via upload * Only start process pools when using multiple processes This is mainly to solve the issue when running on AWS Lambda, but this should improve single core performance overall. --------- Co-authored-by: Kendell Clement commit 92a705c939b370373a70cf6ae9f1616de33288b9 Author: Cole Lyman Date: Thu May 11 14:31:06 2023 -0600 Update `base_editor` parameters in README and add Plot Harness (#301) * Update README to have consistent use of `--base_editor_output` (#16) * Add files via upload --------- Co-authored-by: Kendell Clement commit 7d46c4490235df45c5546b1b470e4e6a99727031 Author: Cole Lyman Date: Wed May 10 15:41:33 2023 -0600 Clarify CRISPRessoWGS intended use (#303) * Update README to have consistent use of `--base_editor_output` (#16) * Add sample plotting jupyter notebook * Add clarifying info to CRISPRessoWGS description Clarify WGS usage commit 833a701787bb47674b3e921c38cac6189c775cf7 Author: Kendell Clement Date: Thu May 4 17:02:46 2023 -0400 Remove debug print statements commit 712eb2a11825e8d36f2870deb12b35486bd633fb Author: Kendell Clement Date: Thu May 4 16:40:07 2023 -0400 Allow dashes in filenames resolve #73 commit a439f094745b2b5e7f032f0777d4c67e6d6f93c5 Author: Kendell Clement Date: Sat Apr 22 23:41:58 2023 -0400 Raise exceptions from within futures in plot_pool commit 7e807a60de2a9d18bccd034b87106ceaf7153338 Author: Kendell Clement Date: Sat Apr 22 23:38:56 2023 -0400 Fix future pandas indexing warning Pandas error was "FutureWarning: Calling float on a single element Series is deprecated and will raise a TypeError in the future. Use float(ser.iloc[0]) instead" commit 304a92aa7a7ef8c705cb070dce25d9a2e5745ba9 Author: Cole Lyman Date: Thu Apr 20 13:59:27 2023 -0600 Remove debug print statements fixes #295 (#297) The format string option used here is only available in Python version >=3.8. commit 478c06f784603e96d20f96e91993fdcc4ac35c8a Author: Kendell Clement Date: Thu Apr 13 12:09:26 2023 -0400 Update plotCustomAllelePlot.py script for #292 (#293) Update type of 'max_rows' param to int Fix location of 'args' in crispresso2_info object commit bcdae39e05d530f4a4e78738c3b30f7664981919 Author: Kendell Clement Date: Mon Mar 27 13:18:34 2023 -0400 Update pooled parameter format commit 546446e36e7e68b527767d6c31ec341a49df2059 Author: Kendell Clement Date: Tue Feb 14 16:26:23 2023 -0500 Fix running plots in parallel (#286) The reason the plots were running slower before this change is because I was calling the plot function, not passing it to `submit`. So it was essentially running in serial, but worse because it was still spinning up/down the processes. Co-authored-by: Cole Lyman commit d75f32a2eb5aeaaee866c09e5655a3e27af8b1a1 Author: kclem Date: Fri Feb 10 15:45:15 2023 -0500 Fix #283 to avoid filename collisions Previously, amplicon names longer than 21bp were truncated, but the check for uniqueness wasn't working, so it would overwrite some plot files. This fixes the filename collision and enforces uniqueness in reference filename prefixes. Thanks @mbiokyle29 commit e577318006cd17b2725bd028e5e56634c6eb829a Author: kclem Date: Mon Feb 6 16:37:25 2023 -0500 Case-insensitive headers accepted in CRISPRessoPooled commit d34927620a4a6126a9988b3041e76f60728abbfe Author: Kendell Clement Date: Tue Jan 31 13:48:33 2023 -0500 Fix print statement in CORE commit ee88b7ed89c395f68225a50dea44a2ad69d5e9a5 Author: Kendell Clement Date: Tue Jan 31 13:22:51 2023 -0500 Version bump to 2.2.12 commit 1d4679c72d0c8b4154317c9aff5179217198e2d7 Author: Kendell Clement Date: Tue Jan 31 13:01:31 2023 -0500 Status Updates + Pooled Mixed Mode Update (#279) * Implement logging handler to overwrite the latest log status to file * Add StatusHandler to CRISPRessoCORE log This will take the latest log output and write it to a file (`status.txt`), the catch being that with each log the file is overwritten so that one can easily tell where CRISPResso currently is and what the error is (if any). These changes include some slight refactoring in order to accomodate any potential parameter exceptions. * Add StatusHandler to CRISPRessoBatch and refactor `logger.warn` to `warn` * Add StatusHandler to CRISPRessoPooled and a little refactoring * Implement `percent_complete` to the status log * Add StatusHandler to CRISPRessoAggregate log * Add StatusHandler to CRISPRessoCompare log * Add StatusHandler to CRISPRessoPooledWGSCompare log * Add StatusHandler to CRISPRessoWGS log * Rename `status.txt` to `CRISPResso_status.txt` * Modify status log names to match the tool they are generated from * Add percent_complete stages to CRISPRessoCORE These also include log statements of each plot that is being generated as well as fixing some variable name collisions with `ind`. * Format the percentage in the log to be 2 decimal places * Change all plotting logs from `info` to `debug` and simplify progress This refactors how the progress of the plots is calculated, making it much simplier. Before this change we would of had to keep track of the number of times `percent_complete` was output, but now it simply updates the percent complete after each amplicon is finished processing. Hopefully this will make things easier to mantain even though it will be a little less "accurate" (not sure how accurate the original implementation was...). * Implemented shared console log handler across all CRISPResso* calls This allows for easy changes to logging formatting, which was inspired by having to change the default logging level. The default logging level needs to be set at `logging.DEBUG` in order for the debug log statements to not be ignored for the running and status logs. * Add ability to set the verbosity level to each CRISPResso* tool This allows users to set a verbosity level between 1 and 4 using the `-v`/`--verbosity` CLI parameter. If the `--debug` flag is present, then the level will default to 4, being the most verbose. * Implement showing the last seen `percent_compelte` when none is provided * Keep track of and log when multiple parallel runs are completed These changes modify `CRISPRessoMultiProcessing.run_crispresso_cmds` such that we can now display when a run is completed. This potentially breaks how signals and interupts are handled with multiple runs happening, but this needs to be reviewed. * Add debug and percentage complete to CRISPRessoBatch * Add percent complete to CRISPRessoPooled * Add debug and percent_complete message to CRISPRessoAggregate * Add `percent_complete` to CRISPRessoCompare * Add `percent_complete` to CRISPRessoPooledWGSCompare * Add status and `percent_complete` to CRISPRessoMeta * Add `verbosity` arguments to CRISPRessoCompare and CRISPRessoPooledWGSCompare * Fixing documentation to match pooled headers * Header removal bug fix change documentation to guide_seq * Update documentation and help feature for CRISPRessoPooled * Remove extra newlines from CRISPRessoPooled -h * Make variable names as clear as my firstborn child's name * Update one more variable name * Fix bug to flow CRISPRessoPooled options to sub command * Make amplicon file args variable name clear * Update how parameters are set and retrieved from parameter object The refactor in the previous commit changed the type of the arguments to a dictionary which doesn't have the parameters as attributes, and this commit fixes that error. * Add note in output header for change in default CRISPRessoPooled In the next release (2.3.0) the `--demultiplex_only_at_amplicons` will be the default when running in mixed-mode. This is to allow for inexact alignments of the reads and the amplicons to the genome. For more context, see this issue https://github.com/pinellolab/CRISPResso2/issues/276 * Clarify the verbosity parameter help message * Separate out parameters to `normalize_name` in CRISPRessoCORE * Separate out parameters to `normalize_name` in CRISPRessoWGS * Separate out parameters to `normalize_name` in CRISPRessoPooled * Separate out parameters to `normalize_name` in CRISPRessoCompare * Fix bug in CRISPRessoPooled by replacing `database_id` with `normalize_name` * Refactor `run_crispresso_cmds` to not require a `logger` This commit implements the functionality to make the `logger` object optional by seeing which module called the `run_crispresso_cmds` function and obtaining the correct object from that module name. The function also immediately returns when no commands are passed to it. * Add amplicon name to plotting debug statements in CRISPRessoCORE --------- Co-authored-by: Cole Lyman Co-authored-by: Cole Lyman Co-authored-by: Cole Lyman Co-authored-by: Samuel Nichols commit ff7eca76e6a3a08af4ac18ac4e88d20f2a06b1f9 Author: Kendell Clement Date: Thu Jan 26 15:27:27 2023 -0500 CRISPRessoPooled custom header fix (#278) * Fixing documentation to match pooled headers * Header removal bug fix change documentation to guide_seq * Update documentation and help feature for CRISPRessoPooled * Remove extra newlines from CRISPRessoPooled -h * Make variable names as clear as my firstborn child's name * Update one more variable name Co-authored-by: Samuel Nichols commit 104866e1080c973bb025d1a5ba59b19dca1658af Author: Cole Lyman Date: Thu Jan 5 14:00:26 2023 -0700 Fix deprecated numpy type names (fixes #269) (#270) In the most recent version of numpy (1.24) some of the types have been deprecated. This commit fixes these errors. commit 58a8e42df88b66fad6b4f6ad04a5b9d9d43d01b4 Author: Cole Lyman Date: Thu Jan 5 06:49:35 2023 -0700 Add snippet about installing CRISPResso2 via bioconda on Apple silicon (#274) I have suffered enough trying to debug my installation, so hopefully this helps someone else. Co-authored-by: Cole Lyman commit b9851e98104602eb78c2b384105267624295e9d3 Author: Cole Lyman Date: Thu Dec 22 13:30:23 2022 -0700 Fix bug when pooled bam is input (#265) This change checks to see if a bam file was input, and if so it doesn't try to remove any intermediate files because there aren't any. Co-authored-by: Cole Lyman commit b822612642043e75a19042941f69b457ce51f517 Author: Kendell Clement Date: Mon Dec 19 15:26:45 2022 -0500 Delete vscode settings commit b99aa624dec68ef7d19264340ce0cafa829625f4 Author: Kendell Clement Date: Mon Dec 19 13:29:14 2022 -0500 Clarify input param help for pooled bam commit 3fae1e8b821ec6b1890bff6561fa8fa67dc49a04 Author: Kendell Clement Date: Mon Dec 19 13:28:54 2022 -0500 Fix #235 - Cigar string is * if read unaligned Previously, the bam would set the cigar string to 0 if the read was unaligned. This breaks the sam->bam conversion and causes the errors in #235. commit c65ba07dc5a983453cdf7bb1e27005230dac6f1b Author: Cole Lyman Date: Thu Dec 8 13:48:17 2022 -0700 Add deprecation notice (#260) * Add FLASh and Trimmomatic deprecation notice to CLI output * Add Edilytics email address to CLI output commit 2a30e5a45f5350ee7c6435bce1cd4edc4d31668a Author: Kendell Clement Date: Tue Dec 6 12:16:19 2022 -0500 Format filterReadsOnSequencePresence script commit 9d764414edd88a46ad5e4f496e4f1c8d5d60ce3e Author: Kendell Clement Date: Fri Dec 2 22:12:54 2022 -0500 Clarify default CRISPRessoPooled settings for use_legacy_bowtie2_options_string commit 9ddea40f7f02b546941ddaa4c71fc5283075051a Author: kclem Date: Mon Nov 14 10:33:04 2022 -0500 Add check for prime editing extension sequence in prime edited sequence if the user specifies the prime_editing_override_prime_edited_ref_seq, it could not contain the extension seq (if they don't provide the extension seq in the appropriate orientation), so check that here. Extension sequence should be provided reverse-complement to the prime edited sequence. commit 152f2dd5001da7090641ee8a1326bde9f7e8104e Author: kclem Date: Wed Nov 9 11:53:41 2022 -0500 Version bump to 2.2.11a commit 9ed356e3a0c6c316d0860d121772f80ddca6de1d Author: kclem Date: Wed Nov 9 11:47:30 2022 -0500 Add param to override prime editing sequence checks CRISPResso checks that prime editing guides are provided in the proper orientation (e.g. pegRNA 3'->5', spacer sequence 5'->3') and checks these orientations by alignment. Sometimes, the alignment can be better in the opposite direction, and this parameter allows these checks to be overridden. Otherwise, these checks would halt the program and produce the output 'The prime editing pegRNA spacer sequence appears to be given in the 3\'->5\' order. The prime editing pegRNA spacer sequence (--prime_editing_pegRNA_spacer_seq) must be given in the RNA 5\'->3\' order.' commit 39dd80afb98a22b7edb6f801c363d86bb77eeb5b Author: kclem Date: Wed Nov 9 10:06:51 2022 -0500 Update filterReadsOnSequencePresence.py commit fe55526927e3fb6e17c9a8a6f59c7057bc1e14eb Author: Kendell Clement Date: Mon Nov 7 22:25:16 2022 -0500 Add script to filter input based on sequence presence commit 713e57a19c35180035ca35e11a5820065eda0198 Author: Kendell Clement Date: Tue Oct 18 16:02:26 2022 -0400 Allow spaces in read names for CRISPRessoWGS commit 39ce008bdddccdd8229c0ba185dce78bc2f66968 Author: Cole Lyman Date: Sat Oct 8 21:09:58 2022 -0600 Fix typo of CRISPResssoPlot when plotting nucleotide quilt (#250) commit 6a2b342c8503b7327c0a2414edfbd16912d60ca5 Author: Kendell Clement Date: Sat Oct 8 23:08:47 2022 -0400 Batch amplicon plots (#251) * Error out if HDR amplicon matches existing amplicon * Add check for amplicon sequence uniqueness * Fix bug with bam_input not having bam_output * Test for no returned lines in auto mode, version bump to 2.2.11 * Fix pandas deprecation of df.append commit 726b2b93d6e419a1b0aa6a968c97edc55b4cc5a8 Author: Kendell Clement Date: Thu Oct 6 16:32:02 2022 -0400 Fix CRISPRessoBatch plot pool bug when plots are suppressed commit 7e5049c4dfb88cbc87c91935a91d1f51120a10c2 Author: Cole Lyman Date: Wed Sep 21 21:04:51 2022 -0600 Fix batch quilt plot name (#249) This fixes an incorrectly named allele quilt plot input in CRISPRessoBatch. commit 1821ca5029c5a1485733f13ab3f2048b4f1fa04e Author: Kendell Clement Date: Thu Sep 15 15:49:08 2022 -0400 Version bump to 2.2.10 commit c5f79aebfc1ae209f4ee320df250eed89a02787c Author: Cole Lyman Date: Wed Sep 14 14:24:55 2022 -0600 Parallel plot refactor (#247) * Fix duplicate plotting in CRISPRessoBatch aggregate * Refactor mulltiprocessing plots in CRISPRessoBatch * Refactor multiprocessing plots in CRISPRessoCORE * Refactor multiprocessing plots for CRISPRessoAggregate commit 4ed5e24e6cc1dd8068e2391573ae2438acd32db2 Author: Kendell Clement Date: Tue Sep 13 14:12:11 2022 -0400 print files in curr dir if Aggregate can't find files commit ce25bc06f29988e7a10afd0b6a09ba0caf0950e0 Author: Kendell Clement Date: Mon Sep 12 10:32:57 2022 -0400 Spelling typo commit c15f01c75083403f17c58c121b2afe97e9f2a1ec Author: Kendell Clement Date: Tue Sep 6 17:49:52 2022 -0400 Add helper function to create alignment scoring matrix New scoring matrix can be created using CRISPResso2Align.make_matrix() commit c80f82838c5a228b79ad4484092877cfee08e02c Author: Cole Lyman Date: Mon Aug 22 18:28:33 2022 -0600 Add `zip_output` (#240) * Making zip of results * Zip command added, if zip is true place_report_in_output_folder is also true, zip removes all files while zipping * Adding --zip to compare and pooled/wgs compare * Add more formatting changes to CRISPRessoShared * Refactoring propagate_crispress_options so only one version exists * Zip added to arguments_to_ignore and warning added when changing arguments * Restore styling * Update README to include --zip * Rename --zip to --zip_output * Change --zip to --zip_output in CompareCORE and PooledWGSCompareCORE * Bug fix arg to args Co-authored-by: Samuel Nichols commit 5de3d7286d8e33c7cf4d3615fce715806e72f511 Author: Kendell Clement Date: Thu Aug 11 21:42:34 2022 -0400 Fix fix to aggregate for CRISPRessoWGS commit a2294c266f43b14969a5d6474076f31a77a57173 Author: Kendell Clement Date: Thu Aug 11 21:40:50 2022 -0400 Fix bug in aggregate for WGS commit 7ce3eb4abe4b8ceac933272ac9cb16a8bedf26a3 Author: Kendell Clement Date: Mon Aug 8 21:53:45 2022 -0400 Update CRISPRessoWGS to allow non-word characters in region names commit 040ac0033d6e250f4e3a412101874cf5e914e08a Author: kclem Date: Mon Aug 8 16:04:59 2022 -0400 Enable processing of cram files by CRISPRessoWGS Adds --reference to samtools view when viewing cram files commit cf112a0caba8789e28530cc09171285ec6ea9b4c Author: kclem Date: Mon Aug 8 14:55:46 2022 -0400 Auto amplicon detection for interleaved input Enables processing of interleaved fastq files for guess_guides and guess_amplicons, as well as get_most_frequent_reads. When interleaved input is present, the input is first separated into R1/R2 files, then processing is performed. commit 4ba524dc7b947feca8a0f743837844f9febc2171 Author: Cole Lyman Date: Thu Aug 4 11:32:11 2022 -0600 Potential fix for aggregate plots in Batch mode (#237) commit 6097a8a104d3f156ef7c08e196ac37e32bf04c71 Author: Kendell Clement Date: Thu Jul 21 22:45:48 2022 -0400 Fix pct_vectors in crispresso2_info json object commit 65a079d86d6f386793397398f839c46014b54543 Author: Kendell Clement Date: Wed Jul 20 23:46:37 2022 -0400 Fix more readme spelling bugs commit e817376ecd54cdea1f29e303ca25b9e7d1d38333 Author: Kendell Clement Date: Wed Jul 20 23:42:23 2022 -0400 Fix bug in readme spelling commit 49740ba1d66ed6d13a9e154b8b17bc8b5186581d Author: Kendell Clement Date: Wed Jul 20 16:10:09 2022 -0400 Fix loading of crispresso info from WGS and Pooled commit b68a43271115251b18e8955e285ccc18f549e8cd Author: Kendell Clement Date: Thu Jul 14 14:11:04 2022 -0400 Add plotly to dockerfile commit b0b7d41d697304d0d5fc93e3346c9de1b98ba41d Author: Kendell Clement Date: Thu Jul 14 14:10:00 2022 -0400 Fix #231 Allow N's in bam output (Try 2) commit c460b3e73fd06a230dbac2e37c86b833144ebf94 Author: Kendell Clement Date: Thu Jul 14 14:09:10 2022 -0400 Revert "Fix #231 Allow N's in bam output" This reverts commit 2f6ad1dbe05210af9ccc1b1f17783cd212a888d3. commit 2f6ad1dbe05210af9ccc1b1f17783cd212a888d3 Author: Kendell Clement Date: Thu Jul 14 13:52:37 2022 -0400 Fix #231 Allow N's in bam output commit 0a2419e518dc9b3520058c3927f98b31cd51347e Author: Cole Lyman Date: Fri Jul 8 21:10:01 2022 -0600 Fix bug when name is provided instead of amplicon_name in pooled input file (#229) Also, raise an exception (instead of incorrectly executing) when there are not enough matched parameters in the pooled input file. commit cb58212379803788c04ca5793baaa760cbbeaa81 Author: Cole Lyman Date: Fri Jul 8 21:09:49 2022 -0600 Fix bug when comparing two samples with the same name. (#228) commit e8a796f5f451409cbafed4404dfba4b6b8a124ca Author: Kendell Clement Date: Thu Jun 23 21:30:23 2022 -0400 Version bump to 2.2.9 commit 632143ddedea48bab9229baeb4bf3ea4d1f658d6 Author: Cole Lyman Date: Mon Jun 20 19:53:14 2022 -0600 Don't run global frameshift plot when there are no reads (#226) When there are no reads (i.e. global_MODIFIED_FRAMESHIFT + global_MODIFIED_NON_FRAMESHIFT + global_NON_MODIFIED_NON_FRAMESHIFT == 0) there was a bug when trying to compute the pie chart, because all of the values in the pie chart are 0. This fix, will make sure that there is at least one read in order for the plot to bee constructed properly. commit 4bb06218e835d2624d53fd401542caef6f8a3a55 Author: kclem Date: Fri Jun 3 16:57:02 2022 -0400 Improvements for guide inference in 'auto' mode In 'auto' mode, a putative guide sequence is selected at the site of maximal editing. If the site of maximal editing happens near the end of the guide (e.g. base 0) many things will break (e.g. quantification windows, etc). This update excludes bases from being used to find the guide using the --exclude_bp_from_left and --exclude_bp_from_right parameters. At default, these parameters are 15bp, so the first and last 15bp would not be selected for the site of maximal editing and thus be the site of a guide sequence. In addition, the site of maximal editing must have 3x the magnitude over the background. commit 9d64de187835b2553ad2b4374d32edab27f83645 Author: Kendell Clement Date: Thu Jun 2 20:22:25 2022 -0400 Update README.md commit 6aafc5387986f5089ba55b68d128343d68052792 Author: Simon P Shen Date: Tue May 31 17:42:53 2022 -0400 directory in quotes in batch cmd (#222) Add quotes around output folder for folders that have spaces. commit 432f163ac68b9a650d1fd326171aadc505ee87f4 Author: Kendell Clement Date: Tue May 24 23:38:36 2022 -0400 CRISPRessoBatch fills NA values in batch settings NA values in CRISPRessoBatch are filled with the value from args - either the default value or the value from the command line args (if set) commit 6de774adbad3aa8cd99d07b0ba7692984b356cd4 Author: kclem Date: Mon May 23 14:18:02 2022 -0400 Fix file naming bug for HDR outputs In html file, figures 4e and 4f incorrectly referenced figure 4d. This fixes this bug. commit b88fec0668a4082a12ead3d26582e86d829dd7cc Author: Kendell Clement Date: Sat May 21 00:32:15 2022 -0400 For bam_output, fix bug that wrote unaligned lines twice commit 3564e77ebcdedb4b01cc01dcca18ba3221fac67c Author: Kendell Clement Date: Thu May 19 16:32:18 2022 -0400 Update README with CRISPRessoPooled headers and bam_output parameters commit bc08d81f17cb1929d1c37a1773cffcf36fb12fe2 Author: Kendell Clement Date: Thu May 19 16:11:30 2022 -0400 Add more links to tools commit 006c497a379ecd94b017a883a5db887861e1586a Author: Kendell Clement Date: Thu May 19 16:08:14 2022 -0400 Add links to tools commit dc8243373ad00d6bd467fc30c59942596ff0c5d6 Author: Kendell Clement Date: Mon May 16 21:38:06 2022 -0400 fastq_to_bam implementation (#219) commit e88b6833977c6b2768299e0b2e7af623e3a9ae7c Author: Kendell Clement Date: Sun May 8 02:14:13 2022 -0400 Fix bug for when guides don't agree in CRISPRessoAggregate commit 7eb763116a8c60603f1cd654645215767ee8eb52 Author: Kendell Clement Date: Thu May 5 03:28:21 2022 -0400 Fix bug for case of empty summary plots in report generation commit 0324fa67d14ed945f0c9531d9bcf73ebcf4ca042 Author: Kendell Clement Date: Thu May 5 03:28:02 2022 -0400 Create report for number of significant bases in CRISPRessoCompare commit e3c9d0026a9ee6732f3ed6bdcf2a824850d7e66a Author: Kendell Clement Date: Wed May 4 22:43:11 2022 -0400 Update pickle to json in readme and CRISPRessoPooledWGSCompare commit 1553f7977c12bf1091a20ca55b878bccfb739b61 Author: Kendell Clement Date: Wed May 4 18:10:04 2022 -0400 Merge pull request #4 from pinellolab/master (#218) commit bcecbfc047d294e26f381a6668e08cb4db24445c Merge: 15b0e05b bb13e007 Author: Kendell Clement Date: Wed May 4 18:06:37 2022 -0400 Merge branch 'master' into master commit bb13e007738d6e7a4909e01f03daff592f334f36 Merge: af4ab6e8 d0b41483 Author: Kendell Clement Date: Wed May 4 17:59:32 2022 -0400 Merge branch 'master' of https://github.com/edilytics/CRISPResso2 commit 15b0e05b9e03bbec5236e58776ddf9aa2f93180e Author: Kendell Clement Date: Wed May 4 17:54:52 2022 -0400 2 flexible pooled input (#217) * Batch type coerce and r2 file check * Upgrade tabs for bootstrap5 * Update readme with additional pooled amplicon file headers Co-authored-by: Samuel Nichols commit d0b41483bee704940ba60c58289f412b04c71659 Author: Kendell Clement Date: Wed May 4 13:43:43 2022 -0400 Update README.md commit ce49fab5301cb73ba0daf6c765e350eb083c76f1 Merge: 5f909713 b913fcb4 Author: Kendell Clement Date: Wed May 4 13:40:30 2022 -0400 Merge pull request #3 from edilytics/2-flexible-pooled-input Add flexibility to CRISPRessoPooled amplicon input by allowing headers. Also, prime editing and quantification window coordinate parameters can be passed to CRISPRessoPooled. commit b913fcb402a8ba3106c3ff7913563a33d8d19fca Author: Kendell Clement Date: Wed May 4 13:38:25 2022 -0400 Update CRISPRessoPooledCORE.py Replace process to read header, increase flexibility for column order commit 945bf31f16530b7ce25b89095b2c7005bf146117 Merge: 7b8f6788 5f909713 Author: Kendell Clement Date: Wed May 4 12:45:24 2022 -0400 Merge branch 'master' into 2-flexible-pooled-input commit 5f9097133765736a7c2fe3c8e9b730845fed0b70 Author: Kendell Clement Date: Wed May 4 12:23:44 2022 -0400 Version bump to 2.2.8 commit c4a94ce0e06c6ebae13e128fbe6b708e635121c4 Author: Kendell Clement Date: Wed May 4 00:13:17 2022 -0400 Fix summary plot representation for multi reports *fixed old reference to make_multi_report which called old summary plot format * renamed summary_plot to summary_plots to reflect a dict with multiple plots commit 62900e9ae6fa37ce99a04f12a63ed5c912f75042 Author: Cole Lyman Date: Tue May 3 20:47:52 2022 -0600 Large aggregation (#192) * Squashed commit of the following: commit 8564eb03f0d9e62abf4b7528baf5c2ae296be8f9 Merge: f6ef62c 07cc7d8 Author: Kendell Clement Date: Tue Jan 11 16:20:15 2022 -0500 Merge branch 'indel-alignment-fix' of https://github.com/edilytics/CRISPResso2 into indel-alignment-fix commit 07cc7d856ab3fcbbaa5381f17f29568192388887 Author: Cole Lyman Date: Fri Dec 10 15:29:59 2021 -0700 Fix bug in `find_indels_substitutions` This bug occurred when there was a deletion at the end of a sequence, and was thus not properly accounted for. commit f6ef62cfdf909adac1b10ea86555cd218f8b2a74 Author: Cole Lyman Date: Fri Dec 10 15:29:59 2021 -0700 Fix bug in `find_indels_substitutions` This bug occurred when there was a deletion at the end of a sequence, and was thus not properly accounted for. commit 7212f87f4be60057a6c848947ff6b5efde132a25 Author: Cole Lyman Date: Fri Dec 10 15:26:17 2021 -0700 Add a unit test for `find_indels_substitutions` This unit test checks for deletions at the end of a sequence, which are inherently outside of the include_indx_set window. commit d50b4e903b973c71a275e31d470b40e59280ee13 Author: Cole Lyman Date: Fri Dec 10 15:03:22 2021 -0700 Fix a bug in `find_indels_substitutions` The bug that this commit fixes is when an insertion occurs at the edge of the include indexes. The trouble with this earlier was that it was using the `idx` to calculate the size of the insertion, but the `idx` wasn't being incremented anymore because it was outside of the include window. commit 4db066f7bc333b7662a9232ac732ebb33ac3ace8 Author: Cole Lyman Date: Fri Dec 10 15:01:39 2021 -0700 Add test case for `find_indels_substitutions` This test case is extracted from the CRISPRessoBatch integration test and provides an example where there is an insertion at the edge of the include index. commit 3b3a7417f5bbd6c2785a2af54a47e01d2e820451 Author: Cole Lyman Date: Fri Dec 10 11:37:07 2021 -0700 Fix bug in CRISPRessoCompare where sample names were not properly set This was a place where it was (partially) missed during the crispresso2_info object refactoring. commit e9f5eff3d95b676b5ee2e23371a5604f600d34b2 Author: Cole Lyman Date: Fri Dec 10 15:26:17 2021 -0700 Add a unit test for `find_indels_substitutions` This unit test checks for deletions at the end of a sequence, which are inherently outside of the include_indx_set window. commit d4d45a918254ab19a7e7956e9e731389c6f36ecb Author: Cole Lyman Date: Fri Dec 10 15:03:22 2021 -0700 Fix a bug in `find_indels_substitutions` The bug that this commit fixes is when an insertion occurs at the edge of the include indexes. The trouble with this earlier was that it was using the `idx` to calculate the size of the insertion, but the `idx` wasn't being incremented anymore because it was outside of the include window. commit 13f00bb40239c83e6e5cf844561fdb7000d3d9ab Author: Cole Lyman Date: Fri Dec 10 15:01:39 2021 -0700 Add test case for `find_indels_substitutions` This test case is extracted from the CRISPRessoBatch integration test and provides an example where there is an insertion at the edge of the include index. commit 659ae34e8fd106f7ecc163b5bea0b5a80ab0283c Author: Cole Lyman Date: Fri Dec 10 11:37:07 2021 -0700 Fix bug in CRISPRessoCompare where sample names were not properly set This was a place where it was (partially) missed during the crispresso2_info object refactoring. * Add parameter `--suppress_batch_summary_plots` If many runs are run at the same time, batch summary plots may fail because they are too large for matplotlib. This parameter `--suppress_batch_summary_plots` allows individual runs to be plotted, but suppresses batch summary plots that may otherwise be too big. * Pep formatting cleanup * Add summary nucleotide plots to aggregate * Aggregate plots are paginated * Update CRISPRessoAggregateCORE.py Remove max sample limit for plotting * Add --max_samples_per_summary_plot to CRISPRessoAggregate Parameterize the max number of samples to plot on each page of reports. Additional PDFs will be created with this number of samples on them. * Add plotly function to plot an interactive heatmap * Fix deprecated numpy type to suppress warning * Add plotting of heatmaps to CRISPRessoAggregateCORE to summarize modification types These heatmaps are interactive (zoomable and panable) and show for each sample the percentage of insertions, substitutions, and deletions. * Add the heatmap summaries to the CRISPRessoAggregate report * Update Bootstrap to 5.1.3 This is mainly so that we can use the fullscreen modal functionality in this version. * Move the plotly heatmaps to a Bootstrap modal * Fix bug where plots were not filling up entire modal. I have tried countless different ways for this to work, and this is the best that I can come up with. After the modal is opened it triggers the plot to resize, and then for some reason you need to trigger the resize event. I think this is because a `div` changing size won't actually trigger the resizing of the plot (and neither will just calling `Plotly.Plots.resize`...?!). * Update the axis labels and add autosize to plotly heatmaps I'm pretty sure the autosize doesn't do anything, but it is there for good measure. * Abandon attempts to make plots fullscreen This includes removing the Bootstrap modal (two out of the three plots would resize properly and I couldn't figure out a way to have the plot displayed outside of the modal). I have left in some javascript to make the plot fullscreen, but I couldn't get the formatting quite right and the plot wasn't much bigger in the fullscreen version because there was a ton of space between the plot and the heatmap. If some brave soul would like to tackle it, feel free! * Rename and refactor how plot data is passed around I have consolidated how the plot data is passed around, so that now you can pass in only one dict with all of the information instead of 4 or 5 separate parameters. I also renamed the `heatmap_plot_*` to `allele_modification_heatmap_*`. * Implement the line plot version of the modification percentages This also includes correctly resizing the plot when the line plot tab is selected! * Change default `max_samples_per_summary_plot` to be 150 instead of 250 * Remove extra assignments of `this_number_samples` and suppress plot The plot that is suppressed is the large nucleotide quilt when there is a large number of samples. Is it okay to suppress this plot @kclem? * Implement parallel plotting in CRISPRessoAggregate * Fix sample indexing error and heatmap scaling for large number of samples * Add parameter `--suppress_batch_summary_plots` If many runs are run at the same time, batch summary plots may fail because they are too large for matplotlib. This parameter `--suppress_batch_summary_plots` allows individual runs to be plotted, but suppresses batch summary plots that may otherwise be too big. * Pep formatting cleanup * Add summary nucleotide plots to aggregate * Aggregate plots are paginated * Update CRISPRessoAggregateCORE.py Remove max sample limit for plotting * Add --max_samples_per_summary_plot to CRISPRessoAggregate Parameterize the max number of samples to plot on each page of reports. Additional PDFs will be created with this number of samples on them. * Add plotly function to plot an interactive heatmap * Fix deprecated numpy type to suppress warning * Add plotting of heatmaps to CRISPRessoAggregateCORE to summarize modification types These heatmaps are interactive (zoomable and panable) and show for each sample the percentage of insertions, substitutions, and deletions. * Add the heatmap summaries to the CRISPRessoAggregate report * Update Bootstrap to 5.1.3 This is mainly so that we can use the fullscreen modal functionality in this version. * Move the plotly heatmaps to a Bootstrap modal * Fix bug where plots were not filling up entire modal. I have tried countless different ways for this to work, and this is the best that I can come up with. After the modal is opened it triggers the plot to resize, and then for some reason you need to trigger the resize event. I think this is because a `div` changing size won't actually trigger the resizing of the plot (and neither will just calling `Plotly.Plots.resize`...?!). * Update the axis labels and add autosize to plotly heatmaps I'm pretty sure the autosize doesn't do anything, but it is there for good measure. * Abandon attempts to make plots fullscreen This includes removing the Bootstrap modal (two out of the three plots would resize properly and I couldn't figure out a way to have the plot displayed outside of the modal). I have left in some javascript to make the plot fullscreen, but I couldn't get the formatting quite right and the plot wasn't much bigger in the fullscreen version because there was a ton of space between the plot and the heatmap. If some brave soul would like to tackle it, feel free! * Rename and refactor how plot data is passed around I have consolidated how the plot data is passed around, so that now you can pass in only one dict with all of the information instead of 4 or 5 separate parameters. I also renamed the `heatmap_plot_*` to `allele_modification_heatmap_*`. * Implement the line plot version of the modification percentages This also includes correctly resizing the plot when the line plot tab is selected! * Change default `max_samples_per_summary_plot` to be 150 instead of 250 * Remove extra assignments of `this_number_samples` and suppress plot The plot that is suppressed is the large nucleotide quilt when there is a large number of samples. Is it okay to suppress this plot @kclem? * Implement parallel plotting in CRISPRessoAggregate * Fix sample indexing error and heatmap scaling for large number of samples * Add plotly requrement to setup.py * Remove space around vertical barcharts * Add scrollbar to long images in multiReport * Fill in default (empty) values to allele modification plots When not running CRISPRessoAggregate, default values for the `allele_modification_heatmap_plot` and `allele_modification_lin_plot` dictionaries will be set so that the template can be properly rendered. * Include CRISPRessoBatch in the refactor of how summary_plot dicts are handled * Update dockerfile for new docker * minor bug fixes for plotCustomAllelePlot.py to work with Python3 (#212) * Allow for flexible parsing of quant window coordinates * CRISPRessoPooled debug flash command, fix pep formatting * Set flexiguide homology parameter type to int * Coerce ints in batch file checking (#200) * Batch type coerce and r2 file check * Revert "Batch type coerce and r2 file check" This reverts commit f91736688ea9739cf3063e3601c52ad6da1116a4. * Coerce int values * Handle multiple qwcs in batch mode If multiple qwcs were provided in batch mode, a parsing error would occur. This fixes this bug. * Fix bug from old pandas for int cols Evidently old pandas versions throw an error if a column doesn't exist. This checks to see if the column exists before the values are set. * Create allele modification heatmaps and line plots in CRISPRessoBatch * Add allele modification heatmaps and line plots to CRISPRessoBatch * Make all plots in CRISPRessoBatch run in parallel * Make `--suppress_batch_summary_plots` store true Also, only open and shutdown the process pool when necessary. * Add blank values for allele_modification entries when not present Co-authored-by: Kendell Clement Co-authored-by: dharjanto Co-authored-by: Samuel Nichols commit f67376fc9ab0e407d4086aa42fd1c77706ebc9c0 Author: Kendell Clement Date: Fri Apr 15 00:46:30 2022 -0400 Fix bug from old pandas for int cols Evidently old pandas versions throw an error if a column doesn't exist. This checks to see if the column exists before the values are set. commit b34fe2956ff88629809b2434878028723dfc4895 Author: Kendell Clement Date: Thu Apr 14 23:58:07 2022 -0400 Handle multiple qwcs in batch mode If multiple qwcs were provided in batch mode, a parsing error would occur. This fixes this bug. commit c94e3b9f2e301bda91e9c1e6f4ef794b33b5dbf0 Author: Samuel Nichols Date: Thu Apr 14 21:48:32 2022 -0600 Coerce ints in batch file checking (#200) * Batch type coerce and r2 file check * Revert "Batch type coerce and r2 file check" This reverts commit f91736688ea9739cf3063e3601c52ad6da1116a4. * Coerce int values commit fc4542491bb86eb143db0044a848a56234403496 Author: Kendell Clement Date: Thu Apr 14 22:13:23 2022 -0400 Set flexiguide homology parameter type to int commit 23fe2aa8e26067d1bcf36bfafc67e023c7588d2f Author: Kendell Clement Date: Thu Apr 14 22:12:37 2022 -0400 CRISPRessoPooled debug flash command, fix pep formatting commit d292d33d8c1fa3bfd2cee656643fd47bcdab161d Author: Kendell Clement Date: Thu Apr 14 22:00:19 2022 -0400 Allow for flexible parsing of quant window coordinates commit e1667cb53a7ea6fbb33369c8530a78639ed423ec Author: dharjanto Date: Mon Apr 11 22:08:21 2022 -0400 minor bug fixes for plotCustomAllelePlot.py to work with Python3 (#212) commit 7b8f6788da18f6ab173fa3c3d10f4ab6bb2acc26 Author: Samuel Nichols Date: Fri Apr 8 10:21:00 2022 -0600 Update README commit 9bc24cd0474ed9f398dff64274d3181c4b2f8637 Author: Samuel Nichols Date: Tue Mar 29 11:25:09 2022 -0600 Using Amplicon_Name commit 88ac5d72074b3da63de035e02c911ce34cd29414 Merge: b6057a2d e5afa478 Author: Samuel Nichols Date: Mon Mar 28 22:32:09 2022 -0600 Merge remote-tracking branch 'origin/master' into 2-flexible-pooled-input commit b6057a2d54cb8637ff0900416de8e2de72213f76 Author: Samuel Nichols Date: Mon Mar 28 20:53:05 2022 -0600 Printing info statements for matched headers commit af4ab6e8507d7aa4b7b68f217a458e0d9c966f55 Merge: bbb7d6f0 51a943c3 Author: Cole Lyman Date: Fri Mar 25 09:44:13 2022 -0600 Merge branch 'pinellolab:master' into master commit 3c1eb012fc02563e3e963f17a62c7e932f5bcddc Author: Samuel Nichols Date: Thu Mar 24 12:31:43 2022 -0600 Debugging and column checking commit 0b47acbc592a6df6adf14641357b2104b76be691 Author: Samuel Nichols Date: Wed Mar 23 09:42:51 2022 -0600 New variables added to pooled commit a0ff3a44d6d19d7b37f91919b5c0180206f72d53 Author: Samuel Nichols Date: Mon Mar 21 09:32:28 2022 -0600 Read as string not bytes commit 710675fc3c0307e21103abd604315b47ff80a894 Author: Samuel Nichols Date: Wed Mar 16 13:51:30 2022 -0600 Adding command building for new options commit f386818a48e5c840bd567611e6f1320c8146cac7 Author: Samuel Nichols Date: Wed Mar 16 10:08:33 2022 -0600 Comment out df_template.iloc instance commit eb5e309da57c8b96cd760728ddbf67be05f30d1c Author: Samuel Nichols Date: Wed Mar 16 09:59:19 2022 -0600 Potential solution for flexible headers commit 51a943c3a8f8181963acc420e75a5e8ee103cf7c Author: Kendell Clement Date: Tue Mar 15 11:00:46 2022 -0400 CRISPRessoPooled pep formatting and fix CRISPRessoPooled doesn't re-count reads if it has been run once and the `aligned_pooled_bam` is provided as input pep code formatting changes commit bbb7d6f0907aa13518d20e7f470e7de518b825f4 Merge: ddbd39f0 5a10d638 Author: Kendell Clement Date: Tue Mar 15 10:23:38 2022 -0400 Merge branch 'master' of https://github.com/edilytics/CRISPResso2 commit 5a10d638c638f21f8a2934955e92ef7e117b889e Author: Kendell Clement Date: Sat Feb 26 14:21:57 2022 -0500 Move metadata for bam input and output commit e5afa4784d5330a1dc95c5deafcd9217edeac631 Author: Samuel Nichols Date: Wed Feb 16 10:20:24 2022 -0700 Coerce int values commit ede7d85b50055311908000578c76a1860ae9de4d Author: Samuel Nichols Date: Wed Feb 16 10:18:29 2022 -0700 Revert "Batch type coerce and r2 file check" This reverts commit f91736688ea9739cf3063e3601c52ad6da1116a4. commit f91736688ea9739cf3063e3601c52ad6da1116a4 Author: Samuel Nichols Date: Wed Feb 16 10:10:52 2022 -0700 Batch type coerce and r2 file check commit 7b4a310b0f8b64c00e02eca3d522ad50d39b43ae Author: Kendell Clement Date: Tue Feb 15 22:18:05 2022 -0500 Reiterate WGS region file is tab-separated Add note to WGS description that region file should be tab-separated. Closes #199 commit b8497542e388ad401d0815d426f27abc3201a76d Author: kclem Date: Fri Feb 11 15:07:14 2022 -0500 Extend x-axis to longest scaffold incorporation length commit ab7248947afade089809c74bfe6e9d5394e8f6dc Author: kclem Date: Wed Feb 9 17:05:11 2022 -0500 Fix prime editing indexing for plots commit ddbd39f06b262d5ebd2cc69e116c08b22b6bd84e Merge: a7ffd468 442a48c7 Author: Kendell Clement Date: Thu Jan 13 15:35:36 2022 -0500 Merge branch 'pinellolab:master' into master … * Move plotly import to the top (#57) * Args as Data (#56) * Use args.json to build arg parser * Add args.json * Added names to args json file, refactored directory navigation to allow C2web access to args json file * JSON updates * adding tools to function call * refactoring args functions declarations, debugging some of pooled * adjusting comments * Added neccesary tools to WGS, Pooled, and Core * rewrote some functions that interact with argument parser, removed required from wgs and pooled arguments * fixing argument propogation * added amplicons_file to options_to_ignore * Refactored functions and args json to better reflect division between tools * Fixed required functionality, removed old argument parsers * Round guardrail messages * Add percentage * Update CRISPRessoBatchCORE.py * Update CRISPRessoShared.py * Improving amplicon error message * Fix help message for disable_guardrails * Removing fastq requirement for Core and Pooled * Remove lambda router * Fixing tools and variable formatting * Adding suppression of arguments * improved help text * Update integration_tests.yml --------- Co-authored-by: Samuel Nichols * Update message of CRISPRessoPooled default behavior changing in v2.3.1 (#59) * Restore CRISPResso2Align.c to previous version (#60) * Add args.json to MANIFEST.in so that it is copied in pip install (#61) --------- Co-authored-by: mbowcut2 <55161542+mbowcut2@users.noreply.github.com> Co-authored-by: Samuel Nichols Co-authored-by: Trevor Martin <60452953+trevormartinj7@users.noreply.github.com> Co-authored-by: trevormartinj7 Co-authored-by: McKay Co-authored-by: Kendell Clement --- CRISPResso2/CRISPRessoAggregateCORE.py | 19 +- CRISPResso2/CRISPRessoBatchCORE.py | 68 +- CRISPResso2/CRISPRessoCORE.py | 534 +-- CRISPResso2/CRISPRessoCOREResources.c | 2911 ++++++----------- CRISPResso2/CRISPRessoCOREResources.pyx | 52 +- CRISPResso2/CRISPRessoCompareCORE.py | 28 +- CRISPResso2/CRISPRessoMetaCORE.py | 14 +- CRISPResso2/CRISPRessoPlot.py | 168 +- CRISPResso2/CRISPRessoPooledCORE.py | 170 +- CRISPResso2/CRISPRessoPooledWGSCompareCORE.py | 2 +- .../CRISPRessoReports/CRISPRessoReport.py | 70 +- .../templates/batchReport.html | 20 +- .../CRISPRessoReports/templates/layout.html | 4 - .../templates/pooledReport.html | 4 +- .../CRISPRessoReports/templates/report.html | 59 +- .../shared/partials/guardrail_warnings.html | 5 + CRISPResso2/CRISPRessoShared.py | 910 ++++-- CRISPResso2/CRISPRessoWGSCORE.py | 33 +- CRISPResso2/args.json | 844 +++++ Dockerfile | 2 +- LICENSE.txt | 3 +- MANIFEST.in | 1 + README.md | 557 ++-- scripts/plotAmbiguous.py | 13 +- scripts/plotCustomAllelePlot.py | 21 +- 25 files changed, 3439 insertions(+), 3073 deletions(-) create mode 100644 CRISPResso2/CRISPRessoReports/templates/shared/partials/guardrail_warnings.html create mode 100644 CRISPResso2/args.json diff --git a/CRISPResso2/CRISPRessoAggregateCORE.py b/CRISPResso2/CRISPRessoAggregateCORE.py index 689bef98..b521dac7 100644 --- a/CRISPResso2/CRISPRessoAggregateCORE.py +++ b/CRISPResso2/CRISPRessoAggregateCORE.py @@ -17,10 +17,14 @@ import traceback from datetime import datetime from CRISPResso2 import CRISPRessoShared -from CRISPResso2 import CRISPRessoPlot from CRISPResso2.CRISPRessoReports import CRISPRessoReport from CRISPResso2.CRISPRessoMultiProcessing import get_max_processes, run_plot +if CRISPRessoShared.is_C2Pro_installed(): + from CRISPRessoPro import __version__ as CRISPRessoProVersion + C2PRO_INSTALLED = True +else: + C2PRO_INSTALLED = False import logging @@ -67,9 +71,18 @@ def main(): parser.add_argument('--debug', help='Show debug messages', action='store_true') parser.add_argument('-v', '--verbosity', type=int, help='Verbosity level of output to the console (1-4), 4 is the most verbose', default=3) + + # CRISPRessoPro params + parser.add_argument('--use_matplotlib', action='store_true', + help='Use matplotlib for plotting instead of plotly/d3 when CRISPRessoPro is installed') args = parser.parse_args() + if args.use_matplotlib or not CRISPRessoShared.is_C2Pro_installed(): + from CRISPResso2 import CRISPRessoPlot + else: + from CRISPRessoPro import plot as CRISPRessoPlot + CRISPRessoShared.set_console_log_level(logger, args.verbosity, args.debug) output_folder_name='CRISPRessoAggregate_on_%s' % args.name @@ -85,7 +98,7 @@ def main(): log_filename=_jp('CRISPRessoAggregate_RUNNING_LOG.txt') logger.addHandler(logging.FileHandler(log_filename)) - logger.addHandler(CRISPRessoShared.StatusHandler(_jp('CRISPRessoAggregate_status.txt'))) + logger.addHandler(CRISPRessoShared.StatusHandler(_jp('CRISPRessoAggregate_status.json'))) with open(log_filename, 'w+') as outfile: outfile.write('[Command used]:\n%s\n\n[Execution log]:\n' % ' '.join(sys.argv)) @@ -595,7 +608,7 @@ def main(): this_plot_suffix_int += 1 this_plot_suffix = "_" + str(this_plot_suffix_int) - if not args.suppress_plots: + if C2PRO_INSTALLED and not args.use_matplotlib and not args.suppress_plots: crispresso2_info['results']['general_plots']['allele_modification_heatmap_plot_names'] = [] crispresso2_info['results']['general_plots']['allele_modification_heatmap_plot_paths'] = {} crispresso2_info['results']['general_plots']['allele_modification_heatmap_plot_titles'] = {} diff --git a/CRISPResso2/CRISPRessoBatchCORE.py b/CRISPResso2/CRISPRessoBatchCORE.py index 9f95986d..291a017f 100644 --- a/CRISPResso2/CRISPRessoBatchCORE.py +++ b/CRISPResso2/CRISPRessoBatchCORE.py @@ -14,10 +14,15 @@ import traceback from datetime import datetime from CRISPResso2 import CRISPRessoShared -from CRISPResso2 import CRISPRessoPlot from CRISPResso2 import CRISPRessoMultiProcessing from CRISPResso2.CRISPRessoReports import CRISPRessoReport +if CRISPRessoShared.is_C2Pro_installed(): + from CRISPRessoPro import __version__ as CRISPRessoProVersion + C2PRO_INSTALLED = True +else: + C2PRO_INSTALLED = False + import logging logger = logging.getLogger(__name__) @@ -70,15 +75,7 @@ def main(): )) sys.exit() - parser = CRISPRessoShared.getCRISPRessoArgParser(parser_title = 'CRISPRessoBatch Parameters') - - #batch specific params - parser.add_argument('-bs', '--batch_settings', type=str, help='Settings file for batch. Must be tab-separated text file. The header row contains CRISPResso parameters (e.g., fastq_r1, fastq_r2, amplicon_seq, and other optional parameters). Each following row sets parameters for an additional batch.', required=True) - parser.add_argument('--skip_failed', help='Continue with batch analysis even if one sample fails', action='store_true') - parser.add_argument('--min_reads_for_inclusion', help='Minimum number of reads for a batch to be included in the batch summary', type=int, default=0) - parser.add_argument('-bo', '--batch_output_folder', help='Directory where batch analysis output will be stored') - parser.add_argument('--suppress_batch_summary_plots', help='Suppress batch summary plots - e.g. if many samples are run at once, the summary plots of all sub-runs may be too large. This parameter suppresses the production of these plots.', action='store_true') - parser.add_argument('--crispresso_command', help='CRISPResso command to call', default='CRISPResso') + parser = CRISPRessoShared.getCRISPRessoArgParser("Batch", parser_title = 'CRISPRessoBatch Parameters') args = parser.parse_args() @@ -86,12 +83,12 @@ def main(): debug_flag = args.debug - crispresso_options = CRISPRessoShared.get_crispresso_options() + crispresso_options = CRISPRessoShared.get_core_crispresso_options() options_to_ignore = {'name', 'output_folder', 'zip_output'} crispresso_options_for_batch = list(crispresso_options-options_to_ignore) CRISPRessoShared.check_file(args.batch_settings) - config = CRISPRessoShared.check_custom_config(args) + custom_config = CRISPRessoShared.check_custom_config(args) if args.zip_output and not args.place_report_in_output_folder: warn('Invalid arguement combination: If zip_output is True then place_report_in_output_folder must also be True. Setting place_report_in_output_folder to True.') @@ -116,6 +113,12 @@ def main(): _jp = lambda filename: os.path.join(OUTPUT_DIRECTORY, filename) #handy function to put a file in the output directory + if args.use_matplotlib or not C2PRO_INSTALLED: + from CRISPResso2 import CRISPRessoPlot + else: + from CRISPRessoPro import plot as CRISPRessoPlot + CRISPRessoPlot.setMatplotlibDefaults() + try: info('Creating Folder %s' % OUTPUT_DIRECTORY, {'percent_complete': 0}) os.makedirs(OUTPUT_DIRECTORY) @@ -124,7 +127,7 @@ def main(): log_filename = _jp('CRISPRessoBatch_RUNNING_LOG.txt') logger.addHandler(logging.FileHandler(log_filename)) - status_handler = CRISPRessoShared.StatusHandler(_jp('CRISPRessoBatch_status.txt')) + status_handler = CRISPRessoShared.StatusHandler(_jp('CRISPRessoBatch_status.json')) logger.addHandler(status_handler) with open(log_filename, 'w+') as outfile: @@ -179,7 +182,7 @@ def main(): batch_params[int_col] = batch_params[int_col].astype(int) # rename column "a" to "amplicon_seq", etc - batch_params.rename(index=str, columns=CRISPRessoShared.get_crispresso_options_lookup(), inplace=True) + batch_params.rename(index=str, columns=CRISPRessoShared.get_crispresso_options_lookup("Core"), inplace=True) batch_count = batch_params.shape[0] batch_params.index = range(batch_count) @@ -298,7 +301,6 @@ def main(): crispresso2_info['results']['batch_names_arr'] = batch_names_arr crispresso2_info['results']['batch_input_names'] = batch_input_names - CRISPRessoMultiProcessing.run_crispresso_cmds(crispresso_cmds, n_processes_for_batch, 'batch', args.skip_failed, start_end_percent=[10, 90]) run_datas = [] # crispresso2 info from each row @@ -393,6 +395,8 @@ def main(): crispresso2_info['results']['general_plots']['allele_modification_line_plot_labels'] = {} crispresso2_info['results']['general_plots']['allele_modification_line_plot_datas'] = {} + large_plot_cutoff = 300 + percent_complete_start, percent_complete_end = 90, 99 percent_complete_step = (percent_complete_end - percent_complete_start) / len(all_amplicons) # report for amplicons @@ -573,7 +577,7 @@ def main(): sub_modification_percentage_summary_filename = _jp(amplicon_plot_name + 'Modification_percentage_summary_around_sgRNA_'+sgRNA+'.txt') sub_modification_percentage_summary_df.to_csv(sub_modification_percentage_summary_filename, sep='\t', index=None) - if not args.suppress_plots and not args.suppress_batch_summary_plots: + if not args.suppress_plots and not args.suppress_batch_summary_plots and (nucleotide_percentage_summary_df.shape[0] / 6) < large_plot_cutoff: # plot for each guide # show all sgRNA's on the plot sub_sgRNA_intervals = [] @@ -604,11 +608,11 @@ def main(): nucleotide_quilt_input = { 'nuc_pct_df': sub_nucleotide_percentage_summary_df, 'mod_pct_df': sub_modification_percentage_summary_df, - 'fig_filename_root': this_window_nuc_pct_quilt_plot_name, + 'fig_filename_root': f'{this_window_nuc_pct_quilt_plot_name}.json' if not args.use_matplotlib and C2PRO_INSTALLED else this_window_nuc_pct_quilt_plot_name, 'save_also_png': save_png, 'sgRNA_intervals': sub_sgRNA_intervals, 'quantification_window_idxs': include_idxs, - 'custom_colors': config['colors'], + 'custom_colors': custom_config['colors'], } debug('Plotting nucleotide percentage quilt for amplicon {0}, sgRNA {1}'.format(amplicon_name, sgRNA)) plot( @@ -623,7 +627,7 @@ def main(): crispresso2_info['results']['general_plots']['summary_plot_labels'][plot_name] = 'Composition of each base around the guide ' + sgRNA + ' for the amplicon ' + amplicon_name crispresso2_info['results']['general_plots']['summary_plot_datas'][plot_name] = [('Nucleotide frequencies', os.path.basename(nucleotide_frequency_summary_filename)), ('Modification frequencies', os.path.basename(modification_frequency_summary_filename))] - if args.base_editor_output: + if args.base_editor_output and (sub_nucleotide_percentage_summary_df.shape[0] / 6) < large_plot_cutoff: this_window_nuc_conv_plot_name = _jp(amplicon_plot_name + 'Nucleotide_conversion_map_around_sgRNA_'+sgRNA) conversion_map_input = { 'nuc_pct_df': sub_nucleotide_percentage_summary_df, @@ -633,7 +637,7 @@ def main(): 'save_also_png': save_png, 'sgRNA_intervals': sub_sgRNA_intervals, 'quantification_window_idxs': include_idxs, - 'custom_colors': config['colors'] + 'custom_colors': custom_config['colors'] } debug('Plotting nucleotide conversion map for amplicon {0}, sgRNA {1}'.format(amplicon_name, sgRNA)) plot( @@ -656,11 +660,11 @@ def main(): nucleotide_quilt_input = { 'nuc_pct_df': nucleotide_percentage_summary_df, 'mod_pct_df': modification_percentage_summary_df, - 'fig_filename_root': this_nuc_pct_quilt_plot_name, + 'fig_filename_root': f'{this_nuc_pct_quilt_plot_name}.json' if not args.use_matplotlib and C2PRO_INSTALLED else this_nuc_pct_quilt_plot_name, 'save_also_png': save_png, 'sgRNA_intervals': consensus_sgRNA_intervals, 'quantification_window_idxs': include_idxs, - 'custom_colors': config['colors'], + 'custom_colors': custom_config['colors'], } debug('Plotting nucleotide quilt for {0}'.format(amplicon_name)) plot( @@ -674,7 +678,7 @@ def main(): crispresso2_info['results']['general_plots']['summary_plot_titles'][plot_name] = '' crispresso2_info['results']['general_plots']['summary_plot_labels'][plot_name] = 'Composition of each base for the amplicon ' + amplicon_name crispresso2_info['results']['general_plots']['summary_plot_datas'][plot_name] = [('Nucleotide frequencies', os.path.basename(nucleotide_frequency_summary_filename)), ('Modification frequencies', os.path.basename(modification_frequency_summary_filename))] - if args.base_editor_output: + if args.base_editor_output and (sub_nucleotide_percentage_summary_df.shape[0] / 6) < large_plot_cutoff: this_nuc_conv_plot_name = _jp(amplicon_plot_name + 'Nucleotide_conversion_map') conversion_map_input = { 'nuc_pct_df': nucleotide_percentage_summary_df, @@ -684,7 +688,7 @@ def main(): 'save_also_png': save_png, 'sgRNA_intervals': consensus_sgRNA_intervals, 'quantification_window_idxs': include_idxs, - 'custom_colors': config['colors'] + 'custom_colors': custom_config['colors'] } debug('Plotting nucleotide conversion map for {0}'.format(amplicon_name)) plot( @@ -706,20 +710,20 @@ def main(): nucleotide_quilt_input = { 'nuc_pct_df': nucleotide_percentage_summary_df, 'mod_pct_df': modification_percentage_summary_df, - 'fig_filename_root': this_nuc_pct_quilt_plot_name, + 'fig_filename_root': f'{this_nuc_pct_quilt_plot_name}.json' if not args.use_matplotlib and C2PRO_INSTALLED else this_nuc_pct_quilt_plot_name, 'save_also_png': save_png, - 'custom_colors': config['colors'], + 'custom_colors': custom_config['colors'], } debug('Plotting nucleotide quilt for {0}'.format(amplicon_name)) plot( - CRISPRessoPlot.plot_nucleotide_quilt, - nucleotide_quilt_input, - ) + CRISPRessoPlot.plot_nucleotide_quilt, + nucleotide_quilt_input, + ) plot_name = os.path.basename(this_nuc_pct_quilt_plot_name) nuc_pct_quilt_plot_names.append(plot_name) crispresso2_info['results']['general_plots']['summary_plot_labels'][plot_name] = 'Composition of each base for the amplicon ' + amplicon_name crispresso2_info['results']['general_plots']['summary_plot_datas'][plot_name] = [('Nucleotide frequencies', os.path.basename(nucleotide_frequency_summary_filename)), ('Modification frequencies', os.path.basename(modification_frequency_summary_filename))] - if args.base_editor_output: + if args.base_editor_output and (sub_nucleotide_percentage_summary_df.shape[0] / 6) < large_plot_cutoff: this_nuc_conv_plot_name = _jp(amplicon_plot_name + 'Nucleotide_percentage_quilt') conversion_map_input = { 'nuc_pct_df': nucleotide_percentage_summary_df, @@ -727,7 +731,7 @@ def main(): 'conversion_nuc_from': args.conversion_nuc_from, 'conversion_nuc_to': args.conversion_nuc_to, 'save_also_png': save_png, - 'custom_colors': config['colors'] + 'custom_colors': custom_config['colors'] } debug('Plotting BE nucleotide conversion map for {0}'.format(amplicon_name)) plot( @@ -740,7 +744,7 @@ def main(): crispresso2_info['results']['general_plots']['summary_plot_datas'][plot_name] = [('Nucleotide frequencies', os.path.basename(nucleotide_frequency_summary_filename)), ('Modification frequencies', os.path.basename(modification_frequency_summary_filename))] # allele modification frequency heatmap and line plots - if not args.suppress_plots and not args.suppress_batch_summary_plots: + if C2PRO_INSTALLED and not args.use_matplotlib and not args.suppress_plots and not args.suppress_batch_summary_plots and (nucleotide_percentage_summary_df.shape[0] / 6) < large_plot_cutoff: if guides_all_same: sgRNA_intervals = [consensus_sgRNA_intervals] * modification_frequency_summary_df.shape[0] else: diff --git a/CRISPResso2/CRISPRessoCORE.py b/CRISPResso2/CRISPRessoCORE.py index 99aa4838..9a032e85 100644 --- a/CRISPResso2/CRISPRessoCORE.py +++ b/CRISPResso2/CRISPRessoCORE.py @@ -30,7 +30,13 @@ from CRISPResso2 import CRISPRessoCOREResources from CRISPResso2.CRISPRessoReports import CRISPRessoReport from CRISPResso2 import CRISPRessoShared -from CRISPResso2 import CRISPRessoPlot + +if CRISPRessoShared.is_C2Pro_installed(): + from CRISPRessoPro import __version__ as CRISPRessoProVersion + C2PRO_INSTALLED = True +else: + C2PRO_INSTALLED = False + from CRISPResso2 import CRISPResso2Align from CRISPResso2 import CRISPRessoMultiProcessing @@ -81,13 +87,50 @@ def is_exe(fpath): return None -def check_program(binary_name,download_url=None): + +def check_program(binary_name, download_url=None, version_flag=None, version_regex=None, version=None): + """Check if a program is installed and accessible. + + Parameters + ---------- + binary_name : str + Name of the binary to check. + download_url : str, optional + URL to download the program from that is displayed if not installed. + version_flag : str, optional + Flag to pass to the program to get the version. + version_regex : str, optional + Regex to extract the version from the output of the program. + version : str, optional + Version to check against. + + Returns + ------- + None, will exit if program is not installed. + """ if not which(binary_name): - error('You need to install and have the command #####%s##### in your PATH variable to use CRISPResso!\n Please read the documentation!' % binary_name) + error('You need to install and have the command #####{0}##### in your PATH variable to use CRISPResso!\n Please read the documentation!'.format(binary_name)) if download_url: - error('You can download it here:%s' % download_url) + error('You can download it here: {0}'.format(download_url)) sys.exit(1) + if version_flag: + p = sb.Popen('{0} {1}'.format(binary_name, version_flag), shell=True, stdout=sb.PIPE, stderr=sb.STDOUT) + if binary_name == 'fastp': + p_output = p.communicate()[0].decode('utf-8') + else: + p_output = p.communicate()[1].decode('utf-8') + major_version, minor_version, patch_version = map(int, re.search(version_regex, p_output).groups()) + if major_version <= version[0] and minor_version <= version[1] and patch_version < version[2]: + error('You need to install version {0} of {1} to use CRISPResso!'.format(version, binary_name)) + error('You have version {0}.{1}.{2} installed'.format(major_version, minor_version, patch_version)) + if download_url: + error('You can download it here: {0}'.format(download_url)) + sys.exit(1) + + +check_fastp = lambda: check_program('fastp', download_url='http://opengene.org/fastp/fastp', version_flag='--version', version_regex=r'fastp (\d+)\.(\d+)\.(\d+)', version=(0, 19, 8)) + def get_avg_read_length_fastq(fastq_filename): cmd=('z' if fastq_filename.endswith('.gz') else '' ) +('cat < \"%s\"' % fastq_filename)+\ r''' | awk 'BN {n=0;s=0;} NR%4 == 2 {s+=length($0);n++;} END { printf("%d\n",s/n)}' ''' @@ -113,7 +156,6 @@ def get_n_reads_bam(bam_filename,bam_chr_loc=""): #end = time.time() #start = time.time() from matplotlib import font_manager as fm -CRISPRessoPlot.setMatplotlibDefaults() #end = time.time() #start = time.time() @@ -125,7 +167,6 @@ def get_n_reads_bam(bam_filename,bam_chr_loc=""): pd=check_library('pandas') np=check_library('numpy') -check_program('flash') #start = time.time() sns=check_library('seaborn') @@ -205,7 +246,7 @@ def get_cloned_include_idxs_from_quant_window_coordinates(quant_window_coordinat idxs[i] = -1 * abs(idxs[i]) for coord in split_quant_window_coordinates(quant_window_coordinates): include_idxs.extend(idxs[coord[0]:coord[1] + 1]) - + return list(filter(lambda x: x >= 0, include_idxs)) @@ -225,7 +266,7 @@ def get_pe_scaffold_search(prime_edited_ref_sequence, prime_editing_pegRNA_exten """ info('Processing pegRNA scaffold sequence...') #first, define the sequence we are looking for (extension plus the first base(s) of the scaffold) - scaffold_dna = CRISPRessoShared.reverse_complement(prime_editing_pegRNA_scaffold_seq) + scaffold_dna = CRISPRessoShared.reverse_complement(prime_editing_pegRNA_scaffold_seq.upper().replace('U','T')) extension_seq_dna_top_strand = prime_editing_pegRNA_extension_seq.upper().replace('U', 'T') prime_editing_extension_seq_dna = CRISPRessoShared.reverse_complement(extension_seq_dna_top_strand) @@ -341,6 +382,24 @@ def get_new_variant_object(args, fastq_seq, refs, ref_names, aln_matrix, pe_scaf payload['ref_name'] = best_match_name payload['aln_scores'] = aln_scores + + payload['irregular_ends'] = False + if best_match_s1s[idx][0] == '-' or best_match_s2s[idx][0] == '-' or best_match_s1s[idx][0] != best_match_s2s[idx][0]: + payload['irregular_ends'] = True + elif best_match_s1s[idx][-1] == '-' or best_match_s2s[idx][-1] == '-' or best_match_s1s[idx][-1] != best_match_s2s[idx][-1]: + payload['irregular_ends'] = True + + #Insertions out of quantification window + payload['insertions_outside_window'] = (len(payload['all_insertion_positions'])/2) - (len(payload['insertion_positions'])/2) + #Deletions out of quantification window + payload['deletions_outside_window'] = len(payload['all_deletion_coordinates']) - len(payload['deletion_coordinates']) + #Substitutions out of quantification window + payload['substitutions_outside_window'] = len(payload['all_substitution_positions']) - len(payload['substitution_positions']) + #Sums + payload['total_mods'] = (len(payload['all_insertion_positions'])/2) + len(payload['all_deletion_positions']) + len(payload['all_substitution_positions']) + payload['mods_in_window'] = payload['substitution_n'] + payload['deletion_n'] + payload['insertion_n'] + payload['mods_outside_window'] = payload['total_mods'] - payload['mods_in_window'] + # If there is an insertion/deletion/substitution in the quantification window, the read is modified. is_modified = False if not args.ignore_deletions and payload['deletion_n'] > 0: @@ -362,6 +421,7 @@ def get_new_variant_object(args, fastq_seq, refs, ref_names, aln_matrix, pe_scaf payload['aln_strand'] = best_match_strands[idx] new_variant['variant_'+best_match_name] = payload + new_variant['best_match_name'] = best_match_name new_variant['class_name'] = "&".join(class_names) @@ -397,7 +457,7 @@ def get_new_variant_object(args, fastq_seq, refs, ref_names, aln_matrix, pe_scaf def process_fastq(fastq_filename, variantCache, ref_names, refs, args): """process_fastq processes each of the reads contained in a fastq file, given a cache of pre-computed variants - fastqIn: name of fastq (e.g. output of FLASH) + fastqIn: name of fastq (e.g. output of fastp) This file can be gzipped or plain text variantCache: dict with keys: sequence @@ -468,13 +528,19 @@ def process_fastq(fastq_filename, variantCache, ref_names, refs, args): -allelic varaints if two variants are known to exist """ - N_TOT_READS = 0 N_CACHED_ALN = 0 # read was found in cache N_CACHED_NOTALN = 0 #read was found in 'not aligned' cache N_COMPUTED_ALN = 0 # not in cache, aligned to at least 1 sequence with min cutoff N_COMPUTED_NOTALN = 0 #not in cache, not aligned to any sequence with min cutoff + N_GLOBAL_SUBS = 0 #number of substitutions across all reads - indicator of sequencing quality + N_SUBS_OUTSIDE_WINDOW = 0 + N_MODS_IN_WINDOW = 0 #number of modifications found inside the quantification window + N_MODS_OUTSIDE_WINDOW = 0 #number of modifications found outside the quantification window + N_READS_IRREGULAR_ENDS = 0 #number of reads with modifications at the 0 or -1 position + READ_LENGTH = 0 + aln_matrix_loc = os.path.join(_ROOT, args.needleman_wunsch_aln_matrix_loc) CRISPRessoShared.check_file(aln_matrix_loc) aln_matrix = CRISPResso2Align.read_matrix(aln_matrix_loc) @@ -500,7 +566,6 @@ def process_fastq(fastq_filename, variantCache, ref_names, refs, args): info("Processing reads; N_TOT_READS: %d N_COMPUTED_ALN: %d N_CACHED_ALN: %d N_COMPUTED_NOTALN: %d N_CACHED_NOTALN: %d"%(N_TOT_READS, N_COMPUTED_ALN, N_CACHED_ALN, N_COMPUTED_NOTALN, N_CACHED_NOTALN)) N_TOT_READS+=1 - #if the sequence has been seen and can't be aligned, skip it if (fastq_seq in not_aln): N_CACHED_NOTALN += 1 @@ -509,6 +574,13 @@ def process_fastq(fastq_filename, variantCache, ref_names, refs, args): if (fastq_seq in variantCache): N_CACHED_ALN+=1 variantCache[fastq_seq]['count'] += 1 + match_name = "variant_" + variantCache[fastq_seq]['best_match_name'] + N_GLOBAL_SUBS += variantCache[fastq_seq][match_name]['substitution_n'] + variantCache[fastq_seq][match_name]['substitutions_outside_window'] + N_SUBS_OUTSIDE_WINDOW += variantCache[fastq_seq][match_name]['substitutions_outside_window'] + N_MODS_IN_WINDOW += variantCache[fastq_seq][match_name]['mods_in_window'] + N_MODS_OUTSIDE_WINDOW += variantCache[fastq_seq][match_name]['mods_outside_window'] + if variantCache[fastq_seq][match_name]['irregular_ends']: + N_READS_IRREGULAR_ENDS += 1 #otherwise, create a new variant object, and put it in the cache else: @@ -519,6 +591,16 @@ def process_fastq(fastq_filename, variantCache, ref_names, refs, args): else: N_COMPUTED_ALN+=1 variantCache[fastq_seq] = new_variant + match_name = "variant_" + new_variant['best_match_name'] + if READ_LENGTH == 0: + READ_LENGTH = len(new_variant[match_name]['aln_seq']) + N_GLOBAL_SUBS += new_variant[match_name]['substitution_n'] + new_variant[match_name]['substitutions_outside_window'] + N_SUBS_OUTSIDE_WINDOW += new_variant[match_name]['substitutions_outside_window'] + N_MODS_IN_WINDOW += new_variant[match_name]['mods_in_window'] + N_MODS_OUTSIDE_WINDOW += new_variant[match_name]['mods_outside_window'] + if new_variant[match_name]['irregular_ends']: + N_READS_IRREGULAR_ENDS += 1 + fastq_handle.close() @@ -527,10 +609,17 @@ def process_fastq(fastq_filename, variantCache, ref_names, refs, args): "N_CACHED_ALN" : N_CACHED_ALN, "N_CACHED_NOTALN" : N_CACHED_NOTALN, "N_COMPUTED_ALN" : N_COMPUTED_ALN, - "N_COMPUTED_NOTALN" : N_COMPUTED_NOTALN + "N_COMPUTED_NOTALN" : N_COMPUTED_NOTALN, + "N_GLOBAL_SUBS": N_GLOBAL_SUBS, + "N_SUBS_OUTSIDE_WINDOW": N_SUBS_OUTSIDE_WINDOW, + "N_MODS_IN_WINDOW": N_MODS_IN_WINDOW, + "N_MODS_OUTSIDE_WINDOW": N_MODS_OUTSIDE_WINDOW, + "N_READS_IRREGULAR_ENDS": N_READS_IRREGULAR_ENDS, + "READ_LENGTH": READ_LENGTH } return(aln_stats) + def process_bam(bam_filename, bam_chr_loc, output_bam, variantCache, ref_names, refs, args): """ process_bam processes each of the reads contained in a bam file, given a cache of pre-computed variants @@ -550,6 +639,13 @@ def process_bam(bam_filename, bam_chr_loc, output_bam, variantCache, ref_names, N_COMPUTED_ALN = 0 # not in cache, aligned to at least 1 sequence with min cutoff N_COMPUTED_NOTALN = 0 #not in cache, not aligned to any sequence with min cutoff + N_GLOBAL_SUBS = 0 #number of substitutions across all reads - indicator of sequencing quality + N_SUBS_OUTSIDE_WINDOW = 0 + N_MODS_IN_WINDOW = 0 #number of modifications found inside the quantification window + N_MODS_OUTSIDE_WINDOW = 0 #number of modifications found outside the quantification window + N_READS_IRREGULAR_ENDS = 0 #number of reads with modifications at the 0 or -1 position + READ_LENGTH = 0 + aln_matrix_loc = os.path.join(_ROOT, args.needleman_wunsch_aln_matrix_loc) CRISPRessoShared.check_file(aln_matrix_loc) aln_matrix = CRISPResso2Align.read_matrix(aln_matrix_loc) @@ -593,6 +689,13 @@ def process_bam(bam_filename, bam_chr_loc, output_bam, variantCache, ref_names, if (fastq_seq in variantCache): N_CACHED_ALN+=1 variantCache[fastq_seq]['count'] += 1 + match_name = "variant_" + variantCache[fastq_seq]['best_match_name'] + N_GLOBAL_SUBS += variantCache[fastq_seq][match_name]['substitution_n'] + variantCache[fastq_seq][match_name]['substitutions_outside_window'] + N_SUBS_OUTSIDE_WINDOW += variantCache[fastq_seq][match_name]['substitutions_outside_window'] + N_MODS_IN_WINDOW += variantCache[fastq_seq][match_name]['mods_in_window'] + N_MODS_OUTSIDE_WINDOW += variantCache[fastq_seq][match_name]['mods_outside_window'] + if variantCache[fastq_seq][match_name]['irregular_ends']: + N_READS_IRREGULAR_ENDS += 1 #sam_line_els[5] = variantCache[fastq_seq]['sam_cigar'] sam_line_els.append(variantCache[fastq_seq]['crispresso2_annotation']) sam_out.write("\t".join(sam_line_els)+"\n") @@ -654,6 +757,16 @@ def process_bam(bam_filename, bam_chr_loc, output_bam, variantCache, ref_names, variantCache[fastq_seq] = new_variant + match_name = 'variant_' + new_variant['best_match_name'] + if READ_LENGTH == 0: + READ_LENGTH = len(new_variant[match_name]['aln_seq']) + N_GLOBAL_SUBS += new_variant[match_name]['substitution_n'] + new_variant[match_name]['substitutions_outside_window'] + N_SUBS_OUTSIDE_WINDOW += new_variant[match_name]['substitutions_outside_window'] + N_MODS_IN_WINDOW += new_variant[match_name]['mods_in_window'] + N_MODS_OUTSIDE_WINDOW += new_variant[match_name]['mods_outside_window'] + if new_variant[match_name]['irregular_ends']: + N_READS_IRREGULAR_ENDS += 1 + output_sam = output_bam+".sam" cmd = 'samtools view -Sb '+output_sam + '>'+output_bam + ' && samtools index ' + output_bam bam_status=sb.call(cmd, shell=True) @@ -663,14 +776,21 @@ def process_bam(bam_filename, bam_chr_loc, output_bam, variantCache, ref_names, ) info("Finished reads; N_TOT_READS: %d N_COMPUTED_ALN: %d N_CACHED_ALN: %d N_COMPUTED_NOTALN: %d N_CACHED_NOTALN: %d"%(N_TOT_READS, N_COMPUTED_ALN, N_CACHED_ALN, N_COMPUTED_NOTALN, N_CACHED_NOTALN)) - aln_stats = {"N_TOT_READS": N_TOT_READS, - "N_CACHED_ALN": N_CACHED_ALN, - "N_CACHED_NOTALN": N_CACHED_NOTALN, - "N_COMPUTED_ALN": N_COMPUTED_ALN, - "N_COMPUTED_NOTALN": N_COMPUTED_NOTALN, + aln_stats = {"N_TOT_READS" : N_TOT_READS, + "N_CACHED_ALN" : N_CACHED_ALN, + "N_CACHED_NOTALN" : N_CACHED_NOTALN, + "N_COMPUTED_ALN" : N_COMPUTED_ALN, + "N_COMPUTED_NOTALN" : N_COMPUTED_NOTALN, + "N_GLOBAL_SUBS": N_GLOBAL_SUBS, + "N_SUBS_OUTSIDE_WINDOW": N_SUBS_OUTSIDE_WINDOW, + "N_MODS_IN_WINDOW": N_MODS_IN_WINDOW, + "N_MODS_OUTSIDE_WINDOW": N_MODS_OUTSIDE_WINDOW, + "N_READS_IRREGULAR_ENDS": N_READS_IRREGULAR_ENDS, + "READ_LENGTH": READ_LENGTH } return(aln_stats) + def process_fastq_write_out(fastq_input, fastq_output, variantCache, ref_names, refs, args): """ process_fastq_write_out processes each of the reads contained in a fastq input file, given a cache of pre-computed variants. All reads are read in, analyzed, and written to output with annotation @@ -689,6 +809,13 @@ def process_fastq_write_out(fastq_input, fastq_output, variantCache, ref_names, N_COMPUTED_ALN = 0 # not in cache, aligned to at least 1 sequence with min cutoff N_COMPUTED_NOTALN = 0 #not in cache, not aligned to any sequence with min cutoff + N_GLOBAL_SUBS = 0 #number of substitutions across all reads - indicator of sequencing quality + N_SUBS_OUTSIDE_WINDOW = 0 + N_MODS_IN_WINDOW = 0 #number of modifications found inside the quantification window + N_MODS_OUTSIDE_WINDOW = 0 #number of modifications found outside the quantification window + N_READS_IRREGULAR_ENDS = 0 #number of reads with modifications at the 0 or -1 position + READ_LENGTH = 0 + aln_matrix_loc = os.path.join(_ROOT, args.needleman_wunsch_aln_matrix_loc) CRISPRessoShared.check_file(aln_matrix_loc) aln_matrix = CRISPResso2Align.read_matrix(aln_matrix_loc) @@ -725,6 +852,13 @@ def process_fastq_write_out(fastq_input, fastq_output, variantCache, ref_names, elif fastq_seq in variantCache: #if the sequence is already associated with a variant in the variant cache, pull it out N_CACHED_ALN+=1 variantCache[fastq_seq]['count'] += 1 + match_name = "variant_" + variantCache[fastq_seq]['best_match_name'] + N_GLOBAL_SUBS += variantCache[fastq_seq][match_name]['substitution_n'] + variantCache[fastq_seq][match_name]['substitutions_outside_window'] + N_SUBS_OUTSIDE_WINDOW += variantCache[fastq_seq][match_name]['substitutions_outside_window'] + N_MODS_IN_WINDOW += variantCache[fastq_seq][match_name]['mods_in_window'] + N_MODS_OUTSIDE_WINDOW += variantCache[fastq_seq][match_name]['mods_outside_window'] + if variantCache[fastq_seq][match_name]['irregular_ends']: + N_READS_IRREGULAR_ENDS += 1 fastq_out_handle.write(fastq_id+fastq_seq+"\n"+fastq_plus+variantCache[fastq_seq]['crispresso2_annotation']+"\n"+fastq_qual) #otherwise, create a new variant object, and put it in the cache @@ -775,6 +909,15 @@ def process_fastq_write_out(fastq_input, fastq_output, variantCache, ref_names, fastq_out_handle.write(fastq_id+fastq_seq+"\n"+fastq_plus+crispresso2_annotation+"\n"+fastq_qual) variantCache[fastq_seq] = new_variant + match_name = 'variant_' + new_variant['best_match_name'] + if READ_LENGTH == 0: + READ_LENGTH = len(new_variant[match_name]['aln_seq']) + N_GLOBAL_SUBS += new_variant[match_name]['substitution_n'] + new_variant[match_name]['substitutions_outside_window'] + N_SUBS_OUTSIDE_WINDOW += new_variant[match_name]['substitutions_outside_window'] + N_MODS_IN_WINDOW += new_variant[match_name]['mods_in_window'] + N_MODS_OUTSIDE_WINDOW += new_variant[match_name]['mods_outside_window'] + if new_variant[match_name]['irregular_ends']: + N_READS_IRREGULAR_ENDS += 1 #last step of loop = read next line fastq_id = fastq_input_handle.readline() @@ -782,11 +925,17 @@ def process_fastq_write_out(fastq_input, fastq_output, variantCache, ref_names, fastq_out_handle.close() info("Finished reads; N_TOT_READS: %d N_COMPUTED_ALN: %d N_CACHED_ALN: %d N_COMPUTED_NOTALN: %d N_CACHED_NOTALN: %d"%(N_TOT_READS, N_COMPUTED_ALN, N_CACHED_ALN, N_COMPUTED_NOTALN, N_CACHED_NOTALN)) - aln_stats = {"N_TOT_READS": N_TOT_READS, - "N_CACHED_ALN": N_CACHED_ALN, - "N_CACHED_NOTALN": N_CACHED_NOTALN, - "N_COMPUTED_ALN": N_COMPUTED_ALN, - "N_COMPUTED_NOTALN": N_COMPUTED_NOTALN, + aln_stats = {"N_TOT_READS" : N_TOT_READS, + "N_CACHED_ALN" : N_CACHED_ALN, + "N_CACHED_NOTALN" : N_CACHED_NOTALN, + "N_COMPUTED_ALN" : N_COMPUTED_ALN, + "N_COMPUTED_NOTALN" : N_COMPUTED_NOTALN, + "N_GLOBAL_SUBS": N_GLOBAL_SUBS, + "N_SUBS_OUTSIDE_WINDOW": N_SUBS_OUTSIDE_WINDOW, + "N_MODS_IN_WINDOW": N_MODS_IN_WINDOW, + "N_MODS_OUTSIDE_WINDOW": N_MODS_OUTSIDE_WINDOW, + "N_READS_IRREGULAR_ENDS": N_READS_IRREGULAR_ENDS, + "READ_LENGTH": READ_LENGTH } return(aln_stats) @@ -818,6 +967,13 @@ def process_single_fastq_write_bam_out(fastq_input, bam_output, bam_header, vari N_COMPUTED_ALN = 0 # not in cache, aligned to at least 1 sequence with min cutoff N_COMPUTED_NOTALN = 0 # not in cache, not aligned to any sequence with min cutoff + N_GLOBAL_SUBS = 0 #number of substitutions across all reads - indicator of sequencing quality + N_SUBS_OUTSIDE_WINDOW = 0 + N_MODS_IN_WINDOW = 0 #number of modifications found inside the quantification window + N_MODS_OUTSIDE_WINDOW = 0 #number of modifications found outside the quantification window + N_READS_IRREGULAR_ENDS = 0 #number of reads with modifications at the 0 or -1 position + READ_LENGTH = 0 + aln_matrix_loc = os.path.join(_ROOT, args.needleman_wunsch_aln_matrix_loc) CRISPRessoShared.check_file(aln_matrix_loc) aln_matrix = CRISPResso2Align.read_matrix(aln_matrix_loc) @@ -861,6 +1017,13 @@ def process_single_fastq_write_bam_out(fastq_input, bam_output, bam_header, vari elif fastq_seq in variantCache: # if the sequence is already associated with a variant in the variant cache, pull it out N_CACHED_ALN += 1 variantCache[fastq_seq]['count'] += 1 + match_name = "variant_" + variantCache[fastq_seq]['best_match_name'] + N_GLOBAL_SUBS += variantCache[fastq_seq][match_name]['substitution_n'] + variantCache[fastq_seq][match_name]['substitutions_outside_window'] + N_SUBS_OUTSIDE_WINDOW += variantCache[fastq_seq][match_name]['substitutions_outside_window'] + N_MODS_IN_WINDOW += variantCache[fastq_seq][match_name]['mods_in_window'] + N_MODS_OUTSIDE_WINDOW += variantCache[fastq_seq][match_name]['mods_outside_window'] + if variantCache[fastq_seq][match_name]['irregular_ends']: + N_READS_IRREGULAR_ENDS += 1 new_sam_entry = variantCache[fastq_seq]['sam_entry'][:] new_sam_entry[0] = fastq_id new_sam_entry[10] = fastq_qual @@ -973,12 +1136,20 @@ def process_single_fastq_write_bam_out(fastq_input, bam_output, bam_header, vari sam_out_handle.write("\t".join(new_sam_entry)+"\n") # write cached alignment with modified read id and qual variantCache[fastq_seq] = new_variant + match_name = 'variant_' + new_variant['best_match_name'] + if READ_LENGTH == 0: + READ_LENGTH = len(new_variant[match_name]['aln_seq']) + N_GLOBAL_SUBS += new_variant[match_name]['substitution_n'] + new_variant[match_name]['substitutions_outside_window'] + N_SUBS_OUTSIDE_WINDOW += new_variant[match_name]['substitutions_outside_window'] + N_MODS_IN_WINDOW += new_variant[match_name]['mods_in_window'] + N_MODS_OUTSIDE_WINDOW += new_variant[match_name]['mods_outside_window'] + if new_variant[match_name]['irregular_ends']: + N_READS_IRREGULAR_ENDS += 1 #last step of loop = read next line fastq_id = fastq_input_handle.readline().strip()[1:] fastq_input_handle.close() sam_out_handle.close() - sort_and_index_cmd = 'samtools sort ' + sam_out + ' -o ' + bam_output + ' && samtools index ' + bam_output sort_bam_status = sb.call(sort_and_index_cmd, shell=True) if sort_bam_status: @@ -990,11 +1161,17 @@ def process_single_fastq_write_bam_out(fastq_input, bam_output, bam_header, vari os.remove(sam_out) info("Finished reads; N_TOT_READS: %d N_COMPUTED_ALN: %d N_CACHED_ALN: %d N_COMPUTED_NOTALN: %d N_CACHED_NOTALN: %d"%(N_TOT_READS, N_COMPUTED_ALN, N_CACHED_ALN, N_COMPUTED_NOTALN, N_CACHED_NOTALN)) - aln_stats = {"N_TOT_READS": N_TOT_READS, - "N_CACHED_ALN": N_CACHED_ALN, - "N_CACHED_NOTALN": N_CACHED_NOTALN, - "N_COMPUTED_ALN": N_COMPUTED_ALN, - "N_COMPUTED_NOTALN": N_COMPUTED_NOTALN, + aln_stats = {"N_TOT_READS" : N_TOT_READS, + "N_CACHED_ALN" : N_CACHED_ALN, + "N_CACHED_NOTALN" : N_CACHED_NOTALN, + "N_COMPUTED_ALN" : N_COMPUTED_ALN, + "N_COMPUTED_NOTALN" : N_COMPUTED_NOTALN, + "N_GLOBAL_SUBS": N_GLOBAL_SUBS, + "N_SUBS_OUTSIDE_WINDOW": N_SUBS_OUTSIDE_WINDOW, + "N_MODS_IN_WINDOW": N_MODS_IN_WINDOW, + "N_MODS_OUTSIDE_WINDOW": N_MODS_OUTSIDE_WINDOW, + "N_READS_IRREGULAR_ENDS": N_READS_IRREGULAR_ENDS, + "READ_LENGTH": READ_LENGTH } return(aln_stats) @@ -1092,7 +1269,7 @@ def print_stacktrace_if_debug(): sys.exit() - arg_parser = CRISPRessoShared.getCRISPRessoArgParser() + arg_parser = CRISPRessoShared.getCRISPRessoArgParser("Core") args = arg_parser.parse_args() CRISPRessoShared.set_console_log_level(logger, args.verbosity, args.debug) @@ -1125,7 +1302,7 @@ def print_stacktrace_if_debug(): with open(log_filename, 'w+') as outfile: outfile.write('CRISPResso version %s\n[Command used]:\n%s\n\n[Execution log]:\n' %(CRISPRessoShared.__version__, crispresso_cmd_to_write)) - logger.addHandler(CRISPRessoShared.StatusHandler(_jp('CRISPResso_status.txt'))) + logger.addHandler(CRISPRessoShared.StatusHandler(_jp('CRISPResso_status.json'))) aln_matrix_loc = os.path.join(_ROOT, "EDNAFULL") CRISPRessoShared.check_file(aln_matrix_loc) @@ -1159,7 +1336,7 @@ def print_stacktrace_if_debug(): if args.amplicon_seq is None and args.auto is False: arg_parser.print_help() - raise CRISPRessoShared.BadParameterException('Please provide an amplicon sequence for analysis using the --amplicon_seq parameter.') + raise CRISPRessoShared.BadParameterException('Please provide an amplicon sequence for analysis using the --amplicon_seq parameter or use the --auto parameter to automatically assign amplicon to most common read.') if (args.needleman_wunsch_gap_open > 0): raise CRISPRessoShared.BadParameterException("Needleman Wunsch gap open penalty must be <= 0") @@ -1167,6 +1344,13 @@ def print_stacktrace_if_debug(): raise CRISPRessoShared.BadParameterException("Needleman Wunsch gap extend penalty must be <= 0") + if args.use_matplotlib or not C2PRO_INSTALLED: + from CRISPResso2 import CRISPRessoPlot + else: + from CRISPRessoPro import plot as CRISPRessoPlot + CRISPRessoPlot.setMatplotlibDefaults() + + #create output directory crispresso2_info_file = os.path.join(OUTPUT_DIRECTORY, 'CRISPResso2_info.json') crispresso2_info = {'running_info': {}, 'results': {'alignment_stats': {}, 'general_plots': {}}} #keep track of all information for this run to be pickled and saved at the end of the run @@ -1299,6 +1483,7 @@ def rreplace(s, old, new): info('Inferring reference amplicon sequence..', {'percent_complete': 1}) + check_fastp() auto_fastq_r1 = args.fastq_r1 #paths to fastq files for performing auto functions auto_fastq_r2 = args.fastq_r2 if args.bam_input != "": #if input is a bam, create temp files with reads for processing here @@ -1321,8 +1506,7 @@ def rreplace(s, old, new): fastq_r1=auto_fastq_r1, fastq_r2=auto_fastq_r2, number_of_reads_to_consider=number_of_reads_to_consider, - flash_command=args.flash_command, - max_paired_end_reads_overlap=args.max_paired_end_reads_overlap, + fastp_command=args.fastp_command, min_paired_end_reads_overlap=args.min_paired_end_reads_overlap, aln_matrix=aln_matrix, needleman_wunsch_gap_open=args.needleman_wunsch_gap_open, @@ -1350,8 +1534,7 @@ def rreplace(s, old, new): fastq_r1=auto_fastq_r1, fastq_r2=auto_fastq_r2, number_of_reads_to_consider=number_of_reads_to_consider, - flash_command=args.flash_command, - max_paired_end_reads_overlap=args.max_paired_end_reads_overlap, + fastp_command=args.fastp_command, min_paired_end_reads_overlap=args.min_paired_end_reads_overlap, exclude_bp_from_left=args.exclude_bp_from_left, exclude_bp_from_right=args.exclude_bp_from_right, @@ -1389,7 +1572,7 @@ def rreplace(s, old, new): ) else: #not auto - amplicon_seq_arr = args.amplicon_seq.split(",") + amplicon_seq_arr = list(map(lambda x: x.upper(), args.amplicon_seq.split(","))) amplicon_name_arr = args.amplicon_name.split(",") #split on commas, only accept empty values amplicon_min_alignment_score_arr = [float(x) for x in args.amplicon_min_alignment_score.split(",") if x] @@ -1665,20 +1848,17 @@ def get_prime_editing_guides(this_amp_seq, this_amp_name, ref0_seq, prime_edited #now that we're done with adding possible guides and amplicons, go through each amplicon and compute quantification windows info('Computing quantification windows', {'percent_complete': 2}) + if C2PRO_INSTALLED: + info(f'CRISPRessoPro v{CRISPRessoProVersion} installed', {'percent_complete': 3}) + else: + info(f'CRISPRessoPro not installed', {'percent_complete': 3}) found_guide_seq = [False]*len(guides) found_coding_seq = [False]*len(coding_seqs) - max_amplicon_len = 0 #for flash - min_amplicon_len = 99**99 #for flash - for idx, seq in enumerate(amplicon_seq_arr): this_seq = seq.strip().upper() this_seq_length = len(this_seq) - if this_seq_length > max_amplicon_len: - max_amplicon_len = this_seq_length - if this_seq_length < min_amplicon_len: - min_amplicon_len = this_seq_length this_name = 'Amplicon'+str(idx) if idx < len(amplicon_name_arr): @@ -2189,134 +2369,89 @@ def get_prime_editing_guides(this_amp_seq, this_amp_name, ref0_seq, prime_edited raise CRISPRessoShared.BadParameterException('Read trimming options are not available with bam input') elif args.fastq_r1 != '' and args.fastq_r2 == '': #single end reads if not args.trim_sequences: #no trimming or merging required - output_forward_filename=args.fastq_r1 + output_forward_filename = args.fastq_r1 else: + check_fastp() + info('Trimming sequences with fastp...') output_forward_filename=_jp('reads.trimmed.fq.gz') - #Trimming with trimmomatic - cmd='%s SE -phred33 %s %s %s >>%s 2>&1'\ - % (args.trimmomatic_command, args.fastq_r1, - output_forward_filename, - args.trimmomatic_options_string.replace('NexteraPE-PE.fa', 'TruSeq3-SE.fa'), - log_filename) - #print cmd - TRIMMOMATIC_STATUS=sb.call(cmd, shell=True) - - if TRIMMOMATIC_STATUS: - raise CRISPRessoShared.TrimmomaticException('TRIMMOMATIC failed to run, please check the log file.') - crispresso2_info['trimmomatic_command'] = cmd + cmd = '{command} -i {r1} -o {out} {options} --json {json_report} --html {html_report} >> {log} 2>&1'.format( + command=args.fastp_command, + r1=args.fastq_r1, + out=output_forward_filename, + options=args.fastp_options_string, + json_report=_jp('fastp_report.json'), + html_report=_jp('fastp_report.html'), + log=log_filename, + ) + fastp_status = sb.call(cmd, shell=True) + + if fastp_status: + raise CRISPRessoShared.FastpException('FASTP failed to run, please check the log file.') + crispresso2_info['fastp_command'] = cmd files_to_remove += [output_forward_filename] - processed_output_filename=output_forward_filename + info('Done!') + + processed_output_filename = output_forward_filename elif args.fastq_r1 != '' and args.fastq_r2 != '':#paired end reads + processed_output_filename = _jp('oet.extendedFrags.fastq.gz') + not_combined_1_filename = _jp('out.notCombined_1.fastq.gz') + not_combined_2_filename = _jp('out.notCombined_2.fastq.gz') + check_fastp() + info('Processing sequences with fastp...') if not args.trim_sequences: - output_forward_paired_filename=args.fastq_r1 - output_reverse_paired_filename=args.fastq_r2 - else: - info('Trimming sequences with Trimmomatic...') - output_forward_paired_filename=_jp('output_forward_paired.fq.gz') - output_forward_unpaired_filename=_jp('output_forward_unpaired.fq.gz') - output_reverse_paired_filename=_jp('output_reverse_paired.fq.gz') - output_reverse_unpaired_filename=_jp('output_reverse_unpaired.fq.gz') - - #Trimming with trimmomatic - cmd='%s PE -phred33 %s %s %s %s %s %s %s >>%s 2>&1'\ - % (args.trimmomatic_command, - args.fastq_r1, args.fastq_r2, output_forward_paired_filename, - output_forward_unpaired_filename, output_reverse_paired_filename, - output_reverse_unpaired_filename, args.trimmomatic_options_string, log_filename) - #print cmd - TRIMMOMATIC_STATUS=sb.call(cmd, shell=True) - if TRIMMOMATIC_STATUS: - raise CRISPRessoShared.TrimmomaticException('TRIMMOMATIC failed to run, please check the log file.') - crispresso2_info['trimmomatic_command'] = cmd - - files_to_remove += [output_forward_paired_filename] - files_to_remove += [output_reverse_paired_filename] - - info('Done!', {'percent_complete': 6}) - - #for paired-end reads, merge them - info('Estimating average read length...') - if args.debug: - info('Checking average read length from ' + output_forward_paired_filename) - if get_n_reads_fastq(output_forward_paired_filename): - avg_read_length=get_avg_read_length_fastq(output_forward_paired_filename) - if args.debug: - info('Average read length is ' + str(avg_read_length) + ' from ' + output_forward_paired_filename) + args.fastp_options_string += ' --disable_adapter_trimming --disable_trim_poly_g --disable_quality_filtering --disable_length_filtering' else: - raise CRISPRessoShared.NoReadsAfterQualityFilteringException('No reads survived the average or single bp quality filtering.') - - #Merging with Flash - info('Merging paired sequences with Flash...') - min_overlap = args.min_paired_end_reads_overlap - max_overlap = args.max_paired_end_reads_overlap - if args.stringent_flash_merging: - expected_max_overlap=2*avg_read_length - min_amplicon_len - expected_min_overlap=2*avg_read_length - max_amplicon_len - # print('avg read len: ' + str(avg_read_length)) - # print('expected_max_overlap' + str(expected_max_overlap)) - # print('expected_min_overlap' + str(expected_min_overlap)) - # print('min amplicon len:' + str(min_amplicon_len)) - # print('max amplicon len:' + str(max_amplicon_len)) - indel_overlap_tolerance = 10 # magic number bound on how many bp inserted/deleted in ~90% of reads (for flash) - #max overlap is either the entire read (avg_read_length) or the expected amplicon length + indel tolerance - max_overlap = max(10, min(avg_read_length, expected_max_overlap+indel_overlap_tolerance)) - #min overlap is either 4bp (as in crispresso1) or the expected amplicon length - indel tolerance - min_overlap = max(4, expected_min_overlap-indel_overlap_tolerance) - # print('max_overlap: ' + str(max_overlap)) - # print('min_overlap: ' + str(min_overlap)) - # if reads are longer than the amplicon, there is no way to tell flash to have them overlap like this.. - if avg_read_length > min_amplicon_len: - info('Warning: Reads are longer than amplicon.') - min_overlap = avg_read_length-10 - max_overlap = 2*avg_read_length - - output_prefix = "out" - if clean_file_prefix != "": - output_prefix = clean_file_prefix + "out" - cmd='%s "%s" "%s" --min-overlap %d --max-overlap %d --allow-outies -z -d %s -o %s >>%s 2>&1' %\ - (args.flash_command, - output_forward_paired_filename, - output_reverse_paired_filename, - min_overlap, - max_overlap, - OUTPUT_DIRECTORY, - output_prefix, - log_filename) - - info('Running FLASH command: ' + cmd) - crispresso2_info['flash_command'] = cmd - FLASH_STATUS=sb.call(cmd, shell=True) - if FLASH_STATUS: - raise CRISPRessoShared.FlashException('Flash failed to run, please check the log file.') - - flash_hist_filename=_jp('out.hist') - flash_histogram_filename=_jp('out.histogram') - flash_not_combined_1_filename=_jp('out.notCombined_1.fastq.gz') - flash_not_combined_2_filename=_jp('out.notCombined_2.fastq.gz') - - processed_output_filename=_jp('out.extendedFrags.fastq.gz') - if os.path.isfile(processed_output_filename) is False: - raise CRISPRessoShared.FlashException('Flash failed to produce merged reads file, please check the log file.') - - files_to_remove+=[processed_output_filename, flash_hist_filename, flash_histogram_filename,\ - flash_not_combined_1_filename, flash_not_combined_2_filename, _jp('out.hist.innie'), _jp('out.histogram.innie'), _jp('out.histogram.outie'), _jp('out.hist.outie')] - - if (args.force_merge_pairs): - old_flashed_filename = processed_output_filename + args.fastp_options_string += ' --detect_adapter_for_pe' + + fastp_cmd = '{command} -i {r1} -I {r2} --merge --merged_out {out_merged} --unpaired1 {unpaired1} --unpaired2 {unpaired2} --overlap_len_require {min_overlap} --thread {num_threads} --json {json_report} --html {html_report} {options} >> {log} 2>&1'.format( + command=args.fastp_command, + r1=args.fastq_r1, + r2=args.fastq_r2, + out_merged=processed_output_filename, + unpaired1=not_combined_1_filename, + unpaired2=not_combined_2_filename, + min_overlap=args.min_paired_end_reads_overlap, + num_threads=n_processes, + json_report=_jp('fastp_report.json'), + html_report=_jp('fastp_report.html'), + options=args.fastp_options_string, + log=log_filename, + ) + fastp_status = sb.call(fastp_cmd, shell=True) + if fastp_status: + raise CRISPRessoShared.FastpException('Fastp failed to run, please check the log file.') + crispresso2_info['running_info']['fastp_command'] = fastp_cmd + + if not os.path.isfile(processed_output_filename): + raise CRISPRessoShared.FastpException('Fastp failed to produce merged reads file, please check the log file.') + + info('Done!', {'percent_complete': 6}) + + files_to_remove += [ + processed_output_filename, + not_combined_1_filename, + not_combined_2_filename, + ] + + if args.force_merge_pairs: new_merged_filename=_jp('out.forcemerged_uncombined.fastq.gz') - num_reads_force_merged = CRISPRessoShared.force_merge_pairs(flash_not_combined_1_filename, flash_not_combined_2_filename, new_merged_filename) + num_reads_force_merged = CRISPRessoShared.force_merge_pairs(not_combined_1_filename, not_combined_2_filename, new_merged_filename) new_output_filename=_jp('out.forcemerged.fastq.gz') - merge_command = "cat %s %s > %s"%(processed_output_filename, new_merged_filename, new_output_filename) - MERGE_STATUS=sb.call(merge_command, shell=True) - if MERGE_STATUS: - raise FlashException('Force-merging read pairs failed to run, please check the log file.') + merge_command = "cat {0} {1} > {2}".format( + processed_output_filename, new_merged_filename, new_output_filename, + ) + merge_status = sb.call(merge_command, shell=True) + if merge_status: + raise CRISPRessoShared.FastpException('Force-merging read pairs failed to run, please check the log file.') + else: + info(f'Forced {num_reads_force_merged} read paisr together.') processed_output_filename = new_output_filename - files_to_remove+=[new_merged_filename] - files_to_remove+=[new_output_filename] + files_to_remove += [new_merged_filename] + files_to_remove += [new_output_filename] if args.debug: info('Wrote force-merged reads to ' + new_merged_filename) @@ -3432,7 +3567,7 @@ def save_count_vectors_to_file(vectors, vectorNames, refSeq, filename): info('Making Plots...') ############################################################################################################################################### save_png = True - config = CRISPRessoShared.check_custom_config(args) + custom_config = CRISPRessoShared.check_custom_config(args) if args.suppress_report: save_png = False @@ -3511,6 +3646,7 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ 'N_TOTAL': N_TOTAL, 'piechart_plot_root': plot_1b_root, 'barplot_plot_root': plot_1c_root, + 'custom_colors': custom_config['colors'], 'save_png': save_png } crispresso2_info['results']['general_plots']['plot_1b_root'] = os.path.basename(plot_1b_root) @@ -3653,17 +3789,18 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ mod_df_for_plot = modification_percentage_summary_df.copy() mod_df_for_plot.insert(0, 'Batch', ref_name) - plot_root = _jp('2a.'+ref_plot_name + 'Nucleotide_percentage_quilt') + plot_root = _jp('2a.'+ ref_plot_name + 'Nucleotide_percentage_quilt') + pro_output_name = f'plot_{os.path.basename(plot_root)}.json' plot_2a_input = { 'nuc_pct_df': nuc_df_for_plot, 'mod_pct_df': mod_df_for_plot, - 'fig_filename_root': plot_root, + 'fig_filename_root': f'{_jp(pro_output_name)}' if not args.use_matplotlib and C2PRO_INSTALLED else plot_root, 'save_also_png': save_png, 'sgRNA_intervals': sgRNA_intervals, 'sgRNA_names': sgRNA_names, 'sgRNA_mismatches': sgRNA_mismatches, 'quantification_window_idxs': include_idxs_list, - 'custom_colors': config["colors"], + 'custom_colors': custom_config["colors"], } debug('Plotting nucleotide quilt across amplicon') plot(CRISPRessoPlot.plot_nucleotide_quilt, plot_2a_input) @@ -3700,17 +3837,18 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ new_include_idx = [] for x in include_idxs_list: new_include_idx += [x - new_sel_cols_start] - plot_root = _jp('2b.'+ref_plot_name + 'Nucleotide_percentage_quilt_around_' + sgRNA_label) + plot_root = _jp('2b.'+ ref_plot_name + 'Nucleotide_percentage_quilt_around_' + sgRNA_label) + pro_output_name = f'plot_{os.path.basename(plot_root)}.json' plot_2b_input = { 'nuc_pct_df': nuc_df_for_plot.iloc[:, sel_cols], 'mod_pct_df': mod_df_for_plot.iloc[:, sel_cols], - 'fig_filename_root': plot_root, + 'fig_filename_root': f'{_jp(pro_output_name)}' if not args.use_matplotlib and C2PRO_INSTALLED else plot_root, 'save_also_png': save_png, 'sgRNA_intervals': new_sgRNA_intervals, 'sgRNA_names': sgRNA_names, 'sgRNA_mismatches': sgRNA_mismatches, 'quantification_window_idxs': new_include_idx, - 'custom_colors': config["colors"], + 'custom_colors': custom_config["colors"], } debug('Plotting nucleotide distribuition around {0} for {1}'.format(sgRNA_legend, ref_name)) plot(CRISPRessoPlot.plot_nucleotide_quilt, plot_2b_input) @@ -3762,6 +3900,7 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ ), 'plot_root': plot_root, 'save_also_png': save_png, + 'ref_name': ref_name, } debug('Plotting indel size distribution for {0}'.format(ref_name)) plot(CRISPRessoPlot.plot_indel_size_distribution, plot_3a_input) @@ -3843,6 +3982,8 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ 'xmax_ins': xmax_ins, 'xmax_mut': xmax_mut, 'save_also_png': save_png, + 'custom_colors': custom_config["colors"], + 'ref_name' : ref_name, } debug('Plotting frequency deletions/insertions for {0}'.format(ref_name)) plot(CRISPRessoPlot.plot_frequency_deletions_insertions, plot_3b_input) @@ -3888,7 +4029,7 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ ), }, 'plot_root': plot_root, - 'custom_colors': config["colors"], + 'custom_colors': custom_config["colors"], 'save_also_png': save_png, } debug('Plotting amplication modifications for {0}'.format(ref_name)) @@ -3918,7 +4059,7 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ 'Mutation position distribution', ref_name, ), 'plot_root': plot_root, - 'custom_colors': config["colors"], + 'custom_colors': custom_config["colors"], 'save_also_png': save_png, } debug('Plotting modification frequency for {0}'.format(ref_name)) @@ -3947,7 +4088,7 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ ), 'ref_name': ref_name, 'plot_root': plot_root, - 'custom_colors': config["colors"], + 'custom_colors': custom_config["colors"], 'save_also_png': save_png, } debug('Plotting quantification window locations for {0}'.format(ref_name)) @@ -3979,6 +4120,7 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ }, 'plot_root': plot_root, 'save_also_png': save_png, + 'ref_name': ref_name, } debug('Plotting position dependent indel for {0}'.format(ref_name)) plot( @@ -4004,7 +4146,7 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ 'n_total': N_TOTAL, 'ref_len': ref_len, 'ref_name': ref_names[0], - 'custom_colors': config["colors"], + 'custom_colors': custom_config["colors"], 'save_also_png': save_png, } if ref_name == ref_names[0]: @@ -4066,16 +4208,17 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ hdr_nucleotide_percentage_summary_df.rename(columns={'Batch':'Amplicon'}).to_csv(nuc_freq_filename,sep='\t',header=True,index=False) plot_root = _jp('4g.HDR_nucleotide_percentage_quilt') + pro_output_name = f'plot_{os.path.basename(plot_root)}.json' plot_4g_input = { 'nuc_pct_df': hdr_nucleotide_percentage_summary_df, 'mod_pct_df': hdr_modification_percentage_summary_df, - 'fig_filename_root': plot_root, + 'fig_filename_root': f'{_jp(pro_output_name)}' if not args.use_matplotlib and C2PRO_INSTALLED else plot_root, 'save_also_png': save_png, 'sgRNA_intervals': sgRNA_intervals, 'quantification_window_idxs': include_idxs_list, 'sgRNA_names': sgRNA_names, 'sgRNA_mismatches': sgRNA_mismatches, - 'custom_colors': config["colors"], + 'custom_colors': custom_config["colors"], } debug('Plotting HDR nucleotide quilt') plot(CRISPRessoPlot.plot_nucleotide_quilt, plot_4g_input) @@ -4124,6 +4267,7 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ 'ref_name': ref_name, 'plot_root': plot_root, 'save_also_png': save_png, + 'custom_colors': custom_config['colors'], } debug('Plotting frameshift analysis for {0}'.format(ref_name)) plot(CRISPRessoPlot.plot_frameshift_analysis, plot_5_input) @@ -4149,6 +4293,7 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ 'plot_root': plot_root, 'save_also_png': save_png, + 'ref_name': ref_name, } debug('Plotting frameshift frequency for {0}'.format(ref_name)) plot(CRISPRessoPlot.plot_frameshift_frequency, plot_6_input) @@ -4176,8 +4321,9 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ ref_name, ), 'plot_root': plot_root, - 'custom_colors': config["colors"], + 'custom_colors': custom_config["colors"], 'save_also_png': save_png, + 'ref_name': ref_name, } debug('Plotting non-coding mutation positions for {0}'.format(ref_name)) plot(CRISPRessoPlot.plot_non_coding_mutations, plot_7_input) @@ -4191,6 +4337,8 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ 'count_total': count_total, 'plot_root': plot_root, 'save_also_png': save_png, + 'ref_name': ref_name, + 'custom_colors': custom_config['colors'], } debug('Plotting potential splice sites') plot(CRISPRessoPlot.plot_potential_splice_sites, plot_8_input) @@ -4216,7 +4364,8 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ 'fig_filename_root': fig_filename_root, 'save_also_png': save_png, 'quantification_window_idxs': include_idxs_list, - 'custom_colors': config['colors'] + 'custom_colors': custom_config['colors'], + 'ref_name': ref_name, } debug('Plotting substitutions across reference for {0}'.format(ref_name)) plot(CRISPRessoPlot.plot_subs_across_ref, plot_10a_input) @@ -4235,7 +4384,7 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ ), 'fig_filename_root': fig_filename_root, 'save_also_png': save_png, - 'custom_colors': config['colors'] + 'custom_colors': custom_config['colors'] } debug('Plotting substitution frequency barplot for {0}'.format(ref_name)) plot(CRISPRessoPlot.plot_sub_freqs, plot_10b_input) @@ -4250,7 +4399,7 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ 'plot_title': get_plot_title_with_ref_name('Substitution frequency\nin quantification window', ref_name), 'fig_filename_root': fig_filename_root, 'save_also_png': save_png, - 'custom_colors': config['colors'] + 'custom_colors': custom_config['colors'] } debug('Plotting substitution frequency barplot in quantification window for {0}'.format(ref_name)) plot(CRISPRessoPlot.plot_sub_freqs, plot_10c_input) @@ -4333,6 +4482,7 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ 'reference_seq': ref_seq_around_cut, 'df_alleles': df_to_plot, 'fig_filename_root': fig_filename_root, + 'custom_colors': custom_config["colors"], 'MIN_FREQUENCY': args.min_frequency_alleles_around_cut_to_plot, 'MAX_N_ROWS': args.max_rows_alleles_around_cut_to_plot, 'SAVE_ALSO_PNG': save_png, @@ -4341,7 +4491,6 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ 'sgRNA_names': sgRNA_names, 'sgRNA_mismatches': sgRNA_mismatches, 'annotate_wildtype_allele': args.annotate_wildtype_allele, - 'custom_colors': config["colors"], } debug('Plotting allele distribution around cut for {0}'.format(ref_name)) plot(CRISPRessoPlot.plot_alleles_table, plot_9_input) @@ -4428,7 +4577,7 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ 'conversion_nuc_from': args.conversion_nuc_from, 'fig_filename_root': fig_filename_root, 'save_also_png': save_png, - 'custom_colors': config['colors'], + 'custom_colors': custom_config['colors'], } debug('Plotting conversion at {0}s around the {1} for {2}'.format(args.conversion_nuc_from, sgRNA_legend, ref_name)) plot( @@ -4448,7 +4597,7 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ 'conversion_nuc_from': args.conversion_nuc_from, 'fig_filename_root': fig_filename_root, 'save_also_png': save_png, - 'custom_colors': config['colors'] + 'custom_colors': custom_config['colors'] } debug('Plotting non-reference conversion at {0}s around the {1} for {2}'.format(args.conversion_nuc_from, sgRNA_legend, ref_name)) plot( @@ -4471,7 +4620,7 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ 'conversion_nuc_from': args.conversion_nuc_from, 'fig_filename_root': fig_filename_root, 'save_also_png': save_png, - 'custom_colors': config['colors'] + 'custom_colors': custom_config['colors'] } debug('Plotting scaled non-reference conversion at {0}s around the {1} for {2}'.format(args.conversion_nuc_from, sgRNA_legend, ref_name)) plot( @@ -4538,6 +4687,7 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ 'global_non_modified_non_frameshift': global_NON_MODIFIED_NON_FRAMESHIFT, 'plot_root': plot_root, 'save_also_png': save_png, + 'custom_colors': custom_config['colors'], } debug('Plotting global frameshift in-frame mutations pie chart', {'percent_complete': 90}) plot( @@ -4577,6 +4727,7 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ 'global_count_total': global_count_total, 'plot_root': plot_root, 'save_also_png': save_png, + 'custom_colors': custom_config['colors'], } debug('Plotting global potential splice sites pie chart', {'percent_complete': 94}) plot(CRISPRessoPlot.plot_impact_on_splice_sites, plot_8a_input) @@ -4592,7 +4743,7 @@ def count_alternate_alleles(sub_base_vectors, ref_name, ref_sequence, ref_total_ scaffold_insertion_sizes_filename = "" if args.prime_editing_pegRNA_scaffold_seq != "": #first, define the sequence we are looking for (extension plus the first base(s) of the scaffold) - scaffold_dna_seq = CRISPRessoShared.reverse_complement(args.prime_editing_pegRNA_scaffold_seq) + scaffold_dna_seq = CRISPRessoShared.reverse_complement(args.prime_editing_pegRNA_scaffold_seq.upper().replace('U','T')) pe_seq = refs['Prime-edited']['sequence'] pe_scaffold_dna_info = get_pe_scaffold_search(pe_seq, args.prime_editing_pegRNA_extension_seq, args.prime_editing_pegRNA_scaffold_seq, args.prime_editing_pegRNA_scaffold_min_match_length) @@ -4655,16 +4806,17 @@ def get_scaffold_len(row, scaffold_start_loc, scaffold_seq): include_idxs_list = refs[ref_names[0]]['include_idxs'] plot_root = _jp('11a.Prime_editing_nucleotide_percentage_quilt') + pro_output_name = f'plot_{os.path.basename(plot_root)}.json' plot_11a_input = { 'nuc_pct_df': pe_nucleotide_percentage_summary_df, 'mod_pct_df': pe_modification_percentage_summary_df, - 'fig_filename_root': plot_root, + 'fig_filename_root': f'{_jp(pro_output_name)}' if not args.use_matplotlib and C2PRO_INSTALLED else plot_root, 'save_also_png': save_png, 'sgRNA_intervals': sgRNA_intervals, 'sgRNA_names': sgRNA_names, 'sgRNA_mismatches': sgRNA_mismatches, 'quantification_window_idxs': include_idxs_list, - 'custom_colors': config['colors'] + 'custom_colors': custom_config['colors'] } info('Plotting prime editing nucleotide percentage quilt', {'percent_complete': 96}) plot(CRISPRessoPlot.plot_nucleotide_quilt, plot_11a_input) @@ -4714,16 +4866,17 @@ def get_scaffold_len(row, scaffold_start_loc, scaffold_seq): for x in pe_include_idxs_list: new_include_idx += [x - new_sel_cols_start] plot_root = _jp('11b.Nucleotide_percentage_quilt_around_' + sgRNA_label) + pro_output_name = f'plot_{os.path.basename(plot_root)}.json' plot_11b_input = { 'nuc_pct_df': pe_nucleotide_percentage_summary_df.iloc[:, sel_cols], 'mod_pct_df': pe_modification_percentage_summary_df.iloc[:, sel_cols], - 'fig_filename_root': plot_root, + 'fig_filename_root': f'{_jp(pro_output_name)}' if not args.use_matplotlib and C2PRO_INSTALLED else plot_root, 'save_also_png': save_png, 'sgRNA_intervals': new_sgRNA_intervals, 'sgRNA_names': sgRNA_names, 'sgRNA_mismatches': sgRNA_mismatches, 'quantification_window_idxs': new_include_idx, - 'custom_colors': config['colors'] + 'custom_colors': custom_config['colors'] } info('Plotting nucleotide quilt', {'percent_complete': 97}) plot(CRISPRessoPlot.plot_nucleotide_quilt, plot_11b_input) @@ -4803,6 +4956,11 @@ def get_scaffold_len(row, scaffold_start_loc, scaffold_seq): crispresso2_info['running_info']['running_time'] = running_time crispresso2_info['running_info']['running_time_string'] = running_time_string + if args.disable_guardrails: + crispresso2_info['results']['guardrails_htmls'] = [] + else: + crispresso2_info['results']['guardrails_htmls'] = CRISPRessoShared.safety_check(crispresso2_info, aln_stats, custom_config['guardrails']) + if not args.suppress_report: if (args.place_report_in_output_folder): @@ -4833,13 +4991,9 @@ def get_scaffold_len(row, scaffold_start_loc, scaffold_seq): print_stacktrace_if_debug() error('sgRNA error, please check your input.\n\nERROR: %s' % e) sys.exit(2) - except CRISPRessoShared.TrimmomaticException as e: - print_stacktrace_if_debug() - error('Trimming error, please check your input.\n\nERROR: %s' % e) - sys.exit(4) - except CRISPRessoShared.FlashException as e: + except CRISPRessoShared.FastpException as e: print_stacktrace_if_debug() - error('Merging error, please check your input.\n\nERROR: %s' % e) + error('Merging or trimming error, please check your input.\n\nERROR: %s' % e) sys.exit(5) except CRISPRessoShared.BadParameterException as e: print_stacktrace_if_debug() diff --git a/CRISPResso2/CRISPRessoCOREResources.c b/CRISPResso2/CRISPRessoCOREResources.c index 9d3b6102..b312833b 100644 --- a/CRISPResso2/CRISPRessoCOREResources.c +++ b/CRISPResso2/CRISPRessoCOREResources.c @@ -1,21 +1,21 @@ -/* Generated by Cython 3.0.6 */ +/* Generated by Cython 3.0.9 */ /* BEGIN: Cython Metadata { "distutils": { "depends": [ - "/opt/conda/lib/python3.10/site-packages/numpy/core/include/numpy/arrayobject.h", - "/opt/conda/lib/python3.10/site-packages/numpy/core/include/numpy/arrayscalars.h", - "/opt/conda/lib/python3.10/site-packages/numpy/core/include/numpy/ndarrayobject.h", - "/opt/conda/lib/python3.10/site-packages/numpy/core/include/numpy/ndarraytypes.h", - "/opt/conda/lib/python3.10/site-packages/numpy/core/include/numpy/ufuncobject.h" + "/Users/cole/mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/core/include/numpy/arrayobject.h", + "/Users/cole/mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/core/include/numpy/arrayscalars.h", + "/Users/cole/mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/core/include/numpy/ndarrayobject.h", + "/Users/cole/mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/core/include/numpy/ndarraytypes.h", + "/Users/cole/mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/core/include/numpy/ufuncobject.h" ], "extra_compile_args": [ "-w", "-Ofast" ], "include_dirs": [ - "/opt/conda/lib/python3.10/site-packages/numpy/core/include" + "/Users/cole/mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/core/include" ], "name": "CRISPResso2.CRISPRessoCOREResources", "sources": [ @@ -50,10 +50,10 @@ END: Cython Metadata */ #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif -#define CYTHON_ABI "3_0_6" __PYX_EXTRA_ABI_MODULE_NAME +#define CYTHON_ABI "3_0_9" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." -#define CYTHON_HEX_VERSION 0x030006F0 +#define CYTHON_HEX_VERSION 0x030009F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof @@ -595,14 +595,14 @@ END: Cython Metadata */ PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 - PyObject *version_info; // borrowed + PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 - minor_version = 11; // we don't yet need to distinguish between versions > 11 + minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; @@ -660,7 +660,7 @@ END: Cython Metadata */ PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; - PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); // we don't have access to __pyx_empty_bytes here + PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 @@ -746,8 +746,13 @@ END: Cython Metadata */ typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else - #define __Pyx_PyCFunctionFast _PyCFunctionFast - #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords + #if PY_VERSION_HEX >= 0x030d00A4 + # define __Pyx_PyCFunctionFast PyCFunctionFast + # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords + #else + # define __Pyx_PyCFunctionFast _PyCFunctionFast + # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords + #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL @@ -1099,7 +1104,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif -#if PY_VERSION_HEX >= 0x030d00A1 +#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { @@ -1186,7 +1191,7 @@ static CYTHON_INLINE float __PYX_NAN() { #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ - { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } + { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } @@ -1300,24 +1305,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) -{ - const wchar_t *u_end = u; - while (*u_end++) ; - return (size_t)(u_end - u - 1); -} -#else -static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) -{ - const Py_UNICODE *u_end = u; - while (*u_end++) ; - return (size_t)(u_end - u - 1); -} -#endif #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) -#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) -#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) @@ -1367,7 +1355,7 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; - #else // Py < 3.12 + #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) @@ -1520,7 +1508,7 @@ static const char *__pyx_f[] = { /* #### Code section: numeric_typedefs ### */ -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":730 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":730 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -1529,7 +1517,7 @@ static const char *__pyx_f[] = { */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":731 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":731 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -1538,7 +1526,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":732 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":732 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -1547,7 +1535,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":733 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":733 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -1556,7 +1544,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":737 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":737 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< @@ -1565,7 +1553,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":738 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":738 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -1574,7 +1562,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":739 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":739 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -1583,7 +1571,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":740 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":740 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -1592,7 +1580,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":744 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":744 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< @@ -1601,7 +1589,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":745 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":745 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -1610,7 +1598,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":754 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":754 * # The int types are mapped a bit surprising -- * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t # <<<<<<<<<<<<<< @@ -1619,7 +1607,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_long __pyx_t_5numpy_int_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":755 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":755 * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< @@ -1628,7 +1616,7 @@ typedef npy_long __pyx_t_5numpy_int_t; */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":757 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":757 * ctypedef npy_longlong longlong_t * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< @@ -1637,7 +1625,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":758 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":758 * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< @@ -1646,7 +1634,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":760 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":760 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -1655,7 +1643,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":761 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":761 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -1664,7 +1652,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":763 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":763 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -1673,7 +1661,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":764 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":764 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -1682,7 +1670,7 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":765 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":765 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< @@ -1719,7 +1707,7 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do /*--- Type declarations ---*/ -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":767 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":767 * ctypedef npy_longdouble longdouble_t * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< @@ -1728,7 +1716,7 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":768 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":768 * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< @@ -1737,7 +1725,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":769 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":769 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< @@ -1746,7 +1734,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":771 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":771 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< @@ -1961,8 +1949,8 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else - #define __Pyx_Arg_NewRef_VARARGS(arg) arg // no-op - #define __Pyx_Arg_XDECREF_VARARGS(arg) // no-op - arg is borrowed + #define __Pyx_Arg_NewRef_VARARGS(arg) arg + #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL @@ -1978,8 +1966,9 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif - #define __Pyx_Arg_NewRef_FASTCALL(arg) arg // no-op, __Pyx_Arg_FASTCALL is direct and this needs - #define __Pyx_Arg_XDECREF_FASTCALL(arg) // no-op - arg was returned from array + #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs + to have the same reference counting */ + #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS @@ -2214,22 +2203,22 @@ static CYTHON_INLINE int __Pyx_IterFinish(void); static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* TypeImport.proto */ -#ifndef __PYX_HAVE_RT_ImportType_proto_3_0_6 -#define __PYX_HAVE_RT_ImportType_proto_3_0_6 +#ifndef __PYX_HAVE_RT_ImportType_proto_3_0_9 +#define __PYX_HAVE_RT_ImportType_proto_3_0_9 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L -#define __PYX_GET_STRUCT_ALIGNMENT_3_0_6(s) alignof(s) +#define __PYX_GET_STRUCT_ALIGNMENT_3_0_9(s) alignof(s) #else -#define __PYX_GET_STRUCT_ALIGNMENT_3_0_6(s) sizeof(void*) +#define __PYX_GET_STRUCT_ALIGNMENT_3_0_9(s) sizeof(void*) #endif -enum __Pyx_ImportType_CheckSize_3_0_6 { - __Pyx_ImportType_CheckSize_Error_3_0_6 = 0, - __Pyx_ImportType_CheckSize_Warn_3_0_6 = 1, - __Pyx_ImportType_CheckSize_Ignore_3_0_6 = 2 +enum __Pyx_ImportType_CheckSize_3_0_9 { + __Pyx_ImportType_CheckSize_Error_3_0_9 = 0, + __Pyx_ImportType_CheckSize_Warn_3_0_9 = 1, + __Pyx_ImportType_CheckSize_Ignore_3_0_9 = 2 }; -static PyTypeObject *__Pyx_ImportType_3_0_6(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_6 check_size); +static PyTypeObject *__Pyx_ImportType_3_0_9(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_9 check_size); #endif /* Import.proto */ @@ -2350,7 +2339,7 @@ typedef struct { #endif void *defaults; int defaults_pyobjects; - size_t defaults_size; // used by FusedFunction for copying defaults + size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; @@ -2747,6 +2736,7 @@ static const char __pyx_k_substitution_positions[] = "substitution_positions"; static const char __pyx_k_ResultsSlotsDict___init[] = "ResultsSlotsDict.__init__"; static const char __pyx_k_all_insertion_positions[] = "all_insertion_positions"; static const char __pyx_k_all_substitution_values[] = "all_substitution_values"; +static const char __pyx_k_all_deletion_coordinates[] = "all_deletion_coordinates"; static const char __pyx_k_find_indels_substitutions[] = "find_indels_substitutions"; static const char __pyx_k_ResultsSlotsDict___getitem[] = "ResultsSlotsDict.__getitem__"; static const char __pyx_k_ResultsSlotsDict___setitem[] = "ResultsSlotsDict.__setitem__"; @@ -2848,6 +2838,8 @@ typedef struct { PyObject *__pyx_n_s__4; PyObject *__pyx_n_s_a; PyObject *__pyx_n_s_al; + PyObject *__pyx_n_s_all_deletion_coordinates; + PyObject *__pyx_n_u_all_deletion_coordinates; PyObject *__pyx_n_s_all_deletion_positions; PyObject *__pyx_n_u_all_deletion_positions; PyObject *__pyx_n_s_all_insertion_left_positions; @@ -3056,6 +3048,8 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s__4); Py_CLEAR(clear_module_state->__pyx_n_s_a); Py_CLEAR(clear_module_state->__pyx_n_s_al); + Py_CLEAR(clear_module_state->__pyx_n_s_all_deletion_coordinates); + Py_CLEAR(clear_module_state->__pyx_n_u_all_deletion_coordinates); Py_CLEAR(clear_module_state->__pyx_n_s_all_deletion_positions); Py_CLEAR(clear_module_state->__pyx_n_u_all_deletion_positions); Py_CLEAR(clear_module_state->__pyx_n_s_all_insertion_left_positions); @@ -3242,6 +3236,8 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s__4); Py_VISIT(traverse_module_state->__pyx_n_s_a); Py_VISIT(traverse_module_state->__pyx_n_s_al); + Py_VISIT(traverse_module_state->__pyx_n_s_all_deletion_coordinates); + Py_VISIT(traverse_module_state->__pyx_n_u_all_deletion_coordinates); Py_VISIT(traverse_module_state->__pyx_n_s_all_deletion_positions); Py_VISIT(traverse_module_state->__pyx_n_u_all_deletion_positions); Py_VISIT(traverse_module_state->__pyx_n_s_all_insertion_left_positions); @@ -3458,6 +3454,8 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s__4 __pyx_mstate_global->__pyx_n_s__4 #define __pyx_n_s_a __pyx_mstate_global->__pyx_n_s_a #define __pyx_n_s_al __pyx_mstate_global->__pyx_n_s_al +#define __pyx_n_s_all_deletion_coordinates __pyx_mstate_global->__pyx_n_s_all_deletion_coordinates +#define __pyx_n_u_all_deletion_coordinates __pyx_mstate_global->__pyx_n_u_all_deletion_coordinates #define __pyx_n_s_all_deletion_positions __pyx_mstate_global->__pyx_n_s_all_deletion_positions #define __pyx_n_u_all_deletion_positions __pyx_mstate_global->__pyx_n_u_all_deletion_positions #define __pyx_n_s_all_insertion_left_positions __pyx_mstate_global->__pyx_n_s_all_insertion_left_positions @@ -3592,7 +3590,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19 /* #### Code section: module_code ### */ -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":245 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":245 * * @property * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<< @@ -3603,7 +3601,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self) { PyObject *__pyx_r; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":248 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":248 * """Returns a borrowed reference to the object owning the data/memory. * """ * return PyArray_BASE(self) # <<<<<<<<<<<<<< @@ -3613,7 +3611,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject __pyx_r = PyArray_BASE(__pyx_v_self); goto __pyx_L0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":245 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":245 * * @property * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<< @@ -3626,7 +3624,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":251 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":251 * * @property * cdef inline dtype descr(self): # <<<<<<<<<<<<<< @@ -3640,7 +3638,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray PyArray_Descr *__pyx_t_1; __Pyx_RefNannySetupContext("descr", 1); - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":254 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":254 * """Returns an owned reference to the dtype of the array. * """ * return PyArray_DESCR(self) # <<<<<<<<<<<<<< @@ -3653,7 +3651,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray __pyx_r = ((PyArray_Descr *)__pyx_t_1); goto __pyx_L0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":251 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":251 * * @property * cdef inline dtype descr(self): # <<<<<<<<<<<<<< @@ -3668,7 +3666,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":257 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":257 * * @property * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<< @@ -3679,7 +3677,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self) { int __pyx_r; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":260 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":260 * """Returns the number of dimensions in the array. * """ * return PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -3689,7 +3687,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx __pyx_r = PyArray_NDIM(__pyx_v_self); goto __pyx_L0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":257 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":257 * * @property * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<< @@ -3702,7 +3700,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":263 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":263 * * @property * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<< @@ -3713,7 +3711,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self) { npy_intp *__pyx_r; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":268 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":268 * Can return NULL for 0-dimensional arrays. * """ * return PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -3723,7 +3721,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObjec __pyx_r = PyArray_DIMS(__pyx_v_self); goto __pyx_L0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":263 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":263 * * @property * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<< @@ -3736,7 +3734,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObjec return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":271 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":271 * * @property * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<< @@ -3747,7 +3745,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObjec static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self) { npy_intp *__pyx_r; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":275 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":275 * The number of elements matches the number of dimensions of the array (ndim). * """ * return PyArray_STRIDES(self) # <<<<<<<<<<<<<< @@ -3757,7 +3755,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO __pyx_r = PyArray_STRIDES(__pyx_v_self); goto __pyx_L0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":271 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":271 * * @property * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<< @@ -3770,7 +3768,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":278 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":278 * * @property * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<< @@ -3781,7 +3779,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self) { npy_intp __pyx_r; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":281 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":281 * """Returns the total size (in number of elements) of the array. * """ * return PyArray_SIZE(self) # <<<<<<<<<<<<<< @@ -3791,7 +3789,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject * __pyx_r = PyArray_SIZE(__pyx_v_self); goto __pyx_L0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":278 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":278 * * @property * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<< @@ -3804,7 +3802,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject * return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":284 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":284 * * @property * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<< @@ -3815,7 +3813,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject * static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self) { char *__pyx_r; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":290 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":290 * of `PyArray_DATA()` instead, which returns a 'void*'. * """ * return PyArray_BYTES(self) # <<<<<<<<<<<<<< @@ -3825,7 +3823,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__p __pyx_r = PyArray_BYTES(__pyx_v_self); goto __pyx_L0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":284 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":284 * * @property * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<< @@ -3838,7 +3836,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__p return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":773 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":773 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -3855,7 +3853,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 1); - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":774 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":774 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -3869,7 +3867,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":773 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":773 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -3888,7 +3886,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":776 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":776 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -3905,7 +3903,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 1); - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":777 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":777 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -3919,7 +3917,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":776 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":776 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -3938,7 +3936,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":779 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":779 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -3955,7 +3953,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 1); - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":780 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":780 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -3969,7 +3967,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":779 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":779 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -3988,7 +3986,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":782 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":782 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -4005,7 +4003,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 1); - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":783 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":783 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -4019,7 +4017,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":782 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":782 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -4038,7 +4036,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":785 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":785 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -4055,7 +4053,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 1); - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":786 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":786 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -4069,7 +4067,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":785 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":785 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -4088,7 +4086,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":788 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":788 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -4102,7 +4100,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ int __pyx_t_1; __Pyx_RefNannySetupContext("PyDataType_SHAPE", 1); - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":789 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":789 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -4112,7 +4110,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d); if (__pyx_t_1) { - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":790 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":790 * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape # <<<<<<<<<<<<<< @@ -4124,7 +4122,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); goto __pyx_L0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":789 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":789 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -4133,7 +4131,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ */ } - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":792 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":792 * return d.subarray.shape * else: * return () # <<<<<<<<<<<<<< @@ -4147,7 +4145,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ goto __pyx_L0; } - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":788 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":788 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -4162,7 +4160,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":968 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":968 * int _import_umath() except -1 * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -4176,7 +4174,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a const char *__pyx_filename = NULL; int __pyx_clineno = 0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":969 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":969 * * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<< @@ -4185,7 +4183,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_INCREF(__pyx_v_base); - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":970 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":970 * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<< @@ -4194,7 +4192,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 970, __pyx_L1_error) - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":968 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":968 * int _import_umath() except -1 * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -4209,7 +4207,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __pyx_L0:; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":972 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":972 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -4224,7 +4222,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 1); - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":973 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":973 * * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) # <<<<<<<<<<<<<< @@ -4233,7 +4231,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ __pyx_v_base = PyArray_BASE(__pyx_v_arr); - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":974 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":974 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -4243,7 +4241,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = (__pyx_v_base == NULL); if (__pyx_t_1) { - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":975 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":975 * base = PyArray_BASE(arr) * if base is NULL: * return None # <<<<<<<<<<<<<< @@ -4254,7 +4252,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":974 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":974 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -4263,7 +4261,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ } - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":976 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":976 * if base is NULL: * return None * return base # <<<<<<<<<<<<<< @@ -4275,7 +4273,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = ((PyObject *)__pyx_v_base); goto __pyx_L0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":972 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":972 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -4290,7 +4288,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":980 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":980 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -4314,7 +4312,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_array", 1); - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":981 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":981 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -4330,7 +4328,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":982 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":982 * cdef inline int import_array() except -1: * try: * __pyx_import_array() # <<<<<<<<<<<<<< @@ -4339,7 +4337,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { */ __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 982, __pyx_L3_error) - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":981 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":981 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -4353,7 +4351,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":983 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":983 * try: * __pyx_import_array() * except Exception: # <<<<<<<<<<<<<< @@ -4368,7 +4366,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":984 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":984 * __pyx_import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< @@ -4383,7 +4381,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { } goto __pyx_L5_except_error; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":981 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":981 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -4399,7 +4397,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_L8_try_end:; } - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":980 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":980 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -4422,7 +4420,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":986 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":986 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -4446,7 +4444,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_umath", 1); - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":987 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":987 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -4462,7 +4460,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":988 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":988 * cdef inline int import_umath() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -4471,7 +4469,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { */ __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 988, __pyx_L3_error) - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":987 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":987 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -4485,7 +4483,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":989 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":989 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -4500,7 +4498,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":990 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":990 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -4515,7 +4513,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { } goto __pyx_L5_except_error; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":987 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":987 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -4531,7 +4529,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_L8_try_end:; } - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":986 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":986 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -4554,7 +4552,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":992 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":992 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -4578,7 +4576,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_ufunc", 1); - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":993 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":993 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -4594,7 +4592,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":994 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":994 * cdef inline int import_ufunc() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -4603,7 +4601,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { */ __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 994, __pyx_L3_error) - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":993 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":993 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -4617,7 +4615,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":995 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":995 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -4632,7 +4630,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":996 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":996 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -4647,7 +4645,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { } goto __pyx_L5_except_error; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":993 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":993 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -4663,7 +4661,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_L8_try_end:; } - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":992 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":992 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -4686,7 +4684,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":999 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":999 * * * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< @@ -4697,7 +4695,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) { int __pyx_r; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1011 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1011 * bool * """ * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<< @@ -4707,7 +4705,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type)); goto __pyx_L0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":999 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":999 * * * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< @@ -4720,7 +4718,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1014 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1014 * * * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< @@ -4731,7 +4729,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) { int __pyx_r; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1026 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1026 * bool * """ * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<< @@ -4741,7 +4739,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type)); goto __pyx_L0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1014 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1014 * * * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< @@ -4754,7 +4752,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1029 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1029 * * * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -4765,7 +4763,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) { npy_datetime __pyx_r; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1036 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1036 * also needed. That can be found using `get_datetime64_unit`. * """ * return (obj).obval # <<<<<<<<<<<<<< @@ -4775,7 +4773,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1029 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1029 * * * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -4788,7 +4786,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1039 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1039 * * * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -4799,7 +4797,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) { npy_timedelta __pyx_r; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1043 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1043 * returns the int64 value underlying scalar numpy timedelta64 object * """ * return (obj).obval # <<<<<<<<<<<<<< @@ -4809,7 +4807,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1039 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1039 * * * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -4822,7 +4820,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject return __pyx_r; } -/* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1046 +/* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1046 * * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< @@ -4833,7 +4831,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) { NPY_DATETIMEUNIT __pyx_r; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1050 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1050 * returns the unit part of the dtype for a numpy datetime64 object. * """ * return (obj).obmeta.base # <<<<<<<<<<<<<< @@ -4841,7 +4839,7 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base); goto __pyx_L0; - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1046 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":1046 * * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< @@ -4854,59 +4852,44 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec return __pyx_r; } -/* "CRISPResso2/CRISPRessoCOREResources.pyx":43 - * ) +/* "CRISPResso2/CRISPRessoCOREResources.pyx":18 + * re_find_indels = re.compile("(-*-)") * - * def __init__( # <<<<<<<<<<<<<< - * self, - * all_insertion_positions, + * @cython.boundscheck(False) # <<<<<<<<<<<<<< + * @cython.nonecheck(False) + * @cython.wraparound(False) */ /* Python wrapper */ -static PyObject *__pyx_pw_11CRISPResso2_23CRISPRessoCOREResources_16ResultsSlotsDict_1__init__(PyObject *__pyx_self, +static PyObject *__pyx_pw_11CRISPResso2_23CRISPRessoCOREResources_1find_indels_substitutions(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_11CRISPResso2_23CRISPRessoCOREResources_16ResultsSlotsDict_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11CRISPResso2_23CRISPRessoCOREResources_16ResultsSlotsDict_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_11CRISPResso2_23CRISPRessoCOREResources_16ResultsSlotsDict_1__init__(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_11CRISPResso2_23CRISPRessoCOREResources_1find_indels_substitutions = {"find_indels_substitutions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11CRISPResso2_23CRISPRessoCOREResources_1find_indels_substitutions, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_11CRISPResso2_23CRISPRessoCOREResources_1find_indels_substitutions(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { - PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_all_insertion_positions = 0; - PyObject *__pyx_v_all_insertion_left_positions = 0; - PyObject *__pyx_v_insertion_positions = 0; - PyObject *__pyx_v_insertion_coordinates = 0; - PyObject *__pyx_v_insertion_sizes = 0; - PyObject *__pyx_v_insertion_n = 0; - PyObject *__pyx_v_all_deletion_positions = 0; - PyObject *__pyx_v_deletion_positions = 0; - PyObject *__pyx_v_deletion_coordinates = 0; - PyObject *__pyx_v_deletion_sizes = 0; - PyObject *__pyx_v_deletion_n = 0; - PyObject *__pyx_v_all_substitution_positions = 0; - PyObject *__pyx_v_substitution_positions = 0; - PyObject *__pyx_v_all_substitution_values = 0; - PyObject *__pyx_v_substitution_values = 0; - PyObject *__pyx_v_substitution_n = 0; - PyObject *__pyx_v_ref_positions = 0; + PyObject *__pyx_v_read_seq_al = 0; + PyObject *__pyx_v_ref_seq_al = 0; + PyObject *__pyx_v__include_indx = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[18] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + __Pyx_RefNannySetupContext("find_indels_substitutions (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -4916,40 +4899,10 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_all_insertion_positions,&__pyx_n_s_all_insertion_left_positions,&__pyx_n_s_insertion_positions,&__pyx_n_s_insertion_coordinates,&__pyx_n_s_insertion_sizes,&__pyx_n_s_insertion_n,&__pyx_n_s_all_deletion_positions,&__pyx_n_s_deletion_positions,&__pyx_n_s_deletion_coordinates,&__pyx_n_s_deletion_sizes,&__pyx_n_s_deletion_n,&__pyx_n_s_all_substitution_positions,&__pyx_n_s_substitution_positions,&__pyx_n_s_all_substitution_values,&__pyx_n_s_substitution_values,&__pyx_n_s_substitution_n,&__pyx_n_s_ref_positions,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_read_seq_al,&__pyx_n_s_ref_seq_al,&__pyx_n_s_include_indx,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 18: values[17] = __Pyx_Arg_FASTCALL(__pyx_args, 17); - CYTHON_FALLTHROUGH; - case 17: values[16] = __Pyx_Arg_FASTCALL(__pyx_args, 16); - CYTHON_FALLTHROUGH; - case 16: values[15] = __Pyx_Arg_FASTCALL(__pyx_args, 15); - CYTHON_FALLTHROUGH; - case 15: values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); - CYTHON_FALLTHROUGH; - case 14: values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); - CYTHON_FALLTHROUGH; - case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); - CYTHON_FALLTHROUGH; - case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); - CYTHON_FALLTHROUGH; - case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); - CYTHON_FALLTHROUGH; - case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); - CYTHON_FALLTHROUGH; - case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); - CYTHON_FALLTHROUGH; - case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); - CYTHON_FALLTHROUGH; - case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); - CYTHON_FALLTHROUGH; - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); - CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); @@ -4962,231 +4915,51 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_read_seq_al)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 18, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_all_insertion_positions)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ref_seq_al)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 18, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 18, 18, 1); __PYX_ERR(0, 43, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("find_indels_substitutions", 1, 3, 3, 1); __PYX_ERR(0, 18, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_all_insertion_left_positions)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_include_indx)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 18, 18, 2); __PYX_ERR(0, 43, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_insertion_positions)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 18, 18, 3); __PYX_ERR(0, 43, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_insertion_coordinates)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 18, 18, 4); __PYX_ERR(0, 43, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 5: - if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_insertion_sizes)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 18, 18, 5); __PYX_ERR(0, 43, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 6: - if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_insertion_n)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 18, 18, 6); __PYX_ERR(0, 43, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 7: - if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_all_deletion_positions)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[7]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 18, 18, 7); __PYX_ERR(0, 43, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 8: - if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_deletion_positions)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[8]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 18, 18, 8); __PYX_ERR(0, 43, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 9: - if (likely((values[9] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_deletion_coordinates)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[9]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 18, 18, 9); __PYX_ERR(0, 43, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 10: - if (likely((values[10] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_deletion_sizes)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[10]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 18, 18, 10); __PYX_ERR(0, 43, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 11: - if (likely((values[11] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_deletion_n)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[11]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 18, 18, 11); __PYX_ERR(0, 43, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 12: - if (likely((values[12] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_all_substitution_positions)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[12]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 18, 18, 12); __PYX_ERR(0, 43, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 13: - if (likely((values[13] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_substitution_positions)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[13]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 18, 18, 13); __PYX_ERR(0, 43, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 14: - if (likely((values[14] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_all_substitution_values)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[14]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 18, 18, 14); __PYX_ERR(0, 43, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 15: - if (likely((values[15] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_substitution_values)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[15]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 18, 18, 15); __PYX_ERR(0, 43, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 16: - if (likely((values[16] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_substitution_n)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[16]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 18, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 18, 18, 16); __PYX_ERR(0, 43, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 17: - if (likely((values[17] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ref_positions)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[17]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 18, 18, 17); __PYX_ERR(0, 43, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("find_indels_substitutions", 1, 3, 3, 2); __PYX_ERR(0, 18, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 43, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "find_indels_substitutions") < 0)) __PYX_ERR(0, 18, __pyx_L3_error) } - } else if (unlikely(__pyx_nargs != 18)) { + } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); - values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); - values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); - values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); - values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); - values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); - values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); - values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); - values[13] = __Pyx_Arg_FASTCALL(__pyx_args, 13); - values[14] = __Pyx_Arg_FASTCALL(__pyx_args, 14); - values[15] = __Pyx_Arg_FASTCALL(__pyx_args, 15); - values[16] = __Pyx_Arg_FASTCALL(__pyx_args, 16); - values[17] = __Pyx_Arg_FASTCALL(__pyx_args, 17); - } - __pyx_v_self = values[0]; - __pyx_v_all_insertion_positions = values[1]; - __pyx_v_all_insertion_left_positions = values[2]; - __pyx_v_insertion_positions = values[3]; - __pyx_v_insertion_coordinates = values[4]; - __pyx_v_insertion_sizes = values[5]; - __pyx_v_insertion_n = values[6]; - __pyx_v_all_deletion_positions = values[7]; - __pyx_v_deletion_positions = values[8]; - __pyx_v_deletion_coordinates = values[9]; - __pyx_v_deletion_sizes = values[10]; - __pyx_v_deletion_n = values[11]; - __pyx_v_all_substitution_positions = values[12]; - __pyx_v_substitution_positions = values[13]; - __pyx_v_all_substitution_values = values[14]; - __pyx_v_substitution_values = values[15]; - __pyx_v_substitution_n = values[16]; - __pyx_v_ref_positions = values[17]; + } + __pyx_v_read_seq_al = values[0]; + __pyx_v_ref_seq_al = values[1]; + __pyx_v__include_indx = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 18, 18, __pyx_nargs); __PYX_ERR(0, 43, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("find_indels_substitutions", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 18, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5196,11 +4969,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("CRISPResso2.CRISPRessoCOREResources.ResultsSlotsDict.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("CRISPResso2.CRISPRessoCOREResources.find_indels_substitutions", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_16ResultsSlotsDict___init__(__pyx_self, __pyx_v_self, __pyx_v_all_insertion_positions, __pyx_v_all_insertion_left_positions, __pyx_v_insertion_positions, __pyx_v_insertion_coordinates, __pyx_v_insertion_sizes, __pyx_v_insertion_n, __pyx_v_all_deletion_positions, __pyx_v_deletion_positions, __pyx_v_deletion_coordinates, __pyx_v_deletion_sizes, __pyx_v_deletion_n, __pyx_v_all_substitution_positions, __pyx_v_substitution_positions, __pyx_v_all_substitution_values, __pyx_v_substitution_values, __pyx_v_substitution_n, __pyx_v_ref_positions); + __pyx_r = __pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_find_indels_substitutions(__pyx_self, __pyx_v_read_seq_al, __pyx_v_ref_seq_al, __pyx_v__include_indx); /* function exit code */ { @@ -5213,850 +4986,161 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_16ResultsSlotsDict___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_all_insertion_positions, PyObject *__pyx_v_all_insertion_left_positions, PyObject *__pyx_v_insertion_positions, PyObject *__pyx_v_insertion_coordinates, PyObject *__pyx_v_insertion_sizes, PyObject *__pyx_v_insertion_n, PyObject *__pyx_v_all_deletion_positions, PyObject *__pyx_v_deletion_positions, PyObject *__pyx_v_deletion_coordinates, PyObject *__pyx_v_deletion_sizes, PyObject *__pyx_v_deletion_n, PyObject *__pyx_v_all_substitution_positions, PyObject *__pyx_v_substitution_positions, PyObject *__pyx_v_all_substitution_values, PyObject *__pyx_v_substitution_values, PyObject *__pyx_v_substitution_n, PyObject *__pyx_v_ref_positions) { +static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_find_indels_substitutions(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_read_seq_al, PyObject *__pyx_v_ref_seq_al, PyObject *__pyx_v__include_indx) { + PyObject *__pyx_v_ref_positions = NULL; + PyObject *__pyx_v_all_substitution_positions = NULL; + PyObject *__pyx_v_substitution_positions = NULL; + PyObject *__pyx_v_all_substitution_values = NULL; + PyObject *__pyx_v_substitution_values = NULL; + PyObject *__pyx_v_all_deletion_positions = NULL; + PyObject *__pyx_v_all_deletion_coordinates = NULL; + PyObject *__pyx_v_deletion_positions = NULL; + PyObject *__pyx_v_deletion_coordinates = NULL; + PyObject *__pyx_v_deletion_sizes = NULL; + int __pyx_v_start_deletion; + PyObject *__pyx_v_all_insertion_positions = NULL; + PyObject *__pyx_v_all_insertion_left_positions = NULL; + PyObject *__pyx_v_insertion_positions = NULL; + PyObject *__pyx_v_insertion_coordinates = NULL; + PyObject *__pyx_v_insertion_sizes = NULL; + int __pyx_v_start_insertion; + size_t __pyx_v_seq_len; + PyObject *__pyx_v_include_indx_set = NULL; + CYTHON_UNUSED PyObject *__pyx_v_nucSet = NULL; + int __pyx_v_idx; + int __pyx_v_idx_c; + int __pyx_v_current_insertion_size; + PyObject *__pyx_v_c = NULL; + PyObject *__pyx_v_end_deletion = NULL; + size_t __pyx_v_substitution_n; + size_t __pyx_v_deletion_n; + size_t __pyx_v_insertion_n; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_t_11; + size_t __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":63 - * ref_positions - * ): - * self.all_insertion_positions = all_insertion_positions # <<<<<<<<<<<<<< - * self.all_insertion_left_positions = all_insertion_left_positions - * self.insertion_positions = insertion_positions - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_all_insertion_positions, __pyx_v_all_insertion_positions) < 0) __PYX_ERR(0, 63, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":64 - * ): - * self.all_insertion_positions = all_insertion_positions - * self.all_insertion_left_positions = all_insertion_left_positions # <<<<<<<<<<<<<< - * self.insertion_positions = insertion_positions - * self.insertion_coordinates = insertion_coordinates - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_all_insertion_left_positions, __pyx_v_all_insertion_left_positions) < 0) __PYX_ERR(0, 64, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":65 - * self.all_insertion_positions = all_insertion_positions - * self.all_insertion_left_positions = all_insertion_left_positions - * self.insertion_positions = insertion_positions # <<<<<<<<<<<<<< - * self.insertion_coordinates = insertion_coordinates - * self.insertion_sizes = insertion_sizes - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_insertion_positions, __pyx_v_insertion_positions) < 0) __PYX_ERR(0, 65, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":66 - * self.all_insertion_left_positions = all_insertion_left_positions - * self.insertion_positions = insertion_positions - * self.insertion_coordinates = insertion_coordinates # <<<<<<<<<<<<<< - * self.insertion_sizes = insertion_sizes - * self.insertion_n = insertion_n - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_insertion_coordinates, __pyx_v_insertion_coordinates) < 0) __PYX_ERR(0, 66, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":67 - * self.insertion_positions = insertion_positions - * self.insertion_coordinates = insertion_coordinates - * self.insertion_sizes = insertion_sizes # <<<<<<<<<<<<<< - * self.insertion_n = insertion_n - * self.all_deletion_positions = all_deletion_positions - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_insertion_sizes, __pyx_v_insertion_sizes) < 0) __PYX_ERR(0, 67, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":68 - * self.insertion_coordinates = insertion_coordinates - * self.insertion_sizes = insertion_sizes - * self.insertion_n = insertion_n # <<<<<<<<<<<<<< - * self.all_deletion_positions = all_deletion_positions - * self.deletion_positions = deletion_positions - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_insertion_n, __pyx_v_insertion_n) < 0) __PYX_ERR(0, 68, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":69 - * self.insertion_sizes = insertion_sizes - * self.insertion_n = insertion_n - * self.all_deletion_positions = all_deletion_positions # <<<<<<<<<<<<<< - * self.deletion_positions = deletion_positions - * self.deletion_coordinates = deletion_coordinates - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_all_deletion_positions, __pyx_v_all_deletion_positions) < 0) __PYX_ERR(0, 69, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":70 - * self.insertion_n = insertion_n - * self.all_deletion_positions = all_deletion_positions - * self.deletion_positions = deletion_positions # <<<<<<<<<<<<<< - * self.deletion_coordinates = deletion_coordinates - * self.deletion_sizes = deletion_sizes - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_deletion_positions, __pyx_v_deletion_positions) < 0) __PYX_ERR(0, 70, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":71 - * self.all_deletion_positions = all_deletion_positions - * self.deletion_positions = deletion_positions - * self.deletion_coordinates = deletion_coordinates # <<<<<<<<<<<<<< - * self.deletion_sizes = deletion_sizes - * self.deletion_n = deletion_n - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_deletion_coordinates, __pyx_v_deletion_coordinates) < 0) __PYX_ERR(0, 71, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":72 - * self.deletion_positions = deletion_positions - * self.deletion_coordinates = deletion_coordinates - * self.deletion_sizes = deletion_sizes # <<<<<<<<<<<<<< - * self.deletion_n = deletion_n - * self.all_substitution_positions = all_substitution_positions - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_deletion_sizes, __pyx_v_deletion_sizes) < 0) __PYX_ERR(0, 72, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":73 - * self.deletion_coordinates = deletion_coordinates - * self.deletion_sizes = deletion_sizes - * self.deletion_n = deletion_n # <<<<<<<<<<<<<< - * self.all_substitution_positions = all_substitution_positions - * self.substitution_positions = substitution_positions - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_deletion_n, __pyx_v_deletion_n) < 0) __PYX_ERR(0, 73, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":74 - * self.deletion_sizes = deletion_sizes - * self.deletion_n = deletion_n - * self.all_substitution_positions = all_substitution_positions # <<<<<<<<<<<<<< - * self.substitution_positions = substitution_positions - * self.all_substitution_values = all_substitution_values - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_all_substitution_positions, __pyx_v_all_substitution_positions) < 0) __PYX_ERR(0, 74, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":75 - * self.deletion_n = deletion_n - * self.all_substitution_positions = all_substitution_positions - * self.substitution_positions = substitution_positions # <<<<<<<<<<<<<< - * self.all_substitution_values = all_substitution_values - * self.substitution_values = substitution_values - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_substitution_positions, __pyx_v_substitution_positions) < 0) __PYX_ERR(0, 75, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":76 - * self.all_substitution_positions = all_substitution_positions - * self.substitution_positions = substitution_positions - * self.all_substitution_values = all_substitution_values # <<<<<<<<<<<<<< - * self.substitution_values = substitution_values - * self.substitution_n = substitution_n - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_all_substitution_values, __pyx_v_all_substitution_values) < 0) __PYX_ERR(0, 76, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":77 - * self.substitution_positions = substitution_positions - * self.all_substitution_values = all_substitution_values - * self.substitution_values = substitution_values # <<<<<<<<<<<<<< - * self.substitution_n = substitution_n - * self.ref_positions = ref_positions - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_substitution_values, __pyx_v_substitution_values) < 0) __PYX_ERR(0, 77, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":78 - * self.all_substitution_values = all_substitution_values - * self.substitution_values = substitution_values - * self.substitution_n = substitution_n # <<<<<<<<<<<<<< - * self.ref_positions = ref_positions - * self.ref_name = None - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_substitution_n, __pyx_v_substitution_n) < 0) __PYX_ERR(0, 78, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":79 - * self.substitution_values = substitution_values - * self.substitution_n = substitution_n - * self.ref_positions = ref_positions # <<<<<<<<<<<<<< - * self.ref_name = None - * self.aln_scores = None - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ref_positions, __pyx_v_ref_positions) < 0) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_RefNannySetupContext("find_indels_substitutions", 1); - /* "CRISPResso2/CRISPRessoCOREResources.pyx":80 - * self.substitution_n = substitution_n - * self.ref_positions = ref_positions - * self.ref_name = None # <<<<<<<<<<<<<< - * self.aln_scores = None - * self.classification = None + /* "CRISPResso2/CRISPRessoCOREResources.pyx":32 + * # aln A - T T T G G C C + * # 1 2 3 4-4 5 6 7 8 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__getitem__") < 0)) __PYX_ERR(0, 87, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 2)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - } - __pyx_v_self = values[0]; - __pyx_v_key = values[1]; - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 87, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("CRISPResso2.CRISPRessoCOREResources.ResultsSlotsDict.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_16ResultsSlotsDict_2__getitem__(__pyx_self, __pyx_v_self, __pyx_v_key); - - /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_16ResultsSlotsDict_2__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__getitem__", 1); - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":88 - * - * def __getitem__(self, key): - * return getattr(self, key) # <<<<<<<<<<<<<< - * - * def __setitem__(self, key, value): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetAttr(__pyx_v_self, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":87 - * self.aln_strand = None - * - * def __getitem__(self, key): # <<<<<<<<<<<<<< - * return getattr(self, key) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("CRISPResso2.CRISPRessoCOREResources.ResultsSlotsDict.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "CRISPResso2/CRISPRessoCOREResources.pyx":90 - * return getattr(self, key) - * - * def __setitem__(self, key, value): # <<<<<<<<<<<<<< - * setattr(self, key, value) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_11CRISPResso2_23CRISPRessoCOREResources_16ResultsSlotsDict_5__setitem__(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -static PyMethodDef __pyx_mdef_11CRISPResso2_23CRISPRessoCOREResources_16ResultsSlotsDict_5__setitem__ = {"__setitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11CRISPResso2_23CRISPRessoCOREResources_16ResultsSlotsDict_5__setitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_11CRISPResso2_23CRISPRessoCOREResources_16ResultsSlotsDict_5__setitem__(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_key = 0; - PyObject *__pyx_v_value = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[3] = {0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_value,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_key)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 90, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 90, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setitem__") < 0)) __PYX_ERR(0, 90, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 3)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - } - __pyx_v_self = values[0]; - __pyx_v_key = values[1]; - __pyx_v_value = values[2]; - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 90, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("CRISPResso2.CRISPRessoCOREResources.ResultsSlotsDict.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_16ResultsSlotsDict_4__setitem__(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_value); - - /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_16ResultsSlotsDict_4__setitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__setitem__", 1); - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":91 - * - * def __setitem__(self, key, value): - * setattr(self, key, value) # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_1 = PyObject_SetAttr(__pyx_v_self, __pyx_v_key, __pyx_v_value); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 91, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":90 - * return getattr(self, key) - * - * def __setitem__(self, key, value): # <<<<<<<<<<<<<< - * setattr(self, key, value) - * - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("CRISPResso2.CRISPRessoCOREResources.ResultsSlotsDict.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "CRISPResso2/CRISPRessoCOREResources.pyx":96 - * re_find_indels = re.compile("(-*-)") - * - * @cython.boundscheck(False) # <<<<<<<<<<<<<< - * @cython.nonecheck(False) - * @cython.wraparound(False) - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_11CRISPResso2_23CRISPRessoCOREResources_1find_indels_substitutions(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -static PyMethodDef __pyx_mdef_11CRISPResso2_23CRISPRessoCOREResources_1find_indels_substitutions = {"find_indels_substitutions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11CRISPResso2_23CRISPRessoCOREResources_1find_indels_substitutions, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_11CRISPResso2_23CRISPRessoCOREResources_1find_indels_substitutions(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_read_seq_al = 0; - PyObject *__pyx_v_ref_seq_al = 0; - PyObject *__pyx_v__include_indx = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[3] = {0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("find_indels_substitutions (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_read_seq_al,&__pyx_n_s_ref_seq_al,&__pyx_n_s_include_indx,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_read_seq_al)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ref_seq_al)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("find_indels_substitutions", 1, 3, 3, 1); __PYX_ERR(0, 96, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_include_indx)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("find_indels_substitutions", 1, 3, 3, 2); __PYX_ERR(0, 96, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "find_indels_substitutions") < 0)) __PYX_ERR(0, 96, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 3)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - } - __pyx_v_read_seq_al = values[0]; - __pyx_v_ref_seq_al = values[1]; - __pyx_v__include_indx = values[2]; - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("find_indels_substitutions", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 96, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("CRISPResso2.CRISPRessoCOREResources.find_indels_substitutions", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_find_indels_substitutions(__pyx_self, __pyx_v_read_seq_al, __pyx_v_ref_seq_al, __pyx_v__include_indx); - - /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_find_indels_substitutions(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_read_seq_al, PyObject *__pyx_v_ref_seq_al, PyObject *__pyx_v__include_indx) { - PyObject *__pyx_v_ref_positions = NULL; - PyObject *__pyx_v_all_substitution_positions = NULL; - PyObject *__pyx_v_substitution_positions = NULL; - PyObject *__pyx_v_all_substitution_values = NULL; - PyObject *__pyx_v_substitution_values = NULL; - PyObject *__pyx_v_all_deletion_positions = NULL; - PyObject *__pyx_v_deletion_positions = NULL; - PyObject *__pyx_v_deletion_coordinates = NULL; - PyObject *__pyx_v_deletion_sizes = NULL; - int __pyx_v_start_deletion; - PyObject *__pyx_v_all_insertion_positions = NULL; - PyObject *__pyx_v_all_insertion_left_positions = NULL; - PyObject *__pyx_v_insertion_positions = NULL; - PyObject *__pyx_v_insertion_coordinates = NULL; - PyObject *__pyx_v_insertion_sizes = NULL; - int __pyx_v_start_insertion; - size_t __pyx_v_seq_len; - PyObject *__pyx_v_include_indx_set = NULL; - CYTHON_UNUSED PyObject *__pyx_v_nucSet = NULL; - int __pyx_v_idx; - int __pyx_v_idx_c; - int __pyx_v_current_insertion_size; - PyObject *__pyx_v_c = NULL; - PyObject *__pyx_v_end_deletion = NULL; - size_t __pyx_v_substitution_n; - size_t __pyx_v_deletion_n; - size_t __pyx_v_insertion_n; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - int __pyx_t_3; - PyObject *(*__pyx_t_4)(PyObject *); - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; - int __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - int __pyx_t_10; - int __pyx_t_11; - size_t __pyx_t_12; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("find_indels_substitutions", 1); - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":110 - * # aln A - T T T G G C C - * # 1 2 3 4-4 5 6 7 8 = __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 135, __pyx_L1_error) #else - __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 135, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 58, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 135, __pyx_L1_error) #else - __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } @@ -6493,9 +5577,9 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_find_indels_su __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9)) __PYX_ERR(0, 149, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9)) __PYX_ERR(0, 72, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_8)) __PYX_ERR(0, 149, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_8)) __PYX_ERR(0, 72, __pyx_L1_error); __pyx_t_9 = 0; __pyx_t_8 = 0; __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_insertion_coordinates, __pyx_t_5); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 149, __pyx_L1_error) @@ -6783,7 +5867,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_find_indels_su * elif read_seq_al[idx_c] != '-' and start_deletion != -1: # this is the end of a deletion * end_deletion = ref_positions[idx_c] # <<<<<<<<<<<<<< * all_deletion_positions.extend(range(start_deletion, end_deletion)) - * if include_indx_set.intersection(range(start_deletion, end_deletion)): + * all_deletion_coordinates.append((start_deletion, end_deletion)) */ __pyx_t_5 = PyList_GET_ITEM(__pyx_v_ref_positions, __pyx_v_idx_c); __Pyx_INCREF(__pyx_t_5); @@ -6794,18 +5878,18 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_find_indels_su * elif read_seq_al[idx_c] != '-' and start_deletion != -1: # this is the end of a deletion * end_deletion = ref_positions[idx_c] * all_deletion_positions.extend(range(start_deletion, end_deletion)) # <<<<<<<<<<<<<< + * all_deletion_coordinates.append((start_deletion, end_deletion)) * if include_indx_set.intersection(range(start_deletion, end_deletion)): - * deletion_positions.extend(range(start_deletion, end_deletion)) */ __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_start_deletion); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5)) __PYX_ERR(0, 172, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5)) __PYX_ERR(0, 95, __pyx_L1_error); __Pyx_INCREF(__pyx_v_end_deletion); __Pyx_GIVEREF(__pyx_v_end_deletion); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_end_deletion)) __PYX_ERR(0, 172, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_end_deletion)) __PYX_ERR(0, 95, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); @@ -6816,98 +5900,118 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_find_indels_su /* "CRISPResso2/CRISPRessoCOREResources.pyx":173 * end_deletion = ref_positions[idx_c] * all_deletion_positions.extend(range(start_deletion, end_deletion)) - * if include_indx_set.intersection(range(start_deletion, end_deletion)): # <<<<<<<<<<<<<< + * all_deletion_coordinates.append((start_deletion, end_deletion)) # <<<<<<<<<<<<<< + * if include_indx_set.intersection(range(start_deletion, end_deletion)): * deletion_positions.extend(range(start_deletion, end_deletion)) - * deletion_coordinates.append((start_deletion, end_deletion)) */ __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_start_deletion); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5)) __PYX_ERR(0, 173, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5)) __PYX_ERR(0, 96, __pyx_L1_error); __Pyx_INCREF(__pyx_v_end_deletion); __Pyx_GIVEREF(__pyx_v_end_deletion); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_end_deletion)) __PYX_ERR(0, 173, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_end_deletion)) __PYX_ERR(0, 96, __pyx_L1_error); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 173, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_all_deletion_coordinates, __pyx_t_8); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_intersection, __pyx_v_include_indx_set, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 173, __pyx_L1_error) + + /* "CRISPResso2/CRISPRessoCOREResources.pyx":97 + * all_deletion_positions.extend(range(start_deletion, end_deletion)) + * all_deletion_coordinates.append((start_deletion, end_deletion)) + * if include_indx_set.intersection(range(start_deletion, end_deletion)): # <<<<<<<<<<<<<< + * deletion_positions.extend(range(start_deletion, end_deletion)) + * deletion_coordinates.append((start_deletion, end_deletion)) + */ + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_start_deletion); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_8); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8)) __PYX_ERR(0, 97, __pyx_L1_error); + __Pyx_INCREF(__pyx_v_end_deletion); + __Pyx_GIVEREF(__pyx_v_end_deletion); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_end_deletion)) __PYX_ERR(0, 97, __pyx_L1_error); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_5, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 173, __pyx_L1_error) + __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_intersection, __pyx_v_include_indx_set, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { - /* "CRISPResso2/CRISPRessoCOREResources.pyx":174 - * all_deletion_positions.extend(range(start_deletion, end_deletion)) + /* "CRISPResso2/CRISPRessoCOREResources.pyx":98 + * all_deletion_coordinates.append((start_deletion, end_deletion)) * if include_indx_set.intersection(range(start_deletion, end_deletion)): * deletion_positions.extend(range(start_deletion, end_deletion)) # <<<<<<<<<<<<<< * deletion_coordinates.append((start_deletion, end_deletion)) * deletion_sizes.append(end_deletion - start_deletion) */ - __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_start_deletion); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 174, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_start_deletion); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8)) __PYX_ERR(0, 174, __pyx_L1_error); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_5); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5)) __PYX_ERR(0, 98, __pyx_L1_error); __Pyx_INCREF(__pyx_v_end_deletion); __Pyx_GIVEREF(__pyx_v_end_deletion); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_end_deletion)) __PYX_ERR(0, 174, __pyx_L1_error); - __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_5, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_7 = __Pyx_PyList_Extend(__pyx_v_deletion_positions, __pyx_t_8); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 174, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_end_deletion)) __PYX_ERR(0, 98, __pyx_L1_error); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_7 = __Pyx_PyList_Extend(__pyx_v_deletion_positions, __pyx_t_5); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":175 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":99 * if include_indx_set.intersection(range(start_deletion, end_deletion)): * deletion_positions.extend(range(start_deletion, end_deletion)) * deletion_coordinates.append((start_deletion, end_deletion)) # <<<<<<<<<<<<<< * deletion_sizes.append(end_deletion - start_deletion) * start_deletion = -1 */ - __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_start_deletion); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 175, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_start_deletion); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8)) __PYX_ERR(0, 175, __pyx_L1_error); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 99, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_5); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5)) __PYX_ERR(0, 99, __pyx_L1_error); __Pyx_INCREF(__pyx_v_end_deletion); __Pyx_GIVEREF(__pyx_v_end_deletion); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_end_deletion)) __PYX_ERR(0, 175, __pyx_L1_error); - __pyx_t_8 = 0; - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_deletion_coordinates, __pyx_t_5); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 175, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_end_deletion)) __PYX_ERR(0, 99, __pyx_L1_error); + __pyx_t_5 = 0; + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_deletion_coordinates, __pyx_t_8); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 99, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":176 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":100 * deletion_positions.extend(range(start_deletion, end_deletion)) * deletion_coordinates.append((start_deletion, end_deletion)) * deletion_sizes.append(end_deletion - start_deletion) # <<<<<<<<<<<<<< * start_deletion = -1 * */ - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_start_deletion); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 176, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = PyNumber_Subtract(__pyx_v_end_deletion, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 176, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_start_deletion); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_deletion_sizes, __pyx_t_8); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 176, __pyx_L1_error) + __pyx_t_5 = PyNumber_Subtract(__pyx_v_end_deletion, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_deletion_sizes, __pyx_t_5); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":173 - * end_deletion = ref_positions[idx_c] + /* "CRISPResso2/CRISPRessoCOREResources.pyx":97 * all_deletion_positions.extend(range(start_deletion, end_deletion)) + * all_deletion_coordinates.append((start_deletion, end_deletion)) * if include_indx_set.intersection(range(start_deletion, end_deletion)): # <<<<<<<<<<<<<< * deletion_positions.extend(range(start_deletion, end_deletion)) * deletion_coordinates.append((start_deletion, end_deletion)) */ } - /* "CRISPResso2/CRISPRessoCOREResources.pyx":177 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":101 * deletion_coordinates.append((start_deletion, end_deletion)) * deletion_sizes.append(end_deletion - start_deletion) * start_deletion = -1 # <<<<<<<<<<<<<< @@ -6936,7 +6040,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_find_indels_su } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":179 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":103 * start_deletion = -1 * * if start_deletion != -1: # <<<<<<<<<<<<<< @@ -6946,12 +6050,12 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_find_indels_su __pyx_t_6 = (__pyx_v_start_deletion != -1L); if (__pyx_t_6) { - /* "CRISPResso2/CRISPRessoCOREResources.pyx":180 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":104 * * if start_deletion != -1: * end_deletion = ref_positions[seq_len - 1] # <<<<<<<<<<<<<< * all_deletion_positions.extend(range(start_deletion, end_deletion)) - * if include_indx_set.intersection(range(start_deletion, end_deletion)): + * all_deletion_coordinates.append((start_deletion, end_deletion)) */ __pyx_t_12 = (__pyx_v_seq_len - 1); __pyx_t_1 = PyList_GET_ITEM(__pyx_v_ref_positions, __pyx_t_12); @@ -6959,124 +6063,144 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_find_indels_su __Pyx_XDECREF_SET(__pyx_v_end_deletion, __pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":181 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":105 * if start_deletion != -1: * end_deletion = ref_positions[seq_len - 1] * all_deletion_positions.extend(range(start_deletion, end_deletion)) # <<<<<<<<<<<<<< + * all_deletion_coordinates.append((start_deletion, end_deletion)) * if include_indx_set.intersection(range(start_deletion, end_deletion)): - * deletion_positions.extend(range(start_deletion, end_deletion)) */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_start_deletion); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_start_deletion); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 181, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error); __Pyx_INCREF(__pyx_v_end_deletion); __Pyx_GIVEREF(__pyx_v_end_deletion); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_end_deletion)) __PYX_ERR(0, 181, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_end_deletion)) __PYX_ERR(0, 105, __pyx_L1_error); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_7 = __Pyx_PyList_Extend(__pyx_v_all_deletion_positions, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7 = __Pyx_PyList_Extend(__pyx_v_all_deletion_positions, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":182 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":106 * end_deletion = ref_positions[seq_len - 1] * all_deletion_positions.extend(range(start_deletion, end_deletion)) - * if include_indx_set.intersection(range(start_deletion, end_deletion)): # <<<<<<<<<<<<<< + * all_deletion_coordinates.append((start_deletion, end_deletion)) # <<<<<<<<<<<<<< + * if include_indx_set.intersection(range(start_deletion, end_deletion)): * deletion_positions.extend(range(start_deletion, end_deletion)) - * deletion_coordinates.append((start_deletion, end_deletion)) */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_start_deletion); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_start_deletion); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 182, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error); __Pyx_INCREF(__pyx_v_end_deletion); __Pyx_GIVEREF(__pyx_v_end_deletion); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_end_deletion)) __PYX_ERR(0, 182, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_end_deletion)) __PYX_ERR(0, 106, __pyx_L1_error); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_all_deletion_coordinates, __pyx_t_5); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 106, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "CRISPResso2/CRISPRessoCOREResources.pyx":107 + * all_deletion_positions.extend(range(start_deletion, end_deletion)) + * all_deletion_coordinates.append((start_deletion, end_deletion)) + * if include_indx_set.intersection(range(start_deletion, end_deletion)): # <<<<<<<<<<<<<< + * deletion_positions.extend(range(start_deletion, end_deletion)) + * deletion_coordinates.append((start_deletion, end_deletion)) + */ + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_start_deletion); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_intersection, __pyx_v_include_indx_set, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 182, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_5); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5)) __PYX_ERR(0, 107, __pyx_L1_error); + __Pyx_INCREF(__pyx_v_end_deletion); + __Pyx_GIVEREF(__pyx_v_end_deletion); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_end_deletion)) __PYX_ERR(0, 107, __pyx_L1_error); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_intersection, __pyx_v_include_indx_set, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 182, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_6) { - /* "CRISPResso2/CRISPRessoCOREResources.pyx":183 - * all_deletion_positions.extend(range(start_deletion, end_deletion)) + /* "CRISPResso2/CRISPRessoCOREResources.pyx":108 + * all_deletion_coordinates.append((start_deletion, end_deletion)) * if include_indx_set.intersection(range(start_deletion, end_deletion)): * deletion_positions.extend(range(start_deletion, end_deletion)) # <<<<<<<<<<<<<< * deletion_coordinates.append((start_deletion, end_deletion)) * deletion_sizes.append(end_deletion - start_deletion) */ - __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_start_deletion); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 183, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_start_deletion); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8)) __PYX_ERR(0, 183, __pyx_L1_error); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 108, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error); __Pyx_INCREF(__pyx_v_end_deletion); __Pyx_GIVEREF(__pyx_v_end_deletion); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_end_deletion)) __PYX_ERR(0, 183, __pyx_L1_error); - __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 183, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_end_deletion)) __PYX_ERR(0, 108, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7 = __Pyx_PyList_Extend(__pyx_v_deletion_positions, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __Pyx_PyList_Extend(__pyx_v_deletion_positions, __pyx_t_8); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 183, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":184 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":109 * if include_indx_set.intersection(range(start_deletion, end_deletion)): * deletion_positions.extend(range(start_deletion, end_deletion)) * deletion_coordinates.append((start_deletion, end_deletion)) # <<<<<<<<<<<<<< * deletion_sizes.append(end_deletion - start_deletion) * */ - __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_start_deletion); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 184, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_start_deletion); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8)) __PYX_ERR(0, 184, __pyx_L1_error); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error); __Pyx_INCREF(__pyx_v_end_deletion); __Pyx_GIVEREF(__pyx_v_end_deletion); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_end_deletion)) __PYX_ERR(0, 184, __pyx_L1_error); - __pyx_t_8 = 0; - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_deletion_coordinates, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 184, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_end_deletion)) __PYX_ERR(0, 109, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_deletion_coordinates, __pyx_t_5); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":185 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":110 * deletion_positions.extend(range(start_deletion, end_deletion)) * deletion_coordinates.append((start_deletion, end_deletion)) * deletion_sizes.append(end_deletion - start_deletion) # <<<<<<<<<<<<<< * * cdef size_t substitution_n = len(substitution_positions) */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_start_deletion); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_start_deletion); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyNumber_Subtract(__pyx_v_end_deletion, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = PyNumber_Subtract(__pyx_v_end_deletion, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 185, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_deletion_sizes, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_deletion_sizes, __pyx_t_8); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 185, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":182 - * end_deletion = ref_positions[seq_len - 1] + /* "CRISPResso2/CRISPRessoCOREResources.pyx":107 * all_deletion_positions.extend(range(start_deletion, end_deletion)) + * all_deletion_coordinates.append((start_deletion, end_deletion)) * if include_indx_set.intersection(range(start_deletion, end_deletion)): # <<<<<<<<<<<<<< * deletion_positions.extend(range(start_deletion, end_deletion)) * deletion_coordinates.append((start_deletion, end_deletion)) */ } - /* "CRISPResso2/CRISPRessoCOREResources.pyx":179 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":103 * start_deletion = -1 * * if start_deletion != -1: # <<<<<<<<<<<<<< @@ -7085,44 +6209,44 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_find_indels_su */ } - /* "CRISPResso2/CRISPRessoCOREResources.pyx":187 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":112 * deletion_sizes.append(end_deletion - start_deletion) * * cdef size_t substitution_n = len(substitution_positions) # <<<<<<<<<<<<<< * cdef size_t deletion_n = sum(deletion_sizes) * cdef size_t insertion_n = sum(insertion_sizes) */ - __pyx_t_2 = __Pyx_PyList_GET_SIZE(__pyx_v_substitution_positions); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyList_GET_SIZE(__pyx_v_substitution_positions); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 112, __pyx_L1_error) __pyx_v_substitution_n = __pyx_t_2; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":188 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":113 * * cdef size_t substitution_n = len(substitution_positions) * cdef size_t deletion_n = sum(deletion_sizes) # <<<<<<<<<<<<<< * cdef size_t insertion_n = sum(insertion_sizes) * */ - __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_v_deletion_sizes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 188, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_12 = __Pyx_PyInt_As_size_t(__pyx_t_8); if (unlikely((__pyx_t_12 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 188, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_v_deletion_sizes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_12 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_12 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 113, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_deletion_n = __pyx_t_12; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":189 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":114 * cdef size_t substitution_n = len(substitution_positions) * cdef size_t deletion_n = sum(deletion_sizes) * cdef size_t insertion_n = sum(insertion_sizes) # <<<<<<<<<<<<<< * * # return ResultsSlotsDict( */ - __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_v_insertion_sizes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 189, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_12 = __Pyx_PyInt_As_size_t(__pyx_t_8); if (unlikely((__pyx_t_12 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 189, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_v_insertion_sizes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_12 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_12 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_insertion_n = __pyx_t_12; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":214 - * # ) + /* "CRISPResso2/CRISPRessoCOREResources.pyx":116 + * cdef size_t insertion_n = sum(insertion_sizes) * * return { # <<<<<<<<<<<<<< * 'all_insertion_positions': all_insertion_positions, @@ -7130,151 +6254,160 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_find_indels_su */ __Pyx_XDECREF(__pyx_r); - /* "CRISPResso2/CRISPRessoCOREResources.pyx":215 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":117 * * return { * 'all_insertion_positions': all_insertion_positions, # <<<<<<<<<<<<<< * 'all_insertion_left_positions': all_insertion_left_positions, * 'insertion_positions': insertion_positions, */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(17); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 215, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_u_all_insertion_positions, __pyx_v_all_insertion_positions) < 0) __PYX_ERR(0, 215, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(18); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_all_insertion_positions, __pyx_v_all_insertion_positions) < 0) __PYX_ERR(0, 117, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":216 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":118 * return { * 'all_insertion_positions': all_insertion_positions, * 'all_insertion_left_positions': all_insertion_left_positions, # <<<<<<<<<<<<<< * 'insertion_positions': insertion_positions, * 'insertion_coordinates': insertion_coordinates, */ - if (PyDict_SetItem(__pyx_t_8, __pyx_n_u_all_insertion_left_positions, __pyx_v_all_insertion_left_positions) < 0) __PYX_ERR(0, 215, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_all_insertion_left_positions, __pyx_v_all_insertion_left_positions) < 0) __PYX_ERR(0, 117, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":217 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":119 * 'all_insertion_positions': all_insertion_positions, * 'all_insertion_left_positions': all_insertion_left_positions, * 'insertion_positions': insertion_positions, # <<<<<<<<<<<<<< * 'insertion_coordinates': insertion_coordinates, * 'insertion_sizes': insertion_sizes, */ - if (PyDict_SetItem(__pyx_t_8, __pyx_n_u_insertion_positions, __pyx_v_insertion_positions) < 0) __PYX_ERR(0, 215, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_insertion_positions, __pyx_v_insertion_positions) < 0) __PYX_ERR(0, 117, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":218 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":120 * 'all_insertion_left_positions': all_insertion_left_positions, * 'insertion_positions': insertion_positions, * 'insertion_coordinates': insertion_coordinates, # <<<<<<<<<<<<<< * 'insertion_sizes': insertion_sizes, * 'insertion_n': insertion_n, */ - if (PyDict_SetItem(__pyx_t_8, __pyx_n_u_insertion_coordinates, __pyx_v_insertion_coordinates) < 0) __PYX_ERR(0, 215, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_insertion_coordinates, __pyx_v_insertion_coordinates) < 0) __PYX_ERR(0, 117, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":219 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":121 * 'insertion_positions': insertion_positions, * 'insertion_coordinates': insertion_coordinates, * 'insertion_sizes': insertion_sizes, # <<<<<<<<<<<<<< * 'insertion_n': insertion_n, * */ - if (PyDict_SetItem(__pyx_t_8, __pyx_n_u_insertion_sizes, __pyx_v_insertion_sizes) < 0) __PYX_ERR(0, 215, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_insertion_sizes, __pyx_v_insertion_sizes) < 0) __PYX_ERR(0, 117, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":220 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":122 * 'insertion_coordinates': insertion_coordinates, * 'insertion_sizes': insertion_sizes, * 'insertion_n': insertion_n, # <<<<<<<<<<<<<< * * 'all_deletion_positions': all_deletion_positions, */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_insertion_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_u_insertion_n, __pyx_t_1) < 0) __PYX_ERR(0, 215, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_insertion_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 122, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_insertion_n, __pyx_t_5) < 0) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":222 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":124 * 'insertion_n': insertion_n, * * 'all_deletion_positions': all_deletion_positions, # <<<<<<<<<<<<<< + * 'all_deletion_coordinates': all_deletion_coordinates, * 'deletion_positions': deletion_positions, - * 'deletion_coordinates': deletion_coordinates, */ - if (PyDict_SetItem(__pyx_t_8, __pyx_n_u_all_deletion_positions, __pyx_v_all_deletion_positions) < 0) __PYX_ERR(0, 215, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_all_deletion_positions, __pyx_v_all_deletion_positions) < 0) __PYX_ERR(0, 117, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":223 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":125 * * 'all_deletion_positions': all_deletion_positions, + * 'all_deletion_coordinates': all_deletion_coordinates, # <<<<<<<<<<<<<< + * 'deletion_positions': deletion_positions, + * 'deletion_coordinates': deletion_coordinates, + */ + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_all_deletion_coordinates, __pyx_v_all_deletion_coordinates) < 0) __PYX_ERR(0, 117, __pyx_L1_error) + + /* "CRISPResso2/CRISPRessoCOREResources.pyx":126 + * 'all_deletion_positions': all_deletion_positions, + * 'all_deletion_coordinates': all_deletion_coordinates, * 'deletion_positions': deletion_positions, # <<<<<<<<<<<<<< * 'deletion_coordinates': deletion_coordinates, * 'deletion_sizes': deletion_sizes, */ - if (PyDict_SetItem(__pyx_t_8, __pyx_n_u_deletion_positions, __pyx_v_deletion_positions) < 0) __PYX_ERR(0, 215, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_deletion_positions, __pyx_v_deletion_positions) < 0) __PYX_ERR(0, 117, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":224 - * 'all_deletion_positions': all_deletion_positions, + /* "CRISPResso2/CRISPRessoCOREResources.pyx":127 + * 'all_deletion_coordinates': all_deletion_coordinates, * 'deletion_positions': deletion_positions, * 'deletion_coordinates': deletion_coordinates, # <<<<<<<<<<<<<< * 'deletion_sizes': deletion_sizes, * 'deletion_n': deletion_n, */ - if (PyDict_SetItem(__pyx_t_8, __pyx_n_u_deletion_coordinates, __pyx_v_deletion_coordinates) < 0) __PYX_ERR(0, 215, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_deletion_coordinates, __pyx_v_deletion_coordinates) < 0) __PYX_ERR(0, 117, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":225 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":128 * 'deletion_positions': deletion_positions, * 'deletion_coordinates': deletion_coordinates, * 'deletion_sizes': deletion_sizes, # <<<<<<<<<<<<<< * 'deletion_n': deletion_n, * */ - if (PyDict_SetItem(__pyx_t_8, __pyx_n_u_deletion_sizes, __pyx_v_deletion_sizes) < 0) __PYX_ERR(0, 215, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_deletion_sizes, __pyx_v_deletion_sizes) < 0) __PYX_ERR(0, 117, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":226 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":129 * 'deletion_coordinates': deletion_coordinates, * 'deletion_sizes': deletion_sizes, * 'deletion_n': deletion_n, # <<<<<<<<<<<<<< * * 'all_substitution_positions': all_substitution_positions, */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_deletion_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_u_deletion_n, __pyx_t_1) < 0) __PYX_ERR(0, 215, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_deletion_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_deletion_n, __pyx_t_5) < 0) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":228 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":131 * 'deletion_n': deletion_n, * * 'all_substitution_positions': all_substitution_positions, # <<<<<<<<<<<<<< * 'substitution_positions': substitution_positions, * 'all_substitution_values': np.array(all_substitution_values), */ - if (PyDict_SetItem(__pyx_t_8, __pyx_n_u_all_substitution_positions, __pyx_v_all_substitution_positions) < 0) __PYX_ERR(0, 215, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_all_substitution_positions, __pyx_v_all_substitution_positions) < 0) __PYX_ERR(0, 117, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":229 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":132 * * 'all_substitution_positions': all_substitution_positions, * 'substitution_positions': substitution_positions, # <<<<<<<<<<<<<< * 'all_substitution_values': np.array(all_substitution_values), * 'substitution_values': np.array(substitution_values), */ - if (PyDict_SetItem(__pyx_t_8, __pyx_n_u_substitution_positions, __pyx_v_substitution_positions) < 0) __PYX_ERR(0, 215, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_substitution_positions, __pyx_v_substitution_positions) < 0) __PYX_ERR(0, 117, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":230 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":133 * 'all_substitution_positions': all_substitution_positions, * 'substitution_positions': substitution_positions, * 'all_substitution_values': np.array(all_substitution_values), # <<<<<<<<<<<<<< * 'substitution_values': np.array(substitution_values), * 'substitution_n': substitution_n, */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 230, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_array); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 230, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_array); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = NULL; __pyx_t_3 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_5)) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9); + if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_3 = 1; @@ -7282,78 +6415,78 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_find_indels_su } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_all_substitution_values}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_3, 1+__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_all_substitution_values}; + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_3, 1+__pyx_t_3); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } - if (PyDict_SetItem(__pyx_t_8, __pyx_n_u_all_substitution_values, __pyx_t_1) < 0) __PYX_ERR(0, 215, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_all_substitution_values, __pyx_t_5) < 0) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":231 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":134 * 'substitution_positions': substitution_positions, * 'all_substitution_values': np.array(all_substitution_values), * 'substitution_values': np.array(substitution_values), # <<<<<<<<<<<<<< * 'substitution_n': substitution_n, - * + * 'ref_positions': ref_positions, */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 231, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 231, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_array); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; __pyx_t_3 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5); + if (unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); + __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_3 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_substitution_values}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_3, 1+__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_3, 1+__pyx_t_3); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - if (PyDict_SetItem(__pyx_t_8, __pyx_n_u_substitution_values, __pyx_t_1) < 0) __PYX_ERR(0, 215, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_substitution_values, __pyx_t_5) < 0) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":232 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":135 * 'all_substitution_values': np.array(all_substitution_values), * 'substitution_values': np.array(substitution_values), * 'substitution_n': substitution_n, # <<<<<<<<<<<<<< - * * 'ref_positions': ref_positions, + * } */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_substitution_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_u_substitution_n, __pyx_t_1) < 0) __PYX_ERR(0, 215, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_substitution_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 135, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_substitution_n, __pyx_t_5) < 0) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":234 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":136 + * 'substitution_values': np.array(substitution_values), * 'substitution_n': substitution_n, - * * 'ref_positions': ref_positions, # <<<<<<<<<<<<<< * } - * + * @cython.boundscheck(False) */ - if (PyDict_SetItem(__pyx_t_8, __pyx_n_u_ref_positions, __pyx_v_ref_positions) < 0) __PYX_ERR(0, 215, __pyx_L1_error) - __pyx_r = __pyx_t_8; - __pyx_t_8 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_ref_positions, __pyx_v_ref_positions) < 0) __PYX_ERR(0, 117, __pyx_L1_error) + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":96 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":18 * re_find_indels = re.compile("(-*-)") * * @cython.boundscheck(False) # <<<<<<<<<<<<<< @@ -7376,6 +6509,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_find_indels_su __Pyx_XDECREF(__pyx_v_all_substitution_values); __Pyx_XDECREF(__pyx_v_substitution_values); __Pyx_XDECREF(__pyx_v_all_deletion_positions); + __Pyx_XDECREF(__pyx_v_all_deletion_coordinates); __Pyx_XDECREF(__pyx_v_deletion_positions); __Pyx_XDECREF(__pyx_v_deletion_coordinates); __Pyx_XDECREF(__pyx_v_deletion_sizes); @@ -7393,9 +6527,9 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_find_indels_su return __pyx_r; } -/* "CRISPResso2/CRISPRessoCOREResources.pyx":238 - * - * +/* "CRISPResso2/CRISPRessoCOREResources.pyx":138 + * 'ref_positions': ref_positions, + * } * @cython.boundscheck(False) # <<<<<<<<<<<<<< * @cython.nonecheck(False) * @cython.wraparound(False) @@ -7460,7 +6594,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 138, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -7468,7 +6602,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 138, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("find_indels_substitutions_legacy", 1, 3, 3, 1); __PYX_ERR(0, 238, __pyx_L3_error) } @@ -7478,7 +6612,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 138, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("find_indels_substitutions_legacy", 1, 3, 3, 2); __PYX_ERR(0, 238, __pyx_L3_error) } @@ -7500,7 +6634,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("find_indels_substitutions_legacy", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 238, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("find_indels_substitutions_legacy", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 138, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -7580,7 +6714,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("find_indels_substitutions_legacy", 1); - /* "CRISPResso2/CRISPRessoCOREResources.pyx":243 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":145 * def find_indels_substitutions_legacy(read_seq_al, ref_seq_al, _include_indx): * * cdef char* sub_seq='' # <<<<<<<<<<<<<< @@ -7589,85 +6723,85 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s */ __pyx_v_sub_seq = ((char *)""); - /* "CRISPResso2/CRISPRessoCOREResources.pyx":260 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":162 * # aln A - T T T G G C C * # 1 2 3 4-4 5 6 7 8 = __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 268, __pyx_L1_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 169, __pyx_L1_error) #else - __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 268, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 169, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 268, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 169, __pyx_L1_error) #else - __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } @@ -7729,7 +6863,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 268, __pyx_L1_error) + else __PYX_ERR(0, 169, __pyx_L1_error) } break; } @@ -7740,128 +6874,128 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __pyx_v_idx_c = __pyx_t_2; __pyx_t_2 = (__pyx_t_2 + 1); - /* "CRISPResso2/CRISPRessoCOREResources.pyx":269 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":170 * idx=0 * for idx_c, c in enumerate(ref_seq_al): * if c in nucSet: # <<<<<<<<<<<<<< * ref_positions.append(idx) * if ref_seq_al[idx_c]!=read_seq_al[idx_c] and read_seq_al[idx_c] != '-' and read_seq_al[idx_c] != 'N': */ - __pyx_t_6 = (__Pyx_PySet_ContainsTF(__pyx_v_c, __pyx_v_nucSet, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 269, __pyx_L1_error) + __pyx_t_6 = (__Pyx_PySet_ContainsTF(__pyx_v_c, __pyx_v_nucSet, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 170, __pyx_L1_error) if (__pyx_t_6) { - /* "CRISPResso2/CRISPRessoCOREResources.pyx":270 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":171 * for idx_c, c in enumerate(ref_seq_al): * if c in nucSet: * ref_positions.append(idx) # <<<<<<<<<<<<<< * if ref_seq_al[idx_c]!=read_seq_al[idx_c] and read_seq_al[idx_c] != '-' and read_seq_al[idx_c] != 'N': * all_substitution_positions.append(idx) */ - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 270, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_ref_positions, __pyx_t_5); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 270, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_ref_positions, __pyx_t_5); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":271 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":172 * if c in nucSet: * ref_positions.append(idx) * if ref_seq_al[idx_c]!=read_seq_al[idx_c] and read_seq_al[idx_c] != '-' and read_seq_al[idx_c] != 'N': # <<<<<<<<<<<<<< * all_substitution_positions.append(idx) * all_substitution_values.append(read_seq_al[idx_c]) */ - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_ref_seq_al, __pyx_v_idx_c, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_ref_seq_al, __pyx_v_idx_c, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_read_seq_al, __pyx_v_idx_c, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_read_seq_al, __pyx_v_idx_c, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = PyObject_RichCompare(__pyx_t_5, __pyx_t_8, Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_9 = PyObject_RichCompare(__pyx_t_5, __pyx_t_8, Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_10) { } else { __pyx_t_6 = __pyx_t_10; goto __pyx_L7_bool_binop_done; } - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_read_seq_al, __pyx_v_idx_c, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_read_seq_al, __pyx_v_idx_c, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_t_9, __pyx_kp_u__3, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_t_9, __pyx_kp_u__3, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_10) { } else { __pyx_t_6 = __pyx_t_10; goto __pyx_L7_bool_binop_done; } - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_read_seq_al, __pyx_v_idx_c, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_read_seq_al, __pyx_v_idx_c, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_t_9, __pyx_n_u_N, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_t_9, __pyx_n_u_N, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_6 = __pyx_t_10; __pyx_L7_bool_binop_done:; if (__pyx_t_6) { - /* "CRISPResso2/CRISPRessoCOREResources.pyx":272 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":173 * ref_positions.append(idx) * if ref_seq_al[idx_c]!=read_seq_al[idx_c] and read_seq_al[idx_c] != '-' and read_seq_al[idx_c] != 'N': * all_substitution_positions.append(idx) # <<<<<<<<<<<<<< * all_substitution_values.append(read_seq_al[idx_c]) * if idx in _include_indx: */ - __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 272, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_all_substitution_positions, __pyx_t_9); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 272, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_all_substitution_positions, __pyx_t_9); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 173, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":273 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":174 * if ref_seq_al[idx_c]!=read_seq_al[idx_c] and read_seq_al[idx_c] != '-' and read_seq_al[idx_c] != 'N': * all_substitution_positions.append(idx) * all_substitution_values.append(read_seq_al[idx_c]) # <<<<<<<<<<<<<< * if idx in _include_indx: * substitution_positions.append(idx) */ - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_read_seq_al, __pyx_v_idx_c, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_read_seq_al, __pyx_v_idx_c, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_all_substitution_values, __pyx_t_9); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_all_substitution_values, __pyx_t_9); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":274 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":175 * all_substitution_positions.append(idx) * all_substitution_values.append(read_seq_al[idx_c]) * if idx in _include_indx: # <<<<<<<<<<<<<< * substitution_positions.append(idx) * substitution_values.append(read_seq_al[idx_c]) */ - __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 274, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_t_9, __pyx_v__include_indx, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 274, __pyx_L1_error) + __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_t_9, __pyx_v__include_indx, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_6) { - /* "CRISPResso2/CRISPRessoCOREResources.pyx":275 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":176 * all_substitution_values.append(read_seq_al[idx_c]) * if idx in _include_indx: * substitution_positions.append(idx) # <<<<<<<<<<<<<< * substitution_values.append(read_seq_al[idx_c]) * */ - __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_substitution_positions, __pyx_t_9); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_substitution_positions, __pyx_t_9); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":276 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":177 * if idx in _include_indx: * substitution_positions.append(idx) * substitution_values.append(read_seq_al[idx_c]) # <<<<<<<<<<<<<< * * idx+=1 */ - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_read_seq_al, __pyx_v_idx_c, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 276, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_read_seq_al, __pyx_v_idx_c, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_substitution_values, __pyx_t_9); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 276, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_substitution_values, __pyx_t_9); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":274 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":175 * all_substitution_positions.append(idx) * all_substitution_values.append(read_seq_al[idx_c]) * if idx in _include_indx: # <<<<<<<<<<<<<< @@ -7870,7 +7004,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s */ } - /* "CRISPResso2/CRISPRessoCOREResources.pyx":271 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":172 * if c in nucSet: * ref_positions.append(idx) * if ref_seq_al[idx_c]!=read_seq_al[idx_c] and read_seq_al[idx_c] != '-' and read_seq_al[idx_c] != 'N': # <<<<<<<<<<<<<< @@ -7879,7 +7013,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s */ } - /* "CRISPResso2/CRISPRessoCOREResources.pyx":278 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":179 * substitution_values.append(read_seq_al[idx_c]) * * idx+=1 # <<<<<<<<<<<<<< @@ -7888,7 +7022,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s */ __pyx_v_idx = (__pyx_v_idx + 1); - /* "CRISPResso2/CRISPRessoCOREResources.pyx":269 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":170 * idx=0 * for idx_c, c in enumerate(ref_seq_al): * if c in nucSet: # <<<<<<<<<<<<<< @@ -7898,7 +7032,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s goto __pyx_L5; } - /* "CRISPResso2/CRISPRessoCOREResources.pyx":281 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":182 * * else: * if idx==0: # <<<<<<<<<<<<<< @@ -7909,16 +7043,16 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __pyx_t_6 = (__pyx_v_idx == 0); if (__pyx_t_6) { - /* "CRISPResso2/CRISPRessoCOREResources.pyx":282 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":183 * else: * if idx==0: * ref_positions.append(-1) # <<<<<<<<<<<<<< * else: * ref_positions.append(-idx) */ - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_ref_positions, __pyx_int_neg_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 282, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_ref_positions, __pyx_int_neg_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 183, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":281 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":182 * * else: * if idx==0: # <<<<<<<<<<<<<< @@ -7928,7 +7062,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s goto __pyx_L11; } - /* "CRISPResso2/CRISPRessoCOREResources.pyx":284 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":185 * ref_positions.append(-1) * else: * ref_positions.append(-idx) # <<<<<<<<<<<<<< @@ -7936,16 +7070,16 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s * substitution_n = len(substitution_positions) */ /*else*/ { - __pyx_t_9 = __Pyx_PyInt_From_int((-__pyx_v_idx)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 284, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_From_int((-__pyx_v_idx)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_ref_positions, __pyx_t_9); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 284, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_ref_positions, __pyx_t_9); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __pyx_L11:; } __pyx_L5:; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":268 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":169 * nucSet = set(['A', 'T', 'C', 'G', 'N']) * idx=0 * for idx_c, c in enumerate(ref_seq_al): # <<<<<<<<<<<<<< @@ -7955,146 +7089,146 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":286 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":187 * ref_positions.append(-idx) * * substitution_n = len(substitution_positions) # <<<<<<<<<<<<<< * * #the remainder of positions are with reference to the original reference sequence indexes we calculated above */ - __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_v_substitution_positions); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_v_substitution_positions); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 187, __pyx_L1_error) __pyx_v_substitution_n = __pyx_t_3; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":289 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":190 * * #the remainder of positions are with reference to the original reference sequence indexes we calculated above * all_deletion_positions=[] # <<<<<<<<<<<<<< * deletion_positions=[] * deletion_coordinates=[] */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_all_deletion_positions = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":290 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":191 * #the remainder of positions are with reference to the original reference sequence indexes we calculated above * all_deletion_positions=[] * deletion_positions=[] # <<<<<<<<<<<<<< * deletion_coordinates=[] * deletion_sizes=[] */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_deletion_positions = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":291 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":192 * all_deletion_positions=[] * deletion_positions=[] * deletion_coordinates=[] # <<<<<<<<<<<<<< * deletion_sizes=[] * */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_deletion_coordinates = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":292 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":193 * deletion_positions=[] * deletion_coordinates=[] * deletion_sizes=[] # <<<<<<<<<<<<<< * * all_insertion_positions=[] */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_deletion_sizes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":294 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":195 * deletion_sizes=[] * * all_insertion_positions=[] # <<<<<<<<<<<<<< * all_insertion_left_positions=[] * insertion_positions=[] */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 294, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_all_insertion_positions = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":295 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":196 * * all_insertion_positions=[] * all_insertion_left_positions=[] # <<<<<<<<<<<<<< * insertion_positions=[] * insertion_coordinates = [] */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 295, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_all_insertion_left_positions = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":296 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":197 * all_insertion_positions=[] * all_insertion_left_positions=[] * insertion_positions=[] # <<<<<<<<<<<<<< * insertion_coordinates = [] * insertion_sizes=[] */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_insertion_positions = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":297 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":198 * all_insertion_left_positions=[] * insertion_positions=[] * insertion_coordinates = [] # <<<<<<<<<<<<<< * insertion_sizes=[] * */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_insertion_coordinates = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":298 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":199 * insertion_positions=[] * insertion_coordinates = [] * insertion_sizes=[] # <<<<<<<<<<<<<< * * include_indx_set = set(_include_indx) */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_insertion_sizes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":300 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":201 * insertion_sizes=[] * * include_indx_set = set(_include_indx) # <<<<<<<<<<<<<< * for p in re_find_indels.finditer(read_seq_al): * st,en=p.span() */ - __pyx_t_1 = PySet_New(__pyx_v__include_indx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error) + __pyx_t_1 = PySet_New(__pyx_v__include_indx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_include_indx_set = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":301 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":202 * * include_indx_set = set(_include_indx) * for p in re_find_indels.finditer(read_seq_al): # <<<<<<<<<<<<<< * st,en=p.span() * ref_st = 0 */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_re_find_indels); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 301, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_re_find_indels); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_finditer); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_finditer); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; @@ -8115,7 +7249,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_read_seq_al}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_2, 1+__pyx_t_2); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } @@ -8124,9 +7258,9 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 202, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -8135,28 +7269,28 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 301, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 202, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 202, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 301, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 202, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 202, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -8166,7 +7300,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 301, __pyx_L1_error) + else __PYX_ERR(0, 202, __pyx_L1_error) } break; } @@ -8175,14 +7309,14 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __Pyx_XDECREF_SET(__pyx_v_p, __pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":302 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":203 * include_indx_set = set(_include_indx) * for p in re_find_indels.finditer(read_seq_al): * st,en=p.span() # <<<<<<<<<<<<<< * ref_st = 0 * if st-1 > 0: */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s_span); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s_span); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_5 = NULL; __pyx_t_2 = 0; @@ -8202,7 +7336,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_2, 0+__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -8212,7 +7346,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 302, __pyx_L1_error) + __PYX_ERR(0, 203, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -8225,15 +7359,15 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_5); #else - __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); @@ -8241,7 +7375,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __Pyx_GOTREF(__pyx_t_9); index = 1; __pyx_t_5 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_5)) goto __pyx_L15_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(0, 302, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(0, 203, __pyx_L1_error) __pyx_t_12 = NULL; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L16_unpacking_done; @@ -8249,17 +7383,17 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 302, __pyx_L1_error) + __PYX_ERR(0, 203, __pyx_L1_error) __pyx_L16_unpacking_done:; } - __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_st = __pyx_t_2; __pyx_v_en = __pyx_t_13; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":303 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":204 * for p in re_find_indels.finditer(read_seq_al): * st,en=p.span() * ref_st = 0 # <<<<<<<<<<<<<< @@ -8269,7 +7403,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __Pyx_INCREF(__pyx_int_0); __Pyx_XDECREF_SET(__pyx_v_ref_st, __pyx_int_0); - /* "CRISPResso2/CRISPRessoCOREResources.pyx":304 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":205 * st,en=p.span() * ref_st = 0 * if st-1 > 0: # <<<<<<<<<<<<<< @@ -8279,7 +7413,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __pyx_t_6 = ((__pyx_v_st - 1) > 0); if (__pyx_t_6) { - /* "CRISPResso2/CRISPRessoCOREResources.pyx":305 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":206 * ref_st = 0 * if st-1 > 0: * ref_st = ref_positions[st] # <<<<<<<<<<<<<< @@ -8291,7 +7425,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __Pyx_DECREF_SET(__pyx_v_ref_st, __pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":304 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":205 * st,en=p.span() * ref_st = 0 * if st-1 > 0: # <<<<<<<<<<<<<< @@ -8300,30 +7434,30 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s */ } - /* "CRISPResso2/CRISPRessoCOREResources.pyx":306 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":207 * if st-1 > 0: * ref_st = ref_positions[st] * ref_en = idx-1 # <<<<<<<<<<<<<< * if en < len(ref_positions): * ref_en = ref_positions[en] */ - __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_idx - 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_idx - 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_ref_en, __pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":307 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":208 * ref_st = ref_positions[st] * ref_en = idx-1 * if en < len(ref_positions): # <<<<<<<<<<<<<< * ref_en = ref_positions[en] * all_deletion_positions.extend(range(ref_st,ref_en)) */ - __pyx_t_14 = __Pyx_PyList_GET_SIZE(__pyx_v_ref_positions); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 307, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_GET_SIZE(__pyx_v_ref_positions); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 208, __pyx_L1_error) __pyx_t_6 = (__pyx_v_en < __pyx_t_14); if (__pyx_t_6) { - /* "CRISPResso2/CRISPRessoCOREResources.pyx":308 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":209 * ref_en = idx-1 * if en < len(ref_positions): * ref_en = ref_positions[en] # <<<<<<<<<<<<<< @@ -8335,7 +7469,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __Pyx_DECREF_SET(__pyx_v_ref_en, __pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":307 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":208 * ref_st = ref_positions[st] * ref_en = idx-1 * if en < len(ref_positions): # <<<<<<<<<<<<<< @@ -8344,114 +7478,114 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s */ } - /* "CRISPResso2/CRISPRessoCOREResources.pyx":309 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":210 * if en < len(ref_positions): * ref_en = ref_positions[en] * all_deletion_positions.extend(range(ref_st,ref_en)) # <<<<<<<<<<<<<< * inc_del_pos = include_indx_set.intersection(range(ref_st,ref_en)) * if(len(inc_del_pos)>0): */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_ref_st); __Pyx_GIVEREF(__pyx_v_ref_st); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_ref_st)) __PYX_ERR(0, 309, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_ref_st)) __PYX_ERR(0, 210, __pyx_L1_error); __Pyx_INCREF(__pyx_v_ref_en); __Pyx_GIVEREF(__pyx_v_ref_en); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref_en)) __PYX_ERR(0, 309, __pyx_L1_error); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 309, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref_en)) __PYX_ERR(0, 210, __pyx_L1_error); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __Pyx_PyList_Extend(__pyx_v_all_deletion_positions, __pyx_t_5); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Extend(__pyx_v_all_deletion_positions, __pyx_t_5); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":310 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":211 * ref_en = ref_positions[en] * all_deletion_positions.extend(range(ref_st,ref_en)) * inc_del_pos = include_indx_set.intersection(range(ref_st,ref_en)) # <<<<<<<<<<<<<< * if(len(inc_del_pos)>0): * deletion_positions.extend(range(ref_st,ref_en)) */ - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 310, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_ref_st); __Pyx_GIVEREF(__pyx_v_ref_st); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_ref_st)) __PYX_ERR(0, 310, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_ref_st)) __PYX_ERR(0, 211, __pyx_L1_error); __Pyx_INCREF(__pyx_v_ref_en); __Pyx_GIVEREF(__pyx_v_ref_en); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_ref_en)) __PYX_ERR(0, 310, __pyx_L1_error); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_ref_en)) __PYX_ERR(0, 211, __pyx_L1_error); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_intersection, __pyx_v_include_indx_set, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 310, __pyx_L1_error) + __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_intersection, __pyx_v_include_indx_set, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_inc_del_pos, __pyx_t_5); __pyx_t_5 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":311 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":212 * all_deletion_positions.extend(range(ref_st,ref_en)) * inc_del_pos = include_indx_set.intersection(range(ref_st,ref_en)) * if(len(inc_del_pos)>0): # <<<<<<<<<<<<<< * deletion_positions.extend(range(ref_st,ref_en)) * deletion_coordinates.append((ref_st,ref_en)) */ - __pyx_t_14 = PyObject_Length(__pyx_v_inc_del_pos); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 311, __pyx_L1_error) + __pyx_t_14 = PyObject_Length(__pyx_v_inc_del_pos); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 212, __pyx_L1_error) __pyx_t_6 = (__pyx_t_14 > 0); if (__pyx_t_6) { - /* "CRISPResso2/CRISPRessoCOREResources.pyx":312 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":213 * inc_del_pos = include_indx_set.intersection(range(ref_st,ref_en)) * if(len(inc_del_pos)>0): * deletion_positions.extend(range(ref_st,ref_en)) # <<<<<<<<<<<<<< * deletion_coordinates.append((ref_st,ref_en)) * deletion_sizes.append(en-st) */ - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_ref_st); __Pyx_GIVEREF(__pyx_v_ref_st); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_ref_st)) __PYX_ERR(0, 312, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_ref_st)) __PYX_ERR(0, 213, __pyx_L1_error); __Pyx_INCREF(__pyx_v_ref_en); __Pyx_GIVEREF(__pyx_v_ref_en); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_ref_en)) __PYX_ERR(0, 312, __pyx_L1_error); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_ref_en)) __PYX_ERR(0, 213, __pyx_L1_error); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_7 = __Pyx_PyList_Extend(__pyx_v_deletion_positions, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Extend(__pyx_v_deletion_positions, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":313 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":214 * if(len(inc_del_pos)>0): * deletion_positions.extend(range(ref_st,ref_en)) * deletion_coordinates.append((ref_st,ref_en)) # <<<<<<<<<<<<<< * deletion_sizes.append(en-st) * */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_ref_st); __Pyx_GIVEREF(__pyx_v_ref_st); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_ref_st)) __PYX_ERR(0, 313, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_ref_st)) __PYX_ERR(0, 214, __pyx_L1_error); __Pyx_INCREF(__pyx_v_ref_en); __Pyx_GIVEREF(__pyx_v_ref_en); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref_en)) __PYX_ERR(0, 313, __pyx_L1_error); - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_deletion_coordinates, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 313, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref_en)) __PYX_ERR(0, 214, __pyx_L1_error); + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_deletion_coordinates, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 214, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":314 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":215 * deletion_positions.extend(range(ref_st,ref_en)) * deletion_coordinates.append((ref_st,ref_en)) * deletion_sizes.append(en-st) # <<<<<<<<<<<<<< * * deletion_n = np.sum(deletion_sizes) */ - __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_en - __pyx_v_st)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 314, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_en - __pyx_v_st)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_deletion_sizes, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 314, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_deletion_sizes, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":311 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":212 * all_deletion_positions.extend(range(ref_st,ref_en)) * inc_del_pos = include_indx_set.intersection(range(ref_st,ref_en)) * if(len(inc_del_pos)>0): # <<<<<<<<<<<<<< @@ -8460,7 +7594,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s */ } - /* "CRISPResso2/CRISPRessoCOREResources.pyx":301 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":202 * * include_indx_set = set(_include_indx) * for p in re_find_indels.finditer(read_seq_al): # <<<<<<<<<<<<<< @@ -8470,16 +7604,16 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":316 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":217 * deletion_sizes.append(en-st) * * deletion_n = np.sum(deletion_sizes) # <<<<<<<<<<<<<< * * for p in re_find_indels.finditer(ref_seq_al): */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sum); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 316, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sum); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -8500,23 +7634,23 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_deletion_sizes}; __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_13, 1+__pyx_t_13); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 316, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_v_deletion_n = __pyx_t_8; __pyx_t_8 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":318 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":219 * deletion_n = np.sum(deletion_sizes) * * for p in re_find_indels.finditer(ref_seq_al): # <<<<<<<<<<<<<< * st,en=p.span() * #sometimes insertions run off the end of the reference */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re_find_indels); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 318, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re_find_indels); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_finditer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_finditer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; @@ -8537,7 +7671,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_ref_seq_al}; __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_13, 1+__pyx_t_13); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 318, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } @@ -8546,9 +7680,9 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 219, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; for (;;) { @@ -8557,28 +7691,28 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 318, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 219, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 219, __pyx_L1_error) #else - __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 318, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 219, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 219, __pyx_L1_error) #else - __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif } @@ -8588,7 +7722,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 318, __pyx_L1_error) + else __PYX_ERR(0, 219, __pyx_L1_error) } break; } @@ -8597,14 +7731,14 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __Pyx_XDECREF_SET(__pyx_v_p, __pyx_t_8); __pyx_t_8 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":319 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":220 * * for p in re_find_indels.finditer(ref_seq_al): * st,en=p.span() # <<<<<<<<<<<<<< * #sometimes insertions run off the end of the reference * if st == 0: # if insertion happened before ref */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s_span); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s_span); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = NULL; __pyx_t_13 = 0; @@ -8624,7 +7758,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL}; __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_13, 0+__pyx_t_13); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 319, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -8634,7 +7768,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 319, __pyx_L1_error) + __PYX_ERR(0, 220, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -8647,15 +7781,15 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_9); #else - __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { Py_ssize_t index = -1; - __pyx_t_11 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_11 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); @@ -8663,7 +7797,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_9 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L23_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(0, 319, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(0, 220, __pyx_L1_error) __pyx_t_12 = NULL; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L24_unpacking_done; @@ -8671,17 +7805,17 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 319, __pyx_L1_error) + __PYX_ERR(0, 220, __pyx_L1_error) __pyx_L24_unpacking_done:; } - __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_st = __pyx_t_13; __pyx_v_en = __pyx_t_2; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":321 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":222 * st,en=p.span() * #sometimes insertions run off the end of the reference * if st == 0: # if insertion happened before ref # <<<<<<<<<<<<<< @@ -8691,7 +7825,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __pyx_t_6 = (__pyx_v_st == 0); if (__pyx_t_6) { - /* "CRISPResso2/CRISPRessoCOREResources.pyx":322 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":223 * #sometimes insertions run off the end of the reference * if st == 0: # if insertion happened before ref * continue # <<<<<<<<<<<<<< @@ -8700,7 +7834,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s */ goto __pyx_L21_continue; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":321 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":222 * st,en=p.span() * #sometimes insertions run off the end of the reference * if st == 0: # if insertion happened before ref # <<<<<<<<<<<<<< @@ -8709,18 +7843,18 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s */ } - /* "CRISPResso2/CRISPRessoCOREResources.pyx":323 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":224 * if st == 0: # if insertion happened before ref * continue * if en == len(ref_seq_al): # if insertion happened after ref # <<<<<<<<<<<<<< * continue * ref_st = ref_positions[st-1] */ - __pyx_t_14 = PyObject_Length(__pyx_v_ref_seq_al); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_14 = PyObject_Length(__pyx_v_ref_seq_al); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 224, __pyx_L1_error) __pyx_t_6 = (__pyx_v_en == __pyx_t_14); if (__pyx_t_6) { - /* "CRISPResso2/CRISPRessoCOREResources.pyx":324 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":225 * continue * if en == len(ref_seq_al): # if insertion happened after ref * continue # <<<<<<<<<<<<<< @@ -8729,7 +7863,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s */ goto __pyx_L21_continue; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":323 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":224 * if st == 0: # if insertion happened before ref * continue * if en == len(ref_seq_al): # if insertion happened after ref # <<<<<<<<<<<<<< @@ -8738,7 +7872,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s */ } - /* "CRISPResso2/CRISPRessoCOREResources.pyx":325 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":226 * if en == len(ref_seq_al): # if insertion happened after ref * continue * ref_st = ref_positions[st-1] # <<<<<<<<<<<<<< @@ -8751,7 +7885,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __Pyx_XDECREF_SET(__pyx_v_ref_st, __pyx_t_8); __pyx_t_8 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":326 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":227 * continue * ref_st = ref_positions[st-1] * ref_en = ref_positions[en] # <<<<<<<<<<<<<< @@ -8763,100 +7897,100 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __Pyx_XDECREF_SET(__pyx_v_ref_en, __pyx_t_8); __pyx_t_8 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":328 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":229 * ref_en = ref_positions[en] * * all_insertion_left_positions.append(ref_st) # <<<<<<<<<<<<<< * all_insertion_positions.append(ref_st) * all_insertion_positions.append(ref_en) */ - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_all_insertion_left_positions, __pyx_v_ref_st); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_all_insertion_left_positions, __pyx_v_ref_st); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 229, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":329 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":230 * * all_insertion_left_positions.append(ref_st) * all_insertion_positions.append(ref_st) # <<<<<<<<<<<<<< * all_insertion_positions.append(ref_en) * if(ref_st in _include_indx or ref_en in _include_indx): */ - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_all_insertion_positions, __pyx_v_ref_st); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_all_insertion_positions, __pyx_v_ref_st); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 230, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":330 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":231 * all_insertion_left_positions.append(ref_st) * all_insertion_positions.append(ref_st) * all_insertion_positions.append(ref_en) # <<<<<<<<<<<<<< * if(ref_st in _include_indx or ref_en in _include_indx): * insertion_coordinates.append((ref_st,ref_en)) */ - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_all_insertion_positions, __pyx_v_ref_en); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_all_insertion_positions, __pyx_v_ref_en); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 231, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":331 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":232 * all_insertion_positions.append(ref_st) * all_insertion_positions.append(ref_en) * if(ref_st in _include_indx or ref_en in _include_indx): # <<<<<<<<<<<<<< * insertion_coordinates.append((ref_st,ref_en)) * insertion_positions.append(ref_st) */ - __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_v_ref_st, __pyx_v__include_indx, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_v_ref_st, __pyx_v__include_indx, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 232, __pyx_L1_error) if (!__pyx_t_10) { } else { __pyx_t_6 = __pyx_t_10; goto __pyx_L28_bool_binop_done; } - __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_v_ref_en, __pyx_v__include_indx, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_v_ref_en, __pyx_v__include_indx, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 232, __pyx_L1_error) __pyx_t_6 = __pyx_t_10; __pyx_L28_bool_binop_done:; if (__pyx_t_6) { - /* "CRISPResso2/CRISPRessoCOREResources.pyx":332 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":233 * all_insertion_positions.append(ref_en) * if(ref_st in _include_indx or ref_en in _include_indx): * insertion_coordinates.append((ref_st,ref_en)) # <<<<<<<<<<<<<< * insertion_positions.append(ref_st) * insertion_positions.append(ref_en) */ - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 332, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_ref_st); __Pyx_GIVEREF(__pyx_v_ref_st); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_ref_st)) __PYX_ERR(0, 332, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_ref_st)) __PYX_ERR(0, 233, __pyx_L1_error); __Pyx_INCREF(__pyx_v_ref_en); __Pyx_GIVEREF(__pyx_v_ref_en); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_ref_en)) __PYX_ERR(0, 332, __pyx_L1_error); - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_insertion_coordinates, __pyx_t_8); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 332, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_ref_en)) __PYX_ERR(0, 233, __pyx_L1_error); + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_insertion_coordinates, __pyx_t_8); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":333 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":234 * if(ref_st in _include_indx or ref_en in _include_indx): * insertion_coordinates.append((ref_st,ref_en)) * insertion_positions.append(ref_st) # <<<<<<<<<<<<<< * insertion_positions.append(ref_en) * insertion_sizes.append(en-st) */ - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_insertion_positions, __pyx_v_ref_st); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_insertion_positions, __pyx_v_ref_st); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 234, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":334 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":235 * insertion_coordinates.append((ref_st,ref_en)) * insertion_positions.append(ref_st) * insertion_positions.append(ref_en) # <<<<<<<<<<<<<< * insertion_sizes.append(en-st) * */ - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_insertion_positions, __pyx_v_ref_en); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_insertion_positions, __pyx_v_ref_en); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 235, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":335 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":236 * insertion_positions.append(ref_st) * insertion_positions.append(ref_en) * insertion_sizes.append(en-st) # <<<<<<<<<<<<<< * * insertion_n = np.sum(insertion_sizes) */ - __pyx_t_8 = __Pyx_PyInt_From_int((__pyx_v_en - __pyx_v_st)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 335, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_int((__pyx_v_en - __pyx_v_st)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_insertion_sizes, __pyx_t_8); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 335, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_insertion_sizes, __pyx_t_8); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":331 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":232 * all_insertion_positions.append(ref_st) * all_insertion_positions.append(ref_en) * if(ref_st in _include_indx or ref_en in _include_indx): # <<<<<<<<<<<<<< @@ -8865,7 +7999,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s */ } - /* "CRISPResso2/CRISPRessoCOREResources.pyx":318 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":219 * deletion_n = np.sum(deletion_sizes) * * for p in re_find_indels.finditer(ref_seq_al): # <<<<<<<<<<<<<< @@ -8876,16 +8010,16 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":337 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":238 * insertion_sizes.append(en-st) * * insertion_n = np.sum(insertion_sizes) # <<<<<<<<<<<<<< * - * + * retDict = { */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 337, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_sum); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 337, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_sum); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; @@ -8906,7 +8040,7 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_insertion_sizes}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_2, 1+__pyx_t_2); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -8916,9 +8050,9 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s /* "CRISPResso2/CRISPRessoCOREResources.pyx":341 * * retDict = { - * 'all_insertion_positions':all_insertion_positions, # <<<<<<<<<<<<<< - * 'all_insertion_left_positions':all_insertion_left_positions, - * 'insertion_positions':insertion_positions, + * 'all_insertion_positions':all_insertion_positions, # <<<<<<<<<<<<<< + * 'all_insertion_left_positions':all_insertion_left_positions, + * 'insertion_positions':insertion_positions, */ __pyx_t_1 = __Pyx_PyDict_NewPresized(17); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -8926,118 +8060,118 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s /* "CRISPResso2/CRISPRessoCOREResources.pyx":342 * retDict = { - * 'all_insertion_positions':all_insertion_positions, - * 'all_insertion_left_positions':all_insertion_left_positions, # <<<<<<<<<<<<<< - * 'insertion_positions':insertion_positions, - * 'insertion_coordinates':insertion_coordinates, + * 'all_insertion_positions':all_insertion_positions, + * 'all_insertion_left_positions':all_insertion_left_positions, # <<<<<<<<<<<<<< + * 'insertion_positions':insertion_positions, + * 'insertion_coordinates':insertion_coordinates, */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_all_insertion_left_positions, __pyx_v_all_insertion_left_positions) < 0) __PYX_ERR(0, 341, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":343 - * 'all_insertion_positions':all_insertion_positions, - * 'all_insertion_left_positions':all_insertion_left_positions, - * 'insertion_positions':insertion_positions, # <<<<<<<<<<<<<< - * 'insertion_coordinates':insertion_coordinates, - * 'insertion_sizes':insertion_sizes, + /* "CRISPResso2/CRISPRessoCOREResources.pyx":243 + * 'all_insertion_positions':all_insertion_positions, + * 'all_insertion_left_positions':all_insertion_left_positions, + * 'insertion_positions':insertion_positions, # <<<<<<<<<<<<<< + * 'insertion_coordinates':insertion_coordinates, + * 'insertion_sizes':insertion_sizes, */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_insertion_positions, __pyx_v_insertion_positions) < 0) __PYX_ERR(0, 341, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":344 - * 'all_insertion_left_positions':all_insertion_left_positions, - * 'insertion_positions':insertion_positions, - * 'insertion_coordinates':insertion_coordinates, # <<<<<<<<<<<<<< - * 'insertion_sizes':insertion_sizes, - * 'insertion_n':insertion_n, + /* "CRISPResso2/CRISPRessoCOREResources.pyx":244 + * 'all_insertion_left_positions':all_insertion_left_positions, + * 'insertion_positions':insertion_positions, + * 'insertion_coordinates':insertion_coordinates, # <<<<<<<<<<<<<< + * 'insertion_sizes':insertion_sizes, + * 'insertion_n':insertion_n, */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_insertion_coordinates, __pyx_v_insertion_coordinates) < 0) __PYX_ERR(0, 341, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":345 - * 'insertion_positions':insertion_positions, - * 'insertion_coordinates':insertion_coordinates, - * 'insertion_sizes':insertion_sizes, # <<<<<<<<<<<<<< - * 'insertion_n':insertion_n, - * + /* "CRISPResso2/CRISPRessoCOREResources.pyx":245 + * 'insertion_positions':insertion_positions, + * 'insertion_coordinates':insertion_coordinates, + * 'insertion_sizes':insertion_sizes, # <<<<<<<<<<<<<< + * 'insertion_n':insertion_n, + * 'all_deletion_positions':all_deletion_positions, */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_insertion_sizes, __pyx_v_insertion_sizes) < 0) __PYX_ERR(0, 341, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":346 - * 'insertion_coordinates':insertion_coordinates, - * 'insertion_sizes':insertion_sizes, - * 'insertion_n':insertion_n, # <<<<<<<<<<<<<< + /* "CRISPResso2/CRISPRessoCOREResources.pyx":246 + * 'insertion_coordinates':insertion_coordinates, + * 'insertion_sizes':insertion_sizes, + * 'insertion_n':insertion_n, # <<<<<<<<<<<<<< + * 'all_deletion_positions':all_deletion_positions, * - * 'all_deletion_positions':all_deletion_positions, */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_insertion_n, __pyx_v_insertion_n) < 0) __PYX_ERR(0, 341, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":348 - * 'insertion_n':insertion_n, + /* "CRISPResso2/CRISPRessoCOREResources.pyx":247 + * 'insertion_sizes':insertion_sizes, + * 'insertion_n':insertion_n, + * 'all_deletion_positions':all_deletion_positions, # <<<<<<<<<<<<<< * - * 'all_deletion_positions':all_deletion_positions, # <<<<<<<<<<<<<< - * 'deletion_positions':deletion_positions, - * 'deletion_coordinates':deletion_coordinates, + * 'deletion_positions':deletion_positions, */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_all_deletion_positions, __pyx_v_all_deletion_positions) < 0) __PYX_ERR(0, 341, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":349 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":249 + * 'all_deletion_positions':all_deletion_positions, * - * 'all_deletion_positions':all_deletion_positions, - * 'deletion_positions':deletion_positions, # <<<<<<<<<<<<<< - * 'deletion_coordinates':deletion_coordinates, - * 'deletion_sizes':deletion_sizes, + * 'deletion_positions':deletion_positions, # <<<<<<<<<<<<<< + * 'deletion_coordinates':deletion_coordinates, + * 'deletion_sizes':deletion_sizes, */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_deletion_positions, __pyx_v_deletion_positions) < 0) __PYX_ERR(0, 341, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":350 - * 'all_deletion_positions':all_deletion_positions, - * 'deletion_positions':deletion_positions, - * 'deletion_coordinates':deletion_coordinates, # <<<<<<<<<<<<<< - * 'deletion_sizes':deletion_sizes, - * 'deletion_n':deletion_n, + /* "CRISPResso2/CRISPRessoCOREResources.pyx":250 + * + * 'deletion_positions':deletion_positions, + * 'deletion_coordinates':deletion_coordinates, # <<<<<<<<<<<<<< + * 'deletion_sizes':deletion_sizes, + * 'deletion_n':deletion_n, */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_deletion_coordinates, __pyx_v_deletion_coordinates) < 0) __PYX_ERR(0, 341, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":351 - * 'deletion_positions':deletion_positions, - * 'deletion_coordinates':deletion_coordinates, - * 'deletion_sizes':deletion_sizes, # <<<<<<<<<<<<<< - * 'deletion_n':deletion_n, + /* "CRISPResso2/CRISPRessoCOREResources.pyx":251 + * 'deletion_positions':deletion_positions, + * 'deletion_coordinates':deletion_coordinates, + * 'deletion_sizes':deletion_sizes, # <<<<<<<<<<<<<< + * 'deletion_n':deletion_n, * */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_deletion_sizes, __pyx_v_deletion_sizes) < 0) __PYX_ERR(0, 341, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":352 - * 'deletion_coordinates':deletion_coordinates, - * 'deletion_sizes':deletion_sizes, - * 'deletion_n':deletion_n, # <<<<<<<<<<<<<< + /* "CRISPResso2/CRISPRessoCOREResources.pyx":252 + * 'deletion_coordinates':deletion_coordinates, + * 'deletion_sizes':deletion_sizes, + * 'deletion_n':deletion_n, # <<<<<<<<<<<<<< * - * 'all_substitution_positions':all_substitution_positions, + * 'all_substitution_positions':all_substitution_positions, */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_deletion_n, __pyx_v_deletion_n) < 0) __PYX_ERR(0, 341, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":354 - * 'deletion_n':deletion_n, + /* "CRISPResso2/CRISPRessoCOREResources.pyx":254 + * 'deletion_n':deletion_n, * - * 'all_substitution_positions':all_substitution_positions, # <<<<<<<<<<<<<< - * 'substitution_positions':substitution_positions, - * 'all_substitution_values':np.array(all_substitution_values), + * 'all_substitution_positions':all_substitution_positions, # <<<<<<<<<<<<<< + * 'substitution_positions':substitution_positions, + * 'all_substitution_values':np.array(all_substitution_values), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_all_substitution_positions, __pyx_v_all_substitution_positions) < 0) __PYX_ERR(0, 341, __pyx_L1_error) /* "CRISPResso2/CRISPRessoCOREResources.pyx":355 * - * 'all_substitution_positions':all_substitution_positions, - * 'substitution_positions':substitution_positions, # <<<<<<<<<<<<<< - * 'all_substitution_values':np.array(all_substitution_values), - * 'substitution_values':np.array(substitution_values), + * 'all_substitution_positions':all_substitution_positions, + * 'substitution_positions':substitution_positions, # <<<<<<<<<<<<<< + * 'all_substitution_values':np.array(all_substitution_values), + * 'substitution_values':np.array(substitution_values), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_substitution_positions, __pyx_v_substitution_positions) < 0) __PYX_ERR(0, 341, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":356 - * 'all_substitution_positions':all_substitution_positions, - * 'substitution_positions':substitution_positions, - * 'all_substitution_values':np.array(all_substitution_values), # <<<<<<<<<<<<<< - * 'substitution_values':np.array(substitution_values), - * 'substitution_n':substitution_n, + /* "CRISPResso2/CRISPRessoCOREResources.pyx":256 + * 'all_substitution_positions':all_substitution_positions, + * 'substitution_positions':substitution_positions, + * 'all_substitution_values':np.array(all_substitution_values), # <<<<<<<<<<<<<< + * 'substitution_values':np.array(substitution_values), + * 'substitution_n':substitution_n, */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); @@ -9069,11 +8203,11 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_all_substitution_values, __pyx_t_9) < 0) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":357 - * 'substitution_positions':substitution_positions, - * 'all_substitution_values':np.array(all_substitution_values), - * 'substitution_values':np.array(substitution_values), # <<<<<<<<<<<<<< - * 'substitution_n':substitution_n, + /* "CRISPResso2/CRISPRessoCOREResources.pyx":257 + * 'substitution_positions':substitution_positions, + * 'all_substitution_values':np.array(all_substitution_values), + * 'substitution_values':np.array(substitution_values), # <<<<<<<<<<<<<< + * 'substitution_n':substitution_n, * */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 357, __pyx_L1_error) @@ -9106,22 +8240,22 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_substitution_values, __pyx_t_9) < 0) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":358 - * 'all_substitution_values':np.array(all_substitution_values), - * 'substitution_values':np.array(substitution_values), - * 'substitution_n':substitution_n, # <<<<<<<<<<<<<< + /* "CRISPResso2/CRISPRessoCOREResources.pyx":258 + * 'all_substitution_values':np.array(all_substitution_values), + * 'substitution_values':np.array(substitution_values), + * 'substitution_n':substitution_n, # <<<<<<<<<<<<<< * - * 'ref_positions':ref_positions, + * 'ref_positions':ref_positions, */ __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_substitution_n); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_substitution_n, __pyx_t_9) < 0) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":360 - * 'substitution_n':substitution_n, + /* "CRISPResso2/CRISPRessoCOREResources.pyx":260 + * 'substitution_n':substitution_n, * - * 'ref_positions':ref_positions, # <<<<<<<<<<<<<< + * 'ref_positions':ref_positions, # <<<<<<<<<<<<<< * } * return retDict */ @@ -9129,8 +8263,8 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __pyx_v_retDict = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":362 - * 'ref_positions':ref_positions, + /* "CRISPResso2/CRISPRessoCOREResources.pyx":262 + * 'ref_positions':ref_positions, * } * return retDict # <<<<<<<<<<<<<< * @@ -9141,9 +8275,9 @@ static PyObject *__pyx_pf_11CRISPResso2_23CRISPRessoCOREResources_2find_indels_s __pyx_r = __pyx_v_retDict; goto __pyx_L0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":238 - * - * + /* "CRISPResso2/CRISPRessoCOREResources.pyx":138 + * 'ref_positions': ref_positions, + * } * @cython.boundscheck(False) # <<<<<<<<<<<<<< * @cython.nonecheck(False) * @cython.wraparound(False) @@ -9252,7 +8386,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 365, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 265, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -9260,7 +8394,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 365, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 265, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("calculate_homology", 1, 2, 2, 1); __PYX_ERR(0, 365, __pyx_L3_error) } @@ -9280,7 +8414,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("calculate_homology", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 365, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calculate_homology", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 265, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -9473,6 +8607,8 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 1, 1}, {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, {&__pyx_n_s_al, __pyx_k_al, sizeof(__pyx_k_al), 0, 0, 1, 1}, + {&__pyx_n_s_all_deletion_coordinates, __pyx_k_all_deletion_coordinates, sizeof(__pyx_k_all_deletion_coordinates), 0, 0, 1, 1}, + {&__pyx_n_u_all_deletion_coordinates, __pyx_k_all_deletion_coordinates, sizeof(__pyx_k_all_deletion_coordinates), 0, 1, 0, 1}, {&__pyx_n_s_all_deletion_positions, __pyx_k_all_deletion_positions, sizeof(__pyx_k_all_deletion_positions), 0, 0, 1, 1}, {&__pyx_n_u_all_deletion_positions, __pyx_k_all_deletion_positions, sizeof(__pyx_k_all_deletion_positions), 0, 1, 0, 1}, {&__pyx_n_s_all_insertion_left_positions, __pyx_k_all_insertion_left_positions, sizeof(__pyx_k_all_insertion_left_positions), 0, 0, 1, 1}, @@ -9593,9 +8729,9 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 135, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 172, __pyx_L1_error) - __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 188, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 58, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 113, __pyx_L1_error) __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 984, __pyx_L1_error) return 0; __pyx_L1_error:; @@ -9607,7 +8743,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":984 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":984 * __pyx_import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< @@ -9618,7 +8754,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "../../../../opt/conda/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":990 + /* "../../../mambaforge/envs/crispresso/lib/python3.10/site-packages/numpy/__init__.cython-30.pxd":990 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -9629,79 +8765,32 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "CRISPResso2/CRISPRessoCOREResources.pyx":18 - * class ResultsSlotsDict(): - * __slots__ = ( - * 'all_insertion_positions', # <<<<<<<<<<<<<< - * 'all_insertion_left_positions', - * 'insertion_positions', - */ - __pyx_tuple__5 = PyTuple_Pack(23, __pyx_n_u_all_insertion_positions, __pyx_n_u_all_insertion_left_positions, __pyx_n_u_insertion_positions, __pyx_n_u_insertion_coordinates, __pyx_n_u_insertion_sizes, __pyx_n_u_insertion_n, __pyx_n_u_all_deletion_positions, __pyx_n_u_deletion_positions, __pyx_n_u_deletion_coordinates, __pyx_n_u_deletion_sizes, __pyx_n_u_deletion_n, __pyx_n_u_all_substitution_positions, __pyx_n_u_substitution_positions, __pyx_n_u_all_substitution_values, __pyx_n_u_substitution_values, __pyx_n_u_substitution_n, __pyx_n_u_ref_positions, __pyx_n_u_ref_name, __pyx_n_u_aln_scores, __pyx_n_u_classification, __pyx_n_u_aln_seq, __pyx_n_u_aln_ref, __pyx_n_u_aln_strand); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 18, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":43 - * ) - * - * def __init__( # <<<<<<<<<<<<<< - * self, - * all_insertion_positions, - */ - __pyx_tuple__6 = PyTuple_Pack(18, __pyx_n_s_self, __pyx_n_s_all_insertion_positions, __pyx_n_s_all_insertion_left_positions, __pyx_n_s_insertion_positions, __pyx_n_s_insertion_coordinates, __pyx_n_s_insertion_sizes, __pyx_n_s_insertion_n, __pyx_n_s_all_deletion_positions, __pyx_n_s_deletion_positions, __pyx_n_s_deletion_coordinates, __pyx_n_s_deletion_sizes, __pyx_n_s_deletion_n, __pyx_n_s_all_substitution_positions, __pyx_n_s_substitution_positions, __pyx_n_s_all_substitution_values, __pyx_n_s_substitution_values, __pyx_n_s_substitution_n, __pyx_n_s_ref_positions); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 43, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__6); - __Pyx_GIVEREF(__pyx_tuple__6); - __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(18, 0, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_CRISPResso2_CRISPRessoCOREResour_2, __pyx_n_s_init, 43, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 43, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":87 - * self.aln_strand = None - * - * def __getitem__(self, key): # <<<<<<<<<<<<<< - * return getattr(self, key) - * - */ - __pyx_tuple__8 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_key); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 87, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); - __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_CRISPResso2_CRISPRessoCOREResour_2, __pyx_n_s_getitem, 87, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 87, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":90 - * return getattr(self, key) - * - * def __setitem__(self, key, value): # <<<<<<<<<<<<<< - * setattr(self, key, value) - * - */ - __pyx_tuple__10 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_value); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 90, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__10); - __Pyx_GIVEREF(__pyx_tuple__10); - __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_CRISPResso2_CRISPRessoCOREResour_2, __pyx_n_s_setitem, 90, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 90, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":94 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":16 * * * re_find_indels = re.compile("(-*-)") # <<<<<<<<<<<<<< * * @cython.boundscheck(False) */ - __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u__12); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 94, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__13); - __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u__5); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); - /* "CRISPResso2/CRISPRessoCOREResources.pyx":96 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":18 * re_find_indels = re.compile("(-*-)") * * @cython.boundscheck(False) # <<<<<<<<<<<<<< * @cython.nonecheck(False) * @cython.wraparound(False) */ - __pyx_tuple__14 = PyTuple_Pack(30, __pyx_n_s_read_seq_al, __pyx_n_s_ref_seq_al, __pyx_n_s_include_indx, __pyx_n_s_ref_positions, __pyx_n_s_all_substitution_positions, __pyx_n_s_substitution_positions, __pyx_n_s_all_substitution_values, __pyx_n_s_substitution_values, __pyx_n_s_all_deletion_positions, __pyx_n_s_deletion_positions, __pyx_n_s_deletion_coordinates, __pyx_n_s_deletion_sizes, __pyx_n_s_start_deletion, __pyx_n_s_all_insertion_positions, __pyx_n_s_all_insertion_left_positions, __pyx_n_s_insertion_positions, __pyx_n_s_insertion_coordinates, __pyx_n_s_insertion_sizes, __pyx_n_s_start_insertion, __pyx_n_s_seq_len, __pyx_n_s_include_indx_set, __pyx_n_s_nucSet, __pyx_n_s_idx, __pyx_n_s_idx_c, __pyx_n_s_current_insertion_size, __pyx_n_s_c, __pyx_n_s_end_deletion, __pyx_n_s_substitution_n, __pyx_n_s_deletion_n, __pyx_n_s_insertion_n); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 96, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__14); - __Pyx_GIVEREF(__pyx_tuple__14); - __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 30, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_CRISPResso2_CRISPRessoCOREResour_2, __pyx_n_s_find_indels_substitutions, 96, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_tuple__7 = PyTuple_Pack(31, __pyx_n_s_read_seq_al, __pyx_n_s_ref_seq_al, __pyx_n_s_include_indx, __pyx_n_s_ref_positions, __pyx_n_s_all_substitution_positions, __pyx_n_s_substitution_positions, __pyx_n_s_all_substitution_values, __pyx_n_s_substitution_values, __pyx_n_s_all_deletion_positions, __pyx_n_s_all_deletion_coordinates, __pyx_n_s_deletion_positions, __pyx_n_s_deletion_coordinates, __pyx_n_s_deletion_sizes, __pyx_n_s_start_deletion, __pyx_n_s_all_insertion_positions, __pyx_n_s_all_insertion_left_positions, __pyx_n_s_insertion_positions, __pyx_n_s_insertion_coordinates, __pyx_n_s_insertion_sizes, __pyx_n_s_start_insertion, __pyx_n_s_seq_len, __pyx_n_s_include_indx_set, __pyx_n_s_nucSet, __pyx_n_s_idx, __pyx_n_s_idx_c, __pyx_n_s_current_insertion_size, __pyx_n_s_c, __pyx_n_s_end_deletion, __pyx_n_s_substitution_n, __pyx_n_s_deletion_n, __pyx_n_s_insertion_n); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 31, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_CRISPResso2_CRISPRessoCOREResour, __pyx_n_s_find_indels_substitutions, 18, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 18, __pyx_L1_error) - /* "CRISPResso2/CRISPRessoCOREResources.pyx":238 - * - * + /* "CRISPResso2/CRISPRessoCOREResources.pyx":138 + * 'ref_positions': ref_positions, + * } * @cython.boundscheck(False) # <<<<<<<<<<<<<< * @cython.nonecheck(False) * @cython.wraparound(False) @@ -9818,33 +8907,33 @@ static int __Pyx_modinit_type_import_code(void) { /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_6(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_9(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 - sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_6(PyTypeObject), + sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_9(PyTypeObject), #elif CYTHON_COMPILING_IN_LIMITED_API - sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_6(PyTypeObject), + sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_9(PyTypeObject), #else - sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_6(PyHeapTypeObject), + sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_9(PyHeapTypeObject), #endif - __Pyx_ImportType_CheckSize_Warn_3_0_6); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error) + __Pyx_ImportType_CheckSize_Warn_3_0_9); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_0_6(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_0_6(PyArray_Descr),__Pyx_ImportType_CheckSize_Ignore_3_0_6); if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 202, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_0_6(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_6(PyArrayIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_6); if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 225, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_0_6(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_6(PyArrayMultiIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_6); if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 229, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_0_6(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_6(PyArrayObject),__Pyx_ImportType_CheckSize_Ignore_3_0_6); if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 238, __pyx_L1_error) - __pyx_ptype_5numpy_generic = __Pyx_ImportType_3_0_6(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_6(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_6); if (!__pyx_ptype_5numpy_generic) __PYX_ERR(1, 809, __pyx_L1_error) - __pyx_ptype_5numpy_number = __Pyx_ImportType_3_0_6(__pyx_t_1, "numpy", "number", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_6(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_6); if (!__pyx_ptype_5numpy_number) __PYX_ERR(1, 811, __pyx_L1_error) - __pyx_ptype_5numpy_integer = __Pyx_ImportType_3_0_6(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_6(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_6); if (!__pyx_ptype_5numpy_integer) __PYX_ERR(1, 813, __pyx_L1_error) - __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_0_6(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_6(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_6); if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 815, __pyx_L1_error) - __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_0_6(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_6(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_6); if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 817, __pyx_L1_error) - __pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_0_6(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_6(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_6); if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 819, __pyx_L1_error) - __pyx_ptype_5numpy_floating = __Pyx_ImportType_3_0_6(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_6(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_6); if (!__pyx_ptype_5numpy_floating) __PYX_ERR(1, 821, __pyx_L1_error) - __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_0_6(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_6(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_6); if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 823, __pyx_L1_error) - __pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_0_6(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_6(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_6); if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 825, __pyx_L1_error) - __pyx_ptype_5numpy_character = __Pyx_ImportType_3_0_6(__pyx_t_1, "numpy", "character", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_6(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_6); if (!__pyx_ptype_5numpy_character) __PYX_ERR(1, 827, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_0_6(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_6(PyUFuncObject),__Pyx_ImportType_CheckSize_Ignore_3_0_6); if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 866, __pyx_L1_error) + __pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_0_9(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_0_9(PyArray_Descr),__Pyx_ImportType_CheckSize_Ignore_3_0_9); if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 202, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_0_9(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_9(PyArrayIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_9); if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 225, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_0_9(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_9(PyArrayMultiIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_9); if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 229, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_0_9(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_9(PyArrayObject),__Pyx_ImportType_CheckSize_Ignore_3_0_9); if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 238, __pyx_L1_error) + __pyx_ptype_5numpy_generic = __Pyx_ImportType_3_0_9(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_9(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_9); if (!__pyx_ptype_5numpy_generic) __PYX_ERR(1, 809, __pyx_L1_error) + __pyx_ptype_5numpy_number = __Pyx_ImportType_3_0_9(__pyx_t_1, "numpy", "number", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_9(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_9); if (!__pyx_ptype_5numpy_number) __PYX_ERR(1, 811, __pyx_L1_error) + __pyx_ptype_5numpy_integer = __Pyx_ImportType_3_0_9(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_9(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_9); if (!__pyx_ptype_5numpy_integer) __PYX_ERR(1, 813, __pyx_L1_error) + __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_0_9(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_9(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_9); if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 815, __pyx_L1_error) + __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_0_9(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_9(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_9); if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 817, __pyx_L1_error) + __pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_0_9(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_9(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_9); if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 819, __pyx_L1_error) + __pyx_ptype_5numpy_floating = __Pyx_ImportType_3_0_9(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_9(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_9); if (!__pyx_ptype_5numpy_floating) __PYX_ERR(1, 821, __pyx_L1_error) + __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_0_9(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_9(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_9); if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 823, __pyx_L1_error) + __pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_0_9(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_9(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_9); if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 825, __pyx_L1_error) + __pyx_ptype_5numpy_character = __Pyx_ImportType_3_0_9(__pyx_t_1, "numpy", "character", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_9(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_9); if (!__pyx_ptype_5numpy_character) __PYX_ERR(1, 827, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_0_9(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_9(PyUFuncObject),__Pyx_ImportType_CheckSize_Ignore_3_0_9); if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 866, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; @@ -10059,7 +9148,7 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_CRISPRessoCOREResources(PyObject * __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); - __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to CRISPRessoCOREResources pseudovariable */ + __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "CRISPRessoCOREResources" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } @@ -10173,106 +9262,38 @@ if (!__Pyx_RefNanny) { __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "CRISPResso2/CRISPRessoCOREResources.pyx":16 - * char * PyBytes_AS_STRING(PyObject *) - * - * class ResultsSlotsDict(): # <<<<<<<<<<<<<< - * __slots__ = ( - * 'all_insertion_positions', - */ - __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_ResultsSlotsDict, __pyx_n_s_ResultsSlotsDict, (PyObject *) NULL, __pyx_n_s_CRISPResso2_CRISPRessoCOREResour, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":18 - * class ResultsSlotsDict(): - * __slots__ = ( - * 'all_insertion_positions', # <<<<<<<<<<<<<< - * 'all_insertion_left_positions', - * 'insertion_positions', - */ - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_slots, __pyx_tuple__5) < 0) __PYX_ERR(0, 17, __pyx_L1_error) - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":43 - * ) - * - * def __init__( # <<<<<<<<<<<<<< - * self, - * all_insertion_positions, - */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11CRISPResso2_23CRISPRessoCOREResources_16ResultsSlotsDict_1__init__, 0, __pyx_n_s_ResultsSlotsDict___init, NULL, __pyx_n_s_CRISPResso2_CRISPRessoCOREResour, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 43, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":87 - * self.aln_strand = None - * - * def __getitem__(self, key): # <<<<<<<<<<<<<< - * return getattr(self, key) - * - */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11CRISPResso2_23CRISPRessoCOREResources_16ResultsSlotsDict_3__getitem__, 0, __pyx_n_s_ResultsSlotsDict___getitem, NULL, __pyx_n_s_CRISPResso2_CRISPRessoCOREResour, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getitem, __pyx_t_3) < 0) __PYX_ERR(0, 87, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":90 - * return getattr(self, key) - * - * def __setitem__(self, key, value): # <<<<<<<<<<<<<< - * setattr(self, key, value) - * - */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_11CRISPResso2_23CRISPRessoCOREResources_16ResultsSlotsDict_5__setitem__, 0, __pyx_n_s_ResultsSlotsDict___setitem, NULL, __pyx_n_s_CRISPResso2_CRISPRessoCOREResour, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_setitem, __pyx_t_3) < 0) __PYX_ERR(0, 90, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":16 - * char * PyBytes_AS_STRING(PyObject *) - * - * class ResultsSlotsDict(): # <<<<<<<<<<<<<< - * __slots__ = ( - * 'all_insertion_positions', - */ - __pyx_t_3 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_ResultsSlotsDict, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 16, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ResultsSlotsDict, __pyx_t_3) < 0) __PYX_ERR(0, 16, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "CRISPResso2/CRISPRessoCOREResources.pyx":94 * * * re_find_indels = re.compile("(-*-)") # <<<<<<<<<<<<<< * * @cython.boundscheck(False) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_re); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_re); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_compile); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_compile); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_re_find_indels, __pyx_t_2) < 0) __PYX_ERR(0, 94, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_re_find_indels, __pyx_t_2) < 0) __PYX_ERR(0, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":96 + /* "CRISPResso2/CRISPRessoCOREResources.pyx":18 * re_find_indels = re.compile("(-*-)") * * @cython.boundscheck(False) # <<<<<<<<<<<<<< * @cython.nonecheck(False) * @cython.wraparound(False) */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11CRISPResso2_23CRISPRessoCOREResources_1find_indels_substitutions, 0, __pyx_n_s_find_indels_substitutions, NULL, __pyx_n_s_CRISPResso2_CRISPRessoCOREResour, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11CRISPResso2_23CRISPRessoCOREResources_1find_indels_substitutions, 0, __pyx_n_s_find_indels_substitutions, NULL, __pyx_n_s_CRISPResso2_CRISPRessoCOREResour_2, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_find_indels_substitutions, __pyx_t_2) < 0) __PYX_ERR(0, 96, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_find_indels_substitutions, __pyx_t_2) < 0) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "CRISPResso2/CRISPRessoCOREResources.pyx":238 - * - * + /* "CRISPResso2/CRISPRessoCOREResources.pyx":138 + * 'ref_positions': ref_positions, + * } * @cython.boundscheck(False) # <<<<<<<<<<<<<< * @cython.nonecheck(False) * @cython.wraparound(False) @@ -11094,11 +10115,11 @@ static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyO { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { - if (unlikely(eq < 0)) return NULL; // error + if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } - return NULL; // not found (no exception set) + return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { @@ -11211,7 +10232,7 @@ static int __Pyx_ParseOptionalKeywords( if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(value); // transfer ownership of value to values + Py_INCREF(value); Py_DECREF(key); #endif key = NULL; @@ -11230,7 +10251,7 @@ static int __Pyx_ParseOptionalKeywords( && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS - value = NULL; // ownership transferred to values + value = NULL; #endif break; } @@ -11262,7 +10283,7 @@ static int __Pyx_ParseOptionalKeywords( if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS - value = NULL; // ownership transferred to values + value = NULL; #endif break; } @@ -11494,9 +10515,10 @@ static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, in /* UnpackUnboundCMethod */ static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { + PyObject *result; PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args)); if (unlikely(!selfless_args)) return NULL; - PyObject *result = PyObject_Call(method, selfless_args, kwargs); + result = PyObject_Call(method, selfless_args, kwargs); Py_DECREF(selfless_args); return result; } @@ -11921,9 +10943,10 @@ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { + PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign - PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); + exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; @@ -11944,10 +10967,10 @@ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { } /* TypeImport */ -#ifndef __PYX_HAVE_RT_ImportType_3_0_6 -#define __PYX_HAVE_RT_ImportType_3_0_6 -static PyTypeObject *__Pyx_ImportType_3_0_6(PyObject *module, const char *module_name, const char *class_name, - size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_6 check_size) +#ifndef __PYX_HAVE_RT_ImportType_3_0_9 +#define __PYX_HAVE_RT_ImportType_3_0_9 +static PyTypeObject *__Pyx_ImportType_3_0_9(PyObject *module, const char *module_name, const char *class_name, + size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_9 check_size) { PyObject *result = 0; char warning[200]; @@ -12001,7 +11024,7 @@ static PyTypeObject *__Pyx_ImportType_3_0_6(PyObject *module, const char *module module_name, class_name, size, basicsize+itemsize); goto bad; } - if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_6 && + if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_9 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " @@ -12009,7 +11032,7 @@ static PyTypeObject *__Pyx_ImportType_3_0_6(PyObject *module, const char *module module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } - else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_6 && (size_t)basicsize > size) { + else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_9 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", @@ -13268,7 +12291,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, default: return NULL; } - return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); + return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { @@ -14014,7 +13037,7 @@ static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif - Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline + Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); @@ -15077,7 +14100,7 @@ __Pyx_PyType_GetName(PyTypeObject* tp) if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); - name = __Pyx_NewRef(__pyx_n_s__20); + name = __Pyx_NewRef(__pyx_n_s__13); } return name; } diff --git a/CRISPResso2/CRISPRessoCOREResources.pyx b/CRISPResso2/CRISPRessoCOREResources.pyx index 78a6dced..4b6a22f1 100644 --- a/CRISPResso2/CRISPRessoCOREResources.pyx +++ b/CRISPResso2/CRISPRessoCOREResources.pyx @@ -7,7 +7,6 @@ cdef extern from "stdlib.h": ctypedef unsigned int size_t size_t strlen(char* s) - cdef extern from "Python.h": ctypedef void PyObject int _PyBytes_Resize(PyObject **, size_t) @@ -74,6 +73,7 @@ def find_indels_substitutions(read_seq_al, ref_seq_al, _include_indx): substitution_values=[] all_deletion_positions = [] + all_deletion_coordinates = [] deletion_positions = [] deletion_coordinates = [] deletion_sizes = [] @@ -130,6 +130,7 @@ def find_indels_substitutions(read_seq_al, ref_seq_al, _include_indx): elif read_seq_al[idx_c] != '-' and start_deletion != -1: # this is the end of a deletion end_deletion = ref_positions[idx_c] all_deletion_positions.extend(range(start_deletion, end_deletion)) + all_deletion_coordinates.append((start_deletion, end_deletion)) if include_indx_set.intersection(range(start_deletion, end_deletion)): deletion_positions.extend(range(start_deletion, end_deletion)) deletion_coordinates.append((start_deletion, end_deletion)) @@ -139,6 +140,7 @@ def find_indels_substitutions(read_seq_al, ref_seq_al, _include_indx): if start_deletion != -1: end_deletion = ref_positions[seq_len - 1] all_deletion_positions.extend(range(start_deletion, end_deletion)) + all_deletion_coordinates.append((start_deletion, end_deletion)) if include_indx_set.intersection(range(start_deletion, end_deletion)): deletion_positions.extend(range(start_deletion, end_deletion)) deletion_coordinates.append((start_deletion, end_deletion)) @@ -180,6 +182,7 @@ def find_indels_substitutions(read_seq_al, ref_seq_al, _include_indx): 'insertion_n': insertion_n, 'all_deletion_positions': all_deletion_positions, + 'all_deletion_coordinates': all_deletion_coordinates, 'deletion_positions': deletion_positions, 'deletion_coordinates': deletion_coordinates, 'deletion_sizes': deletion_sizes, @@ -190,14 +193,13 @@ def find_indels_substitutions(read_seq_al, ref_seq_al, _include_indx): 'all_substitution_values': np.array(all_substitution_values), 'substitution_values': np.array(substitution_values), 'substitution_n': substitution_n, - 'ref_positions': ref_positions, } - - @cython.boundscheck(False) @cython.nonecheck(False) @cython.wraparound(False) + + def find_indels_substitutions_legacy(read_seq_al, ref_seq_al, _include_indx): cdef char* sub_seq='' @@ -222,7 +224,6 @@ def find_indels_substitutions_legacy(read_seq_al, ref_seq_al, _include_indx): substitution_positions=[] all_substitution_values=[] substitution_values=[] - nucSet = set(['A', 'T', 'C', 'G', 'N']) idx=0 for idx_c, c in enumerate(ref_seq_al): @@ -296,28 +297,27 @@ def find_indels_substitutions_legacy(read_seq_al, ref_seq_al, _include_indx): insertion_n = np.sum(insertion_sizes) - retDict = { - 'all_insertion_positions':all_insertion_positions, - 'all_insertion_left_positions':all_insertion_left_positions, - 'insertion_positions':insertion_positions, - 'insertion_coordinates':insertion_coordinates, - 'insertion_sizes':insertion_sizes, - 'insertion_n':insertion_n, - - 'all_deletion_positions':all_deletion_positions, - 'deletion_positions':deletion_positions, - 'deletion_coordinates':deletion_coordinates, - 'deletion_sizes':deletion_sizes, - 'deletion_n':deletion_n, - - 'all_substitution_positions':all_substitution_positions, - 'substitution_positions':substitution_positions, - 'all_substitution_values':np.array(all_substitution_values), - 'substitution_values':np.array(substitution_values), - 'substitution_n':substitution_n, - - 'ref_positions':ref_positions, + 'all_insertion_positions':all_insertion_positions, + 'all_insertion_left_positions':all_insertion_left_positions, + 'insertion_positions':insertion_positions, + 'insertion_coordinates':insertion_coordinates, + 'insertion_sizes':insertion_sizes, + 'insertion_n':insertion_n, + 'all_deletion_positions':all_deletion_positions, + + 'deletion_positions':deletion_positions, + 'deletion_coordinates':deletion_coordinates, + 'deletion_sizes':deletion_sizes, + 'deletion_n':deletion_n, + + 'all_substitution_positions':all_substitution_positions, + 'substitution_positions':substitution_positions, + 'all_substitution_values':np.array(all_substitution_values), + 'substitution_values':np.array(substitution_values), + 'substitution_n':substitution_n, + + 'ref_positions':ref_positions, } return retDict diff --git a/CRISPResso2/CRISPRessoCompareCORE.py b/CRISPResso2/CRISPRessoCompareCORE.py index b70892ec..abccdddd 100644 --- a/CRISPResso2/CRISPRessoCompareCORE.py +++ b/CRISPResso2/CRISPRessoCompareCORE.py @@ -10,7 +10,6 @@ import traceback import argparse from CRISPResso2 import CRISPRessoShared -from CRISPResso2 import CRISPRessoPlot from CRISPResso2.CRISPRessoReports import CRISPRessoReport import logging @@ -84,27 +83,16 @@ def main(): ''' compare_header = CRISPRessoShared.get_crispresso_header(description, compare_header) print(compare_header) - - parser = argparse.ArgumentParser(description='CRISPRessoCompare Parameters', formatter_class=argparse.ArgumentDefaultsHelpFormatter) - parser.add_argument('crispresso_output_folder_1', type=str, help='First output folder with CRISPResso analysis') - parser.add_argument('crispresso_output_folder_2', type=str, help='Second output folder with CRISPResso analysis') - - #OPTIONALS - parser.add_argument('-n', '--name', help='Output name', default='') - parser.add_argument('-n1', '--sample_1_name', help='Sample 1 name') - parser.add_argument('-n2', '--sample_2_name', help='Sample 2 name') - parser.add_argument('-o', '--output_folder', help='', default='') - parser.add_argument('--reported_qvalue_cutoff', help='Q-value cutoff for signifance in tests for differential editing. Each base position is tested (for insertions, deletions, substitutions, and all modifications) using Fisher\'s exact test, followed by Bonferonni correction. The number of bases with a significance below this threshold in the quantification window are counted and reported in the output summary.', type=float, default=0.05) - parser.add_argument('--min_frequency_alleles_around_cut_to_plot', type=float, help='Minimum %% reads required to report an allele in the alleles table plot.', default=0.2) - parser.add_argument('--max_rows_alleles_around_cut_to_plot', type=int, help='Maximum number of rows to report in the alleles table plot. ', default=50) - parser.add_argument('--suppress_report', help='Suppress output report', action='store_true') - parser.add_argument('--place_report_in_output_folder', help='If true, report will be written inside the CRISPResso output folder. By default, the report will be written one directory up from the report output.', action='store_true') - parser.add_argument('--zip_output', help="If set, the output will be placed in a zip folder.", action='store_true') - parser.add_argument('--debug', help='Show debug messages', action='store_true') - parser.add_argument('-v', '--verbosity', type=int, help='Verbosity level of output to the console (1-4)', default=3) + + parser = CRISPRessoShared.getCRISPRessoArgParser("Compare", parser_title = 'CRISPRessoCompare Parameters') args = parser.parse_args() + if args.use_matplotlib or not CRISPRessoShared.is_C2Pro_installed(): + from CRISPResso2 import CRISPRessoPlot + else: + from CRISPRessoPro import plot as CRISPRessoPlot + CRISPRessoShared.set_console_log_level(logger, args.verbosity, args.debug) debug_flag = args.debug @@ -154,7 +142,7 @@ def main(): log_filename = _jp('CRISPRessoCompare_RUNNING_LOG.txt') logger.addHandler(logging.FileHandler(log_filename)) - logger.addHandler(CRISPRessoShared.StatusHandler(_jp('CRISPRessoCompare_status.txt'))) + logger.addHandler(CRISPRessoShared.StatusHandler(_jp('CRISPRessoCompare_status.json'))) with open(log_filename, 'w+') as outfile: outfile.write('[Command used]:\nCRISPRessoCompare %s\n\n[Execution log]:\n' % ' '.join(sys.argv)) diff --git a/CRISPResso2/CRISPRessoMetaCORE.py b/CRISPResso2/CRISPRessoMetaCORE.py index e2e0b843..a0e3936e 100644 --- a/CRISPResso2/CRISPRessoMetaCORE.py +++ b/CRISPResso2/CRISPRessoMetaCORE.py @@ -13,7 +13,6 @@ import traceback import json from CRISPResso2 import CRISPRessoShared -from CRISPResso2 import CRISPRessoPlot from CRISPResso2 import CRISPRessoMultiProcessing from CRISPResso2.CRISPRessoReports import CRISPRessoReport @@ -87,7 +86,7 @@ def main(): ''' print(CRISPRessoShared.get_crispresso_header(description, meta_string)) - parser = CRISPRessoShared.getCRISPRessoArgParser(parser_title = 'CRISPRessoMeta Parameters') + parser = CRISPRessoShared.getCRISPRessoArgParser("Meta", parser_title = 'CRISPRessoMeta Parameters') #batch specific params parser.add_argument('--metadata', type=str, help='Metadata file according to NIST specification', required=True) @@ -96,11 +95,16 @@ def main(): args = parser.parse_args() + if args.use_matplotlib or not CRISPRessoShared.is_C2Pro_installed(): + from CRISPResso2 import CRISPRessoPlot + else: + from CRISPRessoPro import plot as CRISPRessoPlot + CRISPRessoShared.set_console_log_level(logger, args.verbosity, args.debug) debug_flag = args.debug - crispresso_options = CRISPRessoShared.get_crispresso_options() + crispresso_options = CRISPRessoShared.get_core_crispresso_options() options_to_ignore = {'name', 'output_folder'} crispresso_options_for_meta = list(crispresso_options-options_to_ignore) @@ -123,7 +127,7 @@ def main(): print('table:') print(meta_params) #rename column "a" to "amplicon_seq", etc - meta_params.rename(index=str, columns=CRISPRessoShared.get_crispresso_options_lookup(), inplace=True) + meta_params.rename(index=str, columns=CRISPRessoShared.get_crispresso_options_lookup("Core"), inplace=True) meta_count = meta_params.shape[0] meta_params.index = range(meta_count) @@ -229,7 +233,7 @@ def main(): log_filename=_jp('CRISPRessoMeta_RUNNING_LOG.txt') logger.addHandler(logging.FileHandler(log_filename)) - logger.addHandler(CRISPRessoShared.StatusHandler(_jp('CRISPRessoMeta_status.txt'))) + logger.addHandler(CRISPRessoShared.StatusHandler(_jp('CRISPRessoMeta_status.json'))) with open(log_filename, 'w+') as outfile: outfile.write('[Command used]:\n%s\n\n[Execution log]:\n' % ' '.join(sys.argv)) diff --git a/CRISPResso2/CRISPRessoPlot.py b/CRISPResso2/CRISPRessoPlot.py index 8da1d450..cc886b66 100644 --- a/CRISPResso2/CRISPRessoPlot.py +++ b/CRISPResso2/CRISPRessoPlot.py @@ -8,12 +8,12 @@ import numpy as np import pandas as pd import matplotlib +import json matplotlib.use('AGG') import matplotlib.pyplot as plt import matplotlib.patches as patches import matplotlib.cm as cm import matplotlib.gridspec as gridspec -import plotly.express as px from collections import defaultdict from copy import deepcopy import re @@ -95,7 +95,7 @@ def hex_to_rgb(value): lv = len(value) return tuple(int(value[i:i + lv // 3], 16) for i in range(0, lv, lv // 3)) -def plot_nucleotide_quilt(nuc_pct_df,mod_pct_df,fig_filename_root, custom_colors, save_also_png=False,sgRNA_intervals=None,min_text_pct=0.5,max_text_pct=0.95,quantification_window_idxs=None,sgRNA_names=None,sgRNA_mismatches=None,shade_unchanged=True,group_column='Batch'): +def plot_nucleotide_quilt(nuc_pct_df,mod_pct_df,fig_filename_root, custom_colors, save_also_png=False,sgRNA_intervals=None,min_text_pct=0.5,max_text_pct=0.95,quantification_window_idxs=None,sgRNA_names=None,sgRNA_mismatches=None,shade_unchanged=True,group_column='Batch', **kwargs): """ Plots a nucleotide quilt with each square showing the percentage of each base at that position in the reference nuc_pct_df: dataframe with percents of each base (ACTGN-) at each position @@ -240,7 +240,7 @@ def plot_nucleotide_quilt(nuc_pct_df,mod_pct_df,fig_filename_root, custom_colors plot_y_start = ref_y_start - 0.1 - if sgRNA_intervals and len(sgRNA_intervals) > 0: + if sgRNA_intervals: sgRNA_rows = get_rows_for_sgRNA_annotation(sgRNA_intervals, amp_len) num_sgRNA_rows = max(sgRNA_rows) + 1 sgRNA_y_height = num_sgRNA_rows * 0.3 @@ -332,6 +332,7 @@ def plot_indel_size_distribution( title, plot_root, save_also_png=False, + **kwargs, ): fig, ax = plt.subplots(figsize=(10, 10)) densityPct_0 = 0.0 @@ -381,7 +382,9 @@ def plot_frequency_deletions_insertions( xmax_del, xmax_ins, xmax_mut, + custom_colors, save_also_png=False, + **kwargs, ): y_values_mut = ref['y_values_mut'] x_bins_mut = ref['x_bins_mut'] @@ -517,6 +520,7 @@ def plot_amplicon_modifications( plot_root, custom_colors, save_also_png=False, + **kwargs, ): fig, ax = plt.subplots(figsize=(10, 10)) @@ -669,6 +673,7 @@ def plot_modification_frequency( plot_root, custom_colors, save_also_png=False, + **kwargs, ): fig, ax = plt.subplots(figsize=(10, 10)) @@ -838,6 +843,7 @@ def plot_quantification_window_locations( plot_root, custom_colors, save_also_png, + **kwargs, ): fig, ax = plt.subplots(figsize=(10, 10)) @@ -1005,6 +1011,7 @@ def plot_position_dependent_indels( plot_titles, plot_root, save_also_png, + **kwargs, ): fig, ax = plt.subplots(1, 2, figsize=(24, 10)) ax1 = ax[0] @@ -1110,6 +1117,7 @@ def plot_global_modifications_reference( plot_root, custom_colors, save_also_png=False, + **kwargs, ): fig, ax = plt.subplots(figsize=(10, 10)) ref1_all_insertion_positions = ref1_all_insertion_count_vectors @@ -1268,6 +1276,7 @@ def plot_frameshift_analysis( ref_name, plot_root, save_also_png=False, + **kwargs, ): """Plot 5: Plot a pie chart to plot_root showing classification of reads with regard to coding region for a specific reference sequence, also including a diagram of where the coding region is within the amplicon. @@ -1416,6 +1425,7 @@ def plot_frameshift_frequency( plot_titles, plot_root, save_also_png=False, + **kwargs, ): fig, ax = plt.subplots(1, 2, figsize=(22, 10)) ax1 = ax[0] @@ -1511,6 +1521,7 @@ def plot_global_frameshift_analysis( global_non_modified_non_frameshift, plot_root, save_also_png=False, + **kwargs, ): fig, ax = plt.subplots(figsize=(12, 12)) @@ -1547,6 +1558,7 @@ def plot_global_frameshift_in_frame_mutations( global_hists_inframe, plot_root, save_also_png=False, + **kwargs, ): fig, axs = plt.subplots(2, 1, figsize=(22, 10)) ax1 = axs[0] @@ -1643,6 +1655,7 @@ def plot_impact_on_splice_sites( global_count_total, plot_root, save_also_png=False, + **kwargs, ): fig, ax = plt.subplots(figsize=(12, 12)) patches, texts, autotexts = ax.pie( @@ -1682,6 +1695,7 @@ def plot_non_coding_mutations( plot_root, custom_colors, save_also_png=False, + **kwargs, ): fig, ax = plt.subplots(figsize=(10, 10)) ax.plot( @@ -1822,6 +1836,7 @@ def plot_potential_splice_sites( count_total, plot_root, save_also_png=False, + **kwargs, ): fig, ax = plt.subplots(figsize=(12, 12)) patches, texts, autotexts = ax.pie( @@ -1852,6 +1867,7 @@ def plot_scaffold_indel_lengths( df_scaffold_insertion_sizes, plot_root, save_also_png=False, + **kwargs, ): colors = ['b', 'g'] fig, ax = plt.subplots(figsize=(12, 6)) @@ -1996,7 +2012,7 @@ def add_sgRNA_to_ax(ax,sgRNA_intervals,sgRNA_y_start,sgRNA_y_height,amp_len,x_of else: ax.text(x_offset+min_sgRNA_x, this_sgRNA_y_start + this_sgRNA_y_height/2, 'sgRNA ', horizontalalignment='right', verticalalignment='center', fontsize=font_size) -def plot_conversion_map(nuc_pct_df,fig_filename_root,conversion_nuc_from,conversion_nuc_to,save_also_png,custom_colors,plotPct = 0.9,min_text_pct=0.3,max_text_pct=0.9,conversion_scale_max=None,sgRNA_intervals=None,quantification_window_idxs=None,sgRNA_names=None,sgRNA_mismatches=None): +def plot_conversion_map(nuc_pct_df,fig_filename_root,conversion_nuc_from,conversion_nuc_to,save_also_png,custom_colors,plotPct = 0.9,min_text_pct=0.3,max_text_pct=0.9,conversion_scale_max=None,sgRNA_intervals=None,quantification_window_idxs=None,sgRNA_names=None,sgRNA_mismatches=None,**kwargs): """ Plots a heatmap of conversion across several sequences :param nuc_pct_df combined df of multiple batches @@ -2168,7 +2184,7 @@ def plot_conversion_map(nuc_pct_df,fig_filename_root,conversion_nuc_from,convers plt.close(fig) -def plot_subs_across_ref(ref_len, ref_seq, ref_name, ref_count, all_substitution_base_vectors, plot_title, fig_filename_root, save_also_png, custom_colors, quantification_window_idxs=None): +def plot_subs_across_ref(ref_len, ref_seq, ref_name, ref_count, all_substitution_base_vectors, plot_title, fig_filename_root, save_also_png, custom_colors, quantification_window_idxs=None,**kwargs): """ Plots substitutions across the reference sequece - each position on the x axis reprsents a nucleotide in the reference bars at each x posion show the number of times the reference nucleotide was substituted for another reference @@ -2233,7 +2249,7 @@ def plot_subs_across_ref(ref_len, ref_seq, ref_name, ref_count, all_substitution fig.savefig(fig_filename_root + '.png', bbox_extra_artists=(lgd,), bbox_inches='tight') plt.close(fig) -def plot_sub_freqs(alt_nuc_counts, plot_title, fig_filename_root, save_also_png, custom_colors): +def plot_sub_freqs(alt_nuc_counts, plot_title, fig_filename_root, save_also_png, custom_colors,**kwargs): """ Plots histogram of substitution frequencies for each nucleotide (from nuc X to nuc Y) input: @@ -2263,7 +2279,7 @@ def plot_sub_freqs(alt_nuc_counts, plot_title, fig_filename_root, save_also_png, fig.savefig(fig_filename_root + '.png', bbox_inches='tight') plt.close(fig) -def plot_nuc_freqs(df_nuc_freq, tot_aln_reads, plot_title, fig_filename_root, save_also_png): +def plot_nuc_freqs(df_nuc_freq, tot_aln_reads, plot_title, fig_filename_root, save_also_png,**kwargs): """ Plots a heatmap of the percentage of reads that had each nucletide at each base in the reference Positions in the reference that have more than one allele can be spotted using this plot @@ -2279,7 +2295,7 @@ def plot_nuc_freqs(df_nuc_freq, tot_aln_reads, plot_title, fig_filename_root, sa plt.savefig(fig_filename_root + '.png', bbox_inches='tight') plt.close() -def plot_log_nuc_freqs(df_nuc_freq,tot_aln_reads,plot_title,fig_filename_root,save_also_png,quantification_window_idxs=None): +def plot_log_nuc_freqs(df_nuc_freq,tot_aln_reads,plot_title,fig_filename_root,save_also_png,quantification_window_idxs=None,**kwargs): """ Plots a heatmap of the percentage of reads that had each nucletide at each base in the reference Positions in the reference that have more than one allele can be spotted using this plot @@ -2317,7 +2333,7 @@ def plot_log_nuc_freqs(df_nuc_freq,tot_aln_reads,plot_title,fig_filename_root,sa plt.close(fig) -def plot_conversion_at_sel_nucs(df_subs, ref_name, ref_sequence, plot_title, conversion_nuc_from, fig_filename_root, save_also_png, custom_colors): +def plot_conversion_at_sel_nucs(df_subs, ref_name, ref_sequence, plot_title, conversion_nuc_from, fig_filename_root, save_also_png, custom_colors,**kwargs): ''' Plots the conversion at selected nucleotides Looks for the 'conversion_nuc_from' in the ref_sequence and sets those as 'selected nucleotides' @@ -2379,7 +2395,7 @@ def plot_conversion_at_sel_nucs(df_subs, ref_name, ref_sequence, plot_title, con fig.savefig(fig_filename_root+'.png', bbox_inches='tight', pad_inches=0.1) plt.close(fig) -def plot_conversion_at_sel_nucs_not_include_ref(df_subs, ref_name, ref_sequence, plot_title, conversion_nuc_from, fig_filename_root, save_also_png, custom_colors): +def plot_conversion_at_sel_nucs_not_include_ref(df_subs, ref_name, ref_sequence, plot_title, conversion_nuc_from, fig_filename_root, save_also_png, custom_colors, **kwargs): ''' Plots the conversion at selected nucleotides but ignores non-substitutions (for example at nucs that are 'C' in the reference, bars show the proportion of A T G (not C)) Looks for the 'conversion_nuc_from' in the ref_sequence and sets those as 'selected nucleotides' @@ -2451,7 +2467,7 @@ def plot_conversion_at_sel_nucs_not_include_ref(df_subs, ref_name, ref_sequence, fig.savefig(fig_filename_root+'.png', bbox_inches='tight', pad_inches=0.1) plt.close(fig) -def plot_conversion_at_sel_nucs_not_include_ref_scaled(df_subs, ref_name, ref_sequence, plot_title, conversion_nuc_from, fig_filename_root, save_also_png, custom_colors): +def plot_conversion_at_sel_nucs_not_include_ref_scaled(df_subs, ref_name, ref_sequence, plot_title, conversion_nuc_from, fig_filename_root, save_also_png, custom_colors, **kwargs): ''' Plots the conversion at selected nucleotides not including reference base, scaled by number of events Looks for the 'conversion_nuc_from' in the ref_sequence and sets those as 'selected nucleotides' @@ -2721,7 +2737,21 @@ def prep_alleles_table_compare(df_alleles, sample_name_1, sample_name_2, MAX_N_R return X, annot, y_labels, insertion_dict, per_element_annot_kws -def plot_alleles_heatmap(reference_seq,fig_filename_root,X,annot,y_labels,insertion_dict,per_element_annot_kws,SAVE_ALSO_PNG=False,plot_cut_point=True,sgRNA_intervals=None,sgRNA_names=None,sgRNA_mismatches=None,custom_colors=None): +def plot_alleles_heatmap( + reference_seq, + fig_filename_root, + X, + annot, + y_labels, + insertion_dict, + per_element_annot_kws, + custom_colors, + SAVE_ALSO_PNG=False, + plot_cut_point=True, + sgRNA_intervals=None, + sgRNA_names=None, + sgRNA_mismatches=None, + **kwargs): """ Plots alleles in a heatmap (nucleotides color-coded for easy visualization) input: @@ -2890,7 +2920,7 @@ def plot_alleles_heatmap(reference_seq,fig_filename_root,X,annot,y_labels,insert fig.savefig(fig_filename_root+'.png', bbox_inches='tight', bbox_extra_artists=(lgd,)) plt.close(fig) -def plot_alleles_heatmap_hist(reference_seq,fig_filename_root,X,annot,y_labels,insertion_dict,per_element_annot_kws,count_values,SAVE_ALSO_PNG=False,plot_cut_point=True,sgRNA_intervals=None,sgRNA_names=None,sgRNA_mismatches=None,custom_colors=None): +def plot_alleles_heatmap_hist(reference_seq,fig_filename_root,X,annot,y_labels,insertion_dict,per_element_annot_kws,count_values,custom_colors,SAVE_ALSO_PNG=False,plot_cut_point=True,sgRNA_intervals=None,sgRNA_names=None,sgRNA_mismatches=None,**kwargs): """ Plots alleles in a heatmap (nucleotides color-coded for easy visualization) input: @@ -3025,7 +3055,7 @@ def plot_alleles_heatmap_hist(reference_seq,fig_filename_root,X,annot,y_labels,i plt.savefig(fig_filename_root+'.png', bbox_inches='tight', bbox_extra_artists=(lgd,), pad_inches=0.1) plt.close() -def plot_alleles_table(reference_seq,df_alleles,fig_filename_root,MIN_FREQUENCY=0.5,MAX_N_ROWS=100,SAVE_ALSO_PNG=False,plot_cut_point=True,sgRNA_intervals=None,sgRNA_names=None,sgRNA_mismatches=None,custom_colors=None,annotate_wildtype_allele='****'): +def plot_alleles_table(reference_seq,df_alleles,fig_filename_root,custom_colors,MIN_FREQUENCY=0.5,MAX_N_ROWS=100,SAVE_ALSO_PNG=False,plot_cut_point=True,sgRNA_intervals=None,sgRNA_names=None,sgRNA_mismatches=None,annotate_wildtype_allele='****',**kwargs): """ plots an allele table for a dataframe with allele frequencies input: @@ -3047,9 +3077,9 @@ def plot_alleles_table(reference_seq,df_alleles,fig_filename_root,MIN_FREQUENCY= for ix, is_ref in enumerate(is_reference): if is_ref: y_labels[ix] += annotate_wildtype_allele - plot_alleles_heatmap(reference_seq, fig_filename_root, X, annot, y_labels, insertion_dict, per_element_annot_kws, SAVE_ALSO_PNG, plot_cut_point, sgRNA_intervals, sgRNA_names, sgRNA_mismatches, custom_colors) + plot_alleles_heatmap(reference_seq, fig_filename_root, X, annot, y_labels, insertion_dict, per_element_annot_kws, custom_colors, SAVE_ALSO_PNG, plot_cut_point, sgRNA_intervals, sgRNA_names, sgRNA_mismatches) -def plot_alleles_table_from_file(alleles_file_name,fig_filename_root,MIN_FREQUENCY=0.5,MAX_N_ROWS=100,SAVE_ALSO_PNG=False,plot_cut_point=True,sgRNA_intervals=None,sgRNA_names=None,sgRNA_mismatches=None,custom_colors=None,annotate_wildtype_allele=''): +def plot_alleles_table_from_file(alleles_file_name,fig_filename_root,custom_colors,MIN_FREQUENCY=0.5,MAX_N_ROWS=100,SAVE_ALSO_PNG=False,plot_cut_point=True,sgRNA_intervals=None,sgRNA_names=None,sgRNA_mismatches=None,annotate_wildtype_allele='',**kwargs): """ plots an allele table for a dataframe with allele frequencies infers the reference sequence by finding reference sequences without gaps (-) @@ -3083,9 +3113,9 @@ def plot_alleles_table_from_file(alleles_file_name,fig_filename_root,MIN_FREQUEN for ix, is_ref in enumerate(is_reference): if is_ref: y_labels[ix] += annotate_wildtype_allele - plot_alleles_heatmap(reference_seq, fig_filename_root, X, annot, y_labels, insertion_dict, per_element_annot_kws, SAVE_ALSO_PNG, plot_cut_point, sgRNA_intervals, sgRNA_names, sgRNA_mismatches, custom_colors) + plot_alleles_heatmap(reference_seq, fig_filename_root, X, annot, y_labels, insertion_dict, per_element_annot_kws, custom_colors, SAVE_ALSO_PNG, plot_cut_point, sgRNA_intervals, sgRNA_names, sgRNA_mismatches) -def plot_alleles_tables_from_folder(crispresso_output_folder,fig_filename_root,MIN_FREQUENCY=None,MAX_N_ROWS=None,SAVE_ALSO_PNG=False,custom_colors=None,plot_cut_point=True,sgRNA_intervals=None,sgRNA_names=None,sgRNA_mismatches=None): +def plot_alleles_tables_from_folder(crispresso_output_folder,fig_filename_root,custom_colors,MIN_FREQUENCY=None,MAX_N_ROWS=None,SAVE_ALSO_PNG=False,plot_cut_point=True,sgRNA_intervals=None,sgRNA_names=None,sgRNA_mismatches=None,**kwargs): """ plots an allele table for each sgRNA/amplicon in a CRISPresso run (useful for plotting after running using the plot harness) This function is only used for one-off plotting purposes and not for the general CRISPResso analysis @@ -3152,11 +3182,11 @@ def plot_alleles_tables_from_folder(crispresso_output_folder,fig_filename_root,M new_sgRNA_intervals += [(int_start - new_sel_cols_start - 1, int_end - new_sel_cols_start - 1)] X, annot, y_labels, insertion_dict, per_element_annot_kws, is_reference = prep_alleles_table(df_alleles, ref_seq_around_cut, MAX_N_ROWS, MIN_FREQUENCY) - plot_alleles_heatmap(ref_seq_around_cut, fig_filename_root+"_"+ref_name+"_"+sgRNA_label, X, annot, y_labels, insertion_dict, per_element_annot_kws, SAVE_ALSO_PNG, plot_cut_point, new_sgRNA_intervals, sgRNA_names, sgRNA_mismatches, custom_colors) + plot_alleles_heatmap(ref_seq_around_cut, fig_filename_root+"_"+ref_name+"_"+sgRNA_label, X, annot, y_labels, insertion_dict, per_element_annot_kws, custom_colors, SAVE_ALSO_PNG, plot_cut_point, new_sgRNA_intervals, sgRNA_names, sgRNA_mismatches) plot_count += 1 print('Plotted ' + str(plot_count) + ' plots') -def plot_alleles_table_compare(reference_seq,df_alleles,sample_name_1,sample_name_2,fig_filename_root,MIN_FREQUENCY=0.5,MAX_N_ROWS=100,SAVE_ALSO_PNG=False,plot_cut_point=True,sgRNA_intervals=None,sgRNA_names=None,sgRNA_mismatches=None,custom_colors=None): +def plot_alleles_table_compare(reference_seq,df_alleles,sample_name_1,sample_name_2,fig_filename_root,custom_colors=None,MIN_FREQUENCY=0.5,MAX_N_ROWS=100,SAVE_ALSO_PNG=False,plot_cut_point=True,sgRNA_intervals=None,sgRNA_names=None,sgRNA_mismatches=None,**kwargs): """ plots an allele table for a dataframe with allele frequencies from two CRISPResso runs input: @@ -3174,9 +3204,9 @@ def plot_alleles_table_compare(reference_seq,df_alleles,sample_name_1,sample_nam custom_colors: dict of colors to plot (e.g. colors['A'] = (1,0,0,0.4) # red,blue,green,alpha ) """ X, annot, y_labels, insertion_dict, per_element_annot_kws = prep_alleles_table_compare(df_alleles, sample_name_1, sample_name_2, MAX_N_ROWS, MIN_FREQUENCY) - plot_alleles_heatmap(reference_seq, fig_filename_root, X, annot, y_labels, insertion_dict, per_element_annot_kws, SAVE_ALSO_PNG, plot_cut_point, sgRNA_intervals, sgRNA_names, sgRNA_mismatches, custom_colors) + plot_alleles_heatmap(reference_seq, fig_filename_root, X, annot, y_labels, insertion_dict, per_element_annot_kws, custom_colors, SAVE_ALSO_PNG, plot_cut_point, sgRNA_intervals, sgRNA_names, sgRNA_mismatches) -def plot_nucleotide_quilt_from_folder(crispresso_output_folder,fig_filename_root,save_also_png=False,sgRNA_intervals=None,min_text_pct=0.5,max_text_pct=0.95,quantification_window_idxs=None,sgRNA_names=None,sgRNA_mismatches=None,shade_unchanged=True): +def plot_nucleotide_quilt_from_folder(crispresso_output_folder,fig_filename_root,save_also_png=False,sgRNA_intervals=None,min_text_pct=0.5,max_text_pct=0.95,quantification_window_idxs=None,sgRNA_names=None,sgRNA_mismatches=None,shade_unchanged=True,**kwargs): """ plots an allele table for each sgRNA/amplicon in a CRISPresso run (useful for plotting after running using the plot harness) This function is only used for one-off plotting purposes and not for the general CRISPResso analysis @@ -3252,7 +3282,7 @@ def plot_nucleotide_quilt_from_folder(crispresso_output_folder,fig_filename_root plot_count += 1 print('Plotted ' + str(plot_count) + ' plots') -def plot_unmod_mod_pcts(fig_filename_root,df_summary_quantification,save_png,cutoff=None,max_samples_to_include_unprocessed=20): +def plot_unmod_mod_pcts(fig_filename_root,df_summary_quantification,save_png,cutoff=None,max_samples_to_include_unprocessed=20,**kwargs): """ plots a stacked horizontal barplot for summarizing number of reads, and the percent that are modified and unmodified params: @@ -3311,7 +3341,7 @@ def plot_unmod_mod_pcts(fig_filename_root,df_summary_quantification,save_png,cut fig.savefig(fig_filename_root+'.png', bbox_inches='tight') plt.close(fig) -def plot_reads_total(fig_filename_root,df_summary_quantification,save_png,cutoff=None): +def plot_reads_total(fig_filename_root,df_summary_quantification,save_png,cutoff=None,**kwargs): """ plots a horizontal barplot for summarizing number of reads aligned to each sample """ @@ -3344,7 +3374,7 @@ def plot_reads_total(fig_filename_root,df_summary_quantification,save_png,cutoff def plot_read_barplot(N_READS_INPUT, N_READS_AFTER_PREPROCESSING, N_TOTAL, - plot_root, save_png + plot_root, save_png,**kwargs ): """Plot barplot of total, processed, and aligned reads. @@ -3399,7 +3429,7 @@ def plot_read_barplot(N_READS_INPUT, N_READS_AFTER_PREPROCESSING, N_TOTAL, def plot_class_piechart_and_barplot(class_counts_order, class_counts, ref_names, expected_hdr_amplicon_seq, N_TOTAL, - piechart_plot_root, barplot_plot_root, save_png): + piechart_plot_root, barplot_plot_root, custom_colors, save_png,**kwargs): """Plot a pie chart and barplot of class assignments for reads. Class assignments include: 'MODIFIED','UNMODIFIED','HDR',etc. @@ -3494,7 +3524,7 @@ def plot_class_piechart_and_barplot(class_counts_order, class_counts, ref_names, plt.close() -def plot_class_dsODN_piechart(sizes, labels, plot_root, save_also_png=False): +def plot_class_dsODN_piechart(sizes, labels, plot_root, save_also_png=False,**kwargs): fig, ax = plt.subplots(figsize=(12, 12)) patches, texts, autotexts =ax.pie(sizes, labels=labels, autopct='%1.2f%%') @@ -3519,6 +3549,7 @@ def plot_quantification_comparison_barchart( plot_titles, plot_path, save_also_png=False, + **kwargs ): fig, axs = plt.subplots(1, 2, figsize=(30, 15)) n_groups = 2 @@ -3597,6 +3628,7 @@ def plot_quantification_positions( plot_title, plot_path, save_also_png=False, + **kwargs, ): fig, axs = plt.subplots(2, 1, figsize=(20, 10)) ax1 = axs[0] @@ -3737,85 +3769,3 @@ def plot_quantification_positions( ) plt.close(fig) - - -def plot_allele_modification_heatmap( - sample_values, sample_sgRNA_intervals, plot_path, title, -): - fig = px.imshow( - sample_values, - labels={ - 'x': 'Amplicon Nucleotide (Position)', - 'y': 'Sample (Index)', - 'color': '{0} (%)'.format(title), - }, - aspect='auto', - ) - for sample_id, sgRNA_intervals in zip( - range(sample_values.shape[0]), sample_sgRNA_intervals, - ): - for sgRNA_interval in sgRNA_intervals: - fig.add_shape( - type='rect', - x0=sgRNA_interval[0], - y0=sample_id - 0.5, - x1=sgRNA_interval[1], - y1=sample_id + 0.5, - line={'color': 'Black'}, - ) - - fig.update_layout( - autosize=True, - ) - fig['layout']['yaxis']['scaleanchor'] = 'x' - fig['layout']['yaxis']['gridcolor'] = 'rgba(0, 0, 0, 0)' - fig['layout']['xaxis']['gridcolor'] = 'rgba(0, 0, 0, 0)' - return fig.write_html( - plot_path, - config={ - 'responsive': True, - 'displaylogo': False, - }, - include_plotlyjs='cdn', - full_html=False, - div_id='allele-modification-heatmap-{0}'.format(title.lower()), - ) - - -def plot_allele_modification_line( - sample_values, sample_sgRNA_intervals, plot_path, title, -): - fig = px.line(sample_values.transpose()) - sgRNA_intervals = set( - tuple(sgRNA_interval) - for sample_sgRNA_interval in sample_sgRNA_intervals - for sgRNA_interval in sample_sgRNA_interval - ) - for sgRNA_interval in sgRNA_intervals: - fig.add_shape( - type='rect', - x0=sgRNA_interval[0], - y0=0, - x1=sgRNA_interval[1], - y1=0.5, - fillcolor='Gray', - opacity=0.2, - line={'color': 'gray'}, - ) - - fig.update_layout( - autosize=True, - xaxis_title='Amplicon Nucleotide (Position)', - yaxis_title='{0} (%)'.format(title), - legend_title='Samples', - ) - return fig.write_html( - plot_path, - config={ - 'responsive': True, - 'displaylogo': False, - }, - include_plotlyjs='cdn', - full_html=False, - div_id='allele-modification-line-{0}'.format(title.lower()), - ) diff --git a/CRISPResso2/CRISPRessoPooledCORE.py b/CRISPResso2/CRISPRessoPooledCORE.py index d84b987e..8c63dc42 100644 --- a/CRISPResso2/CRISPRessoPooledCORE.py +++ b/CRISPResso2/CRISPRessoPooledCORE.py @@ -19,7 +19,7 @@ from CRISPResso2 import CRISPRessoShared from CRISPResso2 import CRISPRessoMultiProcessing from CRISPResso2.CRISPRessoReports import CRISPRessoReport -from CRISPResso2 import CRISPRessoPlot + import traceback import logging @@ -107,7 +107,7 @@ def summarize_region_fastq_chunk(input_arr): for input in input_arr: # print('doing region ' + str(input)) region_fastq, uncompressed_reference = input.split(" ") - #region format: REGION_chr8_1077_1198.fastq.gz + # region format: REGION_chr8_1077_1198.fastq.gz #But if the chr has underscores, it could look like this: # REGION_chr8_KI270812v1_alt_1077_1198.fastq.gz region_info = os.path.basename(region_fastq).replace('.fastq.gz', '').replace('.fastq', '').split('_') @@ -294,50 +294,18 @@ def main(): )) sys.exit() - parser = CRISPRessoShared.getCRISPRessoArgParser(parser_title = 'CRISPRessoPooled Parameters') - parser.add_argument('-f', '--amplicons_file', type=str, help='Amplicons description file. This file is a tab-delimited text file with up to 14 columns (2 required):\ - \namplicon_name: an identifier for the amplicon (must be unique).\ - \namplicon_seq: amplicon sequence used in the experiment.\ - \nguide_seq (OPTIONAL): sgRNA sequence used for this amplicon without the PAM sequence. Multiple guides can be given separated by commas and not spaces.\ - \nexpected_hdr_amplicon_seq (OPTIONAL): expected amplicon sequence in case of HDR.\ - \ncoding_seq (OPTIONAL): Subsequence(s) of the amplicon corresponding to coding sequences. If more than one separate them by commas and not spaces.\ - \nprime_editing_pegRNA_spacer_seq (OPTIONAL): pegRNA spacer sgRNA sequence used in prime editing. The spacer should not include the PAM sequence. The sequence should be given in the RNA 5\'->3\' order, so for Cas9, the PAM would be on the right side of the given sequence.\ - \nprime_editing_nicking_guide_seq (OPTIONAL): Nicking sgRNA sequence used in prime editing. The sgRNA should not include the PAM sequence. The sequence should be given in the RNA 5\'->3\' order, so for Cas9, the PAM would be on the right side of the sequence.\ - \nprime_editing_pegRNA_extension_seq (OPTIONAL): Extension sequence used in prime editing. The sequence should be given in the RNA 5\'->3\' order, such that the sequence starts with the RT template including the edit, followed by the Primer-binding site (PBS).\ - \nprime_editing_pegRNA_scaffold_seq (OPTIONAL): If given, reads containing any of this scaffold sequence before extension sequence (provided by --prime_editing_extension_seq) will be classified as \'Scaffold-incorporated\'. The sequence should be given in the 5\'->3\' order such that the RT template directly follows this sequence. A common value ends with \'GGCACCGAGUCGGUGC\'.\ - \nprime_editing_pegRNA_scaffold_min_match_length (OPTIONAL): Minimum number of bases matching scaffold sequence for the read to be counted as \'Scaffold-incorporated\'. If the scaffold sequence matches the reference sequence at the incorporation site, the minimum number of bases to match will be minimally increased (beyond this parameter) to disambiguate between prime-edited and scaffold-incorporated sequences.\ - \nprime_editing_override_prime_edited_ref_seq (OPTIONAL): If given, this sequence will be used as the prime-edited reference sequence. This may be useful if the prime-edited reference sequence has large indels or the algorithm cannot otherwise infer the correct reference sequence.\ - \nquantification_window_coordinates (OPTIONAL): Bp positions in the amplicon sequence specifying the quantification window. This parameter overrides values of the "--quantification_window_center", "-- cleavage_offset", "--window_around_sgrna" or "-- window_around_sgrna" values. Any indels/substitutions outside this window are excluded. Indexes are 0-based, meaning that the first nucleotide is position 0. Ranges are separated by the dash sign like "start-stop", and multiple ranges can be separated by the underscore (\_). A value of 0 disables this filter. (can be comma-separated list of values, corresponding to amplicon sequences given in --amplicon_seq e.g. 5-10,5-10_20-30 would specify the 5th-10th bp in the first reference and the 5th-10th and 20th-30th bp in the second reference) (default: None)\ - \nquantification_window_size (OPTIONAL): Defines the size (in bp) of the quantification window extending from the position specified by the "--cleavage_offset" or "--quantification_window_center" parameter in relation to the provided guide RNA sequence(s) (--sgRNA). Mutations within this number of bp from the quantification window center are used in classifying reads as modified or unmodified. A value of 0 disables this window and indels in the entire amplicon are considered. Default is 1, 1bp on each side of the cleavage position for a total length of 2bp.\ - \nquantification_window_center (OPTIONAL): Center of quantification window to use within respect to the 3\' end of the provided sgRNA sequence. Remember that the sgRNA sequence must be entered without the PAM. For cleaving nucleases, this is the predicted cleavage position. The default is -3 and is suitable for the Cas9 system. For alternate nucleases, other cleavage offsets may be appropriate, for example, if using Cpf1 this parameter would be set to 1. For base editors, this could be set to -17.', default='') - - #tool specific optional - parser.add_argument('--gene_annotations', type=str, help='Gene Annotation Table from UCSC Genome Browser Tables (http://genome.ucsc.edu/cgi-bin/hgTables?command=start), \ - please select as table "knownGene", as output format "all fields from selected table" and as file returned "gzip compressed"', default='') - # rationale for setting the default scores: - # --end-to-end - no clipping, match bonus -ma is set to 0 - # -N 0 number of mismatches allowed in seed alignment - # --np 0 where read (or ref have ambiguous character (N)) penalty is 0 - # -mp 3,2 mismatch penalty - set max mismatch to -3 to coincide with the gap extension penalty (2 is the default min mismatch penalty) - # --score-min L,-5,-3*(1-H) For a given homology score, we allow up to (1-H) mismatches (-3) or gap extensions (-3) and one gap open (-5). This score translates to -5 + -3(1-H)L where L is the sequence length - parser.add_argument('--bowtie2_options_string', type=str, help='Override options for the Bowtie2 alignment command. By default, this is " --end-to-end -N 0 --np 0 -mp 3,2 --score-min L,-5,-3(1-H)" where H is the default homology score.', default='') - parser.add_argument('--use_legacy_bowtie2_options_string', help='Use legacy (more stringent) Bowtie2 alignment parameters: " -k 1 --end-to-end -N 0 --np 0 ".', action='store_true') - parser.add_argument('--min_reads_to_use_region', type=float, help='Minimum number of reads that align to a region to perform the CRISPResso analysis', default=1000) - parser.add_argument('--skip_failed', help='Continue with pooled analysis even if one sample fails', action='store_true') - parser.add_argument('--skip_reporting_problematic_regions', help='Skip reporting of problematic regions. By default, when both amplicons (-f) and genome (-x) are provided, problematic reads that align to the genome but to positions other than where the amplicons align are reported as problematic', action='store_true') - parser.add_argument('--crispresso_command', help='CRISPResso command to call', default='CRISPResso') - parser.add_argument('--compile_postrun_references', help='If set, a file will be produced which compiles the reference sequences of frequent amplicons.', action='store_true') - parser.add_argument('--compile_postrun_reference_allele_cutoff', type=float, help='Only alleles with at least this percentage frequency in the population will be reported in the postrun analysis. This parameter is given as a percent, so 30 is 30%%.', default=30) - parser.add_argument('--alternate_alleles', type=str, help='Path to tab-separated file with alternate allele sequences for pooled experiments. This file has the columns "region_name","reference_seqs", and "reference_names" and gives the reference sequences of alternate alleles that will be passed to CRISPResso for each individual region for allelic analysis. Multiple reference alleles and reference names for a given region name are separated by commas (no spaces).', default='') - parser.add_argument('--limit_open_files_for_demux', help='If set, only one file will be opened during demultiplexing of read alignment locations. This will be slightly slower as the reads must be sorted, but may be necessary if the number of amplicons is greater than the number of files that can be opened due to OS constraints.', action='store_true') - parser.add_argument('--aligned_pooled_bam', type=str, help='Path to aligned input for CRISPRessoPooled processing. If this parameter is specified, the alignments in the given bam will be used to demultiplex reads. If this parameter is not set (default), input reads provided by --fastq_r1 (and optionally --fastq_r2) will be aligned to the reference genome using bowtie2. If the input bam is given, the corresponding reference fasta must also be given to extract reference genomic sequences via the parameter --bowtie2_index. Note that if the aligned reads are paired-end sequenced, they should already be merged into 1 read (e.g. via Flash) before alignment.', default=None) - parser.add_argument('--demultiplex_only_at_amplicons', help='If set, and an amplicon file (--amplicons_file) and reference sequence (--bowtie2_index) are provided, reads overlapping alignment positions of amplicons will be demultiplexed and assigned to that amplicon. If this flag is not set, the entire genome will be demultiplexed and reads with the same start and stop coordinates as an amplicon will be assigned to that amplicon.', action='store_true') + parser = CRISPRessoShared.getCRISPRessoArgParser("Pooled", parser_title = 'CRISPRessoPooled Parameters') args = parser.parse_args() + if args.use_matplotlib or not CRISPRessoShared.is_C2Pro_installed(): + from CRISPResso2 import CRISPRessoPlot + else: + from CRISPRessoPro import plot as CRISPRessoPlot + CRISPRessoShared.set_console_log_level(logger, args.verbosity, args.debug) - crispresso_options = CRISPRessoShared.get_crispresso_options() + crispresso_options = CRISPRessoShared.get_core_crispresso_options() options_to_ignore = {'fastq_r1', 'fastq_r2', 'amplicon_seq', 'amplicon_name', 'output_folder', 'name', 'zip_output', 'split_interleaved_input'} crispresso_options_for_pooled = list(crispresso_options-options_to_ignore) @@ -359,7 +327,7 @@ def main(): log_filename = _jp('CRISPRessoPooled_RUNNING_LOG.txt') logger.addHandler(logging.FileHandler(log_filename)) - logger.addHandler(CRISPRessoShared.StatusHandler(_jp('CRISPRessoPooled_status.txt'))) + logger.addHandler(CRISPRessoShared.StatusHandler(_jp('CRISPRessoPooled_status.json'))) if args.zip_output and not args.place_report_in_output_folder: logger.warn('Invalid arguement combination: If zip_output is True then place_report_in_output_folder must also be True. Setting place_report_in_output_folder to True.') @@ -533,87 +501,72 @@ def main(): CRISPRessoShared.force_symlink(os.path.abspath(args.fastq_r1), symlink_filename) output_forward_filename = symlink_filename else: + info('Trimming sequences with fastp...') output_forward_filename = _jp('reads.trimmed.fq.gz') - # Trimming with trimmomatic - info('Trimming sequences with Trimmomatic...', {'percent_complete': 7}) - cmd = '%s SE -phred33 %s %s %s >>%s 2>&1'\ - % (args.trimmomatic_command, args.fastq_r1, - output_forward_filename, - args.trimmomatic_options_string, - log_filename) - # print cmd - TRIMMOMATIC_STATUS = sb.call(cmd, shell=True) - - if TRIMMOMATIC_STATUS: - raise TrimmomaticException('TRIMMOMATIC failed to run, please check the log file.') + cmd = '{command} -i {r1} -o {out} {options} --json {json_report} --html {html_report} >> {log} 2>&1'.format( + command=args.fastp_command, + r1=args.fastq_r1, + out=output_forward_filename, + options=args.fastp_options_string, + json_report=_jp('fastp_report.json'), + html_report=_jp('fastp_report.html'), + log=log_filename, + ) + fastp_status = sb.call(cmd, shell=True) + + if fastp_status: + raise CRISPRessoShared.FastpException('FASTP failed to run, please check the log file.') + info('Done!', {'percent_complete': 7}) processed_output_filename = output_forward_filename else: # paired end reads case if not args.trim_sequences: - output_forward_paired_filename = args.fastq_r1 - output_reverse_paired_filename = args.fastq_r2 + args.fastp_options_string += ' --disable_adapter_trimming --disable_trim_poly_g --disable_quality_filtering --disable_length_filtering' else: - info('Trimming sequences with Trimmomatic...', {'percent_complete': 7}) - output_forward_paired_filename = _jp('output_forward_paired.fq.gz') - output_forward_unpaired_filename = _jp('output_forward_unpaired.fq.gz') - output_reverse_paired_filename = _jp('output_reverse_paired.fq.gz') - output_reverse_unpaired_filename = _jp('output_reverse_unpaired.fq.gz') - - # Trimming with trimmomatic - cmd = '%s PE -phred33 %s %s %s %s %s %s %s >>%s 2>&1'\ - % (args.trimmomatic_command, - args.fastq_r1, args.fastq_r2, output_forward_paired_filename, - output_forward_unpaired_filename, output_reverse_paired_filename, - output_reverse_unpaired_filename, args.trimmomatic_options_string, log_filename) - # print cmd - TRIMMOMATIC_STATUS = sb.call(cmd, shell=True) - if TRIMMOMATIC_STATUS: - raise TrimmomaticException('TRIMMOMATIC failed to run, please check the log file.') - - info('Done!') - - max_overlap_string = "" - min_overlap_string = "" - if args.max_paired_end_reads_overlap: - max_overlap_string = "--max-overlap " + str(args.max_paired_end_reads_overlap) - if args.min_paired_end_reads_overlap: - min_overlap_string = "--min-overlap " + str(args.min_paired_end_reads_overlap) - # Merging with Flash - info('Merging paired sequences with Flash...', {'percent_complete': 10}) - cmd = args.flash_command+' --allow-outies %s %s %s %s -z -d %s >>%s 2>&1' %\ - (output_forward_paired_filename, - output_reverse_paired_filename, - max_overlap_string, - min_overlap_string, - OUTPUT_DIRECTORY, log_filename) - - if args.debug: - info('Flash command: %s'%cmd) + args.fastp_options_string += ' --detect_adapter_for_pe' - FLASH_STATUS = sb.call(cmd, shell=True) - if FLASH_STATUS: - raise FlashException('Flash failed to run, please check the log file.') + processed_output_filename = _jp('out.extendedFrags.fastq.gz') + not_combined_1_filename = _jp('out.notCombined_1.fastq.gz') + not_combined_2_filename = _jp('out.notCombined_2.fastq.gz') + + info('Merging paired sequences with fastp...') + fastp_cmd = '{command} -i {r1} -I {r2} --merge --merged_out {out_merged} --unpaired1 {unpaired1} --unpaired2 {unpaired2} --overlap_len_require {min_overlap} --thread {num_threads} --json {json_report} --html {html_report} {options} >> {log} 2>&1'.format( + command=args.fastp_command, + r1=args.fastq_r1, + r2=args.fastq_r2, + out_merged=processed_output_filename, + unpaired1=not_combined_1_filename, + unpaired2=not_combined_2_filename, + min_overlap=args.min_paired_end_reads_overlap, + num_threads=n_processes_for_pooled, + json_report=_jp('fastp_report.json'), + html_report=_jp('fastp_report.html'), + options=args.fastp_options_string, + log=log_filename, + ) + fastp_status = sb.call(fastp_cmd, shell=True) - flash_hist_filename = _jp('out.hist') - flash_histogram_filename = _jp('out.histogram') - flash_not_combined_1_filename = _jp('out.notCombined_1.fastq.gz') - flash_not_combined_2_filename = _jp('out.notCombined_2.fastq.gz') + if args.debug: + info('Fastp command: {0}'.format(fastp_cmd)) - processed_output_filename = _jp('out.extendedFrags.fastq.gz') + if fastp_status: + raise CRISPRessoShared.FastpException('Fastp failed to run, please check the log file.') + crispresso2_info['running_info']['fastp_command'] = fastp_cmd if args.force_merge_pairs: - old_flashed_filename = processed_output_filename new_merged_filename = _jp('out.forcemerged_uncombined.fastq.gz') - num_reads_force_merged = CRISPRessoShared.force_merge_pairs(flash_not_combined_1_filename, flash_not_combined_2_filename, new_merged_filename) + num_reads_force_merged = CRISPRessoShared.force_merge_pairs(not_combined_1_filename, not_combined_2_filename, new_merged_filename) new_output_filename = _jp('out.forcemerged.fastq.gz') - merge_command = "cat %s %s > %s"%(processed_output_filename, new_merged_filename, new_output_filename) - MERGE_STATUS = sb.call(merge_command, shell=True) - if MERGE_STATUS: - raise FlashException('Force-merging read pairs failed to run, please check the log file.') + merge_command = "cat {0} {1} > {2}".format(processed_output_filename, new_merged_filename, new_output_filename) + merge_status = sb.call(merge_command, shell=True) + if merge_status: + raise CRISPRessoShared.FastpException('Force-merging read pairs failed to run, please check the log file.') + else: + info(f'Forced {num_reads_force_merged} read pairs together.') processed_output_filename = new_output_filename - info('Done!') + info('Done!', {'percent_complete': 7}) if can_finish_incomplete_run and 'count_input_reads' in crispresso2_info['running_info']['finished_steps']: (N_READS_INPUT, N_READS_AFTER_PREPROCESSING) = crispresso2_info['running_info']['finished_steps']['count_input_reads'] @@ -660,7 +613,7 @@ def main(): head_line = amplicons_fin.readline() header_els = head_line.split('\t') - head_lookup = CRISPRessoShared.get_crispresso_options_lookup() # dict of qwc -> quantification_window_coordinates + head_lookup = CRISPRessoShared.get_crispresso_options_lookup("Core") # dict of qwc -> quantification_window_coordinates # add legacy CRISPRessoPooled headers to the head_lookup # lowercase input header names for matching - they'll get fixed in the matching to default_input_amplicon_headers @@ -891,7 +844,6 @@ def main(): else: warn('Skipping amplicon [%s] because no reads align to it\n'% idx) - CRISPRessoMultiProcessing.run_crispresso_cmds(crispresso_cmds, n_processes_for_pooled, 'amplicon', args.skip_failed, start_end_percent=(16, 80)) # Initialize array to track failed runs failed_batch_arr = [] diff --git a/CRISPResso2/CRISPRessoPooledWGSCompareCORE.py b/CRISPResso2/CRISPRessoPooledWGSCompareCORE.py index abac3cea..09cdd33f 100644 --- a/CRISPResso2/CRISPRessoPooledWGSCompareCORE.py +++ b/CRISPResso2/CRISPRessoPooledWGSCompareCORE.py @@ -231,7 +231,7 @@ def main(): log_filename = _jp('CRISPRessoPooledWGSCompare_RUNNING_LOG.txt') logger.addHandler(logging.FileHandler(log_filename)) - logger.addHandler(CRISPRessoShared.StatusHandler(_jp('CRISPRessoPooledWGSCompare_status.txt'))) + logger.addHandler(CRISPRessoShared.StatusHandler(_jp('CRISPRessoPooledWGSCompare_status.json'))) with open(log_filename, 'w+') as outfile: outfile.write( diff --git a/CRISPResso2/CRISPRessoReports/CRISPRessoReport.py b/CRISPResso2/CRISPRessoReports/CRISPRessoReport.py index c1e11c7c..c4c17fd7 100644 --- a/CRISPResso2/CRISPRessoReports/CRISPRessoReport.py +++ b/CRISPResso2/CRISPRessoReports/CRISPRessoReport.py @@ -5,10 +5,23 @@ ''' import os -from jinja2 import Environment, FileSystemLoader +from jinja2 import Environment, FileSystemLoader, PackageLoader, ChoiceLoader from jinja_partials import generate_render_partial, render_partial from CRISPResso2 import CRISPRessoShared +if CRISPRessoShared.is_C2Pro_installed(): + from CRISPRessoPro import __version__ as CRISPRessoProVersion + C2PRO_INSTALLED = True +else: + C2PRO_INSTALLED = False + + +def get_jinja_loader(_ROOT): + if CRISPRessoShared.is_C2Pro_installed(): + return Environment(loader=ChoiceLoader([FileSystemLoader(os.path.join(_ROOT, 'CRISPRessoReports', 'templates')), PackageLoader('CRISPRessoPro', 'templates')])) + else: + return Environment(loader=FileSystemLoader(os.path.join(_ROOT, 'CRISPRessoReports', 'templates'))) + def render_template(template_name, jinja2_env, **data): """Render a template with partials. @@ -36,6 +49,7 @@ def custom_partial_render(partial_template_name, **partial_data): ), is_default_user=False, is_web=False, + C2PRO_INSTALLED=C2PRO_INSTALLED, ) return template.render(**partial_data) return render_partial( @@ -59,8 +73,8 @@ def make_report_from_folder(crispresso_report_file, crispresso_folder, _ROOT): make_report(run_data, crispresso_report_file, crispresso_folder, _ROOT) -def add_fig_if_exists(fig_name, fig_root, fig_title, fig_caption, fig_data, - amplicon_fig_names, amplicon_figures, crispresso_folder): +def add_fig_if_exists(fig, fig_name, fig_root, fig_title, fig_caption, fig_data, + amplicon_fig_names, amplicon_figures, crispresso_folder, d3_nuc_quilt_names): """ Helper function to add figure if the file exists if fig at filename exists, @@ -69,8 +83,9 @@ def add_fig_if_exists(fig_name, fig_root, fig_title, fig_caption, fig_data, # fullpath=os.path.join(crispresso_folder,fig_root+'.png') pngfullpath = os.path.join(crispresso_folder, fig_root + '.png') htmlfullpath = os.path.join(crispresso_folder, fig_root + '.html') + jsonfullpath = os.path.join(crispresso_folder, f'plot_{fig_root}.json') # print('adding file ' + fig_root + ' at ' + fullpath) - if os.path.exists(pngfullpath) or os.path.exists(htmlfullpath): + if os.path.exists(pngfullpath) or os.path.exists(htmlfullpath) or os.path.exists(jsonfullpath): amplicon_fig_names.append(fig_name) # amplicon_fig_locs[fig_name]=os.path.basename(fig_root+'.png') amplicon_figures['locs'][fig_name] = os.path.basename(fig_root) @@ -86,6 +101,14 @@ def add_fig_if_exists(fig_name, fig_root, fig_title, fig_caption, fig_data, html_string += html.read() html_string += "" amplicon_figures['htmls'][fig_name] = html_string + elif os.path.exists(jsonfullpath) and C2PRO_INSTALLED: + root_name = fig_root.replace('.', '_').replace('-', '_') + d3_nuc_quilt_names.append(f"nuc_quilt_{root_name}") + with open(jsonfullpath) as fig_json_fh: + amplicon_figures['htmls'][fig_name] = f""" +
+ + """ def assemble_figs(run_data, crispresso_folder): @@ -93,15 +116,16 @@ def assemble_figs(run_data, crispresso_folder): Helper function create the data structre for the figures """ figures = {'names': {}, 'locs': {}, 'titles': {}, 'captions': {}, 'datas': {}, 'htmls': {}, 'sgRNA_based_names': {}} + d3_nuc_quilt_names = [] global_fig_names = [] for fig in ['1a', '1b', '1c', '1d', '5a', '6a', '8a', '11c']: fig_name = 'plot_' + fig if fig_name + '_root' in run_data['results']['general_plots']: - add_fig_if_exists(fig_name, run_data['results']['general_plots'][fig_name + '_root'], 'Figure ' + fig, + add_fig_if_exists(fig, fig_name, run_data['results']['general_plots'][fig_name + '_root'], 'Figure ' + fig, run_data['results']['general_plots'][fig_name + '_caption'], run_data['results']['general_plots'][fig_name + '_data'], - global_fig_names, figures, crispresso_folder) + global_fig_names, figures, crispresso_folder, d3_nuc_quilt_names) amplicons = [] for amplicon_name in run_data['results']['ref_names']: @@ -112,11 +136,11 @@ def assemble_figs(run_data, crispresso_folder): '11a']: fig_name = 'plot_' + fig if fig_name + '_root' in run_data['results']['refs'][amplicon_name]: - add_fig_if_exists(fig_name, run_data['results']['refs'][amplicon_name][fig_name + '_root'], + add_fig_if_exists(fig, fig_name, run_data['results']['refs'][amplicon_name][fig_name + '_root'], 'Figure ' + fig_name, run_data['results']['refs'][amplicon_name][fig_name + '_caption'], run_data['results']['refs'][amplicon_name][fig_name + '_data'], - global_fig_names, amplicon_figures, crispresso_folder) + global_fig_names, amplicon_figures, crispresso_folder, d3_nuc_quilt_names) this_sgRNA_based_fig_names = {} for fig in ['2b', '9', '10d', '10e', '10f', '10g', '11b']: @@ -125,10 +149,10 @@ def assemble_figs(run_data, crispresso_folder): if 'plot_' + fig + '_roots' in run_data['results']['refs'][amplicon_name]: for idx, plot_root in enumerate(run_data['results']['refs'][amplicon_name]['plot_' + fig + '_roots']): fig_name = "plot_" + fig + "_" + str(idx) - add_fig_if_exists(fig_name, plot_root, 'Figure ' + fig_name + ' sgRNA ' + str(idx + 1), + add_fig_if_exists(fig, fig_name, plot_root, 'Figure ' + fig_name + ' sgRNA ' + str(idx + 1), run_data['results']['refs'][amplicon_name]['plot_' + fig + '_captions'][idx], run_data['results']['refs'][amplicon_name]['plot_' + fig + '_datas'][idx], - this_fig_names, amplicon_figures, crispresso_folder) + this_fig_names, amplicon_figures, crispresso_folder, d3_nuc_quilt_names) this_sgRNA_based_fig_names[fig] = this_fig_names figures['names'][amplicon_name] = amplicon_figures['names'] @@ -139,7 +163,7 @@ def assemble_figs(run_data, crispresso_folder): figures['captions'][amplicon_name] = amplicon_figures['captions'] figures['datas'][amplicon_name] = amplicon_figures['datas'] figures['htmls'][amplicon_name] = amplicon_figures['htmls'] - data = {'amplicons': amplicons, 'figures': figures} + data = {'amplicons': amplicons, 'figures': figures, 'nuc_quilt_names': d3_nuc_quilt_names} return data @@ -166,9 +190,10 @@ def make_report(run_data, crispresso_report_file, crispresso_folder, _ROOT): 'run_data': run_data, 'report_display_name': report_display_name, 'crispresso_data_path': crispresso_data_path, + 'nuc_quilt_names': data['nuc_quilt_names'], } - j2_env = Environment(loader=FileSystemLoader(os.path.join(_ROOT, 'CRISPRessoReports', 'templates'))) + j2_env = get_jinja_loader(_ROOT) # dest_dir = os.path.dirname(crispresso_report_file) # shutil.copy2(os.path.join(_ROOT,'templates','CRISPResso_justcup.png'),dest_dir) @@ -176,7 +201,7 @@ def make_report(run_data, crispresso_report_file, crispresso_folder, _ROOT): with open(crispresso_report_file, 'w', encoding="utf-8") as outfile: outfile.write(render_template( - 'report.html', j2_env, report_data=report_data, + 'report.html', j2_env, report_data=report_data, C2PRO_INSTALLED=C2PRO_INSTALLED, )) @@ -259,6 +284,15 @@ def make_batch_report_from_folder(crispressoBatch_report_file, crispresso2_info, with open(line_plot_path, encoding="utf-8") as fh: allele_modification_line_plot['htmls'][line_plot_name] = fh.read() + summary_plot_htmls = {} + for plot_name in window_nuc_pct_quilts + nuc_pct_quilts: + if os.path.exists(os.path.join(batch_folder, f'{plot_name}.json')): + with open(os.path.join(batch_folder, f'{plot_name}.json')) as window_nuc_pct_json_fh: + summary_plot_htmls[plot_name] = f""" +
+ + """ + #find path between the report and the data (if the report is in another directory vs in the same directory as the data) crispresso_data_path = os.path.relpath(batch_folder, os.path.dirname(crispressoBatch_report_file)) if crispresso_data_path == ".": @@ -302,6 +336,7 @@ def make_batch_report_from_folder(crispressoBatch_report_file, crispresso2_info, 'titles': summary_plot_titles, 'labels': summary_plot_labels, 'datas': summary_plot_datas, + 'htmls': summary_plot_htmls, }, window_nuc_pct_quilts=window_nuc_pct_quilts, nuc_pct_quilts=nuc_pct_quilts, @@ -490,9 +525,8 @@ def fill_default(dictionary, key, default_type=list): if key not in dictionary: dictionary[key] = default_type() - j2_env = Environment( - loader=FileSystemLoader(os.path.join(_ROOT, 'CRISPRessoReports', 'templates')), - ) + j2_env = get_jinja_loader(_ROOT) + j2_env.filters['dirname'] = dirname if crispresso_tool == 'batch': template = 'batchReport.html' @@ -538,6 +572,7 @@ def fill_default(dictionary, key, default_type=list): 'titles': [], 'labels': [], 'datas': [], + 'htmls': [], } for html in sub_html_files: @@ -556,7 +591,7 @@ def fill_default(dictionary, key, default_type=list): 'titles': summary_plots['titles'], 'labels': summary_plots['labels'], 'datas': summary_plots['datas'], - 'htmls': [], + 'htmls': summary_plots['htmls'] if 'htmls' in summary_plots else [], 'crispresso_data_path': crispresso_data_path, }, run_names=run_names, @@ -575,6 +610,7 @@ def fill_default(dictionary, key, default_type=list): allele_modification_line_plot_titles=allele_modification_line_plot['titles'], allele_modification_line_plot_labels=allele_modification_line_plot['labels'], allele_modification_line_plot_datas=allele_modification_line_plot['datas'], + C2PRO_INSTALLED=C2PRO_INSTALLED, )) diff --git a/CRISPResso2/CRISPRessoReports/templates/batchReport.html b/CRISPResso2/CRISPRessoReports/templates/batchReport.html index 49a6c9ea..fe4a0200 100644 --- a/CRISPResso2/CRISPRessoReports/templates/batchReport.html +++ b/CRISPResso2/CRISPRessoReports/templates/batchReport.html @@ -76,8 +76,12 @@
Nucleotide percentages around guides
{% for plot_name in window_nuc_pct_quilts %} -
{{report_data['titles'][plot_name]}}
- {{ render_partial('shared/partials/fig_summaries.html', report_data=report_data, plot_name=plot_name) }} +
{{report_data['titles'][plot_name]}}
+ {% if plot_name in report_data['htmls'] %} + {{ report_data['htmls'][plot_name]|safe }} + {% else %} + {{ render_partial('shared/partials/fig_summaries.html', report_data=report_data, plot_name=plot_name) }} + {% endif %} {% endfor %}
@@ -90,8 +94,12 @@
Nucleotide percentages in the entire amplicon
{% for plot_name in nuc_pct_quilts %} -
{{report_data['titles'][plot_name]}}
- {{ render_partial('shared/partials/fig_summaries.html', report_data=report_data, plot_name=plot_name) }} +
{{report_data['titles'][plot_name]}}
+ {% if plot_name in report_data['htmls'] %} + {{ report_data['htmls'][plot_name]|safe }} + {% else %} + {{ render_partial('shared/partials/fig_summaries.html', report_data=report_data, plot_name=plot_name) }} + {% endif %} {% endfor %}
@@ -257,4 +265,8 @@
{{allele_modification_heatmap_plot_titles[heatmap_plot_name]}}
{% endblock %} {% block foot %} +{% if C2PRO_INSTALLED %} + + {{ render_partial('partials/batch_d3.html', nucleotide_quilt_slugs=(window_nuc_pct_quilts + nuc_pct_quilts))}} +{% endif %} {% endblock %} diff --git a/CRISPResso2/CRISPRessoReports/templates/layout.html b/CRISPResso2/CRISPRessoReports/templates/layout.html index a028254c..f7a616a4 100644 --- a/CRISPResso2/CRISPRessoReports/templates/layout.html +++ b/CRISPResso2/CRISPRessoReports/templates/layout.html @@ -9,7 +9,6 @@ - - +{% if C2PRO_INSTALLED %} + +{% endif %} {% endblock %} {% block content %} diff --git a/CRISPResso2/CRISPRessoReports/templates/report.html b/CRISPResso2/CRISPRessoReports/templates/report.html index 9214d168..0650b56f 100644 --- a/CRISPResso2/CRISPRessoReports/templates/report.html +++ b/CRISPResso2/CRISPRessoReports/templates/report.html @@ -73,7 +73,9 @@ } } - +{% if C2PRO_INSTALLED %} + +{% endif %} {% endblock %} {% block content %} @@ -86,6 +88,7 @@ {% if report_data['report_display_name'] != '' %}
{{report_data['report_display_name']}}
{% endif %} + {{ render_partial('shared/partials/guardrail_warnings.html', report_data=report_data) }}
CRISPResso2 run information