restriction.sites.to.bed: Generator of a bed file for enzymatic restriction sites.

View source: R/restriction.sites.to.bed.R

restriction.sites.to.bedR Documentation

Generator of a bed file for enzymatic restriction sites.

Description

The function allows to create a bed file that can be added on IGV both as regions and track. It will show the restriction sites of a sequences if starting from the cut positions depending on sequence lenght. Chromosome, start and end of the input sequence are required.

Usage

restriction.sites.to.bed(
  cut_positions,
  chromosome,
  genome_start,
  return_bed = TRUE,
  export_bed_file = FALSE,
  output_file_name = paste(getwd(), "restriction_positions.bed", sep = "/"),
  enzyme_cut_length = 4,
  include_region_description = TRUE,
  region_name = "site",
  append = FALSE
)

Arguments

cut_positions

A numeric vector with the list of the restriction/cut positions.

chromosome

Chromosome number of the region analyzed.

genome_start

Start position on the genome of the region analyzed.

return_bed

Logic value to define if to return the bed as data.frame. By default TRUE.

export_bed_file

Logic value to define if to export the resulting .bed file. By default FALSE.

output_file_name

String corresponding to the path to the exported .bed file. By default "<working.directory>/restriction_positions.bed".

enzyme_cut_length

Numeric value to define the length of cut of the restriction enzyme. By default 4.

include_region_description

Logic value to define whether to include a fourth column containing the region name define by the parameter region_description. By default TRUE.

region_name

Regions base name. Automatically it will be added a number to the base name. By default "site", the resulting regions will be: site_1, site_2, ... .

append

Logic value to define if to append the result to the file. By default FALSE, the file will be overwritten.

Details

To map the positions of restriction enzymes it is possible to use http://restrictionmapper.org/ with the option Map (version 3).

Value

If required, it will be returned a classic bed file (chr start end [name]) with the regions centered on the cut position in the genome.

Examples

restriction.sites.to.bed(cut_positions = c(230, 235, 1250, 36),
                         chromosome = 10,
                         genome_start = 1205126,
                         region_name = "EcoRI_cut_site")


sebastian-gregoricchio/Rseb documentation built on Sept. 4, 2024, 1:59 p.m.