-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |