@@ -63,7 +63,7 @@ def get_rg_count(aligned_file):
6363 return len (p .stdout .decode ('utf-8' ).strip ().split ('\n ' ))
6464
6565
66- def rename_file (f , payload , rg_count , sample_info ):
66+ def rename_file (f , payload , rg_count , sample_info , date_str ):
6767 experimental_strategy = payload ['experiment' ]['experimental_strategy' ].lower ()
6868
6969 if f .endswith ('.bam' ):
@@ -82,7 +82,7 @@ def rename_file(f, payload, rg_count, sample_info):
8282 sample_info [0 ]['donor' ]['donorId' ],
8383 sample_info [0 ]['sampleId' ],
8484 experimental_strategy ,
85- date . today (). strftime ( "%Y%m%d" ) ,
85+ date_str ,
8686 'aln' ,
8787 file_ext
8888 )
@@ -177,9 +177,10 @@ def main(args):
177177 rg_count = get_rg_count (aligned_file )
178178
179179 # get file of the payload
180+ date_str = date .today ().strftime ("%Y%m%d" )
180181 for f in args .files_to_upload :
181- renamed_file = rename_file (f , payload , rg_count , seq_experiment_analysis_dict ['samples' ])
182- payload ['files' ].append (get_files_info (renamed_file ))
182+ renamed_file = rename_file (f , payload , rg_count , seq_experiment_analysis_dict ['samples' ], date_str )
183+ payload ['files' ].append (get_files_info (renamed_file ))
183184
184185 with open ("%s.dna_alignment.payload.json" % str (uuid .uuid4 ()), 'w' ) as f :
185186 f .write (json .dumps (payload , indent = 2 ))
0 commit comments