@@ -341,9 +341,11 @@ def DNA(config, group, project, organism, libraryType, tuples):
341
341
project = BRB .misc .pacifier (project )
342
342
org_name , org_label , org_yaml = organism
343
343
outputDir = createPath (config , group , project , org_label , libraryType , tuples )
344
+ log .debug ('Running snakePipes in output dir ' + outputDir )
344
345
if os .path .exists (os .path .join (outputDir , "analysis.done" )):
345
346
return outputDir , 0 , False
346
347
PE = linkFiles (config , group , project , outputDir , tuples )
348
+ log .debug (os .listdir (outputDir ))
347
349
CMD = "PATH={}/bin:$PATH" .format (os .path .join (config .get ('Options' , 'snakemakeWorkflowBaseDir' )))
348
350
if libraryType == 'CUTandTag-seq' or libraryType == 'CUTandRUN-seq' :
349
351
CMD = [CMD , 'DNAmapping' , '--DAG' , '--trim' , '--dedup' , '--mapq' , '3' , '--cutntag' , '-i' , outputDir , '-o' , outputDir , org_yaml ]
@@ -443,7 +445,11 @@ def scRNAseq(config, group, project, organism, libraryType, tuples):
443
445
'Chromium_NextGEM_SingleCell3Prime_GeneExpression_v3.1_DualIndex' ,
444
446
'Chromium_GEM-X_SingleCell_3primeRNA-seq_v4'
445
447
]
448
+
449
+
446
450
if tuples [0 ][2 ] in accepted_names :
451
+ if 'GRCh38' in org_yaml :
452
+ org_yaml = 'GRCh38'
447
453
PE = linkFiles (config , group , project , outputDir , tuples )
448
454
CMD = [config .get ('10x' , 'RNA' ), outputDir , outputDir , org_yaml ]
449
455
log .info (f"scRNA wf CMD: { ' ' .join (CMD )} " )
@@ -590,7 +596,7 @@ def GetResults(config, project, libraries):
590
596
'Other',
591
597
'scRNA-Seq 10xGenomics',
592
598
'mouse'],
593
-
599
+ }
594
600
This doesn't return anything. It's assumed that everything within a single library type can be analysed together.
595
601
"""
596
602
ignore = False
@@ -614,17 +620,21 @@ def GetResults(config, project, libraries):
614
620
analysisTypes = dict ()
615
621
skipList = []
616
622
external_skipList = []
623
+ org_dict = {}
624
+ print (libraries )
617
625
for library , v in libraries .items ():
618
626
sampleName , libraryType , libraryProtocol , organism , indexType , requestDepth = v
619
627
org_name , org_label , org_yaml = organism
620
628
# Extra checks to see where we miss out
621
629
if libraryType in validLibraryTypes :
622
- log .info (f"ValidLibraryType = { libraryType } " )
630
+ log .info (f"ValidLibraryType for sample { library } = { libraryType } " )
623
631
else :
624
- log .info (f"Not a ValidLibraryType = { libraryType } " )
632
+ log .info (f"Not a ValidLibraryType for sample { library } = { libraryType } " )
625
633
if not (org_label or org_yaml ):
626
634
log .info (f"Species label or YAML was not set for { org_name } (check Parkour DB.)" )
627
635
if libraryType in validLibraryTypes and (org_label or org_yaml ) and (ignore == False or libraryType in config .get ('external' ,'LibraryTypes' )):
636
+ if org_label not in org_dict :
637
+ org_dict [org_label ] = organism
628
638
idx = validLibraryTypes [libraryType ]
629
639
pipeline = pipelines [idx ]
630
640
if pipeline not in analysisTypes :
@@ -645,18 +655,28 @@ def GetResults(config, project, libraries):
645
655
for i in skipList :
646
656
log .info (f"Skipping sample { i [0 ]} /{ i [0 ]} ({ org_name } - project { BRB .misc .pacifier (project )} ).\n " )
647
657
msg = msg + [BRB .ET .telegraphHome (config , group , BRB .misc .pacifier (project ), skipList , org_name )]
658
+ log .debug (config )
648
659
for pipeline , v in analysisTypes .items ():
660
+ log .debug ('Running pipeline ' + pipeline )
649
661
for org_label , v2 in v .items ():
662
+ log .debug ('Running organism label ' + org_label )
663
+ organism = org_dict [org_label ]
664
+ org_name , org_label , org_yaml = organism
665
+ log .debug (organism )
650
666
for libraryType , tuples in v2 .items ():
667
+ log .debug ('Running libraryType ' + libraryType )
668
+ log .debug (tuples )
651
669
reruncount = 0
652
670
# RELACS needs the unpacified project name to copy the original sample sheet to the dest dir
653
671
# hence the pacifier is applied on the project in each pipeline separately
672
+
654
673
outputDir , rv , sambaUpdate = globals ()[pipeline ](config , group , project , organism , libraryType , tuples )
655
674
if reruncount == 0 and rv != 0 :
656
675
# Allow for one re-run
657
676
reruncount += 1
658
677
outputDir , rv , sambaUpdate = globals ()[pipeline ](config , group , project , organism , libraryType , tuples )
659
678
if rv == 0 :
679
+ log .debug ('BRB run for {} {} {} {} complete.' .format (pipeline ,org_label ,libraryType ,tuples ))
660
680
msg = msg + [BRB .ET .phoneHome (config , outputDir , pipeline , tuples , org_name , project , libraryType ) + [sambaUpdate , reruncount ]]
661
681
log .info (f"Processed project { BRB .misc .pacifier (project )} with the { pipeline } pipeline. { libraryType } , { org_name } . Rerun = { reruncount } " )
662
682
else :
0 commit comments