Skip to content

Commit

Permalink
Update clinical sequecning accession file parsing function to handle …
Browse files Browse the repository at this point in the history
…RSV tracking sheet format.
  • Loading branch information
davereinhart committed Aug 6, 2024
1 parent f12863d commit 521db2b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/seattleflu/id3c/cli/command/clinical.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,11 @@ def clinical():
# Parse sequencing accessions subcommand
@clinical.command("parse-sequencing")
@click.argument("accession_ids_filename", metavar = "<Sequencing accession IDs filename>")
@click.argument("record_type", metavar="<record type>", type=click.Choice(['covid', 'rsv-a', 'rsv-b']))
@click.option("-o", "--output", metavar="<output filename>",
help="The filename for the output of missing barcodes")

def parse_sequencing_accessions(accession_ids_filename, output):
def parse_sequencing_accessions(accession_ids_filename, record_type, output):
"""
Process sequencing accession IDs file.
Expand Down Expand Up @@ -99,6 +100,9 @@ def parse_sequencing_accessions(accession_ids_filename, output):
'genbank_accession': 'genbank_accession',
'_provenance': '_provenance'
}
if record_type in ['rsv-a', 'rsv-b']:
clinical_records = clinical_records[clinical_records['pathogen'] == record_type]
column_map['pathogen'] = 'pathogen'

clinical_records = clinical_records[(clinical_records['sfs_sample_barcode'].notnull())&(clinical_records.status=='submitted')].rename(columns=column_map)

Expand Down

0 comments on commit 521db2b

Please sign in to comment.