motifs -- this module accepts motifs from the command line, loads motifs from file, or generates motifs. The corresponding Python regular expression is maintained for each motif as a dictionary value
Hint:
Regulatory Modules should use the format: motif1{0}motif2 for fixed spacing, or motif1{2,30}motif2 for variable spacing.
Keep in mind that you are not limited to two motifs: you can make more, i.e motif1{0}motif2{10,200}motif3
Class Motifs
- dictIUPAC
- holds a dictionary with the IUPAC letters
- holds a dictionary of the reverse complement of IUPAC letters
allOligos(len, DNA = 1)
- returns a list of oligonucleotides of the specified size. DNA is the default 'atgc', alternative 0 is RNA 'augc'
listfromfile(handle, mode=0)
- this reads a \n delimited file for making a list of motifs begining after a single line with .. [ mode=0 ] a list of sequence names (begins after a single line with // [ mode=1 ] handle is closed when exiting
appendstringtolist(_list, _string, pos=0)
- use this to add a fixed string to a known list. You may place it before or after: pos=0 after, pos=1 before.
motifRXdict(ls)
- this will take a list of motifs and return a dicitonary object {} with the values containing the appropriate regular expression by calling function motif_re since dictionary keys can not be redundant, all redundant entries are not added to the list
smartMotifRXdict(ls)
- this will take a list of motifs and return a dictionary object {} that considers the following: sense and antisense together as one motif...AND...will convert composite elements for all watson and crick orientations but maintaing their order (5' to 3') with respect to eachother. Input is a simple list of DNA motifs. The entered element will be the dictionary key: dict{elem:(sense, antisense),...}
composite_combos(ls)
- this returns a list all possible composite motifs for all watson and crick words for the indivdual members
motif_re(_m)
- returns motif's regex expression (non-overlapping) local variable _convertDict should carry the conversion dictionary to be used to create the regular expression e.g. {N:A|T|C|G,} this version is case INSENSITIVE, change self.dictIUPAC to alter the converion rules
listWrevcomps(ls)
- returns a list with its reverse complements. You do not have to worry about removing redundancy since a dictionary can contain only unique keys
Permute(_oliKombar, _oliMotifperm, OlliArr, L, m_len)
- to be called by all combinations, is a recursive algorithm to make all of the possible combinations of any string, returns a list
allcombinations(motif)
- this will take a motif and return a list of all possible combinations. You do not have to worry about removing redundancy since a dictionary can contain only unique keys