npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bioseq-ts

v0.3.3-0

Published

Biological Sequence in Javascript, written in Typescript.

Downloads

398

Readme

Development

Logic

In BioSeqTS we keep things separate in different classes.

Sequence

First, biological sequences (DNA, RNA and amino-acids) are transformed in a Sequence object. Methods to manipulate the sequence (e.g. reverse complement or remove gaps) should be coded there.

BioSeq

A BioSeq object is formed by a Sequence object and a header.

BioSeqSet

The idea here is that a given set of BioSeqs makes up for a BioSeqSet. Adding sequences after initializing a BioSeqSet is not allowed. Our logic is that adding a sequence changes the set and it should be a new set.

What if I need to add sequences?

Simple. Get the BioSeqs, push more sequences to the array and initialize a new set:

const bioSeqSet = new BioSeqSet(initialBioSeqs)
const newSeqToBeAdded = new BioSeq('newSeq', 'AAAAAAA')

const bioseqs = bioSeqSet.getBioSeqs()
bioseqs.push(newSeqToBeAdded)

const newSet = new BioSeqSet(biosets)

Partitions in BioSeqSets

If you are reading here is because you are trying to make some more advance stuff like concatenating alignments.

Granted, it is not that advanced but when you build trees from these alignments, then you will have to pass different partitions so the evolutionary models can be set correctly. To keep all this easy, BioSeqSets has a partitions property.

You can do much other than read it, but the method concatSequences updates it for you. Cool huh?

To read the partitions of a BioSeqSet just get it:

console.log(bioSeqSet.getPartitions())
/*
[
  [0, 100],
  [101, 200],
  ...
]
*/

Note that one of the reasons to make BioSeqSet immutable is to mantain partitions correct.

... to be continued