if testOnly:
    ana.dryRun = testOnly

# What step expects:
# Inputs: 2 bam files, pre-registered in the analysis and both keyed as: 'bamRep' + replicateN + '.bam'
# Outputs: 1 merged bam keyed as: 'mergedRep' + replicate1 + 'Rep' +replcicate2 + '.bam'

# set up keys that join inputs through various file forwardings:
bamAkey = 'bamRep' + repA + '.bam'
bamBkey = 'bamRep' + repB + '.bam'
mergedBamKey = 'mergedRep' + repA + 'Rep' + repB + '.bam'

# Establish Inputs for galaxy and nonGalaxy alike
ana.registerFile(bamAkey, 'galaxyInput', galaxyInputBamA)
ana.registerFile(bamBkey, 'galaxyInput', galaxyInputBamB)
nonGalaxyInput1 = ana.nonGalaxyInput(
    bamAkey)  # Registers and returns the outside location
nonGalaxyInput2 = ana.nonGalaxyInput(
    bamBkey)  # Need to register these to ensure nonGalOut naming

# outputs:
ana.registerFile(mergedBamKey, 'galaxyOutput', galaxyOutMergedBam)
resultsDir = ana.resultsDir(
    galaxyPath)  # prefers nonGalaxyInput location over settings loc
ana.createOutFile(mergedBamKey,'nonGalaxyOutput','%s_%s_merged',ext='bam', \
                  input1=bamAkey, input2=bamBkey)

# Establish step and run it:
step = MergeBamStep(ana, repA, repB)
sys.exit(step.run())
Exemple #2
0
# if tansformed/transformable bam is provided.
if alignedBy != 'unknown':
    suffix = alignedBy.capitalize() + suffix

# What step expects:
# Inputs: 1 Annotation alignment bam             keyed: 'annotation'              + suffix + '.bam'
# Outputs: 1 target Gene       results tab file, keyed: 'quantifyGenesRsem'       + suffix + '.tab'
#          1 target Transcript results tab file, keyed: 'quantifyTranscriptsRsem' + suffix + '.tab'

bamInputKey = 'annotation' + suffix + '.bam'  # Used to tie inputs together
genesFileKey = 'quantifyGenesRsem' + suffix + '.tab'  # Used to tie outputs together
transFileKey = 'quantifyTranscriptsRsem' + suffix + '.tab'

# Establish Inputs for galaxy and nonGalaxy alike
ana.registerFile(bamInputKey, 'galaxyInput', galaxyBamInput)
nonGalaxyInput = ana.nonGalaxyInput(
    bamInputKey)  # Registers and returns the outside location
# outputs:
ana.registerFile(genesFileKey, 'galaxyOutput', galaxyOutGenes)
resultsDir = ana.resultsDir(
    galaxyPath)  # prefers nonGalaxyInput location over settings loc
ana.createOutFile(genesFileKey, 'nonGalaxyOutput', '%s_rsemGenes', ext='tab')
ana.registerFile(transFileKey, 'galaxyOutput', galaxyOutTrans)
ana.createOutFile(transFileKey,
                  'nonGalaxyOutput',
                  '%s_rsemTranscripts',
                  ext='tab')

# Establish step and run it:
step = RsemStep(ana, suffix)
sys.exit(step.run())
if testOnly:
    ana.dryRun = testOnly

# What step expects:
# Inputs: 1 bam, pre-registered in the analysis keyed as: 'alignmentRep' + replicate + '.bam'
# Outputs: 1 interim Corr       file, keyed as: 'strandCorr' + suffix +    '.txt'
#          1 target json        file, keyed as: 'bamEvaluate' + suffix +   '.json'

# TODO: Does a galaxy user really want the sample bam?
    
# set up keys that join inputs through various file forwardings:
bamInputKey   = 'alignmentRep'   + repNo +    '.bam'

# Establish Inputs for galaxy and nonGalaxy alike
ana.registerFile(bamInputKey,'galaxyInput', galaxyInputFile)
nonGalaxyInput  = ana.nonGalaxyInput(bamInputKey)  # Registers and returns the outside location
suffix = 'Rep' + repNo
if nonGalaxyInput.lower().find('_star') != -1:
    suffix += 'ByStar'
elif nonGalaxyInput.find('_tophat') != -1:
    suffix += 'ByTophat'
elif nonGalaxyInput.lower().find('_bwa') != -1:
    suffix += 'ByBwa'
bamSampleKey  = 'alignment'      + suffix + '_5M.bam'
bamEvalKey    = 'bamEvaluate'    + suffix +    '.json'

# outputs:
ana.registerFile( bamEvalKey,     'galaxyOutput',galaxyOutBamEval)
resultsDir  = ana.resultsDir(galaxyPath) # prefers nonGalaxyInput location over settings loc
ana.createOutFile(bamEvalKey,  'nonGalaxyOutput','%s_bamEval',ext='json')
Exemple #4
0
#                                                      'signalStarRep' + replicate +  'AllMinus.bw'
#                                                      'signalStarRep' + replicate +   'AllPlus.bw'
#          or 2 (unpaired) target signal file2:        'signalStarRep' + replicate +      'Uniq.bw'
#                                                      'signalStarRep' + replicate +       'All.bw'

genoBamKey  =     'genomeAlignedStarRep'+repNo + '.bam' # Used to tie outputs together
annoBamKey  = 'annotationAlignedStarRep'+repNo + '.bam' # Used to tie outputs together
statsKey    =        'statisticsStarRep'+repNo + '.txt' # Used to tie outputs together
    
# Establish Inputs for galaxy and nonGalaxy alike
if pairedOrUnpaired == "paired":
    fastqRd1Key='tagsRd1Rep'+repNo + '.fastq' # Used to tie inputs together
    fastqRd2Key='tagsRd2Rep'+repNo + '.fastq' # Used to tie inputs together
    ana.registerFile(fastqRd1Key,'galaxyInput', galaxyInputFile)
    ana.registerFile(fastqRd2Key,'galaxyInput', galaxyInputFile2)
    nonGalaxyInput  = ana.nonGalaxyInput(fastqRd1Key)  # Registers and returns the outside location
    nonGalaxyInput2 = ana.nonGalaxyInput(fastqRd2Key)  # Registers and returns the outside location
    # outputs:
    ana.registerFile(genoBamKey,'galaxyOutput',galaxyGenoBamOutput)
    resultsDir  = ana.resultsDir(galaxyPath) # prefers nonGalaxyInput location over settings loc
    ana.createOutFile(genoBamKey,'nonGalaxyOutput','%s_%s_starGenome', ext='bam', \
                      input1=fastqRd1Key, input2=fastqRd2Key)
    ana.registerFile(annoBamKey,'galaxyOutput',galaxyAnnoBamOutput)
    ana.createOutFile(annoBamKey,'nonGalaxyOutput','%s_%s_starAnnotation', ext='bam', \
                      input1=fastqRd1Key, input2=fastqRd2Key)
    ana.registerFile( statsKey,   'galaxyOutput',galaxyStatsOut)
    ana.createOutFile(statsKey,'nonGalaxyOutput','%s_%s_starStats', ext='txt', \
                      input1=fastqRd1Key, input2=fastqRd2Key)
    # signal bigWigs:
    allMinusKey =               'signalStarRep' + repNo +  'AllMinus.bw'
    ana.registerFile( allMinusKey,   'galaxyOutput',galaxyBwAllMinusOut)