def run(self): filepath = self.param_required('filepath') self.warning('Analysing file: %s'% filepath) file = os.path.split(filepath)[1] work_dir = None if self.param_is_defined('work_dir'): work_dir = self.param_required('work_dir') else: work_dir = os.path.split(filepath)[0] vcfNorm = VcfNormalize(vcf=filepath, vcflib_folder=self.param_required('vcflib_folder'), bgzip_folder=self.param_required('bgzip_folder')) downstream_pipe = None if self.param_is_defined('downstream_pipe'): downstream_pipe = self.param('downstream_pipe') vcf_file = "" if self.param_is_defined('compress'): vcf_file = vcfNorm.run_vcfallelicprimitives(outprefix=file, compress=True, downstream_pipe=downstream_pipe, outdir=work_dir) else: vcf_file = vcfNorm.run_vcfallelicprimitives(outprefix=file, compress=False, downstream_pipe=downstream_pipe, outdir=work_dir) self.param('out_vcf', vcf_file)
def run(self): filepath = self.param_required('filepath') self.warning('Analysing file: %s' % filepath) file = os.path.split(filepath)[1] work_dir = None if self.param_is_defined('work_dir'): if not os.path.isdir(self.param('work_dir')): os.makedirs(self.param('work_dir')) work_dir = self.param('work_dir') else: work_dir = os.path.split(filepath)[0] outprefix = "{0}/{1}".format(self.param('work_dir'), file) vcfNorm = VcfNormalize( vcf=filepath, bcftools_folder=self.param_required('bcftools_folder')) vcf_file = vcfNorm.run_bcftoolsnorm( outprefix=outprefix, reference=self.param_required('reference'), multiallelics=self.param('multiallelics'), type=self.param('type')) self.param('out_vcf', vcf_file)
def run(self): filepath = self.param_required('filepath') self.warning('Analysing file: %s' % filepath) file = os.path.split(filepath)[1] work_dir = None if self.param_is_defined('work_dir'): work_dir = self.param_required('work_dir') else: work_dir = os.path.split(filepath)[0] vcfNorm = VcfNormalize( vcf=filepath, vt_folder=self.param_required('vt_folder'), bgzip_folder=self.param_required('bgzip_folder')) vcf_file = "" if self.param_is_defined('compress'): vcf_file = vcfNorm.run_vtnormalize( outprefix=file, reference=self.param_required('reference'), compress=True, outdir=work_dir) else: vcf_file = vcfNorm.run_vtnormalize( outprefix=file, reference=self.param_required('reference'), compress=False, outdir=work_dir) self.param('vcf_file', vcf_file)
def run(self): filepath = self.param_required('filepath') self.warning('Analysing file: %s' % filepath) file = os.path.split(filepath)[1] work_dir = None if self.param_is_defined('work_dir'): work_dir = self.param_required('work_dir') else: work_dir = os.path.split(filepath)[0] vcfNorm = VcfNormalize( vcf=filepath, gatk_folder=self.param_required('gatk_folder'), bgzip_folder=self.param_required('bgzip_folder')) vcf_file = "" if self.param_is_defined('compress'): compress = None if self.param('compress') == 'True': compress = True elif self.param('compress') == 'False': compress = False else: raise Exception('compress parameter is not valid: {0}'.format( self.param('compress'))) vcf_file = vcfNorm.run_gatk_VariantsToAllelicPrimitives( outprefix=file, reference=self.param_required('reference'), outdir=work_dir, compress=compress) else: vcf_file = vcfNorm.run_gatk_VariantsToAllelicPrimitives( outprefix=file, reference=self.param_required('reference'), outdir=work_dir) self.param('vcf_file', vcf_file)
def vcf_object(): '''Returns an object''' vcf_file = pytest.config.getoption("--vcf") bcftools_folder = pytest.config.getoption("--bcftools_folder") bgzip_folder = pytest.config.getoption("--bgzip_folder") vcflib_folder = pytest.config.getoption("--vcflib_folder") vt_folder = pytest.config.getoption("--vt_folder") gatk_folder = pytest.config.getoption("--gatk_folder") vcf_object = VcfNormalize(vcf=vcf_file, bgzip_folder=bgzip_folder, vcflib_folder=vcflib_folder, vt_folder=vt_folder, bcftools_folder=bcftools_folder, gatk_folder=gatk_folder) return vcf_object