Skip to content

Commit

Permalink
Merge pull request #87 from maxplanck-ie/dev_wd
Browse files Browse the repository at this point in the history
log the actual commands executed
  • Loading branch information
WardDeb authored Aug 16, 2024
2 parents bb941f2 + 3b3d46e commit b19a204
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions BRB/PushButton.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import stat
from pathlib import Path


def createPath(config, group, project, organism, libraryType, tuples):
"""Ensures that the output path exists, creates it otherwise, and return where it is"""
if tuples[0][3]:
Expand Down Expand Up @@ -220,14 +219,13 @@ def RNA(config, group, project, organism, libraryType, tuples):
org = organism2Org(config, organism)
CMD = "PATH={}/bin:$PATH".format(os.path.join(config.get('Options', 'snakemakeWorkflowBaseDir')))
CMD = [CMD, 'mRNA-seq', '--DAG', '--trim', '-j', config.get('Queue', 'parallelProcesses'), '-i', outputDir, '-o', outputDir, org]
#if org == 'dm6':
# CMD.extend(['--star_options', '"--limitBAMsortRAM 60000000000"'])
if tuples[0][2].startswith("Smart-Seq2"):
# SMART-seq isn't a dUTP-based method!
CMD.extend(['--libraryType', '0'])
elif tuples[0][2].startswith("NEBNext Low Input RNA Library"):
# Unstranded
CMD.extend(['--libraryType', '0'])
log.info(f"RNA wf CMD: {CMD}")
try:
subprocess.check_call(' '.join(CMD), shell=True)
except:
Expand Down Expand Up @@ -289,6 +287,7 @@ def RELACS(config, group, project, organism, libraryType, tuples):

# -p 10 is pretty much arbitrary
CMD = ["demultiplex_relacs", "--umiLength", "4", "-p", "10", os.path.join(outputDir, "RELACS_sampleSheet.txt"), os.path.join(outputDir, "RELACS_demultiplexing")]
log.info(f"RELACS demux wf CMD: {CMD}")
try:
subprocess.check_call(' '.join(CMD), shell=True, cwd=outputDir)
except:
Expand All @@ -311,6 +310,7 @@ def RELACS(config, group, project, organism, libraryType, tuples):
org = organism2Org(config, organism)
CMD = "PATH={}/bin:$PATH".format(os.path.join(config.get('Options', 'snakemakeWorkflowBaseDir')))
CMD = [CMD, 'DNA-mapping', '--DAG', '--trim', '--UMIDedup', '--mapq', '3', '-j', config.get('Queue', 'parallelProcesses'), '-i', outputDir, '-o', outputDir, org]
log.info(f"RELACS DNA wf CMD: {CMD}")
try:
subprocess.check_call(' '.join(CMD), shell=True)
except:
Expand Down Expand Up @@ -360,6 +360,7 @@ def DNA(config, group, project, organism, libraryType, tuples):
CMD = [CMD, 'DNA-mapping', '--DAG', '--trim', r"--trimmerOptions '-a nexteraF=CTGTCTCTTATA -A nexteraR=CTGTCTCTTATA'", '--dedup', '--mapq 2', '-j', config.get('Queue', 'parallelProcesses'), '-i', outputDir, '-o', outputDir, org]
else:
CMD = [CMD, 'DNA-mapping', '--DAG', '--trim', '--dedup', '--mapq', '3', '-j', config.get('Queue', 'parallelProcesses'), '-i', outputDir, '-o', outputDir, org]
log.info(f"DNA wf CMD: {CMD}")
try:
subprocess.check_call(' '.join(CMD), shell=True)
except:
Expand Down Expand Up @@ -388,6 +389,7 @@ def WGBS(config, group, project, organism, libraryType, tuples):
org = organism2Org(config, organism)
CMD = "PATH={}/bin:$PATH".format(os.path.join(config.get('Options', 'snakemakeWorkflowBaseDir')))
CMD = [CMD, 'WGBS', '--DAG', '--trim', '-j', config.get('Queue', 'parallelProcesses'), '-i', outputDir, '-o', outputDir, org]
log.info(f"WGBS wf CMD: {CMD}")
try:
subprocess.check_call(' '.join(CMD), shell=True)
except:
Expand Down Expand Up @@ -420,6 +422,7 @@ def ATAC(config, group, project, organism, libraryType, tuples):
org = organism2Org(config, organism)
CMD = "PATH={}/bin:$PATH".format(os.path.join(config.get('Options', 'snakemakeWorkflowBaseDir')))
CMD = [CMD, 'ATAC-seq', '--DAG', '-d', outputDir, org]
log.info(f"ATAC wf CMD: {CMD}")
try:
subprocess.check_call(' '.join(CMD), shell=True)
except:
Expand Down Expand Up @@ -447,7 +450,9 @@ def scRNAseq(config, group, project, organism, libraryType, tuples):
org = organism2Org(config, organism)
if tuples[0][2] == 'Chromium_NextGEM_SingleCell3Prime_GeneExpression_v3.1_DualIndex':
PE = linkFiles(config, group, project, outputDir, tuples)
CMD = [config.get('10x', 'RNA'), outputDir, outputDir, org]
# scRNA has their own organism mapping table, just make sure no spaces are included
CMD = [config.get('10x', 'RNA'), outputDir, outputDir, organism.split(' ')[0].lower()]
log.info(f"scRNA wf CMD: {' '.join(CMD)}")
try:
subprocess.check_call(' '.join(CMD), shell=True)
except:
Expand All @@ -461,6 +466,7 @@ def scRNAseq(config, group, project, organism, libraryType, tuples):
PE = linkFiles(config, group, project, outputDir, tuples)
CMD = "PATH={}/bin:$PATH".format(os.path.join(config.get('Options', 'snakemakeWorkflowBaseDir')))
CMD = [CMD, 'scRNAseq', '--DAG', '-j', config.get('Queue', 'parallelProcesses'), '--myKit CellSeq384','--skipVelocyto' , '-i', outputDir, '-o', outputDir, org]
log.info(f"scRNA wf CMD: {CMD}")
try:
subprocess.check_call(' '.join(CMD), shell=True)
except:
Expand Down Expand Up @@ -494,6 +500,7 @@ def HiC(config, group, project, organism, libraryType, tuples):
org = organism2Org(config, organism)
CMD = "PATH={}/bin:$PATH".format(os.path.join(config.get('Options', 'snakemakeWorkflowBaseDir')))
CMD = [CMD, 'HiC', '--DAG', '--noTAD', '-j', config.get('Queue', 'parallelProcesses'),'--enzyme', 'DpnII', '-i', outputDir, '-o', outputDir, org]
log.info(f"HiC wf CMD: {CMD}")
try:
subprocess.check_call(' '.join(CMD), shell=True)
except:
Expand Down Expand Up @@ -534,6 +541,7 @@ def scATAC(config, group, project, organism, libraryType, tuples):
CMD += " -o "+outputDir
CMD += " "+org
CMD += " --projectID "+project+" --samples "+samples
log.info(f"scATAC wf CMD: {CMD}")
try:
subprocess.check_call(CMD, shell=True)
except:
Expand Down

0 comments on commit b19a204

Please sign in to comment.