Source code for modalysis.cli.parsers.gff
"""CLI parser registration for GFF command group."""
import argparse
from modalysis.cli.handlers.gff import handle_gff_annotate, handle_gff_format
from modalysis.constants import DEFAULT_PORT
[docs]
def register_gff_parser(
subparsers: argparse._SubParsersAction,
) -> None:
"""Register `gff` subcommands and arguments."""
gff_parser = subparsers.add_parser("gff", help="GFF commands")
gff_subparsers = gff_parser.add_subparsers(dest="gff_command")
gff_format_parser = gff_subparsers.add_parser("format", help="Format a GFF file")
gff_format_parser.add_argument(
"--input-path", required=True, help="Path to the input GFF file"
)
gff_format_parser.add_argument(
"--output-path", required=True, help="Path to the output directory"
)
gff_format_parser.add_argument(
"--output-name", required=True, help="Name for the output file"
)
gff_format_parser.add_argument(
"--allowed-chromosomes",
required=True,
help="Path to a file with one valid chromosome name per line",
)
gff_format_parser.add_argument(
"--port",
type=int,
default=DEFAULT_PORT,
help=f"Port the server is running on (default: {DEFAULT_PORT})",
)
gff_format_parser.set_defaults(func=handle_gff_format)
gff_annotate_parser = gff_subparsers.add_parser(
"annotate", help="Annotate formatted GFF file with expression data"
)
gff_annotate_parser.add_argument(
"--gff-path",
required=True,
help="Path to the formatted GFF .modalysis file",
)
gff_annotate_parser.add_argument(
"--expression-paths",
required=True,
nargs="+",
help="Paths to expression TSV files",
)
gff_annotate_parser.add_argument(
"--expression-labels",
required=True,
nargs="+",
help="Labels for each expression file (must match order of --expression-paths)",
)
gff_annotate_parser.add_argument(
"--output-path", required=True, help="Path to the output directory"
)
gff_annotate_parser.add_argument(
"--output-name", required=True, help="Name for the output file"
)
gff_annotate_parser.add_argument(
"--port",
type=int,
default=DEFAULT_PORT,
help=f"Port the server is running on (default: {DEFAULT_PORT})",
)
gff_annotate_parser.set_defaults(func=handle_gff_annotate)