Skip to content

Commit

Permalink
Allowing more flexible approach to name of column in sample metadata …
Browse files Browse the repository at this point in the history
…file that contains sample external id
  • Loading branch information
michael-harper committed Nov 21, 2024
1 parent 2db1152 commit a1630d5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions scripts/upsert_mgrb_participants.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,14 @@ def read_files_from_gcs(bucket_name: str, file_path: str):
@click.option('--project', help='Project name to upsert participants to.')
@click.option('--participant-meta', help='Path to participant metadata CSV.')
@click.option('--sample-meta', help='Path to sample metadata CSV.')
def main(test_bucket: bool, project: str, participant_meta: str, sample_meta: str):
@click.option('--sample-external-id-column', help='Column name for sample external ID.')
def main(
test_bucket: bool,
project: str,
participant_meta: str,
sample_meta: str,
sample_external_id_column: str,
):
"""Upsert participants to metamist"""
# Query metamist
data_response = get_sample_data(project)
Expand Down Expand Up @@ -141,7 +148,7 @@ def main(test_bucket: bool, project: str, participant_meta: str, sample_meta: st
# Get the external ID
seid = '.'.join(name_row['CRAM'].split('.')[:2])

meta_row = metadata_map.get(name_row['RGSM (SampleID)'])
meta_row = metadata_map.get(name_row[sample_external_id_column])
# Get participant external ID
peid = meta_row['externalID']

Expand Down

0 comments on commit a1630d5

Please sign in to comment.