example_genome_coor: Example genome coordinate file

example_genome_coorR Documentation

Example genome coordinate file

Description

Below is an example code that generates random genomic coordinates.

Usage

example_genome_coor

Format

A data frame with 1001 rows and 3 columns

seqnames

Chromosome number of the recorded biological event, e.g. DNA strand breaks

start

5' start position of the recorded biological event

width

Sequence width of the recorded biological event, e.g. 2 for a DNA strand break

Examples


library(data.table)
library(kmeRtone)

# 1. Randomly generate genomic positions and save results
temp_dir <- tempdir()

set.seed(1234)
temp_files <- character(1)
for(chr in 1){
    genomic_coor <- data.table::data.table(
        seqnames = paste0("chr", chr),
        start = sample(
            x = 10000:10000000, 
            size = 100000, 
            replace = FALSE
        ),
        width = 2
    )

    f <- file.path(temp_dir, paste0("chr", chr, ".csv"))
    fwrite(genomic_coor, f)
    temp_files[chr] <- f
}

rm_files <- file.remove(temp_files)



kmeRtone documentation built on Sept. 11, 2024, 9:12 p.m.