Skip to content

Commit

Permalink
Parameterize nextclade id field
Browse files Browse the repository at this point in the history
  • Loading branch information
j23414 committed Sep 18, 2023
1 parent c07ee80 commit 61174f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions join-metadata-and-clades.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import sys
import pandas as pd

NEXTCLADE_JOIN_COLUMN_NAME = 'seqName'
VALUE_MISSING_DATA = '?'

def parse_args():
Expand All @@ -14,6 +13,7 @@ def parse_args():
parser.add_argument("--metadata")
parser.add_argument("--nextclade")
parser.add_argument("--id-field")
parser.add_argument("--nextclade-id-field", default='seqName')
parser.add_argument("--nextclade-field-map", nargs="+",
help="Fields names in the nextclade TSV file mapped to new field names, " +
"formatted as '{old_field_name}={new_field_name}'.",
Expand All @@ -33,7 +33,7 @@ def main():
old_field, new_field = field.split("=")
column_map[old_field] = new_field

clades = pd.read_csv(args.nextclade, index_col=NEXTCLADE_JOIN_COLUMN_NAME,
clades = pd.read_csv(args.nextclade, index_col=args.nextclade_id_field,
sep='\t', low_memory=False, na_filter = False) \
.rename(columns=column_map)

Expand Down

0 comments on commit 61174f8

Please sign in to comment.