0.3.3-0 • Published 4 years ago

bioseq-ts v0.3.3-0

Weekly downloads
10
License
CC0-1.0
Repository
gitlab
Last release
4 years ago

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

0.3.3-0

4 years ago

0.3.2-0

4 years ago

0.3.1-0

4 years ago

0.3.0-1

4 years ago

0.3.0-0

4 years ago

0.2.4-0

4 years ago

0.2.3-0

5 years ago

0.2.2-0

5 years ago

0.2.1-2

5 years ago

0.2.1-0

5 years ago

0.2.0-3

5 years ago

0.2.0-2

5 years ago

0.2.0-1

5 years ago

0.1.5-1

5 years ago

0.1.5-0

5 years ago

0.1.4-0

5 years ago

0.1.2-0

5 years ago

0.1.1-0

5 years ago

0.1.0

5 years ago