Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Performs parsing of BED files including autoSql
You can pipe your file through this programs parseLine function
var parser = new BED()
var text = fs.readFileSync('file.txt', 'utf8')
var results = text.split('\n').map(line => parser.parseLine(line))
The BED constructor accepts an opts object with options
The predefined types can include
bigInteract
bigMaf
bigPsl
bigNarrowPeak
bigGenePred
bigLink
bigChain
mafFrames
mafSummary
If neither autoSql or type is specified, the default BED schema is used (see here)
Parses a BED line according to the currently loaded schema
An Options object can contain
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
const p = new BED()
p.parseLine('chr1\t0\t100')
// outputs { chrom: 'chr1', chromStart: 0, chromEnd: 100, strand: 0 }
If you have a BED format that corresponds to a different schema, you can specify from the list of default built in schemas
Specify this in the opts.type for the BED constructor
const p = new BED({ type: 'bigGenePred' })
const line = 'chr1\t11868\t14409\tENST00000456328.2\t1000\t+\t11868\t11868\t255,128,0\t3\t359,109,1189,\t0,744,1352,\tDDX11L1\tnone\tnone\t-1,-1,-1,\tnone\tENST00000456328.2\tDDX11L1\tnone'
p.parseLine(line)
// above line outputs
{ chrom: 'chr1',
chromStart: 11868,
chromEnd: 14409,
name: 'ENST00000456328.2',
score: 1000,
strand: 1,
thickStart: 11868,
thickEnd: 11868,
reserved: '255,128,0',
blockCount: 3,
blockSizes: [ 359, 109, 1189 ],
chromStarts: [ 0, 744, 1352 ],
name2: 'DDX11L1',
cdsStartStat: 'none',
cdsEndStat: 'none',
exonFrames: [ -1, -1, -1 ],
type: 'none',
geneName: 'ENST00000456328.2',
geneName2: 'DDX11L1',
geneType: 'none' }
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 then you can get it from header.autoSql) then you initialize the schema in the constructor and then use parseLine as normal
const {BigBed} = require('@gmod/bbi')
const bigbed = new BigBed({path: 'yourfile'})
const {autoSql} = await bigbed.getHeader()
const p = new BED({ autoSql })
p.parseLine(line)
// etc.
line
for parseLineThis 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.
MIT © Colin Diesh
2.0.0 (2019-04-15)
FAQs
A BED file format parser with autoSql support
The npm package @gmod/bed receives a total of 719 weekly downloads. As such, @gmod/bed popularity was classified as not popular.
We found that @gmod/bed demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.