biopython-motifs , How can I create motif from sequences of different length? I want to create motif of different length kmers.
Following code works for kmers of same length but not different length.What to do ?
from Bio import motifs

sequences = SeqIO.parse(&quot;myfile.fasta&quot;,&quot;fasta&quot;)
    instances = []
    for data in sequences:
      instance = data.seq
      instances.append(instance)
    
motif = motifs.create(instances)
Motifs are not designed to be variable length in general since PSSMs/PVMs don't support insertions/deletions (indels). Instead, I suggest profile HMMs, such as those offered by HMMER3, which do support indels. You can parse HMMER3 output with Biopython via Bio.SearchIO.HmmerIO