aidenlab / straw

Extract data quickly from Juicebox via straw
MIT License
62 stars 36 forks source link

modularized read_hic_header script #39

Closed srcoulombe closed 4 years ago

srcoulombe commented 4 years ago

Motivation: There is some code duplication between read_hic_header.py and straw.__readcstr and straw.read_header. Maybe a modularized version of the code would make it easier to maintain and update? If this PR is accepted (could use feedback for modifications), straw's Python API could be made more concise.

Changes:

  1. replaced argv with argparse functionality
  2. refactored script code under main() function
  3. code now raises explicit exceptions instead of sys.stderr.write+sys.exit
  4. described 'silent' mode
  5. filled out docstrings
srcoulombe commented 4 years ago

Awesome, should be good now but let me know if there's something else that would be a nice feature