Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
Check if column containing sample ID exists in metadata file
Browse files Browse the repository at this point in the history
  • Loading branch information
dweemx committed Oct 31, 2020
1 parent 362504a commit c32cfce
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/utils/bin/sc_h5ad_annotate_by_sample_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ def similar(a, b):
return SequenceMatcher(None, a, b).ratio()


if args.sample_column_name not in metadata.columns:
raise Exception(f"VSN ERROR: Missing '{args.sample_column_name}'' column in the given metadata file.")

sample_info = metadata[metadata[args.sample_column_name] == SAMPLE_NAME]
sample_scores = [similar(index_entry, SAMPLE_NAME) for index_entry in metadata[args.sample_column_name]]

Expand Down

0 comments on commit c32cfce

Please sign in to comment.