Skip to content

Commit

Permalink
Adding the find_path.py file
Browse files Browse the repository at this point in the history
  • Loading branch information
asylvz committed Jun 27, 2024
1 parent 04d0a2e commit 7e66f1f
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions gaftools/cli/find_path.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
"""
Statistics of a GAF File
"""

import sys
import logging
import itertools
from gaftools.gaf import GAF, Read
from gaftools.cli import log_memory_usage
from gaftools.timer import StageTimer
from gaftools.gfa import GFA

logger = logging.getLogger(__name__)


def run_find_path(gfa_path, input_path, output=None):
timers = StageTimer()

graph = GFA(gfa_path)

path_seq = graph.extract_path(input_path)
print(path_seq)

logger.info("\n== SUMMARY ==")
total_time = timers.total()
log_memory_usage()
logger.info("Total time: %9.2f s", total_time)


def add_arguments(parser):
arg = parser.add_argument
# Positional arguments
arg("gfa_path", metavar="GFA", help="Input GFA file (can be bgzip-compressed)")
arg("input_path", metavar="path", help="GFA path to retrieve the sequence (e.g., \">s82312<s82313\").")
arg("-o", "--output", default=None, help="Output file. If omitted, use standard output.")

def validate(args, parser):
return True


def main(args):
run_find_path(**vars(args))

0 comments on commit 7e66f1f

Please sign in to comment.