@@ -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 ]
@@ -590,7 +592,7 @@ def GetResults(config, project, libraries):
590
592
'Other',
591
593
'scRNA-Seq 10xGenomics',
592
594
'mouse'],
593
-
595
+ }
594
596
This doesn't return anything. It's assumed that everything within a single library type can be analysed together.
595
597
"""
596
598
ignore = False
@@ -614,6 +616,7 @@ def GetResults(config, project, libraries):
614
616
analysisTypes = dict ()
615
617
skipList = []
616
618
external_skipList = []
619
+ org_dict = {}
617
620
for library , v in libraries .items ():
618
621
sampleName , libraryType , libraryProtocol , organism , indexType , requestDepth = v
619
622
org_name , org_label , org_yaml = organism
@@ -625,6 +628,8 @@ def GetResults(config, project, libraries):
625
628
if not (org_label or org_yaml ):
626
629
log .info (f"Species label or YAML was not set for { org_name } (check Parkour DB.)" )
627
630
if libraryType in validLibraryTypes and (org_label or org_yaml ) and (ignore == False or libraryType in config .get ('external' ,'LibraryTypes' )):
631
+ if org_label not in org_dict :
632
+ org_dict [org_label ] = organism
628
633
idx = validLibraryTypes [libraryType ]
629
634
pipeline = pipelines [idx ]
630
635
if pipeline not in analysisTypes :
@@ -645,18 +650,27 @@ def GetResults(config, project, libraries):
645
650
for i in skipList :
646
651
log .info (f"Skipping sample { i [0 ]} /{ i [0 ]} ({ org_name } - project { BRB .misc .pacifier (project )} ).\n " )
647
652
msg = msg + [BRB .ET .telegraphHome (config , group , BRB .misc .pacifier (project ), skipList , org_name )]
653
+ log .debug (config )
648
654
for pipeline , v in analysisTypes .items ():
655
+ log .debug ('Running pipeline ' + pipeline )
649
656
for org_label , v2 in v .items ():
657
+ log .debug ('Running organism label ' + org_label )
658
+ organism = org_dict [org_label ]
659
+ log .debug (organism )
650
660
for libraryType , tuples in v2 .items ():
661
+ log .debug ('Running libraryType ' + libraryType )
662
+ log .debug (tuples )
651
663
reruncount = 0
652
664
# RELACS needs the unpacified project name to copy the original sample sheet to the dest dir
653
665
# hence the pacifier is applied on the project in each pipeline separately
666
+
654
667
outputDir , rv , sambaUpdate = globals ()[pipeline ](config , group , project , organism , libraryType , tuples )
655
668
if reruncount == 0 and rv != 0 :
656
669
# Allow for one re-run
657
670
reruncount += 1
658
671
outputDir , rv , sambaUpdate = globals ()[pipeline ](config , group , project , organism , libraryType , tuples )
659
672
if rv == 0 :
673
+ log .debug ('BRB run for {} {} {} {} complete.' .format (pipeline ,org_label ,libraryType ,tuples ))
660
674
msg = msg + [BRB .ET .phoneHome (config , outputDir , pipeline , tuples , org_name , project , libraryType ) + [sambaUpdate , reruncount ]]
661
675
log .info (f"Processed project { BRB .misc .pacifier (project )} with the { pipeline } pipeline. { libraryType } , { org_name } . Rerun = { reruncount } " )
662
676
else :
0 commit comments