1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/langhuihui-Imprint-genetics

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
В этом репозитории не указан файл с открытой лицензией (LICENSE). При использовании обратитесь к конкретному описанию проекта и его зависимостям в коде.
Клонировать/Скачать
amino acid.js 3.1 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
unknown Отправлено 04.12.2017 14:54 ac7f1cc
/**
* 氨基酸
*/
const base = require('./base')
function insert(b) {
return function() {
this.s.splice(++this.p, 0, b)
if (this.copying) {
this.s1.splice(this.p1++, 0, base.copyOne(b))
}
}
}
function cut() {
let s = this.s
this.s = s.slice(0, this.p + 1)
this.ss.add(this.s)
this.ss.add(s.slice(this.p + 1))
this.ss.delete(s)
let s1 = this.s1
if (s1) { //剪切补串
if (this.p1 > 0 && this.p1 < s1.length) {
this.s1 = s1.slice(this.p1)
this.ss.add(s1.slice(0, this.p1))
this.ss.add(this.s1)
this.ss.delete(s1)
this.p1 = 0
}
}
}
function del() {
this.s.splice(this.p, 1)
}
function swi() {
let s = this.s
let p = this.p
this.s = this.s1
this.p = this.p1
this.s1 = s
this.p1 = p
if (!this.s || this.p < 0 || this.p > this.s.length) {
this.quit()
}
}
function mvr() {
this.p++;
if (this.copying) {
this.s1[--this.p1] = base.copyOne(this.s[this.p])
}
}
function mvl() {
this.p--;
if (this.copying) {
this.s1[++this.p1] = base.copyOne(this.s[this.p])
}
}
function cop() {
if (!this.s1) {
this.s1 = base.copy(this.s[this.p])
this.p1 = 0
}
this.copying = true
}
function off() {
this.copying = false
if (this.s1) {
this.ss.add(this.s1)
this.s1 = null
}
}
function ina() {
this.s.splice(++this.p, 0, 'A')
if (this.copying) {
this.s1.splice(this.p1++, 0, base.copyOne('A'))
}
}
function inc() {
this.s.splice(++this.p, 0, 'C')
if (this.copying) {
this.s1.splice(this.p1++, 0, base.copyOne('C'))
}
}
function ing() {
this.s.splice(++this.p, 0, 'G')
if (this.copying) {
this.s1.splice(this.p1++, 0, base.copyOne('G'))
}
}
function int() {
this.s.splice(++this.p, 0, 'T')
if (this.copying) {
this.s1.splice(this.p1++, 0, base.copyOne('T'))
}
}
function rpy() {
for (let b = this.s[++this.p]; b; b = this.s[++this.p]) {
if (this.copying) {
this.s1[--this.p1] = base.copyOne(b)
}
if (base.isPyrimidine(b)) {
return
}
}
this.quit()
}
function rpu() {
for (let b = this.s[++this.p]; b; b = this.s[++this.p]) {
if (this.copying) {
this.s1[--this.p1] = base.copyOne(b)
}
if (base.isPurine(b)) {
return
}
}
this.quit()
}
function lpy() {
for (let b = this.s[--this.p]; b; b = this.s[--this.p]) {
if (this.copying) {
this.s1[++this.p1] = base.copyOne(b)
}
if (base.isPyrimidine(b)) {
return
}
}
this.quit()
}
function lpu() {
for (let b = this.s[--this.p]; b; b = this.s[--this.p]) {
if (this.copying) {
this.s1[++this.p1] = base.copyOne(b)
}
if (base.isPurine(b)) {
return
}
}
this.quit()
}
module.exports = {
cut,
del,
swi,
mvr,
mvl,
cop,
off,
ina,
inc,
ing,
int,
rpy,
rpu,
lpy,
lpu
}

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/langhuihui-Imprint-genetics.git
git@api.gitlife.ru:oschina-mirror/langhuihui-Imprint-genetics.git
oschina-mirror
langhuihui-Imprint-genetics
langhuihui-Imprint-genetics
master