Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flexiguide alignment parameters #107

Merged
merged 7 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ jobs:
uses: actions/checkout@v3
with:
repository: edilytics/CRISPResso2_tests
ref: 'cole/add-flexiguide-alignment-parameters'
# ref: '<BRANCH-NAME>' # update to specific branch

- name: Run Basic
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Run Pytest

on:
push:

pull_request:
types: [opened, reopened]

Expand All @@ -20,9 +20,8 @@ jobs:
- uses: actions/checkout@v3

- name: Set up Conda
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v3
with:
mamba-version: "*"
channels: conda-forge,bioconda,defaults
auto-activate-base: false
activate-environment: test_env
Expand All @@ -32,15 +31,15 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y gcc g++ bowtie2 samtools libsys-hostname-long-perl

- name: Install Pytest
run: |
pip install pytest pytest-cov

- name: Install CRISPResso
run: |
pip install -e .

- name: Run Pytest
run: |
run: |
pytest tests --cov CRISPResso2
4 changes: 2 additions & 2 deletions CRISPResso2/CRISPRessoCORE.py
Original file line number Diff line number Diff line change
Expand Up @@ -2022,14 +2022,14 @@ def get_prime_editing_guides(this_amp_seq, this_amp_name, ref0_seq, prime_edited
#for all amps in forward and reverse complement amps:
for amp_seq in [this_seq, CRISPRessoShared.reverse_complement(this_seq)]:
ref_incentive = np.zeros(len(amp_seq)+1, dtype=int)
s1, s2, score=CRISPResso2Align.global_align(guide, amp_seq, matrix=aln_matrix, gap_incentive=ref_incentive, gap_open=args.needleman_wunsch_gap_open, gap_extend=args.needleman_wunsch_gap_extend,)
s1, s2, score=CRISPResso2Align.global_align(guide, amp_seq, matrix=aln_matrix, gap_incentive=ref_incentive, gap_open=args.flexiguide_gap_open_penalty, gap_extend=args.flexiguide_gap_extend_penalty)
potential_guide = s1.strip("-")
if abs(len(potential_guide) - len(guide)) < 2: #if length of putative guide is off by less than 2, keep it (allows 1 gap)
loc = s1.find(potential_guide)
potential_ref = amp_seq[loc:loc+len(potential_guide)]
#realign to test for number of mismatches
ref_incentive = np.zeros(len(potential_ref)+1, dtype=int)
sub_s1, sub_s2, sub_score=CRISPResso2Align.global_align(guide, potential_ref, matrix=aln_matrix, gap_incentive=ref_incentive, gap_open=args.needleman_wunsch_gap_open, gap_extend=args.needleman_wunsch_gap_extend,)
sub_s1, sub_s2, sub_score=CRISPResso2Align.global_align(guide, potential_ref, matrix=aln_matrix, gap_incentive=ref_incentive, gap_open=args.flexiguide_gap_open_penalty, gap_extend=args.flexiguide_gap_extend_penalty)
mismatches = []
for i in range(len(sub_s1)):
if sub_s1[i] != sub_s2[i]:
Expand Down
14 changes: 14 additions & 0 deletions CRISPResso2/args.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,20 @@
"default": "",
"tools": ["Core", "Batch", "Pooled", "WGS"]
},
"flexiguide_gap_open_penalty": {
"keys": ["--flexiguide_gap_open_penalty"],
"help": "",
"type": "int",
"default": -20,
"tools": ["Core", "Batch", "Pooled", "WGS"]
},
"flexiguide_gap_extend_penalty": {
"keys": ["--flexiguide_gap_extend_penalty"],
"help": "",
"type": "int",
"default": -2,
"tools": ["Core", "Batch", "Pooled", "WGS"]
},
"discard_guide_positions_overhanging_amplicon_edge": {
"keys": ["--discard_guide_positions_overhanging_amplicon_edge"],
"help": "If set, for guides that align to multiple positions, guide positions will be discarded if plotting around those regions would included bp that extend beyond the end of the amplicon.",
Expand Down
Loading