Skip to content

Commit

Permalink
Merge pull request #167 from naupaka/bioconductor-revisions
Browse files Browse the repository at this point in the history
Thanks to @naupaka for addressing the mega issue related to the Bioconductor section!
  • Loading branch information
ytakemon authored Jan 24, 2023
2 parents 07a8a03 + c28e053 commit 5084e86
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions _episodes_rmd/04-bioconductor-vcfr.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ questions:
objectives:
- "Describe what the Bioconductor repository is and what it is used for"
- "Describe how Bioconductor differs from CRAN"
- "Search Bioconductor for relevent packages"
- "Search Bioconductor for relevant packages"
- "Install a package from Bioconductor"
keypoints:
- "Bioconductor is an alternative package repository for bioinformatics packages."
- "Installing packages from Bioconductor requires a new method, since it is not compatible with the `install.packages()` function used for CRAN."
- "Check Bioconductor to see if there is a package relevent to your analysis before writing code yourself."
- "Check Bioconductor to see if there is a package relevant to your analysis before writing code yourself."
source: Rmd
---

Expand All @@ -21,17 +21,15 @@ source("../bin/chunk-options.R")
knitr_fig_path("04-")
```

<!-- example of rendered lesson https://datacarpentry.org/genomics-r-intro/02-r-basics/index.html -->

## Installing packages from somewhere else besides CRAN?

In some cases, you may want to use a specialized package that is not hosted on [CRAN](https://cran.r-project.org/) (the Comprehensive R Archive Network). This may be because the package is so new that it hasn't yet been submitted to CRAN, or it could be that it is on a focal topic that has an alternative repository. One major example of an alternative repository source is [Bioconductor](https://bioconductor.org/), which has a mission of "promot[ing] the statistical analysis and comprehension of current and emerging high-throughput biological assays." This means that many if not all of the packages available on Bioconductor are focused on the analysis of biological data, and that it can be a great place to look for tools to help you analyze your -omics datasets!
So far we have told you about using packages that are included in the base installation of R (this is what comes with R 'out of the box'), and packages that you can install from [CRAN](https://cran.r-project.org/) (the Comprehensive R Archive Network), which is the primary place many people look for supplemental R packages to install. However, not all R packages are available on CRAN. For bioinformatics-related packages in particular, there is another repository that has many powerful packages that you can install. It is called [Bioconductor](https://bioconductor.org/) and it is a repository specifically focused on bioinformatics packages. [Bioconductor](https://bioconductor.org/) has a mission of "promot[ing] the statistical analysis and comprehension of current and emerging high-throughput biological assays." This means that many if not all of the packages available on Bioconductor are focused on the analysis of biological data, and that it can be a great place to look for tools to help you analyze your -omics datasets!

## So how do I use it?

Since access to the [Bioconductor](https://bioconductor.org/) repository is not built in to base R 'out of the box', there are a couple steps needed to install packages from this alternative source. We will work through the steps (only 2!) to install a package to help with the VCF analysis we are working on, but you can use the same approach to install any of the many thousands of available packages.

![screenshot of bioconductor homepage](fig/bioconductor_website_screenshot.jpg)
![screenshot of bioconductor homepage](../fig/bioconductor_website_screenshot.jpg)

## First, install the `BiocManager` package

Expand All @@ -49,13 +47,19 @@ To check if this worked (and also so you can make a note of the version for repr
BiocManager::version()
```

# Second, install the vcfR package from Bioconductor using `BiocManager`
## Second, install the vcfR package from Bioconductor using `BiocManager`

> ## Head's Up: Installing vcfR may take a while due to numerous dependencies
>
> Just be aware that installing packages that have many dependencies can take a while.
>
{: .callout}

```{r install-vcfR, eval = FALSE}
# install the vcfR package from bioconductor using BiocManager::install()
BiocManager::install("vcfR")
```
You may need to also allow it to install some dependencies or update installed packages in order to successfully complete the process.
Depending on your particular system, you may need to also allow it to install some dependencies or update installed packages in order to successfully complete the process.

> ## Note: Installing packages from Bioconductor vs from CRAN
> Some packages begin by being available only on Bioconductor, and then later
Expand All @@ -74,7 +78,7 @@ You may need to also allow it to install some dependencies or update installed p
{: .callout}


# Search for Bioconductor packages based on your analysis needs
## Search for Bioconductor packages based on your analysis needs

While we are only focusing in this workshop on VCF analyses, there are hundreds or thousands of different types of data and analyses that bioinformaticians may want to work with. Sometimes you may get a new dataset and not know exactly where to start with analyzing or visualizing it. The Bioconductor package search view can be a great way to browse through the packages that are available.

Expand All @@ -98,13 +102,18 @@ vcf files in R.

> ## Challenge
>
> Add code chunks to
> - Use the `BiocManager::available()` function to see what packages are available matching a search term.
> - Use the [biocViews](https://bioconductor.org/packages/release/BiocViews.html#___Software) interface to search for packages of interest.
>
> - Install the `BiocManager` package
> - Use that package's `install()` function to install `vcfR`
> - Browse the Bioconductor website to find a second package, and install it
> You may or may not want to try installing the package, since not all dependencies always install easily. However, this will at least let you see what is available.
{: .challenge}

> ## Tip: Refreshing the RStudio package view after installing
>
> If you install a package from Bioconductor, you may need to refresh the RStudio package view to see it in your list. You can do this by clicking the "Refresh" button in the Packages pane of RStudio.
>
{: .callout}

## Resources

- [Bioconductor](https://bioconductor.org/)
Expand Down

0 comments on commit 5084e86

Please sign in to comment.