Skip to content
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
102 changes: 94 additions & 8 deletions 07_wrapping_up.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,51 @@ ottrpal::include_slide("https://docs.google.com/presentation/d/1fu-KfdN2ldOXB49o

To summarize all of the considerations and best practices discussed in the chapters before this, the first section of this final chapter will walk through an example, step-by-step, of iteratively building up an expository data visualization. Each step or iteration showcases a different view of the same data as we refine how to effectively communicate the message we want to convey for the audience.

Throughout this example exercise, you will see several types of specially-colored boxes. In particular, there are four to which you should pay special attention.

One box highlights potential ethical issues and best practices to avoid those issues.

<div class = "ethics">

In this box, you'll find reminders of the ethical considerations you should be particularly aware of while building data visualizations as well as steps you can take to ensure best practices.

</div>

Another box highlights potential accessibility issues and best practices to avoid those issues.

<div class = "accessibility">

In this box, you'll find reminders of the accessibility considerations you should be particularly aware of while building data visualizations. These include considerations for specific audience groups as well as considerations for increasing clarity for the audience in general. These boxes will include steps you can take to ensure best practices.

</div>

One box highlights specific thought questions or prompts for you to consider as you work through this example.

::: {.emphasis_block}

<div class = "reflection">

In this box, you'll find a specific prompt which poses a thought question about the material for you to consider.

</div>

<details><summary>Example answer in click to expand section</summary>

In this click to expand section, you'll find a possible answer to the thought question.

</details>

:::

The final box often follows the thought question box, but not always. It highlights where within the course various topics were covered.

<div class = "notice">

In this box, you'll find information connecting topics to where they were covered in the course in case you want to review those topics.

</div>


{{< include _example_data_description.qmd >}}

:::{.emphasis_block}
Expand Down Expand Up @@ -160,7 +205,7 @@ It looks even more convincing that chocolate candy is among the most liked candy

<div class = "accessibility">

When using color to distinguish groups, an important accessibility step is to use shape as a redundant way to distinguish groups. This redundancy increases accessibility for those with color vision deficiency.
When using color to distinguish groups, an important accessibility step is to use shape as a redundant way to distinguish groups, especially if the color palette being used isn't necessarily color vision deficiency friendly. This redundancy increases accessibility for those with color vision deficiency.

</div>

Expand All @@ -169,6 +214,12 @@ When using color to distinguish groups, an important accessibility step is to us

{{< include _example_iter5_adjust_points.qmd >}}

<div class = "accessibility">

When using color to distinguish groups, to increase accessibility, use tools to check your color palette to see if the colors can be distinguished by those with color vision deficiency.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
When using color to distinguish groups, to increase accessibility, use tools to check your color palette to see if the colors can be distinguished by those with color vision deficiency.
When using color to distinguish groups, to increase accessibility, use tools (such as this [simulator](https://www.color-blindness.com/coblis-color-blindness-simulator/)to check your color palette to see if the colors can be distinguished by those with color vision deficiency. Use color pallets that were designed for color deficiency such as [viridis in R](https://cran.r-project.org/web/packages/viridis/vignettes/intro-to-viridis.html) and [python](https://matplotlib.org/stable/users/explain/colors/colormaps.html).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going to add a tip box when I wrote that section later today or tomorrow to point them to the section with that info. But if you'd like more info here, I can expand it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've referenced this suggestion in an issue to make sure I handle this improvement


</div>

#### Ordering of axes to promote readability

{{< include _example_iter6_order_axes.qmd >}}
Expand Down Expand Up @@ -227,6 +278,22 @@ But we're not done yet....
ottrpal::include_slide("https://docs.google.com/presentation/d/1fu-KfdN2ldOXB49o9zdpurFbVvl1bOh8cfQ3vu0szk4/edit?slide=id.g3bb275f27df_0_20#slide=id.g3bb275f27df_0_20")
```

:::{.emphasis_block}

<div class = "reflection">

What might be a good caption for this expository data visualization? Try writing one! Focus on providing a detailed description of what the plot shows that will help the plot to tell its story and stand alone.

</div>

<details><summary>A possible caption</summary>

**Chocolate is among the most liked candy in 2017.** A survey of potential trick or treaters in 2017 by the University of British Columbia asked how survey respondents felt when they received certain candies. Here each candy is plotted based on the fraction of respondents which viewed that candy with Joy vs the fraction of respondents which viewed that candy with Despair. The upper right corner of the plot represents the most liked candies (lots of joy, little despair), while the bottom left corner represents the least liked candies (more despair, less joy). Candy color and shape is used to separate chocolate candy (brown triangles) from non-chocolate candy (blue circles). Chocolate candy seems to be among the most liked candy with any full-sized candy bar having the most joy and least despair reported.

</details>

:::

#### Going further

The dataset is an open dataset, meaning that it is available for you to explore and visualize on your own!
Expand All @@ -237,17 +304,36 @@ Perhaps you are interested in how the proportion of indifference affects these r

Perhaps you'd like to try to plot this with a completely different plot type! Whatever your question -- go for it! Practice is one of the best ways to improve your data visualization skills.

## In Summary
## Keep Practicing!

Aim for understanding and readability over complexity. When you are working with your data and selecting your plot, think about what message you want to communicate.
With your data within your research projects, keep practicing thorough exploration prior to intentional and careful data visualization, making design choices to increase the clarity and accessibility of your visualizations for a wide audience.

In addition, more open-ended practice with open source datasets can be found by browsing data visualization communities and challenges such as:

## Checklist
1. [Tidy Tuesday](https://github.com/rfordatascience/tidytuesday)

This checklist contains reminders of considerations and steps you should take while building your expository data visualization in order to minimize its complexity, enhance its clarity and accessibility, and assess its accuracy.
2. [Posit Plotnine challenges](https://github.com/has2k1/plotnine/discussions/categories/2024-plotnine-contest)

{{< include _summary_checklist.qmd >}}
3. [bioviz challenges](http://biovis.net/2026/). Note that these bioviz challenges are more advanced, often describing working with complex multi-omic data and sometimes suggesting that participants should sketch possible visualizations rather than perfectly polishing expository visualization.

## Keep Practicing!
As mentioned within the Field Specific Visualizations chapter, data visualization is commonly used within bioinformatics research to validate models. Researchers may wonder how well their model performs. To answer that question, they may run either experimental or simulated data with known "truth" through the model and compare the model's predictions with the known "truth". Researchers may then wonder why the model is messing up for a prediction that doesn't line up with the observed truth. To answer this, researchers explore specific examples where the known truth and predictions differ and look for patterns.

Two examples of using data visualization to validate models within the bioinformatic literature include:

1. A model (`Xpresso`) which predicts gene expression from gene sequence [@Agarwal_Shendure_2020]. The authors ran the model using sequences of genes with experimentally known expression values and compared the model predictions with the known / observed expression. Figure 3A is an example of this comparison / validation. Other subpanels within the figure explore where the predictions diverge from the observed expression. The authors [provide the data related to this figure](https://www.cell.com/cms/10.1016/j.celrep.2020.107663/attachment/8f2732a1-4b4d-4c39-aae6-5742b2b946af/mmc2.xlsx). Consider recreating Figure 3A or rethink an entirely different or partially different approach for comparing the predictions and the observed expression values.

Give some examples
2. A model (`rhapsodi`) was designed to impute the missing genotypes within sparse single gamete DNA sequencing data [@Carioscia_etal_2022]. As a result of imputing the missing genotypes, the donor haplotypes are phased and recombination break points are discovered. Benchmarking of the model's performance was done using simulated data. Specifically the authors simulated fully known genotype sequences for many gametes from donor haplotypes (keeping track of recombination locations). Then sparsity was introduced through further simulation into these genotype sequences. The model was provided the simulated sparse inputs and the model outputs could be compared with the fully known simulated data. Figure 2 illustrates much of this benchmarking with Figure 2—figure supplement 5 focusing on looking for patterns where truth and predictions differed, specifically for the recombination break points. The [data used to produce that figure is available on the associated GitHub repository](https://github.com/mccoy-lab/transmission-distortion/blob/main/plotting/supp_recomb/fn_fp_tall_df.Rdata). Consider exploring the dataset to look for patterns much like the supplemental figure did.

## In Summary

* Aim for understanding and readability for a broad audience over complexity.
* When you are working with your data and selecting your plot, think about what message you want to communicate.
* Iterate and ask for feedback.
* Carefully check visualizations against data and expectations to ensure accuracy.
* Be careful to avoid common data distortions or unintentional takeaways.

## Checklist

This checklist contains reminders of considerations and steps you should take while building your expository data visualization in order to minimize complexity, enhance clarity, and improve accessibility, as well as assess accuracy.

{{< include _summary_checklist.qmd >}}
Binary file removed assets/box_images/icons8-accessibility-100.png
Binary file not shown.
Binary file removed assets/box_images/icons8-eye-80.png
Binary file not shown.
38 changes: 2 additions & 36 deletions assets/style_ITN.css
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ div.warning{
background-image: url("../assets/box_images/warning.png");
}

div.accessibilitya{
div.accessibility{
border: 4px #e0461b;
border-style: solid;
padding: 1em;
Expand All @@ -326,41 +326,7 @@ div.accessibilitya{
background-color: #e8ebee;
}

div.accessibilitya{
background-image: url("../assets/box_images/icons8-accessibility-100.png")
}

div.accessibilityb{
border: 4px #e0461b;
border-style: solid;
padding: 1em;
margin: 1em 0;
padding-left: 100px;
background-size: 70px;
background-repeat: no-repeat;
background-position: 15px center;
min-height: 120px;
background-color: #e8ebee;
}

div.accessibilityb{
background-image: url("../assets/box_images/icons8-eye-80.png");
}

div.accessibilityc{
border: 4px #e0461b;
border-style: solid;
padding: 1em;
margin: 1em 0;
padding-left: 100px;
background-size: 70px;
background-repeat: no-repeat;
background-position: 15px center;
min-height: 120px;
background-color: #e8ebee;
}

div.accessibilityc{
div.accessibility{
background-image: url("../assets/box_images/eye.png");
}

Expand Down
33 changes: 33 additions & 0 deletions book.bib
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,39 @@ @Manual{rmarkdown2021
url = {https://github.com/rstudio/rmarkdown},
}

@article{Agarwal_Shendure_2020,
title={Predicting mRNA Abundance Directly from Genomic Sequence Using Deep Convolutional Neural Networks},
volume={31},
ISSN={2211-1247},
url={https://www.cell.com/cell-reports/abstract/S2211-1247(20)30616-1},
DOI={10.1016/j.celrep.2020.107663},
abstractNote={<h2>Summary</h2><p>Algorithms that accurately predict gene structure from primary sequence alone were transformative for annotating the human genome. Can we also predict the expression levels of genes based solely on genome sequence? Here, we sought to apply deep convolutional neural networks toward that goal. Surprisingly, a model that includes only promoter sequences and features associated with mRNA stability explains 59% and 71% of variation in steady-state mRNA levels in human and mouse, respectively. This model, termed Xpresso, more than doubles the accuracy of alternative sequence-based models and isolates rules as predictive as models relying on chromatic immunoprecipitation sequencing (ChIP-seq) data. Xpresso recapitulates genome-wide patterns of transcriptional activity, and its residuals can be used to quantify the influence of enhancers, heterochromatic domains, and microRNAs. Model interpretation reveals that promoter-proximal CpG dinucleotides strongly predict transcriptional activity. Looking forward, we propose cell-type-specific gene-expression predictions based solely on primary sequences as a grand challenge for the field.</p>},
number={7},
journal={Cell Reports},
publisher={Elsevier},
author={Agarwal, Vikram and Shendure, Jay},
year={2020},
month=may,
language={English}
}

@article{Carioscia_etal_2022,
title={A method for low-coverage single-gamete sequence analysis demonstrates adherence to Mendel’s first law across a large sample of human sperm},
volume={11},
ISSN={2050-084X},
url={https://doi.org/10.7554/eLife.76383},
DOI={10.7554/eLife.76383},
abstractNote={Recently published single-cell sequencing data from individual human sperm (n=41,189; 969–3377 cells from each of 25 donors) offer an opportunity to investigate questions of inheritance with improved statistical power, but require new methods tailored to these extremely low-coverage data (∼0.01× per cell). To this end, we developed a method, named rhapsodi, that leverages sparse gamete genotype data to phase the diploid genomes of the donor individuals, impute missing gamete genotypes, and discover meiotic recombination breakpoints, benchmarking its performance across a wide range of study designs. We then applied rhapsodi to the sperm sequencing data to investigate adherence to Mendel’s Law of Segregation, which states that the offspring of a diploid, heterozygous parent will inherit either allele with equal probability. While the vast majority of loci adhere to this rule, research in model and non-model organisms has uncovered numerous exceptions whereby ‘selfish’ alleles are disproportionately transmitted to the next generation. Evidence of such ‘transmission distortion’ (TD) in humans remains equivocal in part because scans of human pedigrees have been under-powered to detect small effects. After applying rhapsodi to the sperm data and scanning for evidence of TD, our results exhibited close concordance with binomial expectations under balanced transmission. Together, our work demonstrates that rhapsodi can facilitate novel uses of inferred genotype data and meiotic recombination events, while offering a powerful quantitative framework for testing for TD in other cohorts and study systems.},
journal={eLife},
publisher={eLife Sciences Publications, Ltd},
author={Carioscia, Sara A and Weaver, Kathryn J and Bortvin, Andrew N and Pan, Hao and Ariad, Daniel and Bell, Avery Davis and McCoy, Rajiv C},
editor={Matute, Daniel R and Przeworski, Molly},
year={2022},
month=dec,
pages={e76383}
}


@Book{Xie2018,
title = {R Markdown: The Definitive Guide},
author = {Yihui Xie and J.J. Allaire and Garrett Grolemund},
Expand Down
6 changes: 6 additions & 0 deletions resources/dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ AnVIL
Audiographer
Audiography
automagic
benchmarking
Benchmarking
bioinformatic
Bioinformatic
bioinformatics
bioviz
BIPOC
Bloomberg
bolding
Expand Down Expand Up @@ -78,12 +82,14 @@ Muschelli
NCI
NHGRI
numpy
omic
omics
OTTR
ottrpal
ottrproject
Pandoc
PHQ
Plotnine
png
Preattentive
pre
Expand Down
Loading