Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@gmod/bed

Package Overview
Dependencies
Maintainers
5
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gmod/bed - npm Package Compare versions

Comparing version 2.0.2 to 2.0.3

27

CHANGELOG.md

@@ -0,11 +1,17 @@

## [2.0.3](https://github.com/GMOD/bed-js/compare/v2.0.2...v2.0.3) (2020-07-09)
- Use pre-generated pegjs parser for smaller bundle size
<a name="2.0.2"></a>
## [2.0.2](https://github.com/GMOD/bed-js/compare/v2.0.1...v2.0.2) (2019-11-12)
- Small autoSql grammar improvements e.g. allow \_ in autoSql names (for `_mouseover` from ucsc)
<a name="2.0.1"></a>
<a name="2.0.1"></a>
## [2.0.1](https://github.com/GMOD/bed-js/compare/v2.0.0...v2.0.1) (2019-11-03)
- Add fix for names that contain underscores

@@ -15,4 +21,2 @@

### Major changes

@@ -26,7 +30,4 @@

## [1.0.4](https://github.com/GMOD/bed-js/compare/v1.0.3...v1.0.4) (2019-04-14)
- Changed parseBedText to accept an Options argument with offset and optionally a uniqueId

@@ -36,4 +37,2 @@

- Fix usage of autoSql

@@ -44,4 +43,2 @@ - Use commonjs2 target of the webpack library build

- Fixed dist package on npm

@@ -51,4 +48,2 @@

- Added BED12 support

@@ -62,5 +57,1 @@ - Improved documentation

- Default autoSql types compiled into module with webpack
{
"name": "@gmod/bed",
"version": "2.0.2",
"version": "2.0.3",
"description": "A BED file format parser with autoSql support",

@@ -28,4 +28,5 @@ "main": "dist/main.js",

"clean": "rimraf dist",
"generate": "pegjs -o src/autoSql.js autoSql.pegjs",
"prebuild": "npm run clean && npm run lint",
"build": "webpack",
"build": "npm run generate && webpack",
"preversion": "npm run lint && npm test && npm run build",

@@ -45,22 +46,20 @@ "version": "standard-changelog && git add CHANGELOG.md",

"babel-loader": "^8.0.5",
"documentation": "^9.1.1",
"eslint": "^5.12.0",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-config-prettier": "^3.4.0",
"documentation": "^13.0.0",
"eslint": "^7.1.0",
"eslint-config-airbnb-base": "^14.1.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.10.0",
"eslint-plugin-prettier": "^3.0.1",
"jest": "^24.1.0",
"jest": "^26.0.1",
"jest-raw-loader": "^1.0.1",
"prettier": "^1.14.2",
"raw-loader": "^1.0.0",
"regenerator-runtime": "^0.12.1",
"rimraf": "^2.6.2",
"standard-changelog": "^1.0.0",
"pegjs": "^0.10.0",
"prettier": "^2.0.5",
"raw-loader": "^4.0.1",
"regenerator-runtime": "^0.13.5",
"rimraf": "^3.0.2",
"standard-changelog": "^2.0.24",
"webpack": "^4.29.5",
"webpack-cli": "^3.2.3"
},
"dependencies": {
"pegjs": "^0.10.0",
"snake-case": "^2.1.0"
},
"dependencies": {},
"keywords": [

@@ -67,0 +66,0 @@ "bed",

@@ -10,3 +10,2 @@ # bed-js

### Example

@@ -17,8 +16,7 @@

```js
var parser = new BED()
var text = fs.readFileSync('file.txt', 'utf8')
var results = text.split('\n').map(line => parser.parseLine(line))
var parser = new BED();
var text = fs.readFileSync("file.txt", "utf8");
var results = text.split("\n").map((line) => parser.parseLine(line));
```
## API

@@ -51,13 +49,14 @@

* line: string|Array<string> - is a tab delimited line with fields from the schema, or an array of fields with fields from the schema
* opts: Options - an options object
- line: `string|Array<string>` - is a tab delimited line with fields from the
schema, or an array that has been pre-split by tab with those same contents
- opts: Options - an options object
An Options object can contain
* opts.uniqueId - an indication of a uniqueId that is not encoded by the BED line itself
- opts.uniqueId - an indication of a uniqueId that is not encoded by the BED line itself
The default instantiation of the parser with new BED() simply parses lines assuming the fields come from the standard BED schema.
The default instantiation of the parser with new BED() simply parses lines
assuming the fields come from the standard BED schema.
Your line can just contain just a subset of the fields e.g. `chrom, chromStart, chromEnd, name, score`
## Examples

@@ -68,9 +67,8 @@

```js
const p = new BED()
const p = new BED();
p.parseLine('chr1\t0\t100')
p.parseLine("chr1\t0\t100");
// outputs { chrom: 'chr1', chromStart: 0, chromEnd: 100, strand: 0 }
```
### Parsing BED with a built in schema e.g. bigGenePred

@@ -111,5 +109,8 @@

If you have a BED format with a custom alternative schema with autoSql, or if you are using a BigBed file that contains autoSql (e.g. with [@gmod/bbi](https://github.com/gmod/bbi-js) then you can get it from header.autoSql) then you initialize the schema in the constructor and then use parseLine as normal
If you have a BED format with a custom alternative schema with autoSql, or if
you are using a BigBed file that contains autoSql (e.g. with
[@gmod/bbi](https://github.com/gmod/bbi-js) then you can get it from
header.autoSql) then you initialize the schema in the constructor and then use
parseLine as normal
```

@@ -124,14 +125,17 @@ const {BigBed} = require('@gmod/bbi')

### Important notes
- Does not parse "browser" or "track" lines and will throw an error if
parseLine receives one of these
- By default, parseLine parses only tab delimited text, if you want to use
spaces as is allowed by UCSC then pass an array to `line` for parseLine
- Converts strand from {+,-,.} to {1,-1,0} and also sets strand 0 even if no
strand is in the autoSql
* Does not parse "browser" or "track" lines and will throw an error if parseLine receives one of these
* By default, parseLine parses only tab delimited text, if you want to use spaces as is allowed by UCSC then pass an array to `line` for parseLine
* Converts strand from {+,-,.} to {1,-1,0} and also sets strand 0 even if no strand is in the autoSql
## Academic Use
This package was written with funding from the [NHGRI](http://genome.gov) as part of the [JBrowse](http://jbrowse.org) 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](http://jbrowse.org).
This package was written with funding from the [NHGRI](http://genome.gov) as
part of the [JBrowse](http://jbrowse.org) 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](http://jbrowse.org).

@@ -142,1 +146,4 @@ ## License

based on https://genome-source.gi.ucsc.edu/gitlist/kent.git/blob/master/src/hg/autoSql/autoSql.doc
also see http://genomewiki.ucsc.edu/index.php/AutoSql and https://www.linuxjournal.com/article/5949

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc