INNER CODE UNIT · Python

convert_bit_scores_to_numeric

BortonWrightonLabs/DRAM · bin/combine_annotations.py:70

def convert_bit_scores_to_numeric(lf: pl.LazyFrame) -> pl.LazyFrame:
    bit_score_columns = [
        col for col in lf.collect_schema().names() if "_bitScore" in col
    ]
    if not bit_score_columns:
        return lf
    return lf.with_columns(
        [
            pl.col(col).cast(pl.Float64, strict=False).alias(col)
            for col in bit_score_columns
        ]
    )


def count_motifs(gene_faa, motif="(C..CH)", genes_faa_dict=None):
    if genes_faa_dict is None:
        genes_faa_dict = dict()
    for seq in read_sequence(gene_faa, format="fasta"):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…