run_htseq_count: Run HtSeq-Count

Description Usage Arguments Value Examples

View source: R/run_htseq_count.R

Description

Runs the htseq-count program

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
run_htseq_count(
  input = NULL,
  output = NULL,
  mode = NULL,
  type = NULL,
  attribute = NULL,
  format = NULL,
  gtf = NULL,
  parallel = FALSE,
  cores = 4,
  htseq_count = NULL,
  version = FALSE
)

Arguments

input

List of aligned files in sam or bam format, required

output

List of file names for output,

mode

Mode to handle reads overlapping more than one feature (choices: union, intersection-strict, intersection- nonempty; default: union)

type

Feature type (3rd column in GTF file) to be used,

attribute

GTF attribute to be used as feature ID,

format

Type of <alignment_file> data, can be either sam, bam or auto

gtf

Path to the GTF file

parallel

Run in parallel, default set to FALSE

cores

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

htseq_count

Path to the htseq-count program program, required

version

Returns the version number

Value

A list with the htseq_count commands

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
## Not run: 
path <- "/home/gmh5n/.local/bin/htseq-count"

# Version
run_htseq_count(htseq_count = path,
                version = TRUE)

hisat2.alignments.dir <- "/path/to/hisat/alignments/directory"
bam.files <- list.files(path = hisat2.alignments.dir,
                       pattern = "sorted.bam$",
                       full.names = TRUE,
                       recursive = TRUE)
counts.dir <- "counts_dir"
htseq.counts.files <- paste(counts.dir,
                            paste(list.files(path = hisat2.alignments.dir,recursive = FALSE),
                            "counts.txt",sep = "_"),
                            sep = "/")

# Path to the gtf file
gtf.file <- "/path/to/gtffile"

htseq.counts.cmds <- run_htseq_count(input = bam.files,
                                     output = htseq.counts.files,
                                     mode = "intersection-nonempty",
                                     type = "gene",
                                     attribute = "ID",
                                     format = "bam",
                                     gtf = gtf.file,
                                     htseq_count = path)
htseq.counts.cmds

## End(Not run)

GrahamHamilton/pipelineTools documentation built on June 19, 2021, 1:08 p.m.