File: test_GAlignments-class.R

package info (click to toggle)
r-bioc-genomicalignments 1.0.6-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,980 kB
  • ctags: 54
  • sloc: ansic: 1,493; makefile: 4; sh: 3
file content (37 lines) | stat: -rw-r--r-- 1,163 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
test_GAlignments_constructor <- function()
{
    checkTrue(validObject(GAlignments()))
    checkTrue(validObject(GAlignments(seqnames=factor("A"),
                                      pos=1L, cigar="1M",
                                      strand=strand("-"))))
}

test_GAlignments_seqlevels <- function()
{
    gal0 <- GAlignments(seqnames=Rle(c("chr1", "chr2")),
                        pos=as.integer(c(10, 100)),
                        cigar=c("50M", "50M"),
                        strand=strand(c("*", "*")))

    ## Drop
    gal <- gal0
    seqlevels(gal, force=TRUE) <- "chr2"
    checkIdentical("chr2", seqlevels(gal))

    ## Rename
    gal <- gal0
    seqlevels(gal)[seqlevels(gal) == "chr2"] <- "2"
    checkIdentical(c("chr1", "2"),  seqlevels(gal))
}

test_GAlignments_combine <- function() 
{
    galn <- GAlignments(seqnames=factor("A"),
                        pos=1L, cigar="1M",
                        strand=strand("-"))
    galn_c <- GAlignments(seqnames=rep(factor("A"), 2),
                          pos=rep(1L, 2), cigar=rep("1M", 2),
                          strand=rep(strand("-"), 2))
    checkIdentical(galn_c, c(galn, galn))
}