run_bedtools | R Documentation |
Runs the bedtools program
run_bedtools(
command = NULL,
input = NULL,
reference = NULL,
out.dir = NULL,
sample.names = NULL,
counts = NULL,
name = NULL,
strand = NULL,
parallel = FALSE,
cores = 4,
execute = TRUE,
bedtools = NULL,
version = FALSE
)
command |
Bedtools command to run, at present can only choose from 'coverage' or 'bamtobed'or "getfasta", required |
input |
List of aligned files in bam format, required |
reference |
GTF/GFF3 file for calculating the depth of coverage intervals |
out.dir |
Name of the directory from the Bedtools output |
sample.names |
List of sample names, required |
counts |
Only report the count of overlaps, default set to FALSE |
name |
Use the name field and coordinates for the FASTA header |
strand |
Force strandedness |
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 |
bedtools |
Path to the bedtools program, required |
version |
Returns the version number |
A list with the bedtools commands
## Not run:
# Version
bedtools.path <- "/software/bedtools2/bin/bedtools"
bedtools.version <- run_bedtools(bedtools = bedtools.path,
version = TRUE)
# Bedtools coverage
command = "coverage"
outputDirectory <- "coverage"
sam.files <- list.files(path = alignments.path, pattern = "sam$",
full.names = TRUE,
recursive = TRUE)
sorted.bam.files <- gsub(sam.files,
pattern = ".sam",
replacement = "_sorted.bam")
sample_names <- unlist(lapply(strsplit(list.files(path = reads_path,
pattern = "*_R1_001.fastq$",
full.names = FALSE),"_"), `[[`, 1))
gtfFile <- "mirBase/hsa.ensembl.gff3"
bedtools.cmds <- run_bedtools(command = command,
input = sorted.bam.files,
reference = gtfFile,
out.dir = outputDirectory,
sample.names = sample.names,
counts = TRUE,
bedtools = bedtools.path)
bedtools.cmds
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.