New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

hic-straw

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hic-straw

Utilities for reading .files (contact matrix files)

0.9.8
Source
npm
Version published
Weekly downloads
169
-36.23%
Maintainers
1
Weekly downloads
 
Created
Source

hic-straw

Build Status

Command line and web utilities for reading .hic contact matrix files

Installation

Requires Node (https://nodejs.org)

npm install hic-straw

Examples

Command line

  • Extract file metadata.

    • genome identifier
    • sequences (chromosomes)
    • bin sizes (resolutions)
straw --meta test/data/test_chr22.hic 
  • Extract normalization options.

    • Array of normalization options
straw --norms test/data/test_chr22.hic 

  • Extract values from a local hic file between 40MB and 50MB on chromosome 22 at 100KB resolution with KR (balanced) normalization and print to stdout.

    • array of contact records {binX, binY, value}

straw KR test/data/test_chr22.hic 22:40,000,000-50,000,000 22:40,000,000-50,000,000 BP 100,000

  • Extract values from a remote hic file by URL.
straw KR https://s3.amazonaws.com/igv.broadinstitute.org/data/hic/intra_nofrag_30.hic 8:48,700,000-48,900,000 8:48700000-48900000 BP 10,000

In a node script

See examples/script-es6.js and examples/script-cjs.js.

** Usage (run from the examples directory)

  • node -r esm examples/script-es6.js

  • node examples/script-cjs.js

In a web page

Script tag - see examples/straw.html


<script src="../dist/hic-straw.js"></script>

...

 const straw = new HicStraw({
            "url": "https://s3.amazonaws.com/igv.broadinstitute.org/data/hic/intra_nofrag_30.hic"
        })

        straw.getContactRecords(
            "KR",
            {chr: "8",start: 50000000, end: 60000000},
            {chr: "8",start: 50000000, end: 60000000},
            "BP",
            1000000
        )
            .then(function (contactRecords) {...})

ES6 module - see examples/straw-es6.html



    import HicStraw from '../dist/hic-straw_es6.js'

    const straw = new HicStraw({
        "path": "https://s3.amazonaws.com/igv.broadinstitute.org/data/hic/intra_nofrag_30.hic"
    })

    straw.getContactRecords(
        "KR",
        {chr: "8",start: 50000000, end: 60000000},
        {chr: "8",start: 50000000, end: 60000000},
        "BP",
        1000000
     )
        .then(function (contactRecords) {...})



Keywords

hic

FAQs

Package last updated on 27 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts