Mercurial > repos > bornea > saint_preproc
diff SAINT_preprocessing_v6.py @ 17:40c88c39f8d7 draft
Uploaded
author | bornea |
---|---|
date | Tue, 17 Nov 2015 12:14:10 -0500 |
parents | 13383ba55336 |
children | b230824e1a0e |
line wrap: on
line diff
--- 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])