if args.genes: geneFile = os.path.splitext(os.path.basename(args.blastFile))[0] + ".genes" geneHandle = open(geneFile,'w') DRUGSdb = "ReferenceFiles/" betaLactamProFile = DRUGSdb + args.blacProfile beta_lactams,bLacProfile = pm.import_profile(betaLactamProFile) wildType = pm.import_wt(args.org,DRUGSdb) letterCode = {"Susceptible":"S","Intermediate":"I","Unknown":"U","Resistant":"R"} antibioticLine = "Genome" predictionLine = os.path.basename(args.blastFile) betaList = Annotation.import_list(DRUGSdb + "RF_beta-lactamase_keywords.txt") tetList = Annotation.import_list(DRUGSdb + "RF_tetracycline_keywords.txt") aminoglyList = Annotation.import_list(DRUGSdb + "RF_aminoglycoside_keywords.txt") ciproList = Annotation.import_list(DRUGSdb + "RF_quinolone_keywords.txt") trsxList = Annotation.import_list(DRUGSdb + "RF_TRSX_keywords.txt") chlorList = Annotation.import_list(DRUGSdb + "RF_phenicol_keywords.txt") listList = [betaList,tetList,aminoglyList,ciproList,trsxList,chlorList] antibioticList = ["Beta-lactamase","Tetracycline","Aminoglycoside","Fluoroquinolone","Bactrim","Chloramphenicol"] annotationDict,resfam_positive = Annotation.import_annotations_blast(args.blastFile) geneList = [] for annotation in annotationDict.keys(): name = annotationDict[annotation]
geneHandle = open(gene_file,'w') geneHandle.write("Genome:\t{}\n".format(bacterium)) geneDict = {} # This dictionary will ultimately contain the gene names granting resistance to eacha ntibiotic for # output to <gene_file> wildType = pm.import_wt(organism,DRUGSdb) # Identify and store any wt amino acid sequences that will be needed #letterCode = {"Susceptible":"S","Intermediate":"I","Unknown":"U","Resistant":"R"} # These two lines initialize the prediction output. The antibioticLine is actually the headers for an output table # with one row, which is the prediction line. antibioticLine = "Genome" # header for first column of the output table (a.k.a. organism name) predictionLine = os.path.basename(annotationFile) # Organism name for the output table # The following lines each store, for the different antibiotic classes, words in the annotation that distinguish # each specific type of resistance gene betaList = Annotation.import_list(DRUGSdb + "beta_lactamase_keywords.txt") tetList = Annotation.import_list(DRUGSdb + "tetracycline_names.txt") aminoglyList = Annotation.import_list(DRUGSdb + "aminoglycoside_names.txt") ciproList = Annotation.import_list(DRUGSdb + "ciprofloxacin_names.txt") trsxList = Annotation.import_list(DRUGSdb + "trimethoprim_sulfamethoxazole_names.txt") chlorList = Annotation.import_list(DRUGSdb + "chloramphenicol_names.txt") listList = [betaList,tetList,aminoglyList,ciproList,trsxList,chlorList] # Easy storage for the keywords # This list corresponds to the antibiotic categories of the keyword list above antibioticList = ["Beta-lactamase","Tetracycline","Aminoglycoside","Fluoroquinolone","Bactrim","Chloramphenicol"] annotationDict,resfam_positive = Annotation.import_annotations_Mitch(annotationFile) # A function that stores the # annotations from a HMM output file created specifically with my (Mitch's) version of the HMM annotator. If you # need to be reading these comments then this function probably needs to be updated for your application. The # resfam_positive dictionary contains a boolean value for whether any annotations for a gene were from resfams.
if args.genes: geneFile = os.path.splitext(os.path.basename(args.blastFile))[0] + ".genes" geneHandle = open(geneFile,'w') DRUGSdb = "ReferenceFiles/" betaLactamProFile = DRUGSdb + args.blacProfile beta_lactams,bLacProfile = pm.import_profile(betaLactamProFile) wildType = pm.import_wt(args.org,DRUGSdb) letterCode = {"Susceptible":"S","Intermediate":"I","Unknown":"U","Resistant":"R"} antibioticLine = "Genome" predictionLine = os.path.basename(args.blastFile) betaList = Annotation.import_list(DRUGSdb + "CRD_lactamase_keywords_name.txt") tetList = Annotation.import_list(DRUGSdb + "CRD_tetracycline_keywords_name.txt") aminoglyList = Annotation.import_list(DRUGSdb + "CRD_aminoglycoside_keywords_name.txt") ciproList = Annotation.import_list(DRUGSdb + "CRD_fluoroquinolone_keywords_name.txt") trsxList = Annotation.import_list(DRUGSdb + "CRD_TRSX_keywords_name.txt") chlorList = Annotation.import_list(DRUGSdb + "CRD_amphenicol_keywords_name.txt") listList = [betaList,tetList,aminoglyList,ciproList,trsxList,chlorList] antibioticList = ["Beta-lactamase","Tetracycline","Aminoglycoside","Fluoroquinolone","Bactrim","Chloramphenicol"] annotationDict,resfam_positive = Annotation.import_annotations_blast(args.blastFile) geneList = [] for annotation in annotationDict.keys(): name = annotationDict[annotation]