Skip to content

Conversation

Alessio-Agustini
Copy link

Thank you for your contribution!
If you have any questions about your PR, or need help completing it, you can ping the maintainers of this repository, who will be happy to help if they can find time.

You can optionally use the following checklist when you work on your PR:

  • I have updated any relevant documentation and docstrings.
  • I have added unit tests, and the CodeCov bot shows tests cover my new code.
  • I have mentioned my changes in the CHANGELOG.md file.

Modifications:
*added src/molecular-weight.jl
*modified src/BioSequences.jl to also load the new file
*recently added the previously mentioned implementation of the function for ssDNA and ssRNA

WIP
*Still working in the necessary additions into test/
*Still missing changes in the CHANGELOG.md

Copy link
Member

@jakobnissen jakobnissen left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution, @Alessio-Agustini !

I have a lot of comments to improve the code. Don't let that discourage you from an otherwise good PR.
If you have any questions, please reach out here or on the Julia Slack and I'll explain what I mean in more detail.

@jakobnissen jakobnissen linked an issue Sep 2, 2025 that may be closed by this pull request
@jakobnissen jakobnissen marked this pull request as draft September 2, 2025 07:39
Copy link

codecov bot commented Sep 2, 2025

Codecov Report

❌ Patch coverage is 0% with 191 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.95%. Comparing base (95d9218) to head (45441a3).
⚠️ Report is 24 commits behind head on master.

Files with missing lines Patch % Lines
src/molecular-weight.jl 0.00% 191 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #341      +/-   ##
==========================================
- Coverage   90.87%   85.95%   -4.93%     
==========================================
  Files          31       30       -1     
  Lines        2400     3018     +618     
==========================================
+ Hits         2181     2594     +413     
- Misses        219      424     +205     
Flag Coverage Δ
unittests 85.95% <0.00%> (-4.93%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@Alessio-Agustini
Copy link
Author

First of all, thanks for the detailed feedback. I am still learning julia and it was really helpful. I made the requested changes and also added strand_number as new keyword for the NucSeq implementation of the molecular_weight() function. For the moment the function only supports double as strand_number for DNA sequences.

@Alessio-Agustini
Copy link
Author

I just finished with the second round of feedback corrections. As stated before, I am really thankful for the comments, I am still learning and this was a good exercise.

@jakobnissen
Copy link
Member

Great!
This PR just needs:

  • A docstring for the molecular_weight function
  • Adding it to the built documentation - I can do that if you don't know how to
  • Tests - add a new file "weights.jl" under test, with the tests, then include it in runtests.jl.

@Alessio-Agustini
Copy link
Author

I made the docstring for the functions and some basic tests in src/weight.jl. Probably better test would be better, but I don't have much experience with the test package. If you have any suggestions, I would be glad to read them. I don't know how to change/made documentations, so I would be glad, if you could do that. I also corrected a minor error with the compensation value for phosphate as 5' group. Now it is + 18.06. The nucleotide already have the phosphate in that position and would be only required to account for the water, because in the function there is: length(Nucseq) * water, instead of length ((Nucseq) -1 )* water. With the new value, the calculated weights are compatible with the ones of the listed website tool, which is mentioned in the code as comment.

* Place the source comment of each molecule where it is defined
* Use Runic.jl to automatically format this file
This is more readable than using the literal "18.02"
This avoids loading twice from the array. Maybe the compiler would optimise this,
but it's safer to do this optimisation manually.
@jakobnissen
Copy link
Member

Thanks again! The PR is almost complete. I'll make a series of small changes to get it though. You can read the commit comments to follow along if you want to learn why and how

* Switch from LongSequence to BioSequence to broaden the types of sequences
  that this signature accepts
* Switch from DNAAlphabet{4} to <:DNAAlphabet (and similar for RNA alphabets) to
  also allow 2-bit alphabet sequences
* Switch strandedness kwarg to a bool, since we only want to covert two cases
* Restrict five_terminal_state to Symbol
* The internal _molecular_weight function does not need default values
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.

New Feature: Molecular weight calculations for BioSequences
3 participants