# HG changeset patch # User bornea # Date 1447780450 18000 # Node ID 40c88c39f8d77c1a14dcbd6f4047cf8523adcba5 # Parent 413ffa0e80e7e8861ae629906e30696950c9973e Uploaded diff -r 413ffa0e80e7 -r 40c88c39f8d7 SAINT_preprocessing_v6.py --- a/SAINT_preprocessing_v6.py Tue Nov 17 11:05:54 2015 -0500 +++ b/SAINT_preprocessing_v6.py Tue Nov 17 12:14:10 2015 -0500 @@ -26,7 +26,6 @@ baits = make_bait.split() -print baits i = 0 bait_file_tmp = open("bait.txt", "wr") order = [] @@ -135,6 +134,7 @@ count = 0 for i in lines: if ">sp" in i: + namer = i.split("|")[2] if uniprot_accession_in == i.split("|")[1]: match = count+1 if 'GN=' in i: @@ -150,6 +150,21 @@ else: break return ReturnValue1(seqlength, genename) + elif uniprot_accession_in == namer.split(" "): + match = count+1 + if 'GN=' in i: + lst = i.split('GN=') + lst2 = lst[1].split(' ') + genename = lst2[0] + if 'GN=' not in i: + genename = 'NA' + while ">sp" not in lines[match]: + if match <= db_len: + seqlength = seqlength + len(lines[match].strip()) + match = match + 1 + else: + break + return ReturnValue1(seqlength, genename) count = count + 1 @@ -242,5 +257,5 @@ if __name__ == '__main__': main(infile, baitfile) -os.rename('inter.txt', sys.argv[4]) +os.rename("inter.txt", sys.argv[4]) os.rename("bait.txt", sys.argv[7])