Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
theosanderson committed Aug 4, 2022
1 parent efc9464 commit 0ca50a6
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 38 deletions.
2 changes: 0 additions & 2 deletions docs/taxoniumtools.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,10 @@ You can then open that `tfci-taxonium.jsonl.gz` file at [taxonium.org](http://ta
Right now Taxoniumtools is limited in the types of genome annotations it can support, for SARS-CoV-2 we recommend using the exact [modified .gb file we use in the example](https://raw.githubusercontent.com/theosanderson/taxonium/master/taxoniumtools/test_data/hu1.gb), which splits ORF1ab into ORF1a and ORF1b to avoid the need to model ribosome slippage.
```


```{note}
Some people ask what the "L" in JSONL is for. JSONL means "JSON Lines". Each line of the file is a separate JSON object. In the case of Taxonium JSONL format, the very first line contains a lot of metadata about the tree as a whole, and then each additional line contains information about a single node. It's important to use the "jsonl" extension instead of "json" as otherwise the interface may try to parse your tree as a NextStrain JSON file.
```


##### usher_to_taxonium

```{eval-rst}
Expand Down
4 changes: 2 additions & 2 deletions taxonium_web_client/src/components/AboutOverlay.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ function AboutOverlay({ enabled, setEnabled, overlayContent }) {
<div className="m-5">
<h2 className="font-bold mb-3">Welcome to Taxonium</h2>
<p className="mb-1">
Taxonium is a web application for exploring phylogenetic trees.
Find out more at our{" "}
Taxonium is a web application for exploring phylogenetic trees. Find
out more at our{" "}
<a
className="text-blue underline"
href="https://github.com/theosanderson/taxodium"
Expand Down
64 changes: 32 additions & 32 deletions taxonium_web_client/src/components/SearchPanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,39 +168,39 @@ function SearchPanel({
</div>

{config.enable_ns_download &&
selectedDetails.nodeDetails[key] < 1000000 && (
<>
<div className="mb-3">
<Button className="" onClick={handleDownloadJson}>
Download Nextstrain JSON
</Button>
</div>
selectedDetails.nodeDetails[key] < 1000000 && (
<>
<div className="mb-3">
<Button className="" onClick={handleDownloadJson}>
Download Nextstrain JSON
</Button>
</div>

{backend.type === "server" &&
selectedDetails.nodeDetails[key] < 20000 && (
<>
<div className="mb-3">
<Button
className=""
href={
"https://nextstrain.org/fetch/" +
backend
.getNextstrainJsonUrl(
selectedDetails.nodeDetails.node_id,
config
)
.replace("https://", "")
.replace("http://", "")
}
target="_blank"
>
View clade in Nextstrain
</Button>
</div>
</>
)}
</>
)}
{backend.type === "server" &&
selectedDetails.nodeDetails[key] < 20000 && (
<>
<div className="mb-3">
<Button
className=""
href={
"https://nextstrain.org/fetch/" +
backend
.getNextstrainJsonUrl(
selectedDetails.nodeDetails.node_id,
config
)
.replace("https://", "")
.replace("http://", "")
}
target="_blank"
>
View clade in Nextstrain
</Button>
</div>
</>
)}
</>
)}

{config.covspectrum_links && (
<div className="mb-3">
Expand Down
15 changes: 13 additions & 2 deletions taxonium_web_client/src/hooks/usePerNodeFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,18 @@ import { useMemo } from "react";
function usePerNodeFunctions(data, config) {
const getNodeGenotype = (node_id) => {
console.log("data", data);
let cur_node = data.data.nodeLookup[node_id];

let data_to_use;
if (data.data.nodeLookup[node_id]) {
data_to_use = data.data;
} else if (data.base_data.nodeLookup[node_id]) {
data_to_use = data.base_data;
} else {
console.log("UNEXPECTED ERROR: node not found", node_id);
return null;
}
let cur_node = data_to_use.nodeLookup[node_id];

const assembled_mutations = [];

while (cur_node.parent_id !== cur_node.node_id) {
Expand All @@ -17,7 +28,7 @@ function usePerNodeFunctions(data, config) {
)
);
assembled_mutations.push(...filtered_nt_mutations);
cur_node = data.data.nodeLookup[cur_node.parent_id];
cur_node = data_to_use.nodeLookup[cur_node.parent_id];
}
return assembled_mutations;
};
Expand Down

0 comments on commit 0ca50a6

Please sign in to comment.