comparison SeqSero2_package.py @ 9:558823a8c53a tip

Uploaded
author estrain
date Thu, 03 Oct 2019 07:04:21 -0400
parents 46b848d28b95
children
comparison
equal deleted inserted replaced
8:eb5799b08c3e 9:558823a8c53a
1262 clean_mode=args.c 1262 clean_mode=args.c
1263 k_size=27 #will change for bug fixing 1263 k_size=27 #will change for bug fixing
1264 #database="H_and_O_and_specific_genes.fasta" 1264 #database="H_and_O_and_specific_genes.fasta"
1265 dirpath = os.path.abspath(os.path.dirname(os.path.realpath(__file__))) 1265 dirpath = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
1266 ex_dir = os.path.abspath(os.path.join(os.path.dirname(os.path.dirname(__file__)),'seqsero2_db')) # ed_SL_09152019: add ex_dir for packaging 1266 ex_dir = os.path.abspath(os.path.join(os.path.dirname(os.path.dirname(__file__)),'seqsero2_db')) # ed_SL_09152019: add ex_dir for packaging
1267 database=dirpath+"/seqsero2_db/H_and_O_and_specific_genes.fasta" # ed_SL_09152019: change path to database for packaging 1267 #database=ex_dir+"/seqsero2_db/H_and_O_and_specific_genes.fasta" # ed_SL_09152019: change path to database for packaging
1268 database="H_and_O_and_specific_genes.fasta"
1268 note="Note:" 1269 note="Note:"
1269 NA_note=" This predicted serotype is not in the Kauffman-White scheme." # ed_SL_09272019: add for new output format 1270 NA_note=" This predicted serotype is not in the Kauffman-White scheme." # ed_SL_09272019: add for new output format
1270 if len(sys.argv)==1: 1271 if len(sys.argv)==1:
1271 subprocess.check_call(dirpath+"/SeqSero2_package.py -h",shell=True)#change name of python file 1272 subprocess.check_call(dirpath+"/SeqSero2_package.py -h",shell=True)#change name of python file
1272 else: 1273 else:
1278 pass 1279 pass
1279 else: 1280 else:
1280 subprocess.check_call(["mkdir",make_dir]) 1281 subprocess.check_call(["mkdir",make_dir])
1281 #subprocess.check_call("cp "+dirpath+"/"+database+" "+" ".join(input_file)+" "+make_dir,shell=True) 1282 #subprocess.check_call("cp "+dirpath+"/"+database+" "+" ".join(input_file)+" "+make_dir,shell=True)
1282 #subprocess.check_call("ln -sr "+dirpath+"/"+database+" "+" ".join(input_file)+" "+make_dir,shell=True) 1283 #subprocess.check_call("ln -sr "+dirpath+"/"+database+" "+" ".join(input_file)+" "+make_dir,shell=True)
1283 subprocess.check_call("ln -f -s "+database+" "+" ".join(input_file)+" "+make_dir,shell=True) # ed_SL_09152019: change path to database for packaging 1284 #subprocess.check_call("ln -f -s "+database+" "+" ".join(input_file)+" "+make_dir,shell=True) # ed_SL_09152019: change path to database for packaging
1284 #subprocess.check_call("ln -f -s "+dirpath+"/"+database+" "+" ".join(input_file)+" "+make_dir,shell=True) ### ed_SL_05282019: use -f option to force the replacement of links, remove -r and use absolute path instead to avoid link issue (use 'type=os.path.abspath' in -i argument). 1285 subprocess.check_call("ln -f -s "+dirpath+"/seqsero2_db/"+database+" "+" ".join(input_file)+" "+make_dir,shell=True) ### ed_SL_05282019: use -f option to force the replacement of links, remove -r and use absolute path instead to avoid link issue (use 'type=os.path.abspath' in -i argument).
1285 ############################begin the real analysis 1286 ############################begin the real analysis
1286 if analysis_mode=="a": 1287 if analysis_mode=="a":
1287 if data_type in ["1","2","3"]:#use allele mode 1288 if data_type in ["1","2","3"]:#use allele mode
1288 for_fq,rev_fq=get_input_files(make_dir,input_file,data_type,dirpath) 1289 for_fq,rev_fq=get_input_files(make_dir,input_file,data_type,dirpath)
1289 os.chdir(make_dir) 1290 os.chdir(make_dir)