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

Full implementation of Casanovo-DB #352

Merged
merged 23 commits into from
Sep 13, 2024
Merged

Conversation

VarunAnanth2003
Copy link
Contributor

@VarunAnanth2003 VarunAnanth2003 commented Jul 4, 2024

Addresses all previous comments in PR #325.

High-level changes:

  • Removed all unnecessary subclassing
  • Integrated methods into old Casanovo code as much as possible
  • Removed unnecessary flags for db-search
  • Moved PSM batching into dataloader as opposed to the model
  • Made .mztab output for Casanovo-DB consistent with specifications
  • Added tests for all new functionality

Things to Note:

  • Works with a set list of modifications (all Casanovo mods), cannot be modified at the moment
  • Have not filled out unique, database, and database_version columns of the output .mztab for db-search mode

@VarunAnanth2003 VarunAnanth2003 added the enhancement New feature or request label Jul 4, 2024
Copy link
Collaborator

@bittremieux bittremieux left a comment

Choose a reason for hiding this comment

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

Nice work. It's starting to look quite nice.

Several smaller comments that will be easy to address.

One major comment I have is that we should try to abstract the database functionality a bit more. Now a list of tuples with peptide, mass, protein is passed through several levels in the code. Instead, this can be encapsulated by a ProteinDatabase class with functions cleave, get_candidates, etc. (examples) that provides these functionalities in a much more coherent and understandable fashion.

After that initial implementation, you could also simplify some parts of the database functionality. For example, passing the protein identifier through all inference steps is unnecessary. Instead, the ProteinDatabase can retain this mapping internally, only the peptides are used during inference, and upon exporting this mapping is used to retrieve the relevant protein information.

I suggest starting with drawing a schematic of how this class would work, where it receives information from and where it will be called, and the data flow among those steps. And only after you have this clear mental overview, start with the implementation.

casanovo/casanovo.py Outdated Show resolved Hide resolved
casanovo/casanovo.py Outdated Show resolved Hide resolved
casanovo/casanovo.py Show resolved Hide resolved
casanovo/casanovo.py Outdated Show resolved Hide resolved
casanovo/casanovo.py Outdated Show resolved Hide resolved
tests/unit_tests/test_unit.py Outdated Show resolved Hide resolved
tests/unit_tests/test_unit.py Outdated Show resolved Hide resolved
tests/unit_tests/test_unit.py Outdated Show resolved Hide resolved
tests/unit_tests/test_unit.py Outdated Show resolved Hide resolved
tests/unit_tests/test_unit.py Outdated Show resolved Hide resolved
@VarunAnanth2003
Copy link
Contributor Author

@bittremieux All comments you left should be addressed in the most recent commit

casanovo/config.yaml Outdated Show resolved Hide resolved
casanovo/config.yaml Outdated Show resolved Hide resolved
casanovo/config.yaml Outdated Show resolved Hide resolved
casanovo/config.yaml Outdated Show resolved Hide resolved
casanovo/config.yaml Outdated Show resolved Hide resolved
casanovo/denovo/dataloaders.py Outdated Show resolved Hide resolved
casanovo/denovo/model.py Outdated Show resolved Hide resolved
casanovo/denovo/model.py Outdated Show resolved Hide resolved
tests/conftest.py Outdated Show resolved Hide resolved
tests/conftest.py Outdated Show resolved Hide resolved
@Noble-Lab Noble-Lab deleted a comment from bittremieux Aug 28, 2024
casanovo/config.yaml Outdated Show resolved Hide resolved
casanovo/config.yaml Outdated Show resolved Hide resolved
casanovo/config.yaml Outdated Show resolved Hide resolved
casanovo/data/db_utils.py Show resolved Hide resolved
casanovo/data/db_utils.py Show resolved Hide resolved
casanovo/denovo/dataloaders.py Outdated Show resolved Hide resolved
casanovo/denovo/dataloaders.py Outdated Show resolved Hide resolved
casanovo/denovo/model.py Outdated Show resolved Hide resolved
tests/unit_tests/test_unit.py Outdated Show resolved Hide resolved
tests/unit_tests/test_unit.py Show resolved Hide resolved
casanovo/data/db_utils.py Outdated Show resolved Hide resolved
casanovo/data/db_utils.py Outdated Show resolved Hide resolved
casanovo/data/db_utils.py Outdated Show resolved Hide resolved
casanovo/data/db_utils.py Outdated Show resolved Hide resolved
casanovo/data/db_utils.py Outdated Show resolved Hide resolved
casanovo/data/db_utils.py Outdated Show resolved Hide resolved
casanovo/data/db_utils.py Show resolved Hide resolved
casanovo/data/db_utils.py Outdated Show resolved Hide resolved
casanovo/data/db_utils.py Outdated Show resolved Hide resolved
@VarunAnanth2003 VarunAnanth2003 merged commit 8153ffa into dev_db_search Sep 13, 2024
1 check passed
@VarunAnanth2003 VarunAnanth2003 deleted the db_search_full branch September 13, 2024 20:43
@VarunAnanth2003 VarunAnanth2003 restored the db_search_full branch September 13, 2024 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants