1.0.10 • Published 2 months ago

biotech-js v1.0.10

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

biotech-js

Documentation

Package initially developed at and for A&A Biotechnology for reading all kinds of biotechnology related files.

Currently it supports fastq, fasta and genbank files.

Usage

Reading Fasta file

import { FastaSequenceFile, ProcessingStatus } from "biotech-js";

const file = new FastaSequenceFile("path/to/file.fa");
await file.process();

expect(file.processingStatus).toBe(ProcessingStatus.SuccessFinished);
expect(file.sequences.length).toBe(12345);
expect(file.tookMs).toBeLessThan(1000);

await file.save();
// Default output path is "path/to/file_processed.fa"
// But you can customize it by passing a path to the save method
await file.save("path/to/file2.fa");

Reading Fastq file

import { FastqSequenceFile, ProcessingStatus } from "biotech-js";

const file = new FastqSequenceFile("path/to/file1.fastq");
await file.process();

expect(file.processingStatus).toBe(ProcessingStatus.SuccessFinished);
expect(file.sequences.length).toBe(12345);
expect(file.tookMs).toBeLessThan(1000);

await file.save("path/to/file2.fastq");

Reading Genbank file

import { GenbankSequencesFile, ProcessingStatus } from "biotech-js";

const file = new GenbankSequencesFile("path/to/file1.gb");
await file.process();

expect(file.processingStatus).toBe(ProcessingStatus.SuccessFinished);
expect(file.sequences.length).toBe(12345);
expect(file.tookMs).toBeLessThan(1000);

await file.save("path/to/file2.gb");

Detecting file extension

import { FileExtensionHandler } from "biotech-js";

const path = "path/to/file.fa";
const pathExtension = path.split(".").pop();

const extension = FileExtensionHandler.fileExtensionToEnum(pathExtension);
console.log(extension);
// Output: Fasta

Deployment

When deploying the library to npm run:

yarn b
1.0.10

2 months ago

1.0.9

2 months ago

1.0.2

7 months ago

1.0.8

6 months ago

1.0.6

7 months ago

1.0.5

7 months ago

1.0.4

7 months ago

1.0.3

7 months ago

1.0.1

1 year ago

1.0.0

1 year ago