knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

Introduction

phipcc in an R package designed to generate R Markdown reports for case-control studies of PhIP-seq data. phipcc builds analysis targets using the drake package from rOpenSci and Will Landau. phipcc also depends on phipmake, epitopefindr, and AVARDA.

This guide is written specifically for the Larman Lab and MARCC. Eventually I will write a more general guide.

Overview

There are two major phipcc functions that the user will interact with.

Currently, define_plan_case_control() and the subsetquent call to drake::make() can be run on MARCC. However, the final step of knitting the final report depends on pandoc, a dependency that I haven't yet figured out how to get working on MARCC. However, you can copy the necessary files to your local computer and run render_from_template locally.

Software Setup

MARCC

  1. Open an SSH connection to MARCC from a Larman Lab affiliated account. Execute the following commands.

```{bash, eval = FALSE}

cd /data/hlarman1/PhIPdb/Software/install_r_pkg sbatch --export=pkg="brandonsie/drake" installGithub.sh sbatch --export=pkg="brandonsie/phipmake" installGithub.sh sbatch --export=pkg="brandonsie/phipcc" installGithub.sh

Epitopefindr-specific setup

sbatch --export=pkg="brandonsie/epitopefindr" installGithub.sh sbatch --export=pkg="mhahsler/rBLAST" installGithub.sh sbatch --export=pkg="brandonsie/pdfuniter" installGithub.sh sbatch --export=pkg="Biostrings" installBioc.sh sbatch --export=pkg="IRanges" installBioc.sh sbatch --export=pkg="msa" installBioc.sh sbatch --export=pkg="S4Vectors" installBioc.sh

## Local

1. Install [R (3.5+)](https://www.r-project.org/) and [RStudio](https://www.rstudio.com/).   
2. In R console, execute:  

```r

# Required (for steps that are not yet supported on MARCC)
if(!requireNamespace("remotes")) install.packages("remotes")
remotes::install_github("brandonsie/phipcc")
install.packages("pdftools")

# Optional (for steps that can be carried out either locally or on MARCC)
remotes::install_github("ropensci/drake")
remotes::install_github("brandonsie/phipmake")
remotes::install_github("brandonsie/epitopefindr")
remotes::install_github("mhahsler/rBLAST")
remotes::install_github("brandonsie/pdfuniter")
if (!requireNamespace("BiocManager")) install.packages("BiocManager")
BiocManager::install(c("Biostrings", "IRanges", "msa", "S4Vectors"))

Note

epitopefindr also depends on BLAST+ and pdflatex e.g. from TeX Live. I have already installed these for the Larman Lab group on MARCC. From the Larman Lab group MARCC, installations can be sourced by entering: (these steps are already built in to the MARCC phipcc shell script.)

```{bash, eval = FALSE} export PATH=/data/hlarman1/PhIPdb/Software/texlive/2018/bin/x86_64-linux:"$PATH" export PATH=/data/hlarman1/PhIPdb/Software/BLAST+/ncbi-blast-2.8.1+/bin:"$PATH"

# Preparing a Case-Control Study

## Prerequisites

`phipcc` assumes that the `phipmake` pipeline including `AVARDA` has already been run on the data for your case and control samples.

## Configuration File

A template is provided with field descriptions. In R, you can access this template by running `file.copy(system.file("example_config.tsv", package = "phipcc"), "config.tsv")`. For now, you will need to edit fields manually.

```{bash, eval = FALSE}
wd=~/data/PhIPdb/Studies/Brandon/CaseControl/Lupus/virscan/ # Project Directory

Description of Each Field

MARCC phipcc/drake pipeline

```{bash, eval = FALSE}

cd /data/hlarman1/PhIPdb/Software/phipcc wd=~/data/PhIPdb/Studies/Brandon/CaseControl/Lupus/virscan/ # Project Directory sbatch --export=wd=$wd runphipcc.sh

## Local report knitting


1. From your project directory on MARCC, copy the /data/ directory to a new directory on your local computer.
2. Locally from RStudio, execute the following lines: 

```r

setwd("Local_Project_Directory") #Project Directory
phipcc::render_from_template(import_rdata = TRUE)


brandonsie/phipcc documentation built on June 2, 2020, 6:19 a.m.