Skip to content

Commit

Permalink
Merge pull request #75: Clarify supported files
Browse files Browse the repository at this point in the history
  • Loading branch information
victorlin authored Dec 28, 2023
2 parents 4c2b79f + c9000f2 commit 732ecd7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
16 changes: 14 additions & 2 deletions auspice_client_customisation/handleDroppedFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,16 @@ async function collectDatasets(dispatch, files) {
/* loop through files and, if a sidecar, load it into the associated `Dataset` object */
for (const file of files) {
const nameLower = file.name.toLowerCase();
if (filesSeen.has(nameLower) || !nameLower.endsWith("json")) continue;
if (filesSeen.has(nameLower)) continue;

if (!nameLower.endsWith("json")) {
dispatch(errorNotification({
message: `Failed to load ${file.name}.`,
details: "Please refer to the homepage for supported files, and check that your file is named properly."
}));
continue;
}

for (const [sidecarSuffix, sidecarPropName] of Object.entries(sidecarMappings)) {
if (nameLower.endsWith(`_${sidecarSuffix}.json`)) { // filename looks like a sidecar file?
filesSeen.add(nameLower);
Expand All @@ -125,7 +134,10 @@ async function collectDatasets(dispatch, files) {
}
logs.push(`Read ${file.name} as a sidecar file of ${datasets[mainNameLower].name}`);
} else {
logs.push(`Sidecar file ${file.name} has no associated main dataset file and has been skipped.`);
dispatch(errorNotification({
message: `Failed to load ${file.name}.`,
details: "Does the file prefix match a corresponding dataset?"
}));
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions auspice_client_customisation/splash.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ const SplashContent = (props) => {
for how to run the bioinformatics tools to generate these datasets.
Note that it's possible to drag on multiple datasets, however at most two will be loaded, and it's not possible to control the ordering of these datasets!
</li>
<li>A nextstrain narrative and associated datasets (JSONs) - see the
<li>A nextstrain narrative ending in <Bold>.md</Bold> and associated datasets (JSONs) - see the
<a href="https://docs.nextstrain.org/en/latest/tutorials/narratives-how-to-write.html"> Nextstrain docs </a>
for how author a narrative. Each dataset the narrative references should have a filename which is the
<a href="https://en.wikipedia.org/wiki/URL"> URL path</a> but with forward slashes replaced with underscores ("/"→"_") and a ".json" suffix.
<a href="https://en.wikipedia.org/wiki/URL"> URL path</a> but with forward slashes replaced with underscores ("/"→"_") and a <Bold>.json</Bold> suffix.
Only one narrative can be dropped on at a time!
</li>
<li>
A phylogenetic tree in
<a href="https://en.wikipedia.org/wiki/Newick_format"> Newick format</a>
<a href="https://en.wikipedia.org/wiki/Newick_format"> Newick format</a> with name ending in <Bold>.new</Bold>, <Bold>.nwk</Bold>, or <Bold>.newick</Bold>.
</li>
<li>
Additional metadata as a CSV/TSV (drop this on once the tree has loaded).
Expand Down

0 comments on commit 732ecd7

Please sign in to comment.