Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Package | gql |
Description | Query language for interpreting genome SNPs |
Node Version | >= 0.4 |
This query language is for use with the genomejs JSON format. See the dna2json repository for more information.
Just a reminder: deletions are represented as -
!
This example will create a query that determines if a person is sickle cell effected.
var gql = require('gql');
var dna = require('./genome.json');
var query = gql.or([
gql.exact('rs334', 'TT'),
gql.exact('i3003137', 'AA')
]);
var isMatch = query(dna);
console.log(isMatch); // true or false
All of these APIs return a boolean-returning function that acts as the truth test. These functions take in one argument, a DNA-JSON object. You can nest as deep as you want, or be as basic as you want.
For example, checking if a person is immune to norovirus is pretty simple:
var dna = require('./my-dna.json');
var query = gql.exact('rs601338', 'AA');
var isImmune = query(dna);
Evaluates to true if this was the only allele observed.
q.exact('rs2032651', 'D'); // will only match genotype D
q.exact('rs2032651', 'AT'); // will only match genotype AT
Evaluates to true if the allele was observed at all.
q.has('rs2032651', 'A'); // will match GA, GAT, AB, etc.
Evaluates to true if any allele has been observed.
q.exists('rs2032651');
Evaluates to true if no allele has been observed.
q.doesntExist('rs2032651');
Inverts the result of another condition.
// evaluates to true if rs2032651 != AA
var query = q.not(q.exact('rs2032651', 'AA'));
query({
rs2032651: {
genotype: 'TT'
}
}); // true
query({
rs2032651: {
genotype: 'AA'
}
}); // false
Evaluates to true if only the allele was observed at the specified position.
q.only('rs2032651', 'A'); // will match A, AA, AAA, etc.
Evaluates to true if any of the given condition functions evaluate to true.
q.or([
q.has('rs2032651', 'A'),
q.doesntExist('rs2032651')
]);
Evaluates to true if all of the given condition functions evaluate to true.
q.and([
q.exists('rs2032652'),
q.has('rs2032651', 'A')
]);
Evaluates to true if the number of given condition functions evaluating to true is equal to or greater than the given number.
q.atLeast(2, [
q.exists('rs2032652'),
q.has('rs2032651', 'A'),
q.exact('rs2032653', 'AT'),
q.exact('rs2032654', 'GG')
]);
Evaluates to true if all of the given condition functions evaluate to false.
q.none([
q.has('rs2032651', 'A'),
q.doesntExist('rs2032651')
]);
(MIT License)
Copyright (c) 2013 Fractal contact@wearefractal.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Query language for interpreting genome SNPs
The npm package gql receives a total of 3,562 weekly downloads. As such, gql popularity was classified as popular.
We found that gql demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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 researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.