/usr/bin/gfapy-mergelinear is in python3-gfapy 1.0.0+dfsg-2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | #!/usr/bin/python3
"""
Merge linear paths in a GFA graph
"""
import sys
import os
import gfapy
import argparse
op = argparse.ArgumentParser(description=__doc__)
op.add_argument("filename")
op.add_argument("--redundant", '-r', help="create redundant paths, "+
"similar to the contigs constructed by Readjoiner", action="store_true")
op.add_argument("--no-progress", '-p', help="do not show progress log",
action="store_false", dest="progress")
op.add_argument("--quiet", '-q', help="suppress output", action="store_false",
dest="output")
op.add_argument("--vlevel", help="validation level", default=0, type=int)
op.add_argument('--version', action='version', version='%(prog)s 1.0')
opts = op.parse_args()
gfa = gfapy.Gfa(vlevel=opts.vlevel)
if opts.progress:
gfa.enable_progress_logging(part=0.01)
gfa.read_file(opts.filename)
if opts.redundant:
# remove isolated segments, as this mode is for comparison
# with readjoiner contigs, and isolated vertices are not output by readjoiner
for cc in gfa.connected_components():
if len(cc) == 1:
gfa.segment(cc[0]).disconnect()
gfa.merge_linear_paths(redundant_junctions=opts.redundant,
enable_tracking=False,
merged_name="short")
if opts.output:
print(gfa)
|