Implement new private_api/taxa/shared_peptides endpoint#100
Closed
pverscha wants to merge 5 commits into
Closed
Conversation
Member
Author
|
Merged with #101 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
private_api/taxa/shared_peptidesendpointshared_peptidesNew endpoint
POST /private_api/taxa/shared_peptidesthat accepts a list of taxon IDs at species or strain level, digests all proteins for each taxon, and returns the intersection — peptides present in every taxon after digestion. No index lookup is performed; the result is a pure set intersection across the digested proteomes. Protein retrieval for all taxa runs concurrently.Parameters
taxon_ids— list of taxon IDs; each must be at species or strain rank (400 otherwise)cleavage_regex— regex defining cleavage sites (default:[KR](?!P), tryptic digestion)min_length— minimum peptide length to retain (default:5)Response
{ "shared_peptides": ["PEPTIDE", ...] }Supporting changes
database::get_proteins_for_taxon— new function that retrieves allUniprotEntryrecords for a given taxon ID usingsearch_afterpagination, handling taxa with more than 10,000proteins correctly.
TaxonStore::get_rank— new accessor following the existingget_namepattern.api/src/helpers/digestion— shared module forcleave_sequence,compile_cleavage_regex,validate_taxon_rank, and serde defaults; placed inhelpers/alongsidelca_helper,ec_helper, etc. to keep controller files free of domain logic.ApiError::InvalidRegexError— new error variant (HTTP 400) for invalid cleavage regex strings, distinct from the existingUnknownRankError.fancy-regex— added as a dependency to support lookahead assertions in cleavage patterns (e.g.(?!P)).