-
Notifications
You must be signed in to change notification settings - Fork 37
Preserve numeric-like IDs in QC and add regression test #307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
214a163
fde9e9f
ffe9d1f
441c133
2d39d2d
c1cffd3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,13 +48,23 @@ for _k, _v in _QC_DEFAULTS.items(): | |
|
|
||
| # ---------- Sample sheet + metadata ------------------------------------------ | ||
|
|
||
| _samples_df = pd.read_csv(config["samples"]) | ||
| _SAMPLE_SHEET_DTYPES = { | ||
| "sample_id": "string", | ||
| "library_id": "string", | ||
| } | ||
|
|
||
| _SAMPLE_METADATA_DTYPES = { | ||
| "sample_id": "string", | ||
| } | ||
|
|
||
|
|
||
| _samples_df = pd.read_csv(config["samples"], dtype=_SAMPLE_SHEET_DTYPES) | ||
| _ALL_SAMPLES = _samples_df["sample_id"].unique().tolist() | ||
|
|
||
| _metadata_df = None | ||
| _meta_path = config.get("sample_metadata", "") | ||
| if _meta_path: | ||
| _metadata_df = pd.read_csv(_meta_path) | ||
| _metadata_df = pd.read_csv(_meta_path, dtype=_SAMPLE_METADATA_DTYPES) | ||
|
Comment on lines
+51
to
+67
|
||
|
|
||
|
|
||
| def _has_coords(): | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pd.read_csv(config["samples"], dtype=_SAMPLE_SHEET_DTYPES)will raise iflibrary_idis absent, butlibrary_idis optional in the samples schema and this module only usessample_id. To avoid breaking valid sample sheets, either only forcesample_idto string here, or computedtypeby intersecting_SAMPLE_SHEET_DTYPESwith the columns present in the CSV header before callingread_csv.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot apply changes based on this feedback we should intersect dtype map with parsed header