Answers.Body: <p>Turns out HiC file does store such metadata.</p>
  
  <p><code>straw</code> tool from Aiden Lab contains a script (<a href="https://github.com/aidenlab/straw/blob/master/python/read_hic_header.py" rel="nofollow noreferrer">read_hic_header.py</a>) that prints out the metadata from a given HiC file. Usage: <code>read_hic_header.py &lt;hic file or URL&gt; [verbose]</code></p>
  
  <p>In order to obtain the metadata in the form of a dictionary, one may consider using a function of the same tool that is currently available in my <a href="https://github.com/rraadd88/straw.git" rel="nofollow noreferrer">fork</a>.</p>
  
  <pre><code>from straw import straw_module
  straw_module.read_metadata(infile,verbose=False)
  
  Args
      infile: str, path to the HiC file 
      verbose: bool, print the metadata if True else return the metadata
  Returns
      metadata: dict, the metadata is returned if verbose is False. 
                  Keys of the metadata: 
                  HiC version, 
                  Master index, 
                  Genome ID (str), 
                  Attribute dictionary (dict), 
                  Chromosomes (dict), 
                  chromosomes2length (dict), 
                  Base pair-delimited resolutions (list), 
                  Fragment-delimited resolutions (list). 
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-06T14:54:06.203Z
Answers.LastActivityDate: 2020-04-06T14:54:06.203Z
Answers.UserDisplayName: user345394
Body: <p>I have a bunch of .hic files of different species. But, I don't know which reference genome assembly (e.g. GRCh37 or GRCh38 in the case of human genome) the genomic co-ordinates of the .hic file correspond to. So I wonder if there is any way to figure out the version of the reference genome assembly from a .hic file.</p>
  
  <p><strong>Therefore, my question is</strong>: Does .hic file contain metadata such as the version of reference genome assembly? If yes, then how could I access it? </p>
  
  <p>(I could obtain the information I need by digging into the methods sections of each paper corresponding to each .hic file. But it would be much better if I could get that right-away from the .hic file.).</p>
  
Tags: <reference-genome><chromosome-capture><hi-c>
Title: How to identify the reference genome assembly used to create a .hic file?
ThreadText: # How to identify the reference genome assembly used to create a .hic file?
  
  (Asked by: username_0 on 2020-04-05)
  
  I have a bunch of .hic files of different species. But, I don't know which reference genome assembly (e.g. GRCh37 or GRCh38 in the case of human genome) the genomic co-ordinates of the .hic file correspond to. So I wonder if there is any way to figure out the version of the reference genome assembly from a .hic file.
  
  **Therefore, my question is**: Does .hic file contain metadata such as the version of reference genome assembly? If yes, then how could I access it?
  
  (I could obtain the information I need by digging into the methods sections of each paper corresponding to each .hic file. But it would be much better if I could get that right-away from the .hic file.).
  
  **Tags:** reference-genome, chromosome-capture, hi-c
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2020-04-06. Score: 1 | Accepted answer
  
  Turns out HiC file does store such metadata.
  
  `straw` tool from Aiden Lab contains a script ([read\_hic\_header.py](https://github.com/aidenlab/straw/blob/master/python/read_hic_header.py)) that prints out the metadata from a given HiC file. Usage: `read_hic_header.py <hic file or URL> [verbose]`
  
  In order to obtain the metadata in the form of a dictionary, one may consider using a function of the same tool that is currently available in my [fork](https://github.com/rraadd88/straw.git).
  
  ```
  from straw import straw_module
  straw_module.read_metadata(infile,verbose=False)
  
  Args
      infile: str, path to the HiC file 
      verbose: bool, print the metadata if True else return the metadata
  Returns
      metadata: dict, the metadata is returned if verbose is False. 
                  Keys of the metadata: 
                  HiC version, 
                  Master index, 
                  Genome ID (str), 
                  Attribute dictionary (dict), 
                  Chromosomes (dict), 
                  chromosomes2length (dict), 
                  Base pair-delimited resolutions (list), 
                  Fragment-delimited resolutions (list). 
  
  ```
  
  
  ---
  
  