mist3-ts
TypeScript icon, indicating that this package has built-in type declarations

0.7.13-0 • Public • Published

npm License: CC0-1.0 pipeline status coverage report

mist3-ts

Under construction package, it shouldn't be really published yet.

Install

npm install mist3-ts

Usage

Class: Genomes

fetchDetails()

const version = 'GCF_000005845.2'
const genome = new Genome(version)
const details = genome.details()

fetchAllGenes()

const version = 'GCF_000005845.2'
const genome = new Genome(version)
const allGenes = genome.fetchAllGenes()

fetchChemotaxis()

const version = 'GCF_000005845.2'
const genome = new Genome(version)
const chemotaxis = genome.fetchChemotaxis()

Class: Genes

fetchByIds()

const genes = new Genes(version)
const geneIds = '29096360,29096359'
const allGenes = genes.fetchByIds(geneIds)

fetchByAnyField()

const genes = new Genes(version)
const locus = 'VC0395_RS19590'
const allGenes = genes.fetchByAnyField(locus)

Class: Taxonomy

getParents()

const taxonomy = new Taxonomy()
const taxid = 362
const parents = taxonomy.getParents(taxid)

Class: Aseq

const aseq = new Aseq(version)
const aseqId = '6C4cMS5Ty-EVszF-Jh-nHA'
const seqInfo = aseq.fetch(aseqId)

Class: GenomeStream

Experimental stream wrap around Genome class.

import { GenomeStream } from 'mist3-ts';
import through2 from 'through2';
 
const sink = through2.obj((chunk, enc, next) => {
  next();
});
const version = 'GCF_002996345.1';
const gStream = new GenomeStream(100, logLevel)
const genes = []
const startPage = 11
 
gStream.fetchAllGenes(version, startPage).then(s => {
  s.on('data', gene => {
    // do something with genes
  })
  s.on('end', () => {
    // All done
  })
  s.pipe(sink)
})

Alternative URL

MiST3-TS accepts the address of an alternative MiST3 API URL

Example:

const version = 'GCF_000005845.2'
const localApi = 'http://localhost:5000/v1'
const genome = new Genome(version, localApi)
const details = genome.details()

Documentation

Developer's documentation

...to be continued.

Written with ❤ in Typescript.

Package Sidebar

Install

npm i mist3-ts

Weekly Downloads

0

Version

0.7.13-0

License

CC0-1.0

Unpacked Size

88.5 kB

Total Files

32

Last publish

Collaborators

  • daviortega