diff --git a/src/components/tree/infoPanels/MutationTable.js b/src/components/tree/infoPanels/MutationTable.js index 5a306ecb2..a1c103c22 100644 --- a/src/components/tree/infoPanels/MutationTable.js +++ b/src/components/tree/infoPanels/MutationTable.js @@ -1,7 +1,8 @@ import React from "react"; import styled from 'styled-components'; +import { FaInfoCircle } from "react-icons/fa"; import { getBranchMutations, getTipChanges } from "../../../util/treeMiscHelpers"; - +import { StyledTooltip } from "../../controls/styles"; const Button = styled.button` border: 0px; @@ -132,6 +133,49 @@ const displayGeneMutations = (gene, mutsPerCat) => { ); }; +const InfoContainer = styled.span` + padding-left: 10px; + cursor: help; + color: #888; +`; + +const branchMutationInfo = (
+ A summary of mutations inferred to have occurred on this branch. + Mutations are grouped into one of the following (mutually exclusive) categories, + with the first matching category used: + +
    +
  1. Undeletions: a change from a '-' character to a base; beware that these are often bioinformatics artifacts
  2. +
  3. Gaps: A change to a '-' character, indicating a missing base; these can indicate deletions but sometimes areas of no coverage are filled with gaps
  4. +
  5. Ns: Typically due to lack of sequence coverage or ambiguity at this position (Nucleotides only)
  6. +
  7. Homoplasies: a mutation that has also been observed elsewhere on the tree
  8. +
  9. Unique: Mutations which are only observed on this branch
  10. +
+ + Reversions to Root is an additional category which highlights those mutations which return the state to that of the root. + Mutations in this category will also appear one of the five categories listed above. +

+ Gaps and Ns are grouped into intervals, as they frequently occur in succession. + Click below to copy all changes to clipboard to see the full list. +

); + +const tipChangesInfo = (
+ A summary of sequence changes between the root and the selected tip. + Changes are grouped into one of the following (mutually exclusive) categories, + with the first matching category used: + +
    +
  1. Gaps: A change to a '-' character, indicating a missing base; these can indicate deletions but sometimes areas of no coverage are filled with gaps
  2. +
  3. Ns: Typically due to lack of sequence coverage or ambiguity at this position (Nucleotides only)
  4. +
  5. Reversions to root: The tip state is the same as the root state, however this has changed and been reverted along the way
  6. +
  7. Changes: The tip state differs from the root state
  8. +
+ + Gaps and Ns are grouped into intervals, as they frequently occur in succession. + Click below to copy all changes to clipboard to see the full list. +
); + + export const MutationTable = ({node, geneSortFn, isTip, observedMutations}) => { const categorisedMutations = isTip ? getTipChanges(node) : @@ -148,8 +192,16 @@ export const MutationTable = ({node, geneSortFn, isTip, observedMutations}) => { return ( <> - {isTip ? `Sequence changes observed (from root):` : `Mutations observed on branch:`} + {isTip ? `Sequence changes observed (from root)` : `Mutations observed on branch`} + + + + + + {isTip ? tipChangesInfo : branchMutationInfo} + + {Object.keys(categorisedMutations).sort(geneSortFn).map(