(infile, data_type='fasta', seq_type='dna', pseudo_count=1)
return counts, total
Read alignment file as motif

    Parameters
    ----------

    infile: str
        Path to input alignment file

    data_type: str
        'fasta', 'stockholm', etc/. as supported by Bio.AlignIO

    seq_type: str
        'dna', 'rna' or 'aa'

    pseudo_count: int
        psuedo counts to add before calculating information cotent

    Returns
    -------

    (motif, information_content) : tuple
        A motif instance followd by total informatio content of the motif
Read alignment file as motif
Read alignment file as motif
def read_alignment(infile, data_type='fasta', seq_type='dna', pseudo_count=1):
    """Read alignment file as motif

    Parameters
    ----------

    infile: str
        Path to input alignment file

    data_type: str
        'fasta', 'stockholm', etc/. as supported by Bio.AlignIO

    seq_type: str
        'dna', 'rna' or 'aa'

    pseudo_count: int
        psuedo counts to add before calculating information cotent

    Returns
    -------

    (motif, information_content) : tuple
        A motif instance followd by total informatio content of the motif

    """
    alignment = AlignIO.read(infile, data_type)
    data = []
    for aln in alignment:
        data.append([x for x in str(aln.seq)])
    df = pd.DataFrame(data)
    df_counts = df.apply(pd.value_counts, 0)
    total = df_counts[[0]].sum()
    df_counts = df_counts[df_counts.index != '-']
    # Remove - from counts
    counts_dict = df_counts.to_dict(orient='index')
    counts = {}
    for key, val in counts_dict.items():
        counts[key] = list(val.values())
    return counts, total
    """
    summary_align = AlignInfo.SummaryInfo(alignment)
    if seq_type == 'dna':
        info_content = summary_align.information_content(e_freq_table = naive_freq_tables['dna'],
                                                         chars_to_ignore = ['N'],
                                                         pseudo_count = pseudo_count)
    elif seq_type == 'rna':
        info_content = summary_align.information_content(e_freq_table = naive_freq_tables['rna'],
                                                         chars_to_ignore = ['N'],
                                                         pseudo_count = pseudo_count)
    else:
        info_content = summary_align.information_content(e_freq_table = naive_freq_tables['aa'],
                                                         pseudo_count = pseudo_count)
    motif = create_motif_from_alignment(alignment)
    return (motif, summary_align.ic_vector)
    """
def read_alignment ( infile , data_type = 'fasta' , seq_type = 'dna' , pseudo_count = 1 ) : alignment = AlignIO . read ( infile , data_type ) data = [ ] for aln in alignment : data . append ( [ x for x in str ( aln . seq ) ] ) df = pd . DataFrame ( data ) df_counts = df . apply ( pd . value_counts , 0 ) total = df_counts [ [ 0 ] ] . sum ( ) df_counts = df_counts [ df_counts . index != '-' ] # Remove - from counts counts_dict = df_counts . to_dict ( orient = 'index' ) counts = { } for key , val in counts_dict . items ( ) : counts [ key ] = list ( val . values ( ) ) return counts , total """
    summary_align = AlignInfo.SummaryInfo(alignment)
    if seq_type == 'dna':
        info_content = summary_align.information_content(e_freq_table = naive_freq_tables['dna'],
                                                         chars_to_ignore = ['N'],
                                                         pseudo_count = pseudo_count)
    elif seq_type == 'rna':
        info_content = summary_align.information_content(e_freq_table = naive_freq_tables['rna'],
                                                         chars_to_ignore = ['N'],
                                                         pseudo_count = pseudo_count)
    else:
        info_content = summary_align.information_content(e_freq_table = naive_freq_tables['aa'],
                                                         pseudo_count = pseudo_count)
    motif = create_motif_from_alignment(alignment)
    return (motif, summary_align.ic_vector)
    """