Skip to content

Remove writing sample id to summary files#81

Merged
berndbohmeier merged 2 commits intomainfrom
remove-sample-id
Mar 24, 2026
Merged

Remove writing sample id to summary files#81
berndbohmeier merged 2 commits intomainfrom
remove-sample-id

Conversation

@berndbohmeier
Copy link
Copy Markdown
Collaborator

This was not a good idea, as people make mistakes in the sample ids and then fixing it just in the metadata file wasn't working.

Copy link
Copy Markdown
Owner

@JasonAHendry JasonAHendry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

# for backwards compatibility to be able to show old experiments where this column was not in the data
df = df.join(self.metadata.required_metadata, on="barcode")
if "sample_id" in df.columns:
# We used to safe it, but this is not a good idea as it might be outdated if the metadata file is changed
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

save*

# We used to safe it, but this is not a good idea as it might be outdated if the metadata file is changed
df.drop(columns=["sample_id"], inplace=True)

df = df.join(self.metadata.required_metadata, on="barcode")
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was briefly considering whether we want to do any validation here, e.g. with the validate= flag, but maybe not?

The barcodes in the metadata file we know will be unique from MetadataTableParser. Maybe if people just wanted to look at a few barcodes, they could delete lines from the metadata file. But if we validate we would prevent that.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Afaik validate checks only uniqueness of keys, not completeness, so we can use validate here as the barcodes should be unique.
I will add it.

This was not a good idea, as people make mistakes in the sample ids and
then fixing it just in the metadata file wasn't working.
@berndbohmeier berndbohmeier merged commit 1731f3f into main Mar 24, 2026
3 checks passed
@berndbohmeier berndbohmeier deleted the remove-sample-id branch March 24, 2026 06:47
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.

2 participants