Matrix processing - #60
Merged
Merged
Conversation
Existing rows are replaced in place (preserves row order); new kinases are appended. Preserves CRLF line endings and TRUE/FALSE boolean format. Uses na_filter=False to keep legacy 'nan' string cells intact.
Removed (folded into the new API):
- save_matrices_to_database
- save_kinase_matrices
- save_kinase_to_database
Added:
- save_matrices(processed_results, kin_type, output_dir=None,
update_database=False, confirm=True, kinome_info=None) — unified
batch save with both targets
- kinases_from_densitometry_dir(...) — process every *_densitometry.txt
in a folder, returns dict of {name: kl.Kinase}
- kinase_from_densitometry mirrors the same flags so a one-call
shortcut works
- kin.save(output_dir, update_database, confirm, kinome_info) bound
method — single entry point for both save targets
When update_database=True (atomic, with confirmation prompt):
1. Write raw/norm/log2 matrices to the package database
2. Persist source densitometry to package/densitometry/ so the kinase
can be re-processed in the future from the package alone
3. Rebuild combined *_all_matrices.tsv files (now enumerated from raw/
instead of densitometry/, so brand-new kinases get picked up)
4. Update kinome_information.tsv via interactive prompts or a provided
kinome_info arg (file path / DataFrame / dict). Existing rows ask
for y/n confirmation before being overwritten.
5. Re-score phosphoproteomes
6. Print remaining-manual-steps banner (CHANGELOG, README, version, tests)
If only output_dir is set, files are written there and the package is
left completely untouched (no prompt, no reminder).
Default behavior (no flags) is purely ephemeral — kinase_from_densitometry
returns a kl.Kinase ready for plot_data, score, percentile, etc., with
no side effects on the package.
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.
Adding options to process matrices from densitometries with and without updating the database.