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 5, 2024
1 parent f12863d commit 7bb4696
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions 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']))
@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,10 +100,13 @@ def parse_sequencing_accessions(accession_ids_filename, output):
'genbank_accession': 'genbank_accession',
'_provenance': '_provenance'
}
if record_type=='rsv':
column_map['pathogen'] = 'pathogen'

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

barcode_quality_control(clinical_records, output)
if record_type=='covid':
barcode_quality_control(clinical_records, output)

# Drop columns we're not tracking
clinical_records = clinical_records[column_map.values()]
Expand Down

0 comments on commit 7bb4696

Please sign in to comment.