-
Notifications
You must be signed in to change notification settings - Fork 0
/
blastp.py
29 lines (22 loc) · 907 Bytes
/
blastp.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#! /projects/team1/group2_geneprediction/python3/bin/python3.7
import os
import argparse
import subprocess
parser = argparse.ArgumentParser(description='blast')
parser.add_argument('-d',required=True, help = 'input dir')
parser.add_argument('-t',required=True, help = 'taxidlist')
parser.add_argument('-o',required=True, help = 'outputfolder')
args=parser.parse_args()
def dirname(path):
#if
for filename in os.listdir(path):
dirlist.append(os.path.join(path,filename))
name.append(filename)
if __name__ == '__main__':
dirlist=[]
name=[]
dirname(args.d)
subprocess.call(['mkdir '+args.o],shell=True)
print(args.d,args.t)
for i in range(len(dirlist)):
subprocess.call(['blastp -evalue 1e-6 -db swissprot_v5 -max_target_seqs 1 -outfmt 7 -taxidlist '+args.t+' -out '+args.o+'/'+name[i][0:-4]+'.txt ' +'-query '+dirlist[i]],shell=True)