def createMaskedReferences(refFn, motifStr): # Read input files refRecs = [MaskedReference(rec) for rec in FastaReader(refFn)] maskedMs = [Motif(m) for m in motifStr.split(',')] if motifStr else [] # Mask repeat regions for motif in maskedMs: for rec in refRecs: rec.MaskRepeat(motif) return refRecs
def do_globalAlignment(rep1, rep2): # Aligment align_dict = dict() BASE = "rep1" align_dict['rep1'] = alignment.pairwise_NW(rep1, rep1, 2, -1, -3, 1)[2] align_dict['rep2'] = alignment.pairwise_NW(rep1, rep2, 2, -1, -3, 1)[2] # get 'Match Matrix' and 'Gap List' matchMatrix, gapSeqList = StructMatchGap3.structMatchGap(align_dict, BASE) stageMatrixResult = StageMatrix.stageMatrix(matchMatrix, gapSeqList) Motif_Obj = Motif(stageMatrixResult, BASE) outputStage = OutputStage(stageMatrixResult, None, BASE, Motif_Obj) executionTrace_dict = {"rep1": rep1, "rep2": rep2} commonMotif = CommonMotif(stageMatrixResult, Motif_Obj, executionTrace_dict, outputStage) # comMotifdict= {'s<stage>_<motif>': [CMS], oriIdxRange1, oriIdxRange2}, comMotif_dict = commonMotif.getComMotifDict() return comMotif_dict
def motif(self, line): self.current_motif = Motif() self.motifs.append(self.current_motif) self.current_motif.alphabet = IUPAC.unambiguous_dna
def _from_sites(handle): return Motif().from_jaspar_sites(handle)
def _from_pfm(handle): return Motif().from_jaspar_pfm(handle)