| gtrack.export_bedgraph | R Documentation |
Exports a track or track expression to a UCSC bedGraph file.
gtrack.export_bedgraph(
track,
file,
intervals = NULL,
iterator = NULL,
name = NULL
)
track |
track name or track expression (character string) |
file |
output file path. If it ends in |
intervals |
genomic intervals to export. If |
iterator |
iterator bin size. If |
name |
track name for the bedGraph header line. If |
This function evaluates a track expression over the specified genomic intervals and writes the result in standard bedGraph format (4-column, tab-separated: chrom, start, end, value). NaN values are omitted from the output.
The function supports physical tracks, virtual tracks, and arbitrary track
expressions (e.g. "dense_track * 2"). 2D tracks are not supported.
If the output file path ends in .gz, the output is gzip-compressed.
NULL (invisible). Called for its side effect of writing a
file.
gextract, gtrack.export_bigwig,
gtrack.info
## Not run:
gdb.init_examples()
# Export a dense track
gtrack.export_bedgraph("dense_track", "/tmp/dense.bedgraph")
# Export with specific intervals
intervs <- gintervals(1, 0, 1000)
gtrack.export_bedgraph("dense_track", "/tmp/dense_chr1.bedgraph",
intervals = intervs
)
# Export a track expression
gtrack.export_bedgraph("dense_track * 2", "/tmp/scaled.bedgraph",
iterator = 100
)
# Export compressed
gtrack.export_bedgraph("dense_track", "/tmp/dense.bedgraph.gz")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.