report_pre_assembly.py 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. from .. import stats_preassembly
  2. import argparse
  3. import json
  4. import logging
  5. log = logging.getLogger()
  6. def do_report(db, preads_fofn, genome_length, length_cutoff, out):
  7. kwds = dict(
  8. i_preads_fofn_fn=preads_fofn,
  9. i_raw_reads_db_fn=db,
  10. genome_length=genome_length,
  11. length_cutoff=length_cutoff,
  12. )
  13. report_dict = stats_preassembly.calc_dict(**kwds)
  14. content = json.dumps(report_dict, sort_keys=True,
  15. indent=4, separators=(',', ': '))
  16. open(out, 'w').write(content)
  17. def main():
  18. parser = argparse.ArgumentParser()
  19. parser.add_argument('--genome-length',
  20. type=int,
  21. required=True,
  22. help='Estimated number of bases in the full genome haplotype.')
  23. parser.add_argument('--length-cutoff',
  24. type=int,
  25. required=True,
  26. help='Minimum length of any seed read.')
  27. parser.add_argument('--db',
  28. required=True,
  29. help='Path to raw_reads.db (dazzler DB)')
  30. parser.add_argument('--preads-fofn',
  31. required=True,
  32. help='Path to FOFN of preads fasta files.')
  33. parser.add_argument('--out',
  34. required=True,
  35. help='Path to JSON output file.')
  36. ARGS = parser.parse_args()
  37. do_report(**vars(ARGS))
  38. if __name__ == "__main__":
  39. logging.basicConfig()
  40. log.setLevel(logging.DEBUG)
  41. main()