run_sgrna_quant {CB2}R Documentation

A function to run a sgRNA quantification algorithm from NGS sample

Description

A function to run a sgRNA quantification algorithm from NGS sample

Usage

run_sgrna_quant(lib_path, design, map_path = NULL, ncores = 1, verbose = FALSE)

Arguments

lib_path

The path of the FASTA file.

design

A table contains the study design. It must contain 'fastq_path' and 'sample_name.'

map_path

The path of file contains gene-sgRNA mapping.

ncores

The number that indicates how many processors will be used with a parallelization. The parallelization will be enabled if users do not set the parameter as '-1“ (it means the full physical cores will be used) or greater than '1'.

verbose

Display some logs during the quantification if it is set to 'TRUE'

Value

It will return a list, and the list contains three elements. The first element (‘count’) is a data frame contains the result of the quantification for each sample. The second element (‘total’) is a numeric vector contains the total number of reads of each sample. The last element (‘sequence’) a data frame contains the sequence of each sgRNA in the library.

Examples

library(CB2)
library(magrittr)
library(tibble)
library(dplyr)
library(glue)
FASTA <- system.file("extdata", "toydata", "small_sample.fasta", package = "CB2")
ex_path <- system.file("extdata", "toydata", package = "CB2")

df_design <- tribble(
  ~group, ~sample_name,
  "Base", "Base1",  
  "Base", "Base2", 
  "High", "High1",
  "High", "High2") %>% 
    mutate(fastq_path = glue("{ex_path}/{sample_name}.fastq"))

cb2_count <- run_sgrna_quant(FASTA, df_design)


[Package CB2 version 1.3.4 Index]