Skip to content

Commit 65bd350

Browse files
committed
attempt ftp-friendly source modifier table
1 parent 69b4b24 commit 65bd350

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

pipes/WDL/tasks/tasks_ncbi.wdl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -885,11 +885,12 @@ task biosample_to_genbank {
885885
### Taxon-specific genome naming rules go here
886886
if outrow['organism'].startswith('Influenza'):
887887
### Influenza-specific isolate naming was handled above already and is required to be metadata-free
888-
# Influenza has requirements for serotype and strain field however
889-
match = re.search(r'\(([^()]+)\)+$', outrow['isolate'])
890-
if match:
891-
outrow['serotype'] = match.group(1) # H1N1, H3N2, etc
892-
outrow['strain'] = outrow['organism'].split()[1] # A, B, C, D, etc
888+
# FTP submission pathway requires us to do the naming via the strain field
889+
type = outrow['organism'].split()[1] # A, B, C, D, etc
890+
state = outrow['geo_loc_name'].split(':')[1] if ':' in outrow['geo_loc_name'] else outrow['geo_loc_name']
891+
year = outrow['collection_date'].split('-')[0]
892+
outrow['strain'] = '/'.join([type, state, outrow['isolate'], year])
893+
print("new strain name: {}".format(outrow['strain']))
893894
elif outrow['organism'].startswith('Special taxon with special naming rules'):
894895
### Example special case here
895896
pass

0 commit comments

Comments
 (0)