Source code for modalysis.cli.handlers.dmr
"""CLI handlers for DMR commands."""
import argparse
import logging
from modalysis.client.dmr import (
dmr_annotate,
dmr_common_genes,
dmr_format,
dmr_gene_counts,
)
logger = logging.getLogger(__name__)
[docs]
def handle_dmr_annotate(args: argparse.Namespace) -> None:
"""Handle `modalysis dmr annotate` CLI command."""
base_url = f"http://localhost:{args.port}"
result = dmr_annotate(
dmr_path=args.dmr_path,
gff_path=args.gff_path,
output_path=args.output_path,
output_name=args.output_name,
base_url=base_url,
)
print(result)
[docs]
def handle_dmr_gene_counts(args: argparse.Namespace) -> None:
"""Handle `modalysis dmr gene-counts` CLI command."""
base_url = f"http://localhost:{args.port}"
result = dmr_gene_counts(
annotated_dmr_paths=args.annotated_dmr_paths,
manifestations=args.manifestations,
modifications=args.modifications,
manifestation_labels=args.manifestation_labels,
expression_labels=args.expression_labels,
annotated_gff_path=args.annotated_gff_path,
output_path=args.output_path,
output_name=args.output_name,
output_excel=args.output_excel,
base_url=base_url,
)
print(result)
[docs]
def handle_dmr_common_genes(args: argparse.Namespace) -> None:
"""Handle `modalysis dmr common-genes` CLI command."""
base_url = f"http://localhost:{args.port}"
result = dmr_common_genes(
annotated_dmr_paths=args.annotated_dmr_paths,
manifestations=args.manifestations,
modifications=args.modifications,
manifestation_labels=args.manifestation_labels,
expression_labels=args.expression_labels,
modification_a=args.modification_a,
modification_b=args.modification_b,
annotated_gff_path=args.annotated_gff_path,
output_path=args.output_path,
output_name=args.output_name,
base_url=base_url,
)
print(result)