Merged
Conversation
Signed-off-by: Josh Loecker <joshloecker@icloud.com>
Signed-off-by: Josh Loecker <joshloecker@icloud.com>
Signed-off-by: Josh Loecker <joshloecker@icloud.com>
…sibility of where errors are being raised Signed-off-by: Josh Loecker <joshloecker@icloud.com>
…better visibility of where errors are being raised Signed-off-by: Josh Loecker <joshloecker@icloud.com>
…ervices` Signed-off-by: Josh Loecker <joshloecker@icloud.com>
…ervices` Signed-off-by: Josh Loecker <joshloecker@icloud.com>
…ervices` Signed-off-by: Josh Loecker <joshloecker@icloud.com>
…ervices` Signed-off-by: Josh Loecker <joshloecker@icloud.com>
Signed-off-by: Josh Loecker <joshloecker@icloud.com>
- Add `ModelBuildSettings` dataclass for solver parameters - Remove unused PeakIdentificationParameters and _BuildResults - Minor formatting cleanup Signed-off-by: Josh Loecker <joshloecker@icloud.com>
- Adds TPM dataframe output support - !Converts all async functions to sync - Refactors `_write_counts_matrix` to `_write_matrices - Add better validation for output filepaths - No longer utilize STAR gene count files ![BREAKING-CHANGE]: Converts all async functions to sync Signed-off-by: Josh Loecker <joshloecker@icloud.com>
- !Converts from async functions to sync - Change `fragment_lengths` from a per-sample value to a per-gene value (np.ndarray to pd.DataFrame) - Refactor TPM, FPKM, and zFPKM functions - Adds fpkm output CSV file support - Improves type hints and validations [BREAKING-CHANGE]: This removes all async functions for synchronous counterparts Signed-off-by: Josh Loecker <joshloecker@icloud.com>
- Removes `_get_transcriptomic_details` function as it was unused - Renames `_merge_xomics` to `_trinarize_data` for -1/0/+1 binning - Simplify missing data handling [BREAKING-CHANGE]: Removes all async functions for synchronous counterparts Signed-off-by: Josh Loecker <joshloecker@icloud.com>
- Fixes Z-score combination formula to use equal weights/Stouffer's method - Adds proper handling for NaN/Inf values - Fixes output formatting [BREAKING-CHANGE]: Converts all async functions to their synchronous counterparts Signed-off-by: Josh Loecker <joshloecker@icloud.com>
- Convert all async functions to synchronous - Remove unused imports/types - Replace `await _read_file` with `pd.read_csv` calls Signed-off-by: Josh Loecker <joshloecker@icloud.com>
Signed-off-by: Josh Loecker <joshloecker@icloud.com>
- Change from threshold-based (low_thresh, high_thresh) to percentile-based (low_percentile, high_percentile) - Return tuple with (reaction_expression, min_val, low_expr, high_expr) instead of just a dictionary - Adjust expression values to have a minimum of 0 for consistency and downstream building with Troppo - use np.nanpercentile for threshold computing Signed-off-by: Josh Loecker <joshloecker@icloud.com>
Signed-off-by: Josh Loecker <joshloecker@icloud.com>
- Uses cobamp for optimization handling - Properly partition solution into high-bin and low-bin reactions - Fix high/low index calculation to match Troppo's expected behavior - Add validation for expected solution length - Use 0.5 midpoint for binarizing reaction inclusion Signed-off-by: Josh Loecker <joshloecker@icloud.com>
- Adds `reference_model` parameter to internal `_collect_boundary_reactions` to define constraints for all boundary reactions - Validate compartments exist in reference model Signed-off-by: Josh Loecker <joshloecker@icloud.com>
…exchange reactions not included in the boundary reactions input file This option defaults to False to maintain compatibility with preivous releases Signed-off-by: Josh Loecker <joshloecker@icloud.com>
Signed-off-by: Josh Loecker <joshloecker@icloud.com>
Signed-off-by: Josh Loecker <joshloecker@icloud.com>
Signed-off-by: Josh Loecker <joshloecker@icloud.com>
Signed-off-by: Josh Loecker <joshloecker@icloud.com>
Signed-off-by: Josh Loecker <joshloecker@icloud.com>
… reactions Signed-off-by: Josh Loecker <joshloecker@icloud.com>
Signed-off-by: Josh Loecker <joshloecker@icloud.com>
…alization Signed-off-by: Josh Loecker <joshloecker@icloud.com>
…ut handling Signed-off-by: Josh Loecker <joshloecker@icloud.com>
…th pandas read_csv Signed-off-by: Josh Loecker <joshloecker@icloud.com>
…rmatting Signed-off-by: Josh Loecker <joshloecker@icloud.com>
… in model creation Signed-off-by: Josh Loecker <joshloecker@icloud.com>
Signed-off-by: Josh Loecker <joshloecker@icloud.com>
Signed-off-by: Josh Loecker <joshloecker@icloud.com>
Signed-off-by: Josh Loecker <joshloecker@icloud.com>
…vert` Signed-off-by: Josh Loecker <joshloecker@icloud.com>
Signed-off-by: Josh Loecker <joshloecker@icloud.com>
Signed-off-by: Josh Loecker <joshloecker@icloud.com>
Signed-off-by: Josh Loecker <joshloecker@icloud.com>
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.
This pull request refactors and improves the logic for combining z-score distributions across batches, sources, and contexts in
main/como/combine_distributions.py. The main changes include updating the weighting methodology to use equal weights (Stouffer's Z method), removing invalid weighting by replicate counts, improving handling of missing values, and simplifying function signatures and type usage. The code is also made more robust and readable, with updated docstrings and error messages.Statistical methodology improvements:
_combine_z_distribution_for_sourceto use equal weights (Stouffer's Z method) instead of replicate counts, as replicate counts are not statistically valid weights for z-scores. This change ensures proper aggregation of standardized scores.Code and interface simplification:
weighted_z_floor,weighted_z_ceiling) from batch combination functions and updated function signatures to reflect new logic. [1] [2]convertwithget_remaining_identifiers, and updating type hints and merge logic for Scanpy matrices. [1] [2]Data handling and output improvements:
Code readability and maintainability:
Type and import updates:
main/como/data_types.pyto support the refactored logic.