Beispiel #1
0
    def impInitIO(self, ):
        faInput1 = self.getParamIO('faInput1')
        gtfInput1 = self.getParamIO('gtfInput1')
        assembliesInput = self.getParamIO('assembliesInput')
        gtfOutputDir = self.getParamIO('gtfOutputDir')
        if gtfOutputDir is None:
            self.setParamIO('gtfOutputDir', Configure.getTmpDir())

        #set all input files
        self.setInputDirOrFile('assembliesInput', assembliesInput)

        if faInput1 is None:
            faInput1 = Configure.getConfig('')
            self.setIput('faInput1', faInput1)
            self.setParamIO('faInput1', faInput1)
        else:
            self.setInput('faInput1', faInput1)

        if gtfInput1 is None:
            gtfInput1 = Configure.getConfig('')
            self.setIput('gtfInput1', gtfInput1)
            self.setParamIO('gtfInput1', gtfInput1)
        else:
            self.setInput('gtfInput1', gtfInput1)

        if assembliesInput is not None:
            self._setInputSize(len(self.getInputList('assembliesInput')))
            merged_gtf = list()
            for i in range(len(self.getInputList('assembliesInput'))):
                merged_gtf.append(
                    os.path.join(gtfOutputDir, 'cuffmerge_' + str(i),
                                 'merged.gtf'))
            self.setOutput('merged_gtf', merged_gtf)
        else:
            self.setOutput('merged_gtf', None)
Beispiel #2
0
    def impInitIO(self, ):

        # obtain all input and output parameters
        #fastqInput1 = self.getParamIO('fastqInput1')
        fastqInput1 = self.getParamIO('fastqInput1')
        fastqInput2 = self.getParamIO('fastqInput2')
        samOutputDir = self.getParamIO('samOutputDir')
        ht2Idx = self.getParamIO('ht2Idx')
        if samOutputDir is None:
            self.setParamIO('samOutputDir', Configure.getTmpDir())

        # print(ht2Idx)
        #set all input files
        #self.setInputDirOrFile('fastqInput1',fastqInput1)
        self.setInputDirOrFile('fastqInput1', fastqInput1)
        self.setInputDirOrFile('fastqInput2', fastqInput2)

        if ht2Idx is None:
            self.setInput('ht2IdxFile', Configure.getConfig('ht2IdxFile'))
            self.setParamIO('ht2Idx', Configure.getConfig('ht2Indx'))
        else:
            suffix = [
                '.1.ht2', '.2.ht2', '.3.ht2', '.4.ht2', '.5.ht2', '.6.ht2',
                '.7.ht2', '.8.ht2'
            ]
            ht2IdxFiles = [ht2Idx + s for s in suffix]
            self.setInput('ht2IdxFiles', ht2IdxFiles)

        # create output file paths and set
        self.setOutputDir1To1('samOutput', samOutputDir, 'hisat', 'sam',
                              'fastqInput1')

        # set how many sample are there
        if fastqInput1 is not None:
            self._setInputSize(len(self.getInputList('fastqInput1')))
Beispiel #3
0
    def impInitIO(self, ):
        """
        This function is to initialize 
        all of the input and output files from the io parameters set in __init__() 
        """

        # obtain all input and output parameters
        fastqInput1 = self.getParamIO('fastqInput1')
        fastqInput2 = self.getParamIO('fastqInput2')
        bt2Idx = self.getParamIO('bt2Idx')
        samOutputDir = self.getParamIO('samOutputDir')
        mapRsOutputDir = self.getParamIO('mapRsOutputDir')

        #set all input files
        self.setInputDirOrFile('fastqInput1', fastqInput1)
        self.setInputDirOrFile('fastqInput2', fastqInput2)

        #some special input from __init__ or configure
        if bt2Idx is None:
            self.setInput('bt2IdxFiles', Configure.getConfig('bt2IdxFiles'))
            self.setParamIO('bt2Idx', Configure.getConfig('bt2Idx'))
        else:
            suffix = [
                '.1.bt2', '.2.bt2', '.3.bt2', '.4.bt2', '.rev.1.bt2',
                '.rev.2.bt2'
            ]
            bt2IdxFiles = [bt2Idx + s for s in suffix]
            self.setInput('bt2IdxFiles', bt2IdxFiles)

        # create output file paths and set
        if samOutputDir is None:
            self.setParamIO('samOutputDir', Configure.getTmpDir())
        if mapRsOutputDir is None:
            self.setParamIO('mapRsOutputDir', Configure.getTmpDir())
        self.setOutputDir1To1('samOutput', samOutputDir, None, 'sam',
                              'fastqInput1')
        self.setOutputDir1To1('mapRsOutput', mapRsOutputDir, None,
                              'result.txt', 'fastqInput1')

        # set how many sample are there
        if fastqInput1 is not None:
            self._setInputSize(len(self.getInputList('fastqInput1')))
Beispiel #4
0
	def impInitIO(self,):
		bamInput = self.getParamIO('bamInput')
		gtfInput = self.getParamIO('gtfInput')
		outputDir = self.getParamIO('outputDir')
		#fragBiasCorrectInput = self.getParamIO('fragBiasCorrectInput')
		if outputDir is None:
			self.setParamIO('outputDir',Configure.getTmpDir())


		self.setInputDirOrFile('bamInput',bamInput)

		if gtfInput is None:
			gtfInput=Configure.getConfig('')
			self.setIput('gtfInput',gtfInput)
			self.setParamIO('gtfInput',gtfInput)
		else:
			self.setInput('gtfInput',gtfInput)

		self.setOutput('assembliesOutput',os.path.join(Configure.getTmpDir(), 'assemblies.txt'))


		if bamInput is not None:
			self._setInputSize(len(self.getInputList('bamInput')))
			genes_fpkm_tracking=list()
			isoforms_fpkm_tracking=list()
			skipped_gtf=list()
			transcripts_gtf=list()
			for i in range(len(self.getInputList('bamInput'))):
				genes_fpkm_tracking.append(os.path.join(outputDir, 'cufflinks_'+str(i),'genes.fpkm_tracking'))
				isoforms_fpkm_tracking.append(os.path.join(outputDir, 'cufflinks_'+str(i),'isoforms.fpkm_tracking'))
				skipped_gtf.append(os.path.join(outputDir, 'cufflinks_'+str(i),'skipped.gtf'))
				transcripts_gtf.append(os.path.join(outputDir, 'cufflinks_'+str(i),'transcripts.gtf'))
			self.setOutput('genes_fpkm_tracking',genes_fpkm_tracking)
			self.setOutput('isoforms_fpkm_tracking',isoforms_fpkm_tracking)
			self.setOutput('skipped_gtf',skipped_gtf)
			self.setOutput('transcripts_gtf',transcripts_gtf)
		else:
			self.setOutput('genes_fpkm_tracking',None)
			self.setOutput('isoforms_fpkm_tracking',None)
			self.setOutput('skipped_gtf',None)
			self.setOutput('transcripts_gtf',None)