예제 #1
0
 def _getCoRegSeqs(self):
     # get gene list and related seqs
     geneList = map(lambda l: l.strip('\n'), open(self.mdapArgs[1]).readlines())
     coRegSeqs = MDAP_defs.seqSubSet(geneList,self.mdapArgs[0])
     
     # warn user if there are missing genes
     if coRegSeqs[1]:
         sys.stderr.write('Warning: %s seqs in your gene list were not found in the fasta file provided.\nA list of names follows:\n%s\n'\
                          % (len(coRegSeqs[1]),str(coRegSeqs[1])))
     return coRegSeqs
예제 #2
0
 def _getMaxSize(self):
     """Calculates the number of nucleotides in the set of co-regulated promoter regions."""
     
     # get gene list and related seqs
     geneList = map(lambda l: l.strip('\n'), open(self.mdapArgs[1]).readlines())
     self.coRegSeqs = MDAP_defs.seqSubSet(geneList,self.mdapArgs[0])
     
     # warn user if there are missing genes
     if self.coRegSeqs[1]:
         sys.stderr.write('Warning: %s seqs in your gene list were not found in the fasta file provided.\nA list of names follows:\n%s\n'\
                          % (len(self.coRegSeqs[1]),str(self.coRegSeqs[1])))
     
     # Concatonate, get and set self.maxsize
     return len(''.join(self.coRegSeqs[0].values()))
예제 #3
0
from TAMO.MotifTools import load,sum
import gusPyCode.MDAP_proj.MDAP_defs as md


motifs = load('/Users/biggus/Documents/James/Collaborations/Campbell/data/Results_HyperGeoScreen/masked/Results_gGEMS/CCupAt4Days.6-8mers.gGEMS.top6.motifs.stdThresh.tmo')

# Weights __MUST__ be in same order as motifs are loaded.
weights = [1,
           2,
           3,
           4,
           -1,
           5]

assert len(motifs) == len(weights), \
       'Error: len(motifs) MUST equal len(weights).'

motifs = zip(*[motifs, weights])
motifs.sort(key=lambda x: x[1])
motifs = zip(*motifs)

aligned = md.alignSimilarMotifs(motifs[0])
combined = sum(aligned,zip(*motifs[1]))

None