gen_gfa_v1.py 930 B

1234567891011121314151617181920212223242526272829
  1. import argparse
  2. import os
  3. import sys
  4. from falcon_kit.fc_asm_graph import AsmGraph
  5. from falcon_kit.FastaReader import FastaReader
  6. from falcon_kit.gfa_graph import *
  7. def run(fp_out, collected_gfa):
  8. with open(collected_gfa, 'r') as fp_in:
  9. gfa_graph = deserialize_gfa(fp_in)
  10. gfa_graph.write_gfa_v1(fp_out)
  11. def parse_args(argv):
  12. parser = argparse.ArgumentParser(description="Generates GFA output (on stdout) from FALCON's assembly.",
  13. formatter_class=argparse.ArgumentDefaultsHelpFormatter)
  14. parser.add_argument('collected_gfa', type=str, default='asm.gfa.json',
  15. help='Path to the file with collected and formatted data for generating the GFA')
  16. args = parser.parse_args(argv[1:])
  17. return args
  18. def main(argv=sys.argv):
  19. args = parse_args(argv)
  20. run(sys.stdout, **vars(args))
  21. if __name__ == '__main__': # pragma: no cover
  22. main()