features-barcodes-only#149
Open
joshua-gould wants to merge 10 commits into
Open
Conversation
jshleap
approved these changes
Jun 5, 2026
Comment on lines
+90
to
+95
| query_columns = [ | ||
| c | ||
| for c in query_columns | ||
| if c not in merged_df.columns and c in data.var.index | ||
| ] | ||
| columns.update(query_columns) |
Collaborator
There was a problem hiding this comment.
Suggested change
| query_columns = [ | |
| c | |
| for c in query_columns | |
| if c not in merged_df.columns and c in data.var.index | |
| ] | |
| columns.update(query_columns) | |
| columns.update( | |
| c for c in query_columns | |
| if c not in merged_df.columns and c in data.var.index | |
| ) |
Comment on lines
+98
to
+99
| for i in range(len(columns)): | ||
| merged_df[columns[i]] = values[:, i] |
Collaborator
There was a problem hiding this comment.
Suggested change
| for i in range(len(columns)): | |
| merged_df[columns[i]] = values[:, i] | |
| if sp.issparse(values): | |
| values = values.toarray() | |
| merged_df[columns] = values |
Collaborator
There was a problem hiding this comment.
if we need to test for sparcity (I think is a failsafe) we need to import scipy.sparse as sp
| "--objects", | ||
| required=False, | ||
| help="Path to directory containing output from `find-objects`", | ||
| help="Path to directory containing output from `find-objects` or `merge`", |
Collaborator
There was a problem hiding this comment.
Is intended that --objects and --merge can be used?
Comment on lines
+654
to
+675
| for i in range(len(phenotype_paths)): | ||
| # match */A1-*.parquet and */A1.parquet | ||
| sep = phenotype_filesystems[i].sep | ||
| matches = phenotype_filesystems[i].glob( | ||
| f"{phenotype_paths[i]}{sep}*{sep}{image_key}-*.parquet" | ||
| ) + phenotype_filesystems[i].glob( | ||
| f"{phenotype_paths[i]}{sep}*{sep}{image_key}.parquet" | ||
| ) | ||
|
|
||
| if len(matches) == 0: | ||
| # match A1-*.parquet and A1.parquet | ||
| matches = phenotype_filesystems[i].glob( | ||
| f"{phenotype_paths[i]}{sep}{image_key}-*.parquet" | ||
| ) + phenotype_filesystems[i].glob( | ||
| f"{phenotype_paths[i]}{sep}{image_key}.parquet" | ||
| ) | ||
|
|
||
| for x in matches: | ||
| _phenotype_paths.append(phenotype_filesystems[i].unstrip_protocol(x)) | ||
| if phenotype_suffix is not None: | ||
| _phenotype_suffix.append(phenotype_suffix[i]) | ||
| return _phenotype_paths, _phenotype_suffix |
Collaborator
There was a problem hiding this comment.
Suggested change
| for i in range(len(phenotype_paths)): | |
| # match */A1-*.parquet and */A1.parquet | |
| sep = phenotype_filesystems[i].sep | |
| matches = phenotype_filesystems[i].glob( | |
| f"{phenotype_paths[i]}{sep}*{sep}{image_key}-*.parquet" | |
| ) + phenotype_filesystems[i].glob( | |
| f"{phenotype_paths[i]}{sep}*{sep}{image_key}.parquet" | |
| ) | |
| if len(matches) == 0: | |
| # match A1-*.parquet and A1.parquet | |
| matches = phenotype_filesystems[i].glob( | |
| f"{phenotype_paths[i]}{sep}{image_key}-*.parquet" | |
| ) + phenotype_filesystems[i].glob( | |
| f"{phenotype_paths[i]}{sep}{image_key}.parquet" | |
| ) | |
| for x in matches: | |
| _phenotype_paths.append(phenotype_filesystems[i].unstrip_protocol(x)) | |
| if phenotype_suffix is not None: | |
| _phenotype_suffix.append(phenotype_suffix[i]) | |
| return _phenotype_paths, _phenotype_suffix | |
| has_suffix = phenotype_suffix is not None | |
| suffix_iter = phenotype_suffix if has_suffix else [None] * len(phenotype_paths) | |
| for path, fs, suffix in zip(phenotype_paths, phenotype_filesystems, suffix_iter, strict=True): | |
| sep = fs.sep | |
| # Match */<image_key>[-*].parquet (subdirectory pattern) | |
| matches = ( | |
| fs.glob(f"{path}{sep}*{sep}{image_key}-*.parquet") | |
| + fs.glob(f"{path}{sep}*{sep}{image_key}.parquet") | |
| ) | |
| if not matches: | |
| # Match <image_key>[-*].parquet (flat pattern) | |
| matches = ( | |
| fs.glob(f"{path}{sep}{image_key}-*.parquet") | |
| + fs.glob(f"{path}{sep}{image_key}.parquet") | |
| ) | |
| for match in matches: | |
| phenotypepaths.append(fs.unstrip_protocol(match)) | |
| if has_suffix: | |
| phenotypesuffix.append(suffix) | |
| return phenotypepaths, phenotypesuffix |
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.
No description provided.