aidenlab / straw

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

Module for reading header metadata of HiC file as a dictionary #47

Closed rraadd88 closed 4 years ago

rraadd88 commented 4 years ago

Hi, I wanted to read the header metadata of a HiC file as a dictionary, so

  1. I organised the code in python/read_hic_header.py and created a module named read_metadata in python/straw/straw.py.
  2. Cleaned the python/read_hic_header.py script and simply added a call to the new read_metadata module.

I tested python/read_hic_header.py and it works just the way it was working earlier. This modification would be of help to some who would like to check the metadata of the file before digging into it.

Rohan

nchernia commented 4 years ago

Thanks!

This always prints out in verbose mode, please modify to use the verbose argument.

rraadd88 commented 4 years ago

You're welcome! By default, verbose mode is always ON (verbose=True) in the the function (read_metadata) https://github.com/aidenlab/straw/pull/47/files#diff-91228eba8daf2b768af2951b894555f3R87 and in the script (read_hic_header.py) https://github.com/aidenlab/straw/pull/47/files#diff-2f8541ea8520b7c1d50af29f9a2a1f3dR19

read_metadata will return a dictionary only if verbose=False.

nchernia commented 4 years ago

Verbose should be false by default and should be set by the sys.args flag as we do in the original version. The behavior should remain the same.

On Mon, Apr 6, 2020 at 10:59 AM Rohan Dandage notifications@github.com wrote:

You're welcome! By default, verbose mode is always (verbose=True) in the the function (read_metadata)

https://github.com/aidenlab/straw/pull/47/files#diff-91228eba8daf2b768af2951b894555f3R87 and in the script (read_hic_header.py)

https://github.com/aidenlab/straw/pull/47/files#diff-2f8541ea8520b7c1d50af29f9a2a1f3dR19

read_metadata will return a dictionary only if verbose=False.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/aidenlab/straw/pull/47#issuecomment-609847793, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAK2EW7MWQ6YYRBGUYUFZ7LRLHU6TANCNFSM4MCKVDGA .

-- Neva Cherniavsky Durand, Ph.D. Pronouns: she, her, hers Assistant Professor, Aiden Lab www.aidenlab.org

rraadd88 commented 4 years ago

I made some changes. Please have a look.

nchernia commented 4 years ago

Thanks, looks good.