comparison scripts/S01b_study_seq_composition_aa.py @ 9:04a9ada73cc4 draft

planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit f1ba8d136e0129f3e8435b25a95f70f697d51464-dirty
author abims-sbr
date Tue, 03 Jul 2018 10:55:46 -0400
parents f1e24200e5ae
children
comparison
equal deleted inserted replaced
8:705a7bf4c311 9:04a9ada73cc4
370 370
371 ################### 371 ###################
372 ### RUN RUN RUN ### 372 ### RUN RUN RUN ###
373 ################### 373 ###################
374 374
375
376 ##Create specific folders 375 ##Create specific folders
377 Path_IN_loci_NUC = "./IN_AA" 376 Path_IN_loci_NUC = "./IN_AA"
378 outpath= "./OUT" 377 outpath= "./OUT"
379 os.makedirs(Path_IN_loci_NUC) 378 os.makedirs(Path_IN_loci_NUC)
380 os.makedirs(outpath) 379 os.makedirs(outpath)
381 380
382 infiles = str.split(sys.argv[1], ",") 381 infiles = []
382 with open(sys.argv[2], 'r') as f:
383 for line in f.readlines():
384 infiles.append(line.strip('\n'))
385
383 for file in infiles: 386 for file in infiles:
384 os.system("cp %s %s" %(file, Path_IN_loci_NUC)) 387 os.system("cp %s %s" %(file, Path_IN_loci_NUC))
385 388
386 ## 1 ## List taxa 389 ## 1 ## List taxa
387 LT=[] 390 LT=[]
388 cmd="grep '>' %s" % sys.argv[2] 391 cmd="grep '>' {}".format(sys.argv[1])
389 result = subprocess.check_output(cmd, shell=True) 392 result = subprocess.check_output(cmd, shell=True)
390 result=result.split('\n') 393 result=result.split('\n')
391 for i in result: 394 for i in result:
392 sp=i[1:] 395 sp=i[1:]
393 if sp !='': 396 if sp !='':