build.bed | R Documentation |
Function that helps the building of a bed file providing the columns. It enables also the specification of the track line for software such as IGV in order to pre-define colors, track name, etc.
build.bed(
chr,
start,
end,
name = NULL,
score = 0,
strand = ".",
thickStart = NULL,
thickEnd = NULL,
itemRgb = NULL,
blockCount = NULL,
blockSizes = NULL,
blockStarts = NULL,
track.name = NULL,
display.mode = NULL,
itemRgb.ON = T,
useScore = F,
colorByStrand = NULL,
track.base.color = NULL,
sort = T,
bed.file.name = NULL,
export.track.line = TRUE,
return.data.frame = F,
force.generation = F
)
chr |
String vector containing the name of the chromosome (e.g. chr3, chrY, chr2_random) or scaffold (e.g. scaffold10671). |
start |
Numeric vector indicating the starting position of the feature in the chromosome or scaffold. The first base in a chromosome is numbered 0. |
end |
Numeric vector indicating the ending position of the feature in the chromosome or scaffold. |
name |
String vector defining the name of the BED line. This label is displayed to the left of the BED line in the Genome Browser window when the track is open to full display mode or directly to the left of the item in pack mode. If set as |
score |
A single value or a numeric vector with a score between 0 and 1000. If the track line |
strand |
A single character or a string vector defining the strand: either "." (=no strand) or "+" or "-". By default ".". |
thickStart |
A numeric vector indicating the starting position at which the feature is drawn thickly (for example, the start codon in gene displays). When there is no thick part (default value, |
thickEnd |
A numeric vector indicating the ending position at which the feature is drawn thickly (for example, the start codon in gene displays). When there is no thick part (default value, |
itemRgb |
A single value or a string vector containing the colors for each feature. It can be expressed as an RGB value of the form R,G,B (e.g. "255,0,0") or as any other R-supported color name (it will be converted automatically to RGB version). By default |
blockCount |
A single number or a numeric vector indicating the number of blocks (exons) in the BED line. By default |
blockSizes |
A vector containing a comma-separated list of the block sizes. The number of items in this list should correspond to |
blockStarts |
A vector containing a comma-separated list of block starts. All of the |
track.name |
A string defining the track label that will be displayed to the left of the track in the Genome Browser window, and also the label of the track control at the bottom of the screen. The name can consist of up to 15 characters. It is recommended that the track_label be restricted to alpha-numeric characters and spaces to avoid potential parsing problems. By default |
display.mode |
A string that defines the initial display mode of the annotation track. Values for |
itemRgb.ON |
Logic value to define whether this attribute should be set to "On", the Genome Browser will use the RGB value shown in the |
useScore |
Logic value to define if the |
colorByStrand |
A vector composed by two strings for two colors, either in RGB comma separated format (eg. "0,250,30") or any R-supported color string (they will be converted automatically to RGB format). The order of color sets is c("strand +", "strand -"). Parameter ignored when |
track.base.color |
A single string defining the main color for the annotation track. The track color consists of three comma-separated RGB values from 0-255 (eg. "0,250,30") or any R-supported color string (it will be converted automatically to RGB format). Parameter ignored when |
sort |
Logic value to define whether to sort the bed using the function sort.bed. By default |
bed.file.name |
If a string with a full path to a bed_file is provided, the function will export the bed as a txt file. By default |
export.track.line |
Logic value to define if the track line should be exported. When |
return.data.frame |
Logic value to define if the to return the data.frame corresponding to the bed (it will show the columns names). By default |
force.generation |
Force the generation of bed even when certain errors occur (eg. score > 1000, start > end). By default |
If required the function can export a bed file with or without the track line, return a data.frame (with column names) corresponding to the bed generated, or both. The bed file could be automatically sorted settin the parameter sort = TRUE
.
More information about bed format are available at the following link: https://genome.ucsc.edu/FAQ/FAQformat.html#format1.
More information about track line parameters are available at the following link: https://genome.ucsc.edu/goldenPath/help/hgTracksHelp.html#lines.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.