Skip to content

Commit

Permalink
slurp bash code into python
Browse files Browse the repository at this point in the history
  • Loading branch information
dpark01 committed Sep 23, 2024
1 parent 85a3e6a commit 5af2632
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pipes/WDL/tasks/tasks_ncbi.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,8 @@ task biosample_to_genbank {
out_headers.append('note')
outf_smt.write('\t'.join(out_headers)+'\n')
with open("~{base}.biosample.map.txt", 'wt') as outf_biosample:
with open("~{base}.sample_ids.txt", 'wt') as outf_ids:
with open("~{base}.biosample.map.txt", 'wt') as outf_biosample:
outf_biosample.write('BioSample\tsample\n')
for row in biosample_attributes:
Expand Down Expand Up @@ -777,16 +778,17 @@ task biosample_to_genbank {
# write entry for this sample
outf_smt.write('\t'.join(outrow[h] for h in out_headers)+'\n')
outf_ids.write(outrow['Sequence_ID']+'\n')
# also write numbered versions for every segment/chromosome
sample_name = outrow['Sequence_ID']
if ~{num_segments}>1:
for i in range(~{num_segments}):
outrow['Sequence_ID'] = "{}-{}".format(sample_name, i+1)
outf_smt.write('\t'.join(outrow[h] for h in out_headers)+'\n')
outf_ids.write(outrow['Sequence_ID']+'\n')
CODE
cut -f 1 "${base}.genbank.src" | tail +2 > "${base}.sample_ids.txt"
>>>
output {
File genbank_source_modifier_table = "~{base}.genbank.src"
Expand Down

0 comments on commit 5af2632

Please sign in to comment.