8
8
import stat
9
9
from pathlib import Path
10
10
11
- def createPath (config , group , project , organism , libraryType , tuples ):
11
+ def createPath (config , group , project , organism , libraryType , tuples , stats ):
12
12
"""Ensures that the output path exists, creates it otherwise, and return where it is"""
13
13
if tuples [0 ][3 ]:
14
14
baseDir = "{}/{}/Analysis_{}" .format (config .get ('Paths' , 'baseData' ),
@@ -20,10 +20,11 @@ def createPath(config, group, project, organism, libraryType, tuples):
20
20
BRB .misc .getLatestSeqdir (config .get ('Paths' ,'groupData' ), group ),
21
21
config .get ('Options' , 'runID' ),
22
22
BRB .misc .pacifier (project ))
23
- os .makedirs (baseDir , mode = 0o700 , exist_ok = True )
23
+
24
+ if not stats : os .makedirs (baseDir , mode = 0o700 , exist_ok = True )
24
25
25
26
oDir = os .path .join (baseDir , "{}_{}" .format (BRB .misc .pacifier (libraryType ), organism .split (' ' )[0 ].lower ()))
26
- os .makedirs (oDir , mode = 0o700 , exist_ok = True )
27
+ if not stats : os .makedirs (oDir , mode = 0o700 , exist_ok = True )
27
28
return oDir
28
29
29
30
@@ -564,7 +565,7 @@ def scATAC(config, group, project, organism, libraryType, tuples):
564
565
return outputDir , 0 , True
565
566
566
567
567
- def GetResults (config , project , libraries ):
568
+ def GetResults (config , project , libraries , stats ):
568
569
"""
569
570
Project is something like '352_Grzes_PearceEd' and libraries is a dictionary with libraries as keys:
570
571
{'18L005489': ['FAT_first_A',
@@ -638,7 +639,12 @@ def GetResults(config, project, libraries):
638
639
reruncount = 0
639
640
# RELACS needs the unpacified project name to copy the original sample sheet to the dest dir
640
641
# hence the pacifier is applied on the project in each pipeline separately
641
- outputDir , rv , sambaUpdate = globals ()[pipeline ](config , group , project , organism , libraryType , tuples )
642
+ if stats :
643
+ outputDir , rv , sambaUpdate = (
644
+ createPath (config , group , BRB .misc .pacifier (project ), organism , libraryType , tuples , stats ),
645
+ 0 , False )
646
+ else :
647
+ outputDir , rv , sambaUpdate = globals ()[pipeline ](config , group , project , organism , libraryType , tuples )
642
648
if reruncount == 0 and rv != 0 :
643
649
# Allow for one re-run
644
650
reruncount += 1
0 commit comments