bin/reference_data.py
def prepare_data(self):
        """Prepare the reference data by indexing the fasta and vcf files"""
        self.info('Indexing reference genome data')

        if not util.find_file(self.reference_fasta + '.fai'):
            if os.path.isfile(self.reference_fasta + '.gz.fai'):
                os.rename(self.reference_fasta + '.gz.fai', self.reference_fasta + '.fai')
            else:
                self.procs['faidx'] = self.run_background(
                    '%s faidx %s' % (self.tools['samtools'], self.reference_fasta), 'faidx.log'
                )

        dict_file = os.path.splitext(self.reference_fasta)[0] + '.dict'
        if not util.find_file(dict_file):
            self.procs['CreateSequenceDictionary'] = self.run_background(
                '%s -Xmx20G CreateSequenceDictionary R=%s O=%s' % (self.tools['picard'], self.reference_fasta, dict_file),
                'create_sequence_dict.log'
            )

        if not util.find_file(self.reference_fasta, '.bwt'):
            self.procs['bwa index'] = self.run_background(self.tools['bwa'] + ' index ' + self.reference_fasta,
                                                          'bwa_index.log')

        if not self.reference_variation:
            self.info('Finishing with fasta reference genome only')
        else:
            assert os.path.isfile(self.reference_variation)
            tbi = self.reference_variation + '.tbi'
            if not os.path.isfile(tbi):
                self.info('.tbi file not found - bgzipping VCF and indexing.')
                subprocess.check_call('gzip -dc %s > tmp.vcf' % self.reference_variation, shell=True)
                subprocess.check_call('%s -c tmp.vcf > %s' % (self.tools['bgzip'], self.reference_variation),
                                      shell=True)
                tabix = self.run_background('%s -p vcf %s' % (self.tools['tabix'], self.reference_variation),
                                            'tabix.log')
                tabix.wait()
                self.procs['tabix'] = tabix
Prepare the reference data by indexing the fasta and vcf files
Prepare the reference data by indexing the fasta and vcf files
Prepare the reference data by indexing the fasta and vcf files
def prepare_data(self):
        self.info('Indexing reference genome data')
        if not util.find_file(self.reference_fasta + '.fai'):
            if os.path.isfile(self.reference_fasta + '.gz.fai'):
                os.rename(self.reference_fasta + '.gz.fai', self.reference_fasta + '.fai')
            else:
                self.procs['faidx'] = self.run_background(
                    '%s faidx %s' % (self.tools['samtools'], self.reference_fasta), 'faidx.log'
                )
        dict_file = os.path.splitext(self.reference_fasta)[0] + '.dict'
        if not util.find_file(dict_file):
            self.procs['CreateSequenceDictionary'] = self.run_background(
                '%s -Xmx20G CreateSequenceDictionary R=%s O=%s' % (self.tools['picard'], self.reference_fasta, dict_file),
                'create_sequence_dict.log'
            )
        if not util.find_file(self.reference_fasta, '.bwt'):
            self.procs['bwa index'] = self.run_background(self.tools['bwa'] + ' index ' + self.reference_fasta,
                                                          'bwa_index.log')
        if not self.reference_variation:
            self.info('Finishing with fasta reference genome only')
        else:
            assert os.path.isfile(self.reference_variation)
            tbi = self.reference_variation + '.tbi'
            if not os.path.isfile(tbi):
                self.info('.tbi file not found - bgzipping VCF and indexing.')
                subprocess.check_call('gzip -dc %s > tmp.vcf' % self.reference_variation, shell=True)
                subprocess.check_call('%s -c tmp.vcf > %s' % (self.tools['bgzip'], self.reference_variation),
                                      shell=True)
                tabix = self.run_background('%s -p vcf %s' % (self.tools['tabix'], self.reference_variation),
                                            'tabix.log')
                tabix.wait()
                self.procs['tabix'] = tabix
def prepare_data ( self ) : self . info ( 'Indexing reference genome data' ) if not util . find_file ( self . reference_fasta + '.fai' ) : if os . path . isfile ( self . reference_fasta + '.gz.fai' ) : os . rename ( self . reference_fasta + '.gz.fai' , self . reference_fasta + '.fai' ) else : self . procs [ 'faidx' ] = self . run_background ( '%s faidx %s' % ( self . tools [ 'samtools' ] , self . reference_fasta ) , 'faidx.log' ) dict_file = os . path . splitext ( self . reference_fasta ) [ 0 ] + '.dict' if not util . find_file ( dict_file ) : self . procs [ 'CreateSequenceDictionary' ] = self . run_background ( '%s -Xmx20G CreateSequenceDictionary R=%s O=%s' % ( self . tools [ 'picard' ] , self . reference_fasta , dict_file ) , 'create_sequence_dict.log' ) if not util . find_file ( self . reference_fasta , '.bwt' ) : self . procs [ 'bwa index' ] = self . run_background ( self . tools [ 'bwa' ] + ' index ' + self . reference_fasta , 'bwa_index.log' ) if not self . reference_variation : self . info ( 'Finishing with fasta reference genome only' ) else : assert os . path . isfile ( self . reference_variation ) tbi = self . reference_variation + '.tbi' if not os . path . isfile ( tbi ) : self . info ( '.tbi file not found - bgzipping VCF and indexing.' ) subprocess . check_call ( 'gzip -dc %s > tmp.vcf' % self . reference_variation , shell = True ) subprocess . check_call ( '%s -c tmp.vcf > %s' % ( self . tools [ 'bgzip' ] , self . reference_variation ) , shell = True ) tabix = self . run_background ( '%s -p vcf %s' % ( self . tools [ 'tabix' ] , self . reference_variation ) , 'tabix.log' ) tabix . wait ( ) self . procs [ 'tabix' ] = tabix
Prepare the reference data by indexing the fasta and vcf files
Prepare the reference data by indexing the fasta and vcf files
"""Prepare the reference data by indexing the fasta and vcf files"""
self