44import uuid
55from glob import glob
66from os .path import join , dirname
7- from typing import Optional
87
98import luigi
109import luigi .task
@@ -456,8 +455,8 @@ class OrganizeSingleCellSample(luigi.Task):
456455 def run (self ):
457456 runs = self .input ()
458457 os .makedirs (self .output ().path )
459- for run in runs :
460- for lane , ( f , read_type ) in enumerate ( zip (run .files , run .layout ) ):
458+ for lane , run in enumerate ( runs ) :
459+ for f , read_type in zip (run .files , run .layout ):
461460 dest = join (self .output ().path , f'{ self .sample_id } _S1_L{ lane + 1 :03} _{ read_type } _001.fastq.gz' )
462461 if os .path .exists (dest ):
463462 os .unlink (dest )
@@ -470,10 +469,6 @@ def output(self):
470469class AlignSingleCellSample (DynamicWrapperTask ):
471470 experiment_id : str
472471 sample_id : str
473- expect_cells : Optional [int ] = luigi .OptionalIntParameter (default = None , positional = False )
474- force_cells : Optional [int ] = luigi .OptionalIntParameter (default = None , positional = False )
475- chemistry : Optional [str ] = luigi .OptionalParameter (default = None , positional = False ,
476- description = 'Chemistry to use for Cell Ranger (default is to auto-detect)' )
477472
478473 def run (self ):
479474 fastqs_dir , transcriptome_dir = self .input ()
@@ -482,15 +477,13 @@ def run(self):
482477 transcriptome_dir = transcriptome_dir ,
483478 fastqs_dir = fastqs_dir ,
484479 output_dir = self .output ().path ,
485- expect_cells = self .expect_cells ,
486- force_cells = self .force_cells ,
487- chemistry = self .chemistry ,
488- # FIXME: request a node with AVX512
480+ # TODO: add an avx feature on slurm
489481 scheduler_extra_args = ['--constraint' , 'thrd64' ]
490482 )
491483
492484 def output (self ):
493- return luigi .LocalTarget (join (cfg .OUTPUT_DIR , 'quantified-single-cell' , self .experiment_id , self .sample_id ))
485+ return luigi .LocalTarget (
486+ join (cfg .OUTPUT_DIR , 'quantified-single-cell' , self .reference_id , self .experiment_id , self .sample_id ))
494487
495488class AlignSingleCellExperiment (DynamicTaskWithOutputMixin , DynamicWrapperTask ):
496489 experiment_id : str = luigi .Parameter ()
@@ -591,6 +584,24 @@ def output(self):
591584 return luigi .LocalTarget (
592585 join (gemma_cfg .appdata_dir , 'metadata' , self .experiment_id , 'MultiQCReports/multiqc_report.html' ))
593586
587+ class SubmitSingleCellExperimentDataToGemma (RerunnableTaskMixin , GemmaCliTask ):
588+ experiment_id : str = luigi .Parameter ()
589+ subcommand = 'loadSingleCellData'
590+
591+ def requires (self ):
592+ return AlignSingleCellExperiment (experiment_id = self .experiment_id ,
593+ reference_id = self .single_cell_reference_id (),
594+ source = 'gemma' )
595+
596+ def subcommand_args (self ):
597+ return ['-e' , self .experiment_id , '-a' , self .platform_short_name ,
598+ '--data-path' , self .input ().path ,
599+ '--quantitation-type-recomputed-from-raw-data' ,
600+ '--preferred-quantitation-type' ,
601+ # TODO: add sequencing metadata
602+ # FIXME: add --replace
603+ ]
604+
594605@requires (SubmitExperimentDataToGemma , SubmitExperimentBatchInfoToGemma , SubmitExperimentReportToGemma )
595606class SubmitExperimentToGemma (TaskWithOutputMixin , WrapperTask ):
596607 """
0 commit comments