sort.bed: Sorter function for .bed files.

View source: R/sort.bed.R

sort.bedR Documentation

Sorter function for .bed files.

Description

Sorts .bed files by chromosome and position.

Usage

## S3 method for class 'bed'
sort(
  bed,
  bed.header = FALSE,
  sep = "\t",
  return.bed = TRUE,
  export.file.name = NULL,
  export.header = FALSE,
  unique.regions = TRUE,
  verbose = TRUE
)

Arguments

bed

Two options are possible:
- String with the path to a .bed file;
- Data.frame corresponding to a bed file format (all the columns and their names will be kept).

bed.header

Logic value to define whether the .bed file contains an header or not. By default FALSE.

sep

String containing the separator character for a .bed file. By default "\t".

return.bed

Logic value to define if to return the bed as a data.frame. By default TRUE. Only unique rows are kept.

export.file.name

Optional: string to define the path to the file to be exported, if required. By default NULL, not exported.

export.header

Logic value to define whether the header should be exported in the sorted bed file. By default FALSE.

unique.regions

Logic value to indicate whether the output bed must contain unique regions. By default TRUE.

verbose

Logic value to indicate whether messages should be printed or not. By default TRUE.

Details

The function keeps only unique rows.
To get more information about the bed file format see the following page:
https://genome.ucsc.edu/FAQ/FAQformat.html#format1.

Value

If required, returns a data.frame corresponding to the sorted .bed file.


sebastian-gregoricchio/Rseb documentation built on June 14, 2024, 12:22 p.m.