Mercurial > repos > cstrittmatter > ss2v110
diff bin/SeqSero2_package.py @ 7:aa54a94b9aeb draft
planemo upload commit c50df40caef2fb97c178d6890961e0e527992324-dirty
author | cstrittmatter |
---|---|
date | Mon, 27 Apr 2020 19:39:25 -0400 |
parents | fc22ec8e924e |
children | 357e38526e2a |
line wrap: on
line diff
--- a/bin/SeqSero2_package.py Mon Apr 27 12:36:27 2020 -0400 +++ b/bin/SeqSero2_package.py Mon Apr 27 19:39:25 2020 -0400 @@ -1233,14 +1233,20 @@ xmlfile="NA" return xmlfile,new_fasta -def judge_subspecies(fnameA): +def judge_subspecies(fnameA,dirpath): #seqsero2 -a; judge subspecies on just forward raw reads fastq - salmID_output=subprocess.Popen("SalmID.py -i "+fnameA,shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE) + samid_strcmd = "python " + dirpath + "/../SalmID.py -i "+fnameA + #subprocess.check_call(samid_strcmd + " > Salmidoutput.txt",shell=True) + print(samid_strcmd) + salmID_output=subprocess.Popen(samid_strcmd,shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE) out, err = salmID_output.communicate() + print(err) + print(out) out=out.decode("utf-8") file=open("data_log.txt","a") file.write(out) file.close() + salm_species_scores=out.split("\n")[1].split("\t")[6:] salm_species_results=out.split("\n")[0].split("\t")[6:] max_score=0 @@ -1258,6 +1264,7 @@ prediction="-" return prediction + def judge_subspecies_Kmer(Special_dict): #seqsero2 -k; max_score=0 @@ -1361,7 +1368,7 @@ file.close() Final_list_passed=[x for x in Final_list if float(x[0].split("_cov_")[1].split("_")[0])>=0.9 and (x[1]>=int(x[0].split("__")[1]) or x[1]>=int(x[0].split("___")[1].split("_")[3]) or x[1]>1000)] O_choice,fliC_choice,fljB_choice,special_gene_list,contamination_O,contamination_H,Otypes_uniq,H1_cont_stat_list,H2_cont_stat_list=predict_O_and_H_types(Final_list,Final_list_passed,new_fasta) #predict O, fliC and fljB - subspecies=judge_subspecies(fnameA) #predict subspecies + subspecies=judge_subspecies(fnameA,dirpath) #predict subspecies ###output predict_form,predict_sero,star,star_line,claim=seqsero_from_formula_to_serotypes(O_choice,fliC_choice,fljB_choice,special_gene_list,subspecies) claim="" #04132019, disable claim for new report requirement