Previous changeset 16:413ffa0e80e7 (2015-11-17) Next changeset 18:b230824e1a0e (2015-11-17) |
Commit message:
Uploaded |
modified:
SAINT_preprocessing_v6.py |
b |
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]) |