writeBedTrack: Write splice junction browser tracks

Description Usage Arguments Value Examples

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

 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
33
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

 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
33
34
35
36
37
38
39
40
41
42
43
44
data(exampleDataSet,package="JctSeqData");
writeExprBedTrack("test.exonCoverage.bed.gz", jscs, 
                  plot.exons = TRUE, plot.junctions = FALSE)

## Not run: 
########################################
#Set up example data:
decoder.file <- system.file(
                  "extdata/annoFiles/decoder.bySample.txt",
                  package="JctSeqData");
decoder <- read.table(decoder.file,
                  header=TRUE,
                  stringsAsFactors=FALSE);
gff.file <- system.file(
            "extdata/cts/withNovel.forJunctionSeq.gff.gz",
            package="JctSeqData");
countFiles <- system.file(paste0("extdata/cts/",
     decoder$sample.ID,
     "/QC.spliceJunctionAndExonCounts.withNovel.forJunctionSeq.txt.gz"),
     package="JctSeqData");
######################
#Run example analysis:
jscs <- runJunctionSeqAnalyses(sample.files = countFiles,
           sample.names = decoder$sample.ID,
           condition=factor(decoder$group.ID),
           flat.gff.file = gff.file,
           analysis.type = "junctionsAndExons"
);
########################################

#Exon coverage:
writeExprBedTrack("test.exonCoverage.bed.gz", jscs, 
                  plot.exons = TRUE, plot.junctions = FALSE)
#Junction coverage:
writeExprBedTrack("test.jctCoverage.bed.gz", jscs, 
                  plot.exons = FALSE, plot.junctions = TRUE)
#Both Exon and Junction coverage:
writeExprBedTrack("test.featureCoverage.bed.gz", jscs)

#p-values of significant features:
writeSigBedTrack("test.pvals.bed.gz", jscs)


## End(Not run)

JunctionSeq documentation built on May 31, 2017, 3:24 p.m.