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

Introduction

Before you start see the Getting started with BiocProject vignette for the basic information and installation instructions.

How to download the data with your function

There is no limit to the data processing function complexity. For example, the function can retrieve the data from a remote source and then process it.

processFunction =  system.file(
  "extdata",
  "example_peps-master",
  "example_BiocProject_remote",
  "readRemoteData.R",
  package="BiocProject"
)
source(processFunction)

For reference consider the r { basename(processFunction) } function ``` {r echo=FALSE, comment=""} readRemoteData rm(readRemoteData)

and the [PEP](https://pepkit.github.io/) that it uses:

* sample annotation sheet

```r
sampleAnnotation =  system.file(
  "extdata",
  "example_peps-master",
  "example_BiocProject_remote",
  "sample_table.csv",
  package="BiocProject"
)
sampleAnnotationDF = read.table(sampleAnnotation, sep=",", header=TRUE)
knitr::kable(sampleAnnotationDF, format = "html")
configFile =  system.file(
  "extdata",
  "example_peps-master",
  "example_BiocProject_remote",
  "project_config.yaml",
  package="BiocProject"
)
library(pepr)
.printNestedList(yaml::read_yaml(configFile))

Execute the BiocProject function

Get path to the config file

library(BiocProject)
ProjectConfigRemote = system.file(
  "extdata",
  "example_peps-master",
  "example_BiocProject_remote",
  "project_config.yaml",
  package = "BiocProject"
)

Run the BiocProject function. Creates an object returned with the data processing function with a PEP in its metadata slot:

bpRemote = BiocProject(file=ProjectConfigRemote)

With this simple line of code:

  1. the project metadata were read
  2. data processing function was read into R envrionment
  3. data were downloaded from the remote source and processed
  4. everything was conveniently stored in the created object

Let's inspect the results:

bpRemote

And the metadata

metadata(bpRemote)
sampleTable(bpRemote)
config(bpRemote)


pepkit/BiocProject documentation built on July 28, 2023, 2:49 p.m.