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

feat: extend tree extensions node clade attrs to be more descriptive #741

Merged
merged 1 commit into from
Mar 4, 2022

Conversation

ivan-aksamentov
Copy link
Member

@ivan-aksamentov ivan-aksamentov commented Feb 24, 2022

Extends the Nextclade's Augur tree extension object to provide more data (friendly name of the column and description for the tooltip).

Replaces the meta.extensions.nextclade.clade_node_attr_keysarray of strings with meta.extensions.nextclade.clade_node_attrs array of objects in the auspice tree json.

The expected format is as follows:

{
  "meta": {
    "extensions": {
      "nextclade": {
        "clade_node_attrs": [
          {
            "name": "pango_lineage",
            "displayName": "Pango lineage (Nextclade)",
            "description": "Pango lineage as inferred by Nextclade from the nearest neighbour in the reference tree. 98% accurate for recent sequences, for higher accuracy use dedicated pangolin software in UShER or pangoLEARN mode"
            
          },
          {
            "name": "GISAID_clade",
            "displayName": "GISAID clade",
            "description": "Clades as defined by GISAID"
          }
        ]
      }
    }
  }
}

All keys are optional, but if at least one key is missing, the object will be ignored. Same as if it's not an object. The entire extension object is optional as well. More fields can be added, if necessary.

Testing: paste the example from above into the existing tree meta object and drop it into the web's advanced mode or into cli's --input-tree.

00

01

Extends the Nextclade's Augur tree extension object to provide more data (friendly name of the column and description for the tooltip).

Replaces the `meta.extensions.nextclade.clade_node_attr_keys`array of strings with `meta.extensions.nextclade.clade_node_attrs` array of objects in the auspice tree json.

The expected format is as follows:

```json
{
  "meta": {
    "extensions": {
      "nextclade": {
        "clade_node_attrs": [
          {
            "name": "pango_lineage",
            "displayName": "Pango lineage (Nextclade)",
            "description": "Pango lineage as inferred by Nextclade from the nearest neighbour in the reference tree. 98% accurate for recent sequences, for higher accuracy use dedicated pangolin software in UShER or pangoLEARN mode",
            
          },
          {
            "name": "GISAID_clade",
            "displayName": "GISAID clade",
            "description": "Clades as defined by GISAID"
          }
        ]
      }
    }
  }
}
```

All keys are optional, but if at least one key is missing, the object will be ignored. Sam as if it's not an object. The entire extension object is optional as well. More fields can be added, if necessary.

Testing: paste the example from above into the existing tree `meta` object and drop it into the web's advanced mode or into cli's `--input-tree`.
@vercel
Copy link

vercel bot commented Feb 24, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/nextstrain/nextclade/EFZfsyC3VMuNcCcfoUVHWx3kcWDy
✅ Preview: https://nextclade-git-feat-better-clade-node-attrs-nextstrain.vercel.app

@corneliusroemer
Copy link
Member

Works great, will merge so I can use this on master with a dataset that enables this mode.

@corneliusroemer corneliusroemer merged commit bfc004e into master Mar 4, 2022
@corneliusroemer corneliusroemer deleted the feat/better-clade-node-attrs branch March 4, 2022 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

2 participants