Skip to content

Commit

Permalink
fix: custom genomes were broken
Browse files Browse the repository at this point in the history
Custom genomes were broken and not fully implemented.

At least GRCh38.d1.vd1.dict with all the decoys and other stuff seems to work now.

Closes #44
  • Loading branch information
tuner committed Jun 24, 2024
1 parent 8c2aa86 commit 336ea99
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { FILE_TYPES, converters, detectFileType } from "./files.js";
import spinnerImg from "./img/Ajax-loader.gif";

import "./style.scss";
import { parseSamHeader } from "./sam.js";

const GENOMES = ["hg38", "hg19"];

Expand Down Expand Up @@ -289,6 +290,7 @@ async function visualize() {
closeVisualization();

const spec = createSpec(parsedFiles, genome);
console.log(spec);
genomeSpyLaunched = true;
renderAll();

Expand Down Expand Up @@ -415,6 +417,10 @@ async function handleFiles(files) {
* @returns {any[]}
*/
function parseContigs(textContent) {
// TODO: Implement
throw new Error("Function not implemented.");
const header = parseSamHeader(textContent);

return header.SQ.map((/** @type {any} */ record) => ({
name: record.SN,
size: +record.LN,
}));
}
1 change: 1 addition & 0 deletions src/spec-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export default function createSpec(files, genomeName) {
}
: {
contigs: files.get(FILE_TYPES.DICT).data,
name: "custom",
};

const [segments, cr, hets] = [
Expand Down

0 comments on commit 336ea99

Please sign in to comment.