-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenSeqPermutations.py
More file actions
26 lines (20 loc) · 948 Bytes
/
Copy pathgenSeqPermutations.py
File metadata and controls
26 lines (20 loc) · 948 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# coding: utf-8
# In[ ]:
#And now, here's a connected function that enables the filtering of the output permutation list
#By the length of the output sequence
def genSeqPermutations(seqLen,
seqToExtendFrom = '',
baseSet = ['A', 'G', 'C', 'T'],
preventTooManyPerms = True,
tooManyPerms = 1000000,
returnAllSeqLens = False,
minPermuteSeqLen = 0):
permutationList = permuteSeq(seqLen = seqLen,
seqToExtendFrom = seqToExtendFrom,
baseSet = baseSet,
preventTooManyPerms = preventTooManyPerms,
tooManyPerms = tooManyPerms)
if(returnAllSeqLens):
return permutationList
else:
return [seq for seq in permutationList if len(seq) >= minPermuteSeqLen]