@@ -291,6 +291,10 @@ def main(argv=None):
291291 help = "copy the 'download_fastqs.py' utility to the "
292292 "final location" )
293293 sp = p .add_argument_group ("Advanced options" )
294+ sp .add_argument ('--short_names' ,action = 'store_true' ,
295+ default = None ,
296+ help = "use shortened base names where possible for "
297+ "shared files" )
294298 sp .add_argument ('--link' ,action = 'store_true' ,
295299 help = "hard link files instead of copying" )
296300 sp .add_argument ('--runner' ,action = 'store' ,
@@ -337,6 +341,7 @@ def main(argv=None):
337341 subdir = dest .subdir
338342 zip_fastqs = dest .zip_fastqs
339343 max_zip_size = dest .max_zip_size
344+ short_names = dest .short_names
340345 include_downloader = dest .include_downloader
341346 include_qc_report = dest .include_qc_report
342347 hard_links = dest .hard_links
@@ -347,6 +352,7 @@ def main(argv=None):
347352 subdir = None
348353 zip_fastqs = False
349354 max_zip_size = None
355+ short_names = False
350356 include_downloader = False
351357 include_qc_report = False
352358 hard_links = False
@@ -361,6 +367,8 @@ def main(argv=None):
361367 zip_fastqs = True
362368 if args .max_zip_size :
363369 max_zip_size = args .max_zip_size
370+ if args .short_names :
371+ short_names = args .short_names
364372 if args .include_downloader :
365373 include_downloader = True
366374 if args .include_qc_report :
@@ -392,6 +400,7 @@ def main(argv=None):
392400 print (f"Hard link Fastqs : { hard_links } " )
393401 print (f"Zip Fastqs : { zip_fastqs } " )
394402 print (f"Max ZIP size : { max_zip_size } " )
403+ print (f"Shorten file names : { short_names } " )
395404 print (f"Dry run : { dry_run } " )
396405
397406 # Check at least one artefact is being transferred
@@ -741,6 +750,7 @@ def main(argv=None):
741750 analysis_dir .metadata .run_number ,
742751 analysis_dir .metadata .instrument_datestamp ,
743752 analysis_dir .run_id ))
753+ summary .append (f"Project '{ project .name } '" )
744754 summary .append ("%s%s dataset" %
745755 ("%s " % project .info .single_cell_platform
746756 if project .info .single_cell_platform else '' ,
@@ -857,13 +867,16 @@ def main(argv=None):
857867 run_number = str (analysis_dir .metadata .run_number )
858868 if analysis_dir .metadata .analysis_number is not None :
859869 run_number += "_" + str (analysis_dir .metadata .analysis_number )
860- final_zip_basename = \
861- "{platform}_{datestamp}.{run_number}-{project}-fastqs" .\
862- format (
863- platform = analysis_dir .metadata .platform .upper (),
864- datestamp = analysis_dir .metadata .instrument_datestamp ,
865- run_number = run_number ,
866- project = project .name )
870+ if short_names :
871+ final_zip_basename = f"{ project .name } -fastqs"
872+ else :
873+ final_zip_basename = \
874+ "{platform}_{datestamp}.{run_number}-{project}-fastqs" .\
875+ format (
876+ platform = analysis_dir .metadata .platform .upper (),
877+ datestamp = analysis_dir .metadata .instrument_datestamp ,
878+ run_number = run_number ,
879+ project = project .name )
867880 job_ix = 0
868881 for f in listdir (working_dir ):
869882 if f == "%s.chksums" % project_name :
@@ -907,11 +920,14 @@ def main(argv=None):
907920 if qc_zips :
908921 for qc_zip in qc_zips :
909922 print ("Copying '%s'" % os .path .basename (qc_zip ))
923+ qc_zip_basename = os .path .basename (qc_zip )
924+ if short_names :
925+ # Hack to remove run name from QC report ZIP name
926+ qc_zip_basename = f"{ '.' .join (qc_zip_basename .split ('.' )[:- 2 ])} .zip"
910927 td .run_job (
911- f"copy_qc_zip.{ job_id } .{ os . path . basename ( qc_zip ) } " ,
928+ f"copy_qc_zip.{ job_id } .{ qc_zip_basename } " ,
912929 copy_command (qc_zip ,
913- os .path .join (target_dir ,
914- os .path .basename (qc_zip )),
930+ os .path .join (target_dir , qc_zip_basename ),
915931 link = hard_links ))
916932
917933 # Tar and copy 10xGenomics outputs
@@ -920,12 +936,13 @@ def main(argv=None):
920936 print ("Tar gzipping and copying '%s'" %
921937 os .path .basename (cellranger_dir ))
922938 # Tar & gzip data
923- targz = os .path .join (working_dir ,
924- "%s.%s.%s.tgz" % (
925- os .path .basename (
926- cellranger_dir ),
927- project_name ,
928- project .info .run ))
939+ if short_names :
940+ targz = f"{ os .path .basename (cellranger_dir )} .{ project_name } .tgz"
941+ else :
942+ targz = "%s.%s.%s.tgz" % (os .path .basename (cellranger_dir ),
943+ project_name ,
944+ project .info .run )
945+ targz = os .path .join (working_dir , targz )
929946 targz_job = td .run_job (
930947 f"targz_10x_output.{ job_id } .{ os .path .basename (cellranger_dir )} " ,
931948 Command ("tar" ,
@@ -980,11 +997,13 @@ def main(argv=None):
980997 if visium_images_dir :
981998 print (f"Tar gzipping and copying '{ visium_images_dir } '" )
982999 # Tar & gzip data
983- targz = os .path .join (working_dir ,
984- "%s.%s.%s.tgz" % (
985- os .path .basename (visium_images_dir ),
986- project_name ,
987- project .info .run ))
1000+ if short_names :
1001+ targz = f"{ os .path .basename (visium_images_dir )} .{ project_name } .tgz"
1002+ else :
1003+ targz = "%s.%s.%s.tgz" % (os .path .basename (visium_images_dir ),
1004+ project_name ,
1005+ project .info .run )
1006+ targz = os .path .join (working_dir , targz )
9881007 targz_job = td .run_job (
9891008 f"targz_visium_images.{ job_id } .{ os .path .basename (visium_images_dir )} " ,
9901009 Command ("tar" ,
0 commit comments