Hello everybody ! The idea of my program is as follows : I use clustalOmega to create a multiple sequence alignment saved in a fasta file. Then I would like to create a sequence logo with WebLogo using Biopython. The thing is that my sequences look like this now : "----TTTAT-", so I have to use the alphabet Gapped(IUPAC.unambiguous_dna) for motifs.create (if not, there's a KeyError : '-'). My problem is that afterwards, when I try to launch WebLogo, I get an Error : Exception : Unknown Alphabet. I tried to run the same fasta file on the WebLogo server without using Biopython, everything went just fine. This is the code I use : `nameLogo="sqc_logo" fichier=ReadFastaMul(target) for i in range (0,len(fichier)): instances.append(fichier[i]) print (instances) instances_f=motifs.create(instances,alphabet=Gapped(IUPAC.unambiguous_dna)) print (instances_f)
ReadFastaMul reads a fasta file and generates a list of tuples (name, sequence). I've already used it in several occasions, so I'm rather sure this is not the problem. (I've also tried to run the code defining instances myself, with something likeinstances=['---TTTAAGA-', '--TTTTTAAG-', '----TTTAAG-']` and I've ended up stuck for the same reasons).
If I try everything with ungapped sequences, it works out fine, so weblogo seems to work for these.
It's my first time using Biopython. I have not installed Clustal on my computer yet, so I use a file I've aligned with their online service.
I use Python 2.7 and Biopython 1.6.7 with OS X 10.11.5.
Thanks a lot for any help I may get !