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

doc: Expand the documentation for OffTargetDetector #46

Merged
merged 6 commits into from
Sep 24, 2024
Merged

Conversation

msto
Copy link
Collaborator

@msto msto commented Sep 24, 2024

I added documentation to explain how the class can be used to filter primers vs primer pairs, and the behavior of each filtering method.

I also added Args and Return blocks to the public methods.

@msto msto self-assigned this Sep 24, 2024
@msto msto marked this pull request as ready for review September 24, 2024 16:48
@msto msto requested review from nh13 and tfenne as code owners September 24, 2024 16:48
@msto msto assigned tfenne and unassigned msto Sep 24, 2024
@msto msto requested a review from emmcauley September 24, 2024 16:48
Copy link

codecov bot commented Sep 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.37%. Comparing base (0e64007) to head (bd02b66).
Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #46   +/-   ##
=======================================
  Coverage   97.37%   97.37%           
=======================================
  Files          25       25           
  Lines        1598     1598           
  Branches      302      302           
=======================================
  Hits         1556     1556           
  Misses         23       23           
  Partials       19       19           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +174 to +179
1. Alignment (off-target hit detection): `ref`, `executable`, `threads`,
`three_prime_region_length`, `max_mismatches_in_three_prime_region`, `max_mismatches`,
and `max_primer_hits`.
2. Filtering of individual primers: `max_primer_hits`.
3. Checking of primer pairs: `max_primer_hits`, `min_primer_pair_hits`,
`max_primer_pair_hits`, and `max_amplicon_size`.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought it'd be helpful to have the parameters grouped by the function(s) that use them. I feel like there could be a better way to organize/present this, lmk if you have any suggestions

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree this is helpful. I'm happy to come back later and expand this further too.

Copy link
Contributor

@ameynert ameynert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just the one suggestion about default params. The extra docstrings are v helpful!

I'm also using this API a little differently as I'm looking across multiple FASTA files, so I'm calling .mappings_of directly and aggregating hit counts

@@ -150,6 +165,19 @@ def __init__(
executable: str | Path = "bwa",
) -> None:
"""
Initialize an [[OffTargetDetector]].
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the primer pair related parameters be given defaults? I don't need them for checking single primers.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have been wondering something similar - if it's possible to provide defaults for more of these parameters, or if the features should be decoupled

cc @tfenne @emmcauley

Comment on lines +369 to +373
**Note**: The reverse complement of each primer sequence is used for mapping. The `query`
sequence in each `BwaResult` will match the input primer sequence, as will the sequences
used as keys in the output dictionary. However, the coordinates reported in each `BwaHit`
associated with a result will correspond to complementary sequence.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this sufficiently clear?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is, but I think this function should be private.

@msto msto force-pushed the ms_doc-off-target branch from 382b334 to 1c99e9a Compare September 24, 2024 17:14
Base automatically changed from ms_fix-off-target-expected-hits to main September 24, 2024 17:19
@msto msto force-pushed the ms_doc-off-target branch from 1c99e9a to b6a2bb6 Compare September 24, 2024 17:38
prymer/offtarget/offtarget_detector.py Outdated Show resolved Hide resolved
Comment on lines +174 to +179
1. Alignment (off-target hit detection): `ref`, `executable`, `threads`,
`three_prime_region_length`, `max_mismatches_in_three_prime_region`, `max_mismatches`,
and `max_primer_hits`.
2. Filtering of individual primers: `max_primer_hits`.
3. Checking of primer pairs: `max_primer_hits`, `min_primer_pair_hits`,
`max_primer_pair_hits`, and `max_amplicon_size`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree this is helpful. I'm happy to come back later and expand this further too.

prymer/offtarget/offtarget_detector.py Outdated Show resolved Hide resolved
Comment on lines +369 to +373
**Note**: The reverse complement of each primer sequence is used for mapping. The `query`
sequence in each `BwaResult` will match the input primer sequence, as will the sequences
used as keys in the output dictionary. However, the coordinates reported in each `BwaHit`
associated with a result will correspond to complementary sequence.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is, but I think this function should be private.

@msto msto merged commit c434b1d into main Sep 24, 2024
6 checks passed
@msto msto deleted the ms_doc-off-target branch September 24, 2024 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants