Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Improve TSV examples #1638

Merged
merged 4 commits into from
Mar 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 16 additions & 20 deletions docs/advanced-functionality/drag-drop-csv-tsv.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,31 @@ The general format is compatible with other popular tools such as `MicroReact <h
Example:
--------

A TSV file as follows can be dragged onto `nextstrain.org/zika <https://nextstrain.org/zika>`__ to add a "secret" color-by:
A :download:`small TSV file <../assets/extra-data.tsv>` with the following data:

.. code:: text
.. csv-table::
:file: ../assets/extra-data.tsv
:delim: tab

strain secret
USVI/19/2016 A
USVI/28/2016 B
USVI/41/2016 C
USVI/42/2016 C
can be dragged onto `nextstrain.org/zika <https://nextstrain.org/zika>`_ to add a "secret" color-by:

.. figure:: ../assets/csv-extra-data.png
:alt: auspice with extra data shown via csv
.. figure:: ../assets/extra-data.png
:alt: Auspice with extra data shown via TSV

auspice with extra data shown via csv
Auspice with extra data shown via TSV

A more complex metadata file may look like the following, which makes use of additional features available. This defines colours for the metadata (e.g. ``A`` is yellow, ``B`` is orange) as well as associating strains with (made up) geographic coordinates.
A :download:`more complex TSV file <../assets/extra-data-2.tsv>` can add more data to make use of additional features available:

.. code:: text
.. csv-table::
:file: ../assets/extra-data-2.tsv
:delim: tab

strain secret secret__colour latitude longitude
USVI/19/2016 A #f4e409 0 -120
USVI/28/2016 B #f49015 0 -115
USVI/41/2016 C #710000 0 -100
USVI/42/2016 C #710000 0 -120
This defines colours for the metadata (e.g. ``A`` is yellow, ``B`` is orange) as well as associating strains with (made up) geographic coordinates. When dragged onto `nextstrain.org/zika`_, it looks like:

.. figure:: ../assets/csv-extra-data-2.png
:alt: auspice with extra data shown via csv
.. figure:: ../assets/extra-data-2.png
:alt: Auspice with extra data shown via TSV

auspice with extra data shown via csv
Auspice with extra data shown via TSV

Adding extra colorings and filters
----------------------------------
Expand Down
File renamed without changes
5 changes: 5 additions & 0 deletions docs/assets/extra-data-2.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
strain secret secret__colour latitude longitude
USVI/19/2016 A #f4e409 0 -120
USVI/28/2016 B #f49015 0 -115
USVI/41/2016 C #710000 0 -100
USVI/42/2016 C #710000 0 -120
File renamed without changes
5 changes: 5 additions & 0 deletions docs/assets/extra-data.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
strain secret
USVI/19/2016 A
USVI/28/2016 B
USVI/41/2016 C
USVI/42/2016 C