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

PR2: Fix spelling errors and add things to dictionary.txt #257

Merged
merged 9 commits into from
Oct 2, 2020
Merged
Show file tree
Hide file tree
Changes from 6 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
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ What things should reviewers look out for?
### Formatting Checks
* [ ] Removed any manual numbering of sections.
* [ ] Removed any instances of chunk naming.
* [ ] Spell checked any Rmd file or md file.
* [ ] Spell checked any `.Rmd` file or md file.
* [ ] Comments and documentation are up to date.
* [ ] All links have been checked and are properly formatted.

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/style-and-sp-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
result: ${{ steps.spell_check_run.outputs.sp_chk_results }}
run: |
cat spell_check_results.tsv
if (( $result > 340 )); then
if (( $result > 2 )); then
echo Too many spelling errors, $result
exit 1
fi
Expand Down
8 changes: 4 additions & 4 deletions 01-getting-started/getting-started.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ This tutorial has follow-along examples for use with refine.bio downloads.

## About how this tutorial book is structured

This tutorial contains follow-along analysis examples for refinebio gene expression data.
This tutorial contains follow-along analysis examples for refine.bio gene expression data.
The analysis examples are organized by technology: ["microarray"](https://alexslemonade.github.io/refinebio-examples/02-microarray/intro-to-microarray.nb.html) or ["RNA-seq"](https://alexslemonade.github.io/refinebio-examples/03-rna-seq/intro-to-rna-seq.nb.html), in addition to an ["Advanced Topics"](https://alexslemonade.github.io/refinebio-examples/04-advanced-topics/intro-to-advanced-topics.nb.html) section.
Each analysis is self-contained and provides information with how to obtain the dataset used in the example from refine.bio.
We encourage you to download the [`.Rmd`](http://rmarkdown.rstudio.com) and follow the "getting started" section in the example before diving into our analysis examples.
Expand All @@ -41,7 +41,7 @@ We encourage you to download the [`.Rmd`](http://rmarkdown.rstudio.com) and foll
- A README that introduces you to the analyses, concepts, requirements, and workflows for that module.
- An R Notebook which consists of:
- An R markdown (`.Rmd`) file(s) that you can use in RStudio to run the analysis and contains it's own "getting started" section which describes how to download the example dataset from refine.bio.
- An nb.html file that is the resulting output of the Rmd file rendered as an HTML file.
- An nb.html file that is the resulting output of the `.Rmd` file rendered as an HTML file.

## What you need to install to run the examples

Expand Down Expand Up @@ -87,12 +87,12 @@ Saving one of our R Markdowns (the files that end in `.Rmd`) on your computer wi

See [this guide using to R Notebooks](https://bookdown.org/yihui/rmarkdown/notebook.html#using-notebooks) for more information about inserting and executing code chunks.

## An important note about file paths and Rmds
## An important note about file paths and `.Rmd`s

A `current directory` refers to where R will look for files or otherwise operate.
Directories are the folders of files on your computer; a file path is the series of folders leading to the file you are referring to.
R Markdown documents have the `current directory` always set as wherever the `.Rmd` file itself is saved.
This means all file paths specified in the `.Rmd` must be specified _relative_ to the location of the Rmd.
This means all file paths specified in the `.Rmd` must be specified _relative_ to the location of the `.Rmd`.

For more practice with setting file paths in `.Rmd` files see these:

Expand Down
10 changes: 5 additions & 5 deletions 01-getting-started/getting-started.html
Original file line number Diff line number Diff line change
Expand Up @@ -1693,7 +1693,7 @@ <h2><span class="header-section-number">0.1</span> About refine.bio</h2>
</div>
<div id="about-how-this-tutorial-book-is-structured" class="section level2">
<h2><span class="header-section-number">0.2</span> About how this tutorial book is structured</h2>
<p>This tutorial contains follow-along analysis examples for refinebio gene expression data. The analysis examples are organized by technology: <a href="https://alexslemonade.github.io/refinebio-examples/02-microarray/intro-to-microarray.nb.html">“microarray”</a> or <a href="https://alexslemonade.github.io/refinebio-examples/03-rna-seq/intro-to-rna-seq.nb.html">“RNA-seq”</a>, in addition to an <a href="https://alexslemonade.github.io/refinebio-examples/04-advanced-topics/intro-to-advanced-topics.nb.html">“Advanced Topics”</a> section. Each analysis is self-contained and provides information with how to obtain the dataset used in the example from refine.bio. We encourage you to download the <a href="http://rmarkdown.rstudio.com"><code>.Rmd</code></a> and follow the “getting started” section in the example before diving into our analysis examples.</p>
<p>This tutorial contains follow-along analysis examples for refine.bio gene expression data. The analysis examples are organized by technology: <a href="https://alexslemonade.github.io/refinebio-examples/02-microarray/intro-to-microarray.nb.html">“microarray”</a> or <a href="https://alexslemonade.github.io/refinebio-examples/03-rna-seq/intro-to-rna-seq.nb.html">“RNA-seq”</a>, in addition to an <a href="https://alexslemonade.github.io/refinebio-examples/04-advanced-topics/intro-to-advanced-topics.nb.html">“Advanced Topics”</a> section. Each analysis is self-contained and provides information with how to obtain the dataset used in the example from refine.bio. We encourage you to download the <a href="http://rmarkdown.rstudio.com"><code>.Rmd</code></a> and follow the “getting started” section in the example before diving into our analysis examples.</p>
<p><strong>Each analysis contains:</strong></p>
<ul>
<li>A README that introduces you to the analyses, concepts, requirements, and workflows for that module.<br />
Expand All @@ -1702,7 +1702,7 @@ <h2><span class="header-section-number">0.2</span> About how this tutorial book
<ul>
<li>An R markdown (<code>.Rmd</code>) file(s) that you can use in RStudio to run the analysis and contains it’s own “getting started” section which describes how to download the example dataset from refine.bio.<br />
</li>
<li>An nb.html file that is the resulting output of the Rmd file rendered as an HTML file.</li>
<li>An nb.html file that is the resulting output of the <code>.Rmd</code> file rendered as an HTML file.</li>
</ul></li>
</ul>
</div>
Expand Down Expand Up @@ -1738,9 +1738,9 @@ <h2><span class="header-section-number">0.5</span> How to use R Markdown Documen
<p>R Markdown documents also have the added benefit of producing HTML file output that is nicely rendered and easy to read. Saving one of our R Markdowns (the files that end in <code>.Rmd</code>) on your computer will create an HTML file containing the code and output to be saved alongside it (will end in <code>.nb.html</code>).</p>
<p>See <a href="https://bookdown.org/yihui/rmarkdown/notebook.html#using-notebooks">this guide using to R Notebooks</a> for more information about inserting and executing code chunks.</p>
</div>
<div id="an-important-note-about-file-paths-and-rmds" class="section level2">
<h2><span class="header-section-number">0.6</span> An important note about file paths and Rmds</h2>
<p>A <code>current directory</code> refers to where R will look for files or otherwise operate. Directories are the folders of files on your computer; a file path is the series of folders leading to the file you are referring to. R Markdown documents have the <code>current directory</code> always set as wherever the <code>.Rmd</code> file itself is saved. This means all file paths specified in the <code>.Rmd</code> must be specified <em>relative</em> to the location of the Rmd.</p>
<div id="an-important-note-about-file-paths-and-.rmds" class="section level2">
<h2><span class="header-section-number">0.6</span> An important note about file paths and <code>.Rmd</code>s</h2>
<p>A <code>current directory</code> refers to where R will look for files or otherwise operate. Directories are the folders of files on your computer; a file path is the series of folders leading to the file you are referring to. R Markdown documents have the <code>current directory</code> always set as wherever the <code>.Rmd</code> file itself is saved. This means all file paths specified in the <code>.Rmd</code> must be specified <em>relative</em> to the location of the <code>.Rmd</code>.</p>
<p>For more practice with setting file paths in <code>.Rmd</code> files see these:</p>
<ul>
<li><a href="https://beanumber.github.io/sds192/lab-import.html#paths">This handy course chapter from Baumer and Crouser</a></li>
Expand Down
54 changes: 27 additions & 27 deletions 02-microarray/clustering_microarray_01_heatmap.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@ This notebook illustrates one way that you can use microarray data from refine.b
# How to run this example

For general information about our tutorials and the basic software packages you will need, please see our ['Getting Started' section](https://alexslemonade.github.io/refinebio-examples/01-getting-started/getting-started.html#how-this-tutorial-is-structured).
We recommend taking a look at our [Resources for Learning R](https://alexslemonade.github.io/refinebio-examples/01-getting-started/getting-started.html#resources-for-learning-r) if you have not written code in R before.
We recommend taking a look at our [Resources for Learning R](https://alexslemonade.github.io/refinebio-examples/01-getting-started/getting-started.html#resources-for-learning-r) if you have not written code in R before.

## Obtain the `.Rmd` file

To run this example yourself, [download the `.Rmd` for this analysis by clicking this link](https://alexslemonade.github.io/refinebio-examples/02-microarray/clustering_microarray_01_heatmap.Rmd).

You can open this `.Rmd` file in RStudio and follow the rest of these steps from there. (See our [section about getting started with R notebooks](https://alexslemonade.github.io/refinebio-examples/01-getting-started/getting-started.html#how-to-get-and-use-rmds) if you are unfamiliar with `.Rmd` files.)
Clicking this link will most likely send this to your downloads folder on your computer.
Clicking this link will most likely send this to your downloads folder on your computer.
Move this `.Rmd` file to where you would like this example and its files to be stored.

## Set up your analysis folders
## Set up your analysis folders

Good file organization is helpful for keeping your data analysis project on track!
We have set up some code that will automatically set up a folder structure for you.
Run this next chunk to set up your folders!
We have set up some code that will automatically set up a folder structure for you.
Run this next chunk to set up your folders!

If you have trouble running this chunk, see our [introduction to using `.Rmd`s](https://alexslemonade.github.io/refinebio-examples/01-getting-started/getting-started.html#how-to-get-and-use-rmds) for more resources and explanations.
If you have trouble running this chunk, see our [introduction to using `.Rmd`s](https://alexslemonade.github.io/refinebio-examples/01-getting-started/getting-started.html#how-to-get-and-use-rmds) for more resources and explanations.

```{r}
# Create the data folder if it doesn't exist
Expand Down Expand Up @@ -63,7 +63,7 @@ In the same place you put this `.Rmd` file, you should now have three new empty

## Obtain the dataset from refine.bio

For general information about downloading data for these examples, see our ['Getting Started' section](https://alexslemonade.github.io/refinebio-examples/01-getting-started/getting-started.html#how-to-get-the-data).
For general information about downloading data for these examples, see our ['Getting Started' section](https://alexslemonade.github.io/refinebio-examples/01-getting-started/getting-started.html#how-to-get-the-data).

Go to this [dataset's page on refine.bio](https://www.refine.bio/experiments/GSE24862).

Expand All @@ -76,7 +76,7 @@ Fill out the pop up window with your email and our Terms and Conditions:
<img src="https://github.com/AlexsLemonade/refinebio-examples/raw/e140face75daa6d2c34e30a4755c362e6039a677/template/screenshots/download-email.png" width=500>

It may take a few minutes for the dataset to process.
You will get an email when it is ready.
You will get an email when it is ready.

## About the dataset we are using for this example

Expand All @@ -87,37 +87,37 @@ The samples were obtained from three PLX4032-sensitive parental and three PLX403

## Place the dataset in your new `data/` folder

refine.bio will send you a download button in the email when it is ready.
Follow the prompt to download a zip file that has a name with a series of letters and numbers and ends in `.zip`.
refine.bio will send you a download button in the email when it is ready.
Follow the prompt to download a zip file that has a name with a series of letters and numbers and ends in `.zip`.
Double clicking should unzip this for you and create a folder of the same name.

<img src="https://github.com/AlexsLemonade/refinebio-examples/raw/e140face75daa6d2c34e30a4755c362e6039a677/template/screenshots/download-folder-structure.png" width=400>
<img src="https://github.com/AlexsLemonade/refinebio-examples/raw/e140face75daa6d2c34e30a4755c362e6039a677/template/screenshots/download-folder-structure.png" width=400>

For more details on the contents of this folder see [these docs on refine.bio](http://docs.refine.bio/en/latest/main_text.html#downloadable-files).

The `<experiment_accession_id>` folder has the data and metadata TSV files you will need for this example analysis.
Experiment accession ids usually look something like `GSE1235` or `SRP12345`.
Experiment accession ids usually look something like `GSE1235` or `SRP12345`.

Copy and paste the `GSE24862` folder into your newly created `data/` folder.

## Check out our file structure!

Your new analysis folder should contain:
Your new analysis folder should contain:

- The example analysis Rmd you downloaded
- The example analysis `.Rmd` you downloaded
- A folder called "data" which contains:
- The `GSE24862` folder which contains:
- The gene expression
- The metadata TSV
- A folder for `plots` (currently empty)
- A folder for `results` (currently empty)
Your example analysis folder should now look something like this (except with respective experiment accession id and analysis notebook name you are using):

Your example analysis folder should now look something like this (except with respective experiment accession ID and analysis notebook name you are using):

<img src="https://github.com/AlexsLemonade/refinebio-examples/raw/e140face75daa6d2c34e30a4755c362e6039a677/template/screenshots/analysis-folder-structure.png" width=400>

In order for our example here to run without a hitch, we need these files to be in these locations so we've constructed a test to check before we get started with the analysis.
Run this chunk to double check that your files are in the right place.
In order for our example here to run without a hitch, we need these files to be in these locations so we've constructed a test to check before we get started with the analysis.
Run this chunk to double check that your files are in the right place.

```{r}
# Define the file path to the data directory
Expand All @@ -132,13 +132,13 @@ file.exists(file.path(data_dir, "metadata_GSE24862.tsv"))

If the chunk above printed out `FALSE` to either of those tests, you won't be able to run this analysis _as is_ until those files are in the appropriate place.

If the concept of a "file path" is unfamiliar to you; we recommend taking a look at our [section about file paths](https://alexslemonade.github.io/refinebio-examples/01-getting-started/getting-started.html#an-important-note-about-file-paths-and-Rmds).
If the concept of a "file path" is unfamiliar to you; we recommend taking a look at our [section about file paths](https://alexslemonade.github.io/refinebio-examples/01-getting-started/getting-started.html#an-important-note-about-file-paths-and-Rmds).

# Using a different refine.bio dataset with this analysis?

If you'd like to adapt an example analysis to use a different dataset from [refine.bio](https://www.refine.bio/), we recommend placing the files in the `data/` directory you created and changing the filenames and paths in the notebook to match these files (we've put comments to signify where you would need to change the code).
We suggest saving plots and results to `plots/` and `results/` directories, respectively, as these are automatically created by the notebook.
From here you can customize this analysis example to fit your own scientific questions and preferences.
From here you can customize this analysis example to fit your own scientific questions and preferences.

***

Expand Down Expand Up @@ -196,7 +196,7 @@ Let's take a look at the metadata object that we read into the R environment.
head(metadata)
```

Now let's ensure that the metadata and data are in the same sample order.
Now let's ensure that the metadata and data are in the same sample order.

```{r}
# Make the data in the order of the metadata
Expand All @@ -211,7 +211,7 @@ Now we are going to use a combination of functions from base R and the `pheatmap
## Choose genes of interest

Although you may want to create a heatmap including all of the genes in the set, alternatively, the heatmap could be created using only genes of interest.
For this example, we will sort genes by variance, but there are many alternative criterion by which you may want to sort your genes <i>eg</i> fold change, t-statistic, membership to a particular gene ontology, so on.
For this example, we will sort genes by variance, but there are many alternative criterion by which you may want to sort your genes <i>e.g.</i> fold change, t-statistic, membership to a particular gene ontology, so on.

```{r}
# Calculate the variance for each gene
Expand Down Expand Up @@ -256,7 +256,7 @@ First let's save our clustered heatmap.
You can easily switch this to save to a JPEG or TIFF by changing the function and file name within the function to the respective file suffix.

```{r}
# Open a png file
# Open a PNG file
png(file.path(
plots_dir,
"GSE24862_heatmap_non_annotated.png" # Replace file name with a relevant output plot name
Expand All @@ -265,7 +265,7 @@ png(file.path(
# Print your heatmap
heatmap

# Close the png file:
# Close the PNG file:
dev.off()
```

Expand Down Expand Up @@ -341,7 +341,7 @@ png(file.path(
# Print your heatmap
heatmap_annotated

# Close the png file:
# Close the PNG file:
dev.off()
```

Expand All @@ -352,8 +352,8 @@ dev.off()

# Print session info

At the end of every analysis, before saving your notebook, we recommend printing out your session info.
This helps make your code more reproducible by recording what versions of softwares and packages you used to run this.
At the end of every analysis, before saving your notebook, we recommend printing out your session info.
This helps make your code more reproducible by recording what versions of software and packages you used to run this.

```{r}
# Print session info
Expand Down
24 changes: 12 additions & 12 deletions 02-microarray/clustering_microarray_01_heatmap.html

Large diffs are not rendered by default.

Loading