def preprocess(self, preargs):
        self.base = preargs[0]
        self.fwd = preargs[1]
        self.rev = preargs[2]
        self.datadir = preargs[3]

        #Run quality control ananlysis and quality based trimming
        qcdir = os.path.abspath(self.datadir) + '/qc'
        if not os.path.exists(qcdir):
            os.mkdir(qcdir)
        self.fwd, self.rev = trimgalore.run_qc(self.fwd, self.rev, qcdir, 
            self.base)

        #Run alignment
        self.bamfile = bowtie.bowtie(self.fwd, self.rev, self.datadir, 
            self.base)
        
        #Run picard tools 
        self.bamfile = picard.addreadgroup(self.bamfile, self.base)
        self.bamfile, self.metrics = picard.markdup(self.bamfile)

        #Run GATK realignment and quality recalibration
        self.interval = gatk.target(self.bamfile)
        self.bamfile = gatk.realigner(self.bamfile, self.interval)
        self.table = gatk.baserecal(self.bamfile)
        self.bamfile = gatk.printreads(self.bamfile, self.table)
        self.vcf = gatk.haplocaller(self.bamfile)
        self.srf, self.irf, self.stf, self.itf = gatk.vqsr(self.vcf, self.outdir)
        self.vcffile = gatk.applyrecalibration(self.srf, self.irf, self.stf,
            self.itf, self.vcffile, self.outdir)
        return(self.vcffile)
 def vqsr(self, vcffile):
     #Run VQSR and apply reclibration
     self.vcffile = vcffile
     self.srf, self.irf, self.stf, self.itf = gatk.vqsr(vcffile, self.outdir)
     self.vcffile = gatk.applyrecalibration(self.srf, self.irf, self.stf,
         self.itf, self.vcffile, self.outdir)
     return(self.vcffile)
    def preprocess(self, preargs):
        self.base = preargs[0]
        self.fwd = preargs[1]
        self.rev = preargs[2]
        self.datadir = preargs[3]

        #Run quality control ananlysis and quality based trimming
        qcdir = os.path.abspath(self.datadir) + '/qc'
        if not os.path.exists(qcdir):
            os.mkdir(qcdir)
        self.fwd, self.rev = trimgalore.run_qc(self.fwd, self.rev, qcdir,
                                               self.base)

        #Run alignment
        self.bamfile = bowtie.bowtie(self.fwd, self.rev, self.datadir,
                                     self.base)

        #Run picard tools
        self.bamfile = picard.addreadgroup(self.bamfile, self.base)
        self.bamfile, self.metrics = picard.markdup(self.bamfile)

        #Run GATK realignment and quality recalibration
        self.interval = gatk.target(self.bamfile)
        self.bamfile = gatk.realigner(self.bamfile, self.interval)
        self.table = gatk.baserecal(self.bamfile)
        self.bamfile = gatk.printreads(self.bamfile, self.table)
        self.vcf = gatk.haplocaller(self.bamfile)
        self.srf, self.irf, self.stf, self.itf = gatk.vqsr(
            self.vcf, self.outdir)
        self.vcffile = gatk.applyrecalibration(self.srf, self.irf, self.stf,
                                               self.itf, self.vcffile,
                                               self.outdir)
        return (self.vcffile)