Skip to content

Commit

Permalink
Bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-veit committed Sep 21, 2020
1 parent 05066c7 commit e6ac663
Show file tree
Hide file tree
Showing 4 changed files with 177 additions and 177 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "higlass-sequence",
"version": "0.2.0",
"version": "0.3.0",
"description": "Sequence tracks for HiGlass",
"private": false,
"author": "Alexander Veit",
Expand Down
38 changes: 19 additions & 19 deletions src/scripts/FaiDataFetcher.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import slugid from "slugid";
import { RemoteFile } from "generic-filehandle";
import { tsvParseRows } from "d3-dsv";
import slugid from 'slugid';
import { RemoteFile } from 'generic-filehandle';
import { tsvParseRows } from 'd3-dsv';

class FaiDataFetcher {
constructor(dataConfig) {
this.dataConfig = dataConfig;
this.trackUid = slugid.nice();

const { IndexedFasta } = require("@gmod/indexedfasta");
const { IndexedFasta } = require('@gmod/indexedfasta');

this.chromInfo = null;

this.chromsizePromise = fetch(dataConfig.chromSizesUrl, {
cache: "force-cache",
method: "GET",
cache: 'force-cache',
method: 'GET',
})
.then((response) => response.text())
.then((chrInfoText) => {
Expand All @@ -39,7 +39,7 @@ class FaiDataFetcher {
const TILE_SIZE = 1024;
const totalLenth = this.chromInfo.totalLength;
const maxZoom = Math.ceil(
Math.log(totalLenth / TILE_SIZE) / Math.log(2)
Math.log(totalLenth / TILE_SIZE) / Math.log(2),
);

let retVal = {};
Expand Down Expand Up @@ -67,7 +67,7 @@ class FaiDataFetcher {
error: `Error parsing chromsizes: ${err}`,
});
} else {
console.error("Could not fetch tileInfo for sequence track.");
console.error('Could not fetch tileInfo for sequence track.');
}
});
}
Expand All @@ -80,12 +80,12 @@ class FaiDataFetcher {
const tilePromises = [];

for (const tileId of tileIds) {
const parts = tileId.split(".");
const parts = tileId.split('.');
const z = parseInt(parts[0], 10);
const x = parseInt(parts[1], 10);

if (Number.isNaN(x) || Number.isNaN(z)) {
console.warn("Invalid tile zoom or position:", z, x);
console.warn('Invalid tile zoom or position:', z, x);
continue;
}
zoomLevels.push(z);
Expand Down Expand Up @@ -138,11 +138,11 @@ class FaiDataFetcher {
.getSequence(
chromName,
minX - chromStart,
chromEnd - chromStart
chromEnd - chromStart,
)
.then((value) => {
return value;
})
}),
);

// continue onto the next chromosome
Expand All @@ -156,7 +156,7 @@ class FaiDataFetcher {
.getSequence(chromName, startPos, endPos)
.then((value) => {
return value;
})
}),
);

// end the loop because we've retrieved the last chromosome
Expand All @@ -166,7 +166,7 @@ class FaiDataFetcher {
}

return Promise.all(recordPromises).then((values) => {
const allBases = values.join("");
const allBases = values.join('');
return this.convertBasesToMultivec(allBases);
});
});
Expand All @@ -176,15 +176,15 @@ class FaiDataFetcher {
const res = [];

[...str].forEach((c) => {
if (c === "A" || c === "a") {
if (c === 'A' || c === 'a') {
res.push([1, 0, 0, 0, 0, 0]);
} else if (c === "T" || c === "t") {
} else if (c === 'T' || c === 't') {
res.push([0, 1, 0, 0, 0, 0]);
} else if (c === "G" || c === "g") {
} else if (c === 'G' || c === 'g') {
res.push([0, 0, 1, 0, 0, 0]);
} else if (c === "C" || c === "c") {
} else if (c === 'C' || c === 'c') {
res.push([0, 0, 0, 1, 0, 0]);
} else if (c === "N" || c === "n") {
} else if (c === 'N' || c === 'n') {
res.push([0, 0, 0, 0, 1, 0]);
} else {
res.push([0, 0, 0, 0, 0, 1]);
Expand Down
Loading

0 comments on commit e6ac663

Please sign in to comment.