1.1.14 • Published 2 years ago

@gmod/twobit v1.1.14

Weekly downloads
190
License
MIT
Repository
github
Last release
2 years ago

@gmod/twobit

NPM version Coverage Status Build Status

Read .2bit sequence files using pure JavaScript, works in node or in the browser.

Install

$ npm install --save @gmod/twobit

Usage

const { TwoBitFile } = require('@gmod/twobit')
const t = new TwoBitFile({
  path: require.resolve('./data/foo.2bit'),
})

// get the first 10 bases of a sequence from the file.
// coordinates are UCSC standard 0-based half-open
const chr1Region = await t.getSequence('chr1', 0, 10)
// chr1Region is now a string of bases, 'ACTG...'

// get a whole sequence from the file
const chr1Bases = await t.getSequence('chr1')

// get object with all seq lengths as { seqName => length, ... }
const allSequenceSizes = await t.getSequenceSizes()

// get the size of a single sequence
const chr1Size = await t.getSequenceSize('chr1')

// get an array of all sequence names in the file
const seqNames = await t.getSequenceNames()

API

TwoBitFile

Table of Contents

Academic Use

This package was written with funding from the NHGRI as part of the JBrowse project. If you use it in an academic project that you publish, please cite the most recent JBrowse paper, which will be linked from jbrowse.org.

License

MIT © Robert Buels

1.1.14

2 years ago

1.1.13

2 years ago

1.1.12

2 years ago

1.1.11

2 years ago

1.1.10

5 years ago

1.1.9

5 years ago

1.1.8

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago