Creates a 'Rectangles' track from intervals and values.
gtrack.2d.create(
track = NULL,
description = NULL,
intervals = NULL,
values = NULL
)None.
This function creates a new 'Rectangles' (two-dimensional) track with values at given intervals. 'description' is added as a track attribute.
gdb.init_examples()
intervs1 <- gintervals.2d(
1, (1:4) * 200, (1:4) * 200 + 100,
1, (1:4) * 300, (1:4) * 300 + 200
)
intervs2 <- gintervals.2d(
"X", (7:10) * 100, (7:10) * 100 + 50,
2, (1:4) * 200, (1:4) * 200 + 130
)
intervs <- rbind(intervs1, intervs2)
gtrack.2d.create(
"test_rects", "Test 2d track", intervs,
runif(dim(intervs)[1], 1, 100)
)
gextract("test_rects", .misha$ALLGENOME)
#> chrom1 start1 end1 chrom2 start2 end2 test_rects intervalID
#> 1 chr1 200 300 chr1 300 500 40.88524 1
#> 2 chr1 400 500 chr1 600 800 77.19339 1
#> 3 chr1 600 700 chr1 900 1100 12.82905 1
#> 4 chr1 800 900 chr1 1200 1400 20.27480 1
#> 5 chrX 700 750 chr2 200 330 17.29236 8
#> 6 chrX 800 850 chr2 400 530 66.65745 8
#> 7 chrX 900 950 chr2 600 730 85.80093 8
#> 8 chrX 1000 1050 chr2 800 930 92.72810 8
gtrack.rm("test_rects", force = TRUE)