Looking For Tools Tp Draw Motif Logo
3
4
Entering edit mode
9.7 years ago
Yunfei Li ▴ 310

I try to create some motif logos. Now I follow biopython example and write script like following, it works well when dataset is small, but fails for large dataset. And there are several web tools can create motif logo, but, still, they has input limitation. Any suggestions?

for motif in tot:
    m = Motif.Motif(alphabet=IUPAC.unambiguous_dna)
    for i in tot[motif]:
        m.add_instance(Seq(i,m.alphabet))
    print >>fao, m.format("transfac") #PWM
    pic=motif+".png"
    m.weblogo(pic) #logo

"tot" is a dictionary, "motif" are keys of "tot", which are different motif(such as "TANNTA") I am looking for, and key values are list, which have exact motif sequence as elements (["TATTTA","TAGGTA",.....]).

motif biopython • 9.3k views
ADD COMMENT
7
Entering edit mode
9.7 years ago
Gjain 5.7k

hi Yunfei Li,

you can use the following tools to draw motif logos:

  • WebLogo: A Sequence Logo Generator: is a tool for creating sequence logos from biological sequence alignments. It can be run on the command line, as a standalone webserver, as a CGI webapp, or as a python library.

  • website

    alt text

  • MoRAine is a tool for the reannotation of transcription factor binding motifs and the creation of sequence logos.

  • GENIO/logo: Positional dependent information contents of aligned RNA/DNA or amino acid sequences are useful for the display of consensus sequences and for finding optimal search windows used in sequence analysis. alt text

  • CorreLogo: An online server for 3D sequence logos of RNA and DNA alignments

I hope this helps.

ADD COMMENT
4
Entering edit mode
9.7 years ago
SES 8.5k

The sublogo R package can plot sequence logos and construct a dendogram with a threshold that you can change. It only works well with very short motifs in my experience, but this may be a solution based on your question.

alt text

ADD COMMENT
3
Entering edit mode
9.7 years ago
Yunfei Li ▴ 310

I also think about solutions during waiting for suggestions. This part can create PWM directly, then use STAMP to plot logo.

for key in tot:
    #num report
    print "motif: %s, count: %d" % (key, len(tot[key]))
    #read in by postion
    dic={}
    for seq in tot[key]:
        if re.search("N",seq): continue
        for pos in range(len(seq)):
            dic.setdefault(pos,[]).append(seq[pos])
    #PWM
    print  >> fao, ">%s" % (key)
    for pos in range(len(tot[key][0])):
        posc={'A': 0,'C': 0,'G': 0,'T': 0}
        dic[pos].sort()
        tmp=[(x,len(list(y))) for x, y in groupby(dic[pos])]
        for base,count in tmp: 
            posc[base]+=count
        print >> fao, "%d %d %d %d" % (posc["A"],posc["C"],posc["G"],posc["T"])
    print  >> fao
ADD COMMENT
0
Entering edit mode

What's STAMP? I'm trying to plot weblogo from count dictionary ie. {'A': [3, 7, 0, 2, 1], 'C': [0, 0, 5, 2, 6], 'G': [0, 0, 0, 3, 0], 'T': [4, 0, 2, 0, 0]}

ADD REPLY

Login before adding your answer.

Traffic: 2616 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6