Example #1
0
    def run(self):
        paths = env.get_db_locations()

        try:
            result = subprocess.check_output(['makeblastdb', '-in', self.fasta, '-dbtype', 'prot', '-parse_seqids',
                                              '-title', self.target_name, '-out', self.target_name], cwd=paths[0],
                                              stderr=subprocess.STDOUT)
        except subprocess.CalledProcessError, e:
            result = e.output
Example #2
0
    def run(self):
        paths = env.get_db_locations()

        try:
            result = subprocess.check_output([
                'makeblastdb', '-in', self.fasta, '-dbtype', 'prot',
                '-parse_seqids', '-title', self.target_name, '-out',
                self.target_name
            ],
                                             cwd=paths[0],
                                             stderr=subprocess.STDOUT)
        except subprocess.CalledProcessError as e:
            result = e.output
        return unicode(result)
Example #3
0
 def populate(self):
     try:
         paths = env.get_db_locations()
         result = ''
         for path in paths:
             print path
             if len(path) > 1:
                 dbs = subprocess.check_output(['blastdbcmd', '-list', path])
                 result += dbs
         raw_dbs = result.split('\n')
         # each line looks like: F:\path\to\db\db_name db_type -> db_name
         self.available_dbs = [os.path.basename(x.split()[0]) for x in raw_dbs[:-1]]
     except TypeError, e:  # paths is None
         # need to return this as a list so that it can populate the drop-down menu
         self.available_dbs = ['None, check variable: {}'.format(e.message)]
Example #4
0
 def populate(self):
     try:
         paths = env.get_db_locations()
         result = ''
         for path in paths:
             print(path)
             if len(path) > 1:
                 dbs = subprocess.check_output(
                     ['blastdbcmd', '-list', path])
                 result += dbs
         raw_dbs = result.split('\n')
         # each line looks like: F:\path\to\db\db_name db_type -> db_name
         self.available_dbs = [
             os.path.basename(x.split()[0]) for x in raw_dbs[:-1]
         ]
     except TypeError as e:  # paths is None
         # need to return this as a list so that it can populate the drop-down menu
         self.available_dbs = ['None, check variable: {}'.format(e.message)]