Beispiel #1
0
    def run_makemat(self):
        print "-" * 60
        print "Running Makemat"

        id = self.config['id']

        fasta_file = self.config["path"]["input"]

        try:
            shutil.copy(fasta_file, self.config['path']['output'])
        except shutil.Error:
            pass

        pn_file = os.path.join(self.config['path']['output'], id + '.pn')
        sn_file = os.path.join(self.config['path']['output'], id + '.sn')

        with open(pn_file, 'w') as pn_f:
            pn_f.write(id + '.chk')
        with open(sn_file, 'w') as sn_f:
            sn_f.write(id + '.fasta')
        args = [self.config['makemat']['command'],
                '-P', os.path.join(self.config['path']['output'], id)]

        util.run_command(args)
        print "Done\n"
Beispiel #2
0
    def _run(self):
        ccmpred_config = self.config['ccmpred']

        id = self.config['id']

        aln_file = os.path.join(self.config['path']['output'], id + '.aln')
        output_file = self.output_file

        if self.config['ccmpred']['n_threads'] == 0:
            if 'cuda_dev' in self.config['ccmpred']:
                args = [self.config['ccmpred']['command'],
                        '-d', str(self.config['ccmpred']['cuda_dev']),
                        aln_file,
                        output_file]
            else:
                gpu_id = 0
                print gpu_id
                args = [self.config['ccmpred']['command'],
                        '-d', str(gpu_id), 
                        aln_file,
                        output_file]
        else:
            args = [self.config['ccmpred']['command'],
                    '-t', str(self.config['ccmpred']['n_threads']),
                    aln_file,
                    output_file]

        util.run_command(args)
    def _run(self):
        id = self.config['id']
        aln_file = os.path.join(self.config['path']['output'], id + '.aln')
        output_file = self.output_file

        args = [self.config['freecontact']['command'],
                '-a', str(self.config['freecontact']['n_threads']),
                '-f', aln_file]

        util.run_command(args, output_file)
Beispiel #4
0
    def _run(self):
        id = self.config['id']

        input_file = os.path.join(self.config['path']['output'], id + '.a3m')
        log_file = self.output_file
        hhm_file = os.path.join(self.config['path']['output'], id + '.hhm')

        args = [
            self.config['hhmake']['command'], '-i', input_file, '-o', hhm_file
        ]
        util.run_command(args, log_file)
Beispiel #5
0
    def run_hhfilter(self):
        id = self.config['id']

        pseudo_a3m_file = os.path.join(self.config['path']['output'],
                                       id + '.a3m')
        output_file = os.path.join(self.config['path']['output'],
                                   id + '.filtered')
        args = [
            self.config['hhfilter']['command'], '-id', '90', '-M', 'first',
            '-cov', '50', '-i', pseudo_a3m_file, '-o', output_file
        ]
        util.run_command(args)
Beispiel #6
0
    def run_solvpred(self):
        print "-" * 60
        print "Running Solvpred"

        id = self.config['id']

        matrix_file = self.matrix_file
        solv_file = self.solv_file
        args = [self.config['solvpred']['command'],
                matrix_file,
                self.config['solvpred']['data']]
        util.run_command(args, solv_file)
        print "Done\n"
Beispiel #7
0
    def run_jackhmmer(self):
        id = self.config['id']
        fasta_file = self.config['path']['input']

        output_file = os.path.join(self.config['path']['output'],
                                   id + '.jackali')
        log_file = os.path.join(self.config['path']['output'], id + '.jacklog')

        args = [
            self.config['jackhmmer']['command'], '-N',
            str(self.config['jackhmmer']['n_iter']), '--cpu',
            str(self.config['jackhmmer']['n_threads']), '--incE',
            str(self.config['jackhmmer']['inc_E']), '-A', output_file,
            fasta_file, self.config['jackhmmer']['uniref_db']
        ]

        util.run_command(args, log_file)
Beispiel #8
0
    def run_psipred(self):
        print "-" * 60
        print "Running PsiPred"

        id = self.config['id']

        fasta_file = self.config["path"]["input"]

        matrix_file = self.matrix_file
        ss_file = os.path.join(self.config['path']['output'], id + '.ss')

        args = [self.config['psipred']['command'],
                matrix_file,
                os.path.join(self.config['psipred']['data'], 'weights.dat'),
                os.path.join(self.config['psipred']['data'], 'weights.dat2'),
                os.path.join(self.config['psipred']['data'], 'weights.dat3')]
        util.run_command(args, ss_file)
        print "Done\n"
Beispiel #9
0
    def _run(self):
        hh_config = self.config['hhblits']

        id = self.config['id']
        input_file = self.config['path']['input']
        output_file = os.path.join(self.config['path']['output'], id + '.a3m')
        log_name = os.path.join(self.config['path']['output'], id + '.hhblog')
        args = [
            hh_config['command'], '-i', input_file, '-d',
            hh_config['uniprot_db'], '-oa3m', output_file, '-o', log_name,
            '-n',
            str(hh_config['n_iters']), '-maxfilt',
            str(hh_config['maxfilt']), '-diff',
            str(hh_config['diff']), '-id',
            str(hh_config['id']), '-cov',
            str(hh_config['cov']), '-e',
            str(hh_config['e_value']), '-cpu',
            str(hh_config['n_threads'])
        ]
        util.run_command(args)
Beispiel #10
0
    def run_psipred_pass2(self):
        print "-" * 60
        print "Running PsiPredPass2"

        id = self.config['id']

        ss_file = os.path.join(self.config['path']['output'], id + '.ss')
        ss2_file = self.ss2_file
        horiz_file = os.path.join(self.config['path']['output'], id + '.horiz')

        args = [self.config['psipred_pass2']['command'],
                os.path.join(self.config['psipred']['data'], 'weights_p2.dat'),
                str(self.config['psipred_pass2']['n_iters']),
                str(self.config['psipred_pass2']['DCA']),
                str(self.config['psipred_pass2']['DCB']),
                ss2_file,
                ss_file]

        util.run_command(args, horiz_file)
        print "Done\n"
Beispiel #11
0
    def run_blast(self):
        print "-" * 60
        print "Running PSI-BLAST (blastpgp)"

        id = self.config['id']

        fasta_file = self.config["path"]["input"]
        output_name = os.path.join(self.config['path']['output'], id + '.chk')
        log_name = os.path.join(self.config['path']['output'], id + '.blast')

        blast_config = self.config['blast']
        args = [blast_config['command'],
                '-a', str(blast_config['n_threads']),
                '-b', '0',
                '-j', str(blast_config['n_iters']),
                '-h', str(blast_config['e_value']),
                '-d', str(blast_config['database']),
                '-i', fasta_file,
                '-C', output_name]
        util.run_command(args, log_name)
        print "Done\n"