run_picard: Run Picard

View source: R/run_picard.R

run_picardR Documentation

Run Picard

Description

Runs the Picard program. Curently only works for CollectRnaSeqMetrics, CollectWgsMetrics & MarkDuplicates command

Usage

run_picard(
  command = NULL,
  input = NULL,
  output = NULL,
  out.dir = NULL,
  refFlat = NULL,
  reference = NULL,
  rRNA.intervals = NULL,
  intervals = NULL,
  strand = NULL,
  remove.duplicates = FALSE,
  sample.name = NULL,
  library = NULL,
  platform = NULL,
  unit = NULL,
  vcf.files = NULL,
  parallel = FALSE,
  cores = 4,
  execute = TRUE,
  picard = NULL
)

Arguments

command

Picard command to run, required

input

List of sorted bam files, required

output

List of output bam files, required for MarkDuplicates command

out.dir

Name of the output directory, required

refFlat

Path to the refFlat file, required for CollectRnaSeqMetrics commmand

reference

Path to the fasta formatted reference for CollectWgsMetrics command

rRNA.intervals

Path to the rRNAintrvals list file

intervals

Path to the intrvals list file, usually the exome coordiantes file

strand

Strand-specific information, "FR" for first strand or "RF" for reverse strand, required for CollectRnaSeqMetrics commmand

remove.duplicates

Set for removing marked duplicates, boolean default set to FALSE

sample.name

List of the sample names, required

library

Read group library

platform

Sequencing platform, e.g. ILLUMINA

unit

Platform unit, e.g. run barcode or number

vcf.files

List of VCF files to sort and merge

parallel

Run in parallel, default set to FALSE

cores

Number of cores/threads to use for parallel processing, default set to 4

execute

Whether to execute the commands or not, default set to TRUE

picard

Path to the Picard program, required

Value

A list with the Picard commands

Examples

## Not run: 
sorted.bam.files <- list.files(path = hisat2.alignments.dir, pattern = "sorted.bam$",
                               full.names = TRUE, recursive = TRUE)
sample_names <- unlist(lapply(strsplit(list.files(path = trimmed_reads_dir,
                       pattern = "*_R1_001.fastq$",
                       full.names = FALSE),"_"), `[[`, 1))
picard.dir <- "picard"
refFlat.file <- "refFlatBDGP6.txt"

run_picard(command = "CollectRnaSeqMetrics",
           input = sorted.bam.files,
           out.dir = picard.dir,
           refFlat = refFlat.file,
           strand = strandedness,
           sample.name = sample.names,
           picard = picard.path)

## End(Not run)


GrahamHamilton/pipelineTools documentation built on Dec. 8, 2024, 3:53 p.m.