bioinformatics-parser
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -8,3 +8,3 @@ "use strict"; | ||
exports.reverseComplement = reverseComplement; | ||
exports.fastaToString = fastaToString; | ||
exports.stringify = stringify; | ||
exports.parse = parse; | ||
@@ -22,3 +22,3 @@ exports.isAllowed = isAllowed; | ||
*/ | ||
var LINE_LENGTH = 70; | ||
/** | ||
@@ -42,2 +42,3 @@ * @typedef {Object} Fasta | ||
*/ | ||
function realignFasta(fasta, sequence) { | ||
@@ -99,3 +100,3 @@ var index = fasta.data.indexOf(sequence); | ||
/** | ||
* @param {Fasta} fasta | ||
* @param {Fasta|Fasta[]} fasta | ||
* @returns {string} fasta file string | ||
@@ -105,4 +106,10 @@ */ | ||
function fastaToString(fasta) { | ||
var LINE_LENGTH = 70; | ||
function stringify(fasta) { | ||
if (Array.isArray(fasta)) return fasta.map(function (s) { | ||
return stringifySequence(s); | ||
}).join('\n'); | ||
return stringifySequence(fasta); | ||
} | ||
function stringifySequence(fasta) { | ||
var result = '>' + fasta.description + '\n'; | ||
@@ -109,0 +116,0 @@ var i; |
{ | ||
"name": "bioinformatics-parser", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": ".fasta and .fastq parsers", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
@@ -5,3 +5,5 @@ /* | ||
const LINE_LENGTH = 70 | ||
/** | ||
@@ -68,8 +70,12 @@ * @typedef {Object} Fasta | ||
/** | ||
* @param {Fasta} fasta | ||
* @param {Fasta|Fasta[]} fasta | ||
* @returns {string} fasta file string | ||
*/ | ||
export function fastaToString(fasta) { | ||
const LINE_LENGTH = 70 | ||
export function stringify(fasta) { | ||
if (Array.isArray(fasta)) | ||
return fasta.map(s => stringifySequence(s)).join('\n') | ||
return stringifySequence(fasta) | ||
} | ||
function stringifySequence(fasta) { | ||
let result = '>' + fasta.description + '\n' | ||
@@ -76,0 +82,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
110295
824