[Bioc-devel] GAlignments Constructor Type Checking Error

Martin Morgan mtmorg@n@b|oc @end|ng |rom gm@||@com
Sun Apr 14 13:49:55 CEST 2019


Your strand factor only has level "+", but should have levels "+", "-", "*". Use GenomicRanges::strand() to construct the right thing.

Martin

On 4/14/19, 3:01 AM, "Bioc-devel on behalf of Dario Strbenac" <bioc-devel-bounces using r-project.org on behalf of dstr7320 using uni.sydney.edu.au> wrote:

    Good day,
    
    Although the documentation states "Generally not used directly", I'm trying it. A small example fails because the input is evaluated to be in the wrong format, but it doesn't seem so when I look at the variable type of strand.
    
    debug(GAlignments)
    GAlignments("chr1", 1L, strand = Rle(factor('+')), cigar = "10M")
    
    debug: new("GAlignments", NAMES = names, seqnames = seqnames, 
        start = pos, cigar = cigar, strand = strand, elementMetadata = elementMetadata, 
        seqinfo = seqinfo)
    Browse[2]> strand
    factor-Rle of length 1 with 1 run
      Lengths: 1
      Values : +
    Levels(1): +
    Browse[2]> n
    Error in validObject(.Object) : 
      invalid class “GAlignments” object: 'strand(x)' must be an unnamed 'factor' Rle with no NAs (and with levels +, - and *)
    
    This looks like a false-positive to me. Also, it would increase readability if the constructor didn't run off the edge of the PDF page in the reference manual by using \preformatted. Also, I wonder why seqnames is automatically converted into a factor Rle, but strand isn't. Couldn't strand also use .asFactorRle?
    
    --------------------------------------
    Dario Strbenac
    University of Sydney
    Camperdown NSW 2050
    Australia
    
    _______________________________________________
    Bioc-devel using r-project.org mailing list
    https://stat.ethz.ch/mailman/listinfo/bioc-devel
    


More information about the Bioc-devel mailing list