Skip to content

Matrix processing - #60

Merged
yaront merged 3 commits into
masterfrom
matrix-processing
Apr 25, 2026
Merged

Matrix processing#60
yaront merged 3 commits into
masterfrom
matrix-processing

Conversation

@yaront

@yaront yaront commented Apr 25, 2026

Copy link
Copy Markdown
Contributor

Adding options to process matrices from densitometries with and without updating the database.

yaront added 3 commits April 25, 2026 09:53
  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.
@yaront yaront self-assigned this Apr 25, 2026
@yaront
yaront merged commit dd1ba35 into master Apr 25, 2026
4 checks passed
@yaront
yaront deleted the matrix-processing branch April 25, 2026 17:21
@yaront
yaront restored the matrix-processing branch May 1, 2026 13:54
@yaront
yaront deleted the matrix-processing branch May 1, 2026 13:55
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.

1 participant