@@ -0,0 +1,1464 @@
+'''%0ATake three arguments, the %0Afasta file to use, the string to search for, %0Aand the number of nucleotides on either side to include.%0A%0A%0A'''%0Afrom Bio.Seq import Seq%0Afrom collections import defaultdict%0Aimport sys%0Aimport re%0A%0AfileName = sys.argv%5B1%5D%0Aoligo = sys.argv%5B2%5D%0AtotalLength = sys.argv%5B3%5D%0A%0Af = open(fileName, 'r')%0Ao = open(%22TargetProtector of length_%22 + totalLength + %22_%22 + fileName, 'w')%0A%0Alist = defaultdict(str)%0A%0A%0Aname =''%0AoligoLength = len(oligo)%0AproxLength = (int(totalLength) - oligoLength)/2%0A%0A#print(%22Oligo Length is %25s and the proxLength is %25s%22 %25 (oligoLength, proxLength))%0A%0Afor line in f:%0A%09%09#if your line starts with a %3E then it is the name of the following sequence%0A%09%09if line.startswith('%3E'):%0A%09%09%09name = line%5B1:-1%5D%0A%09%09%09continue #this means skips to the next line%0A%09%09#this code is only executed if it is a sequence of bases and not a name%0A%09%09list%5Bname%5D+=line.strip()%0A%0Amatch = re.search(oligo, list%5Bname%5D)%0Aposition = match.start()%0A%0A#print(list%5Bname%5D)%0A#print(list%5Bname%5D%5Bposition:position+oligoLength%5D)%0AdesiredOligo = Seq(list%5Bname%5D%5Bposition-proxLength:position+oligoLength+proxLength%5D)%0AdesiredOligoRC = desiredOligo.reverse_complement()%0A#print(desiredOligo)%0A#print(desiredOligoRC)%0Aprint(%22Your desired target protector for %25s, covers region, %25s, with a sequence of %25s%22 %25 (oligo, desiredOligo, desiredOligoRC))%0Ao.write(%22Your desired target protector for %25s, covers region, %25s, with a sequence of %25s%22 %25 (oligo, desiredOligo, desiredOligoRC))%0A%0Af.close()%0Ao.close()%0A

Create proximitySequence.py