Exemplo n.º 1
0
def test_convert_PL2GL(clean_tmp):
    '''
    Test the method change PL fields to GL in a VCF file
    '''
    vcf_object=VcfUtils(vcf='data/test.gatk.vcf.gz',
                        bcftools_folder=pytest.config.getoption("--bcftools_folder"))
    
    vcf_object.convert_PL2GL(outfile='data/outdir/test.gatk.GL.vcf.gz',verbose=True)

    assert os.path.exists("data/outdir/test.gatk.GL.vcf.gz")
Exemplo n.º 2
0
    def run(self):
        filepath = self.param_required('filepath')

        self.warning('Analysing file: %s' % filepath)

        if not os.path.isdir(self.param_required('work_dir')):
            os.makedirs(self.param_required('work_dir'))

        threads = 1
        if self.param_is_defined('threads'):
            threads = self.param('threads')

        outprefix = os.path.split(self.param_required('outprefix'))[1]

        outfile = "{0}/{1}.GL.vcf.gz".format(self.param_required('work_dir'),
                                             outprefix)

        vcf_object = VcfUtils(
            vcf=filepath,
            bcftools_folder=self.param_required('bcftools_folder'))

        vcf_file = vcf_object.convert_PL2GL(outfile,
                                            threads=threads,
                                            verbose=True)

        self.param('out_vcf', vcf_file)