~ubuntu-branches/ubuntu/wily/r-bioc-genomicranges/wily-proposed

« back to all changes in this revision

Viewing changes to R/GRangesList-class.R

  • Committer: Package Import Robot
  • Author(s): Andreas Tille
  • Date: 2013-11-26 19:52:13 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20131126195213-1zwbthnie0a7fdns
Tags: 1.14.3-1
* New upstream version
  Closes: #730574
* Build-Depends: r-bioc-xvector

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
            paste("'mcols(x)' cannot have columns named \"seqnames\", ",
34
34
                  "\"ranges\", \"strand\", \"start\", \"end\", \"width\", ",
35
35
                  "or \"element\""))
36
 
    if (any(colnames(x_mcols) %in%
37
 
            colnames(x@unlistData@elementMetadata)))
38
 
        msg <-
39
 
          c(msg,
40
 
            paste("'mcols(x)' cannot have columns named as metadata ",
41
 
                  "columns of unlisted GRanges"))
42
36
    if (!is.null(rownames(x_mcols)))
43
37
        msg <- c(msg, "'mcols(x)' cannot have row names")
44
38
    msg
334
328
{
335
329
    if (!is(value, "Seqinfo"))
336
330
        stop("the supplied 'seqinfo' must be a Seqinfo object")
337
 
    unlisted <- x@unlistData
338
 
    dangling_seqlevels <- getDanglingSeqlevels(unlisted,
 
331
    dangling_seqlevels <- getDanglingSeqlevels(x,
339
332
                              new2old=new2old, force=force,
340
333
                              seqlevels(value))
341
334
    if (length(dangling_seqlevels) != 0L) {
342
 
        dropme <- which(seqnames(unlisted) %in% dangling_seqlevels)
 
335
        dropme <- which(seqnames(x@unlistData) %in% dangling_seqlevels)
343
336
        x <- x[-unique(togroup(x, j=dropme))]
344
337
    }
345
338
    seqinfo(x@unlistData, new2old=new2old) <- value
442
435
{
443
436
    if (!is(value, class(x)[1]))
444
437
        stop(paste0("replacement value must be a ", class(x)[1], " object"))
445
 
    if (!missing(i)) {
446
 
        iInfo <- IRanges:::.bracket.Index(i, length(x), names(x))
447
 
        if (!is.null(iInfo[["msg"]]))
448
 
            stop(iInfo[["msg"]])
449
 
        i <- iInfo[["idx"]]
450
 
    }
 
438
    if (!missing(i))
 
439
        i <- IRanges:::extractROWS(setNames(seq_along(x), names(x)), i)
451
440
    if (!missing(j)) {
452
441
        if (!is.character(j))
453
442
            stop("'j' must be a character vector")