Skip to content

DNA to Protein #63

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

Open
wants to merge 10 commits into
base: dev
Choose a base branch
from
Open

DNA to Protein #63

wants to merge 10 commits into from

Conversation

sadrasabouri
Copy link
Member

Reference Issues/PRs

#59

What does this implement/fix? Explain your changes.

This PR adds the to_protein method so that the OPR object can now have a protein representation.

Any other comments?

@sadrasabouri sadrasabouri added documentation Improvements or additions to documentation new feature labels Apr 21, 2025
@sadrasabouri sadrasabouri added this to the opr v0.5 milestone Apr 21, 2025
@sadrasabouri sadrasabouri requested a review from Copilot April 21, 2025 22:09
@sadrasabouri sadrasabouri self-assigned this Apr 21, 2025
@codecov-commenter
Copy link

codecov-commenter commented Apr 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (8b7cafe) to head (8925cd4).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev       #63   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            5         5           
  Lines          222       234   +12     
  Branches        31        33    +2     
=========================================
+ Hits           222       234   +12     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request implements a new method to convert a DNA sequence to its corresponding protein sequence.

  • Introduces the to_protein method in Primer (opr/primer.py) and its supporting function, protein_seq_calc, in opr/functions.py.
  • Adds a codon-to-amino acid mapping in opr/params.py and several tests in tests/test_operations.py to validate the protein conversion.
  • Updates the README and CHANGELOG to document and track the new functionality.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/test_operations.py Added tests for the new to_protein method with various frames.
opr/primer.py Added to_protein method integrating the protein_seq_calc function.
opr/params.py Added a CODONS_TO_AMINO_ACIDS table to support protein translation.
opr/functions.py Introduced protein_seq_calc to derive protein sequences from RNA.
README.md Documented the new to_protein functionality with examples.
CHANGELOG.md Updated changelog to include the addition of the to_protein method.

@sadrasabouri sadrasabouri requested a review from Copilot April 21, 2025 22:13
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a new to_protein method to the Primer class to enable conversion of DNA sequences into their corresponding protein sequences.

  • Added a new method in opr/primer.py that leverages the new protein_seq_calc function.
  • Introduced the CODONS_TO_AMINO_ACIDS mapping in opr/params.py and the protein_seq_calc function in opr/functions.py.
  • Updated tests, documentation, and the changelog to reflect these changes.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/test_operations.py Added multiple test cases to validate conversion of DNA to protein with various reading frames.
opr/primer.py Implemented the to_protein method to expose protein conversion functionality.
opr/params.py Introduced the CODONS_TO_AMINO_ACIDS mapping for protein translation.
opr/functions.py Added the protein_seq_calc function to compute protein sequences from RNA.
README.md Documented the to_protein functionality with examples.
CHANGELOG.md Recorded the addition of the to_protein method.

@sadrasabouri sadrasabouri marked this pull request as ready for review April 21, 2025 22:15
CHANGELOG.md Outdated
@@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Changed
- Test system modified
- `Python 3.6` support dropped
### Added
Copy link
Member

Choose a reason for hiding this comment

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

### Added
...
### Changed
...

README.md Outdated
@@ -154,6 +154,14 @@
'CUGGAGGACGGAAGAGGAAGUAA'
```

#### To Protein
```pycon
>>> oprimer_rna = oprimer.to_protein(frame=3)
Copy link
Member

Choose a reason for hiding this comment

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

oprimer_rna --> oprimer_protein

@sadrasabouri
Copy link
Member Author

Thanks for the review @sepandhaghighi
I applied the comments and it's ready for a re-review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants