INNER CODE UNIT · Python

organize_columns

BortonWrightonLabs/DRAM · bin/combine_annotations.py:134

def organize_columns(df: pl.DataFrame, special_columns=None) -> pl.DataFrame:
    if special_columns is None:
        special_columns = []
    base_columns = [
        "query_id",
        FASTA_COLUMN,
        "scaffold",
        "gene_number",
        "start_position",
        "stop_position",
        "strandedness",
        "rank",
    ]
    base_columns = [col for col in base_columns if col in df.columns]

    kegg_columns = sorted(
        [col for col in df.columns if col.startswith("kegg_")],
        key=lambda x: (x != "kegg_id", x),

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…