(counts)
return df.to_dict(orient='list'), s.tolist()[0]
Calculat pfm given counts
Calculat pfm given counts
Calculat pfm given counts
def calc_pfm(counts):
    """Calculat pfm given counts"""
    df = pd.DataFrame(counts)
    s = df.T.sum()
    df = (df.T / s).T
    df = df.fillna(0)
    return df.to_dict(orient='list'), s.tolist()[0]
def calc_pfm ( counts ) : df = pd . DataFrame ( counts ) s = df . T . sum ( ) df = ( df . T / s ) . T df = df . fillna ( 0 ) return df . to_dict ( orient = 'list' ) , s . tolist ( ) [ 0 ]