JoshuaTree2.py
def maf2vcf(self, maf_filter_config, species, reference_species, reference_species_fai, vcf_out, change_coordinates = True):
        """Run on a merged maf file first by using merger."""
        reference_species_chromosomes = dict(zip(os.popen("awk '{print $1}' %s"%reference_species_fai).read().splitlines(),map(int,os.popen("awk '{print $2}' %s"%reference_species_fai).read().splitlines())))
        try:
            os.mkdir('vcfs')
        except:
            pass

        self.strand(reference_species)

        self.index()

        if change_coordinates:
            self.change_coordinates(reference_species,reference_species_chromosomes, self.maf_file.replace('.maf','.new_coords.maf'))
        else:
            self.maf_file_new_coords = self.maf_file

        self.config = MAF_filter_config(maf_filter_config, self.maf_file_new_coords, species, reference_species)
        self.config.add_subset_text(keep=False)
        self.config.add_subset_text(species=reference_species)
        self.config.add_vcf_text(vcf_out)
        self.config.run_maffilter()

        vcf_obj = SNP(vcf_out)
        vcf_obj.concat_vcf(vcf_out)
        vcf_obj.generate_new_header(vcf_out)
Run on a merged maf file first by using merger.
Run on a merged maf file first by using merger.
Run on a merged maf file first by using merger .
def maf2vcf(self, maf_filter_config, species, reference_species, reference_species_fai, vcf_out, change_coordinates = True):
        reference_species_chromosomes = dict(zip(os.popen("awk '{print $1}' %s"%reference_species_fai).read().splitlines(),map(int,os.popen("awk '{print $2}' %s"%reference_species_fai).read().splitlines())))
        try:
            os.mkdir('vcfs')
        except:
            pass
        self.strand(reference_species)
        self.index()
        if change_coordinates:
            self.change_coordinates(reference_species,reference_species_chromosomes, self.maf_file.replace('.maf','.new_coords.maf'))
        else:
            self.maf_file_new_coords = self.maf_file
        self.config = MAF_filter_config(maf_filter_config, self.maf_file_new_coords, species, reference_species)
        self.config.add_subset_text(keep=False)
        self.config.add_subset_text(species=reference_species)
        self.config.add_vcf_text(vcf_out)
        self.config.run_maffilter()
        vcf_obj = SNP(vcf_out)
        vcf_obj.concat_vcf(vcf_out)
        vcf_obj.generate_new_header(vcf_out)
def maf2vcf ( self , maf_filter_config , species , reference_species , reference_species_fai , vcf_out , change_coordinates = True ) : reference_species_chromosomes = dict ( zip ( os . popen ( "awk '{print $1}' %s" % reference_species_fai ) . read ( ) . splitlines ( ) , map ( int , os . popen ( "awk '{print $2}' %s" % reference_species_fai ) . read ( ) . splitlines ( ) ) ) ) try : os . mkdir ( 'vcfs' ) except : pass self . strand ( reference_species ) self . index ( ) if change_coordinates : self . change_coordinates ( reference_species , reference_species_chromosomes , self . maf_file . replace ( '.maf' , '.new_coords.maf' ) ) else : self . maf_file_new_coords = self . maf_file self . config = MAF_filter_config ( maf_filter_config , self . maf_file_new_coords , species , reference_species ) self . config . add_subset_text ( keep = False ) self . config . add_subset_text ( species = reference_species ) self . config . add_vcf_text ( vcf_out ) self . config . run_maffilter ( ) vcf_obj = SNP ( vcf_out ) vcf_obj . concat_vcf ( vcf_out ) vcf_obj . generate_new_header ( vcf_out )
Run on a merged maf file first by using merger.
Run on a merged maf file first by using merger .
"""Run on a merged maf file first by using merger."""
self
maf_filter_config
species
reference_species
reference_species_fai
vcf_out
change_coordinates