writeBedTrack {JunctionSeq}R Documentation

Write splice junction browser tracks

Description

This function saves the JunctionSeq results in the form of a set of "bed" files designed for use with the UCSC genome browser.

Usage

writeExprBedTrack(file, jscs, 
     trackLine,
     only.with.sig.gene = FALSE,
     only.sig = FALSE, 
     only.testable = TRUE, 
     plot.exons = TRUE, plot.junctions = TRUE, plot.novel.junctions = TRUE,
     group.RGB, 
     use.score = FALSE, 
     FDR.threshold = 0.05, 
     count.digits = 1, 
     includeGeneID = FALSE,
     includeLocusID = TRUE,
     includeGroupID = TRUE,
     output.format = c("BED", "GTF", "GFF3"),
     use.gzip = TRUE,
     verbose = TRUE)

writeSigBedTrack(file, 
     jscs, 
     trackLine,
     only.sig = TRUE, 
     only.testable = TRUE, 
     plot.exons = TRUE, plot.junctions = TRUE, plot.novel.junctions = TRUE,
     sig.RGB = "255,0,0", 
     nonsig.RGB = "0,0,0", 
     use.score = TRUE, 
     FDR.threshold = 0.05, 
     pval.digits = 4, 
     includeGeneID = FALSE,
     includeLocusID = TRUE,
     output.format = c("BED", "GTF", "GFF3"),
     use.gzip = TRUE,
     verbose = TRUE)

Arguments

file

Character string. File path for the output bed file.

jscs

A JunctionSeqCountSet. Usually created by runJunctionSeqAnalyses.

Alternatively, this can be created manually by readJunctionSeqCounts. However in this case a number of additional steps will be necessary: Dispersions and size factors must then be set, usually using functions estimateSizeFactors and estimateJunctionSeqDispersions. Hypothesis tests must be performed by testForDiffUsage. Effect sizes and parameter estimates must be created via estimateEffectSizes.

trackLine

The "track line" of the bed file. In other words, the first line of the file. By default JunctionSeq will attempt to automatically generate a reasonable track line.

only.with.sig.gene

Logical. If TRUE, only genes containing statistically significant results will be included.

only.sig

Logical. If TRUE, only statistically significant loci will be included.

only.testable

Logical. If TRUE, only loci with sufficiently high expression to be tested will be included.

plot.exons

Logical. If TRUE, exons will be plotted.

plot.junctions

Logical. If TRUE, splice junctions will be plotted.

plot.novel.junctions

Logical. If TRUE, novel splice junctions will be plotted (if plot.junctions is also TRUE).

sig.RGB

Character string. The RGB color for significant genes. Must be in the format "r,g,b", with each value ranging from 0 to 255.

nonsig.RGB

Character string. The RGB color for non-significant loci. Must be in the format "r,g,b", with each value ranging from 0 to 255.

group.RGB

Character string. The RGB color used for each experimental group. Must be in the format "r,g,b", with each value ranging from 0 to 255. Must have a length equal to the number of experimental condition values.

use.score

Logical. If TRUE, score each locus based on the p-value.

FDR.threshold

Numeric. The FDR-adjusted p-value threshold to use to assign statistical significance.

count.digits

Numeric. The number of digits after the decimal point to include for the mean normalized counts.

pval.digits

Numeric. The number of digits after the decimal point to include for the p-values.

includeGeneID

Logical. If TRUE, include the ID of the gene in the "name" field of each line.

includeLocusID

Logical. If TRUE, include the ID of the locus in the "name" field of each line.

includeGroupID

Logical. If TRUE, include the ID of the group in the "name" field of each line.

output.format

Character string. The format to use.

use.gzip

Logical. Whether or not to gzip the bed file.

verbose

Logical. if TRUE, output debugging/progress information.

Value

This is a side-effecting function, and does not return a value.

Examples

data(exampleDataSet,package="JctSeqData");
writeExprBedTrack("test.exonCoverage.bed.gz", jscs, 
                  plot.exons = TRUE, plot.junctions = FALSE)

## Not run: 
##D ########################################
##D #Set up example data:
##D decoder.file <- system.file(
##D                   "extdata/annoFiles/decoder.bySample.txt",
##D                   package="JctSeqData");
##D decoder <- read.table(decoder.file,
##D                   header=TRUE,
##D                   stringsAsFactors=FALSE);
##D gff.file <- system.file(
##D             "extdata/cts/withNovel.forJunctionSeq.gff.gz",
##D             package="JctSeqData");
##D countFiles <- system.file(paste0("extdata/cts/",
##D      decoder$sample.ID,
##D      "/QC.spliceJunctionAndExonCounts.withNovel.forJunctionSeq.txt.gz"),
##D      package="JctSeqData");
##D ######################
##D #Run example analysis:
##D jscs <- runJunctionSeqAnalyses(sample.files = countFiles,
##D            sample.names = decoder$sample.ID,
##D            condition=factor(decoder$group.ID),
##D            flat.gff.file = gff.file,
##D            analysis.type = "junctionsAndExons"
##D );
##D ########################################
##D 
##D #Exon coverage:
##D writeExprBedTrack("test.exonCoverage.bed.gz", jscs, 
##D                   plot.exons = TRUE, plot.junctions = FALSE)
##D #Junction coverage:
##D writeExprBedTrack("test.jctCoverage.bed.gz", jscs, 
##D                   plot.exons = FALSE, plot.junctions = TRUE)
##D #Both Exon and Junction coverage:
##D writeExprBedTrack("test.featureCoverage.bed.gz", jscs)
##D 
##D #p-values of significant features:
##D writeSigBedTrack("test.pvals.bed.gz", jscs)
##D 
## End(Not run)

[Package JunctionSeq version 1.5.4 Index]