Beispiel #1
0
                           dependency=[trimReadsJobID])

################################################################################
## Generate RSEM Transcript alignment command
################################################################################
# Generate file names
args['rsemTranPrefix'] = os.path.join(args['rsemTranSampleDir'], args['name'])
args['rsemTranLog'] = args['rsemTranPrefix'] + '_RSEM.log'
args['rsemTranBam'] = args['rsemTranPrefix'] + '.transcript.bam'
args['rsemTranGenomeBam'] = args['rsemTranPrefix'] + '.genome.bam'
# Generate rsem transcript alignment command
rsemAlignCommand = fastqAlign.rsemBowtie2Align(
    read1=args['trimRead1'],
    read2=args['trimRead2'],
    index=args['<rsemtranindex>'],
    outPrefix=args['rsemTranPrefix'],
    rsemPath=paths['rsem'],
    bowtie2Path=re.sub('[^/]*$', '', paths['bowtie2']),
    threads=args['--threads'],
    forProb=args['--forprob'],
    genomeBam=True)
# Submit rsem transcript command
rsemAlignJobID = moabJobs.add(command=rsemAlignCommand,
                              processors=args['--threads'],
                              stdout=args['rsemTranLog'],
                              stderr=args['rsemTranLog'],
                              dependency=[trimReadsJobID])

################################################################################
## Generate RSEM Spike-In Alignment command
################################################################################
# Generate file names
################################################################################
## Generate RSEM Transcript alignment command
################################################################################
# Generate file names
args['rsemTranPrefix'] = os.path.join(args['rsemTranSampleDir'], args['name'])
args['rsemTranLog'] = args['rsemTranPrefix'] + '_RSEM.log'
args['rsemTranBam'] = args['rsemTranPrefix'] + '.transcript.bam'
args['rsemTranGenomeBam'] = args['rsemTranPrefix'] + '.genome.bam'
# Generate rsem transcript alignment command
rsemAlignCommand = fastqAlign.rsemBowtie2Align(
    read1 = args['trimRead1'],
    read2 = args['trimRead2'],
    index = args['<rsemtranindex>'],
    outPrefix = args['rsemTranPrefix'],
    rsemPath = paths['rsem'],
    bowtie2Path = re.sub('[^/]*$', '', paths['bowtie2']),
    threads = args['--threads'],
    forProb = args['--forprob'],
    genomeBam = True
)
# Submit rsem transcript command
rsemAlignJobID = moabJobs.add(
    command = rsemAlignCommand,
    processors = args['--threads'],
    stdout = args['rsemTranLog'],
    stderr = args['rsemTranLog'],
    dependency = [trimReadsJobID]
)

################################################################################
Beispiel #3
0
)

###############################################################################
## Generate RSEM Transcript alignment command
###############################################################################
# Generate file names
args['rsemTranPrefix'] = os.path.join(args['rsemTranSampleDir'], args['name'])
args['rsemTranLog'] = args['rsemTranPrefix'] + '_rsem.log'
args['rsemTranBam'] = args['rsemTranPrefix'] + '.transcript.bam'
args['rsemTranGenomeBam'] = args['rsemTranPrefix'] + '.genome.bam'
# Generate rsem transcript alignment command
rsemAlignCommand = fastqAlign.rsemBowtie2Align(
    read1 = args['trimRead1'],
    read2 = args['trimRead2'],
    index = args['<rsemtranindex>'],
    outPrefix = args['rsemTranPrefix'],
    rsemPath = pmDict[('rsem', 'path')],
    threads = args['--threads'],
    forProb = args['--forprob'],
    genomeBam = False
)
# Submit rsem transcript command
rsemAlignJobID = slurmJobs.add(
    command = rsemAlignCommand,
    processors = args['--threads'],
    stdout = args['rsemTranLog'],
    stderr = args['rsemTranLog'],
    depend = [trimReadsJobID],
    modules = pmDict[('rsem', 'modules')]
)

###############################################################################
Beispiel #4
0
inDir, inPrefix = os.path.split(args['<inprefix>'])
outDir = os.path.join(args['<outdir>'], args['<samplename>'])
if not os.path.isdir(outDir):
    os.mkdir(outDir)
outPrefix = os.path.join(outDir, args['<samplename>'])
outLog = outPrefix + '.rsem.log'
# Create job dictionary

# Extract fastq files and generate output file names
read1, read2 = fastqFind.findFastq(prefix=inPrefix,
                                   dirList=[inDir],
                                   pair=True,
                                   gzip=True)
rsemCommand = fastqAlign.rsemBowtie2Align(index=args['<index>'],
                                          outPrefix=outPrefix,
                                          read1=read1,
                                          read2=read2,
                                          rsemPath=args['--rsem'],
                                          bowtie2Path=args['--bowtie2'],
                                          threads=args['--threads'],
                                          forProb=args['--forprob'],
                                          genomeBam=args['--genomebam'],
                                          estimateRspd=False,
                                          check=True)
print rsemCommand
jobID = moab.submitJob(rsemCommand,
                       processor=args['--threads'],
                       stdout=outLog,
                       stderr=outLog)
print args['<samplename>'], jobID
"""
# Import required modules
import os
from ngs_python.fastq import fastqFind, fastqAlign
from general_python import docopt, toolbox, moab
# Extract and process arguments
args = docopt.docopt(__doc__,version = 'v1')
args['--threads'] = int(args['--threads'])
args['--forprob'] = float(args['--forprob'])
toolbox.check_var(args['--forprob'], 'num', mn = 0, mx = 1)
inDir, inPrefix = os.path.split(args['<inprefix>'])
outDir = os.path.join(args['<outdir>'], args['<samplename>'])
if not os.path.isdir(outDir):
    os.mkdir(outDir)
outPrefix = os.path.join(outDir, args['<samplename>'])
outLog = outPrefix + '.rsem.log'
# Create job dictionary

# Extract fastq files and generate output file names
read1, read2 = fastqFind.findFastq(prefix = inPrefix, dirList = [inDir],
    pair = True, gzip = True)
rsemCommand = fastqAlign.rsemBowtie2Align(index = args['<index>'],
    outPrefix = outPrefix, read1 = read1, read2 = read2,
    rsemPath = args['--rsem'], bowtie2Path = args['--bowtie2'],
    threads = args['--threads'], forProb = args['--forprob'],
    genomeBam = args['--genomebam'], estimateRspd = False, check = True)
print rsemCommand
jobID = moab.submitJob(rsemCommand, processor = args['--threads'],
    stdout = outLog, stderr = outLog)
print args['<samplename>'], jobID
)

###############################################################################
## Generate RSEM Transcript alignment command
###############################################################################
# Generate file names
args['rsemTranPrefix'] = os.path.join(args['rsemTranSampleDir'], args['name'])
args['rsemTranLog'] = args['rsemTranPrefix'] + '_rsem.log'
args['rsemTranBam'] = args['rsemTranPrefix'] + '.transcript.bam'
args['rsemTranGenomeBam'] = args['rsemTranPrefix'] + '.genome.bam'
# Generate rsem transcript alignment command
rsemAlignCommand = fastqAlign.rsemBowtie2Align(
    read1 = args['trimRead1'],
    read2 = args['trimRead2'],
    index = args['<rsemtranindex>'],
    outPrefix = args['rsemTranPrefix'],
    rsemPath = pmDict[('rsem', 'path')],
    threads = args['--threads'],
    forProb = args['--forprob'],
    genomeBam = False
)
# Submit rsem transcript command
rsemAlignJobID = slurmJobs.add(
    command = rsemAlignCommand,
    processors = args['--threads'],
    stdout = args['rsemTranLog'],
    stderr = args['rsemTranLog'],
    depend = [trimReadsJobID],
    modules = pmDict[('rsem', 'modules')]
)

###############################################################################