run_bcftools: Run bcftools

View source: R/run_bcftools.R

run_bcftoolsR Documentation

Run bcftools

Description

Run bcftools

Usage

run_bcftools(
  command = NULL,
  input = NULL,
  output = NULL,
  regions = NULL,
  parallel = FALSE,
  cores = 4,
  execute = TRUE,
  bcftools = NULL,
  version = NULL
)

Arguments

command

bcftools command to run, at present can only choose isec, view or sort

input

vcf files

output

ouput directory or file

regions

Bed formatted regions of interest file

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

bcftools

Path to the bcftools program, required

version

Returns the version number

Value

A list with the bcftools commands

Examples

## Not run: 
bcftools.path <- "/software/bcftools-v1.9/bin/bcftools"

bcftools.version <- run_bcftools(bcftool = bcftools.path,
                                 version = TRUE)

bcftools.version[1]

# bcftools intersect
command <- "isec"

vcfs <- c("test1.vcf","test2.vcf")
vcfs <- paste(vcfs, collapse = " ")

out.directory <- "test_directory"



bcftools.cmd <- run_bcftools(command = command,
                             input = vcfs,
                             output = out.directory,
                             execute = FALSE,
                             bcftools = bcftools.path)
bcftools.cmd

## End(Not run)


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