Skip to content

Instantly share code, notes, and snippets.

🐒
JavaScript / Haskell / Scala

Oleksandr Tryshchenko tryshchenko

🐒
JavaScript / Haskell / Scala
Block or report user

Report or block tryshchenko

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View spnp-over-db.js
// In order to reduce json file size with such an amount of entities I used short key names:
// gt = alleles group
// rs = Rs[XXXXXX] string
module.exports = (snps, data) =>
snps.reduce((prev, next) => {
if (!next || !next.rs) {
return prev;
}
const rs = next.rs.toLowerCase();
View dna2json.js
const fs = require('fs');
const BLOCKS_LENGTH = 4;
const GENO_PAIR_OFFSET = 3;
const isCommentLine = (el) => el.indexOf('#') > -1;
const isValidSequenceLine = (line) => line.length !== BLOCKS_LENGTH;
module.exports = (genomePath) => {
const data = fs.readFileSync(genomePath, 'utf-8');
return data.split('\n').reduce((prev, el) => {
You can’t perform that action at this time.