Skip to content

Value of SET_STRING_ELT() must be a 'CHARSXP' not a 'raw' #95

@gevro

Description

@gevro

Hi,

I'm encountering a very strange bug/error.

  1. The error occurs only for a specific input dataset that has the same properties as hundreds of other input datasets that run without any issues.
  2. The error occurs only when the code is run as an R script (e.g.. script.R file with heading #!/usr/bin/env Rscript). It does NOT occur when running the exact same code in an interactive R session, which is the strangest aspect of this issue and makes it harder to debug.

Code causing the error:

# bam is loaded from a BAM file with scanBam (Rsamtools package)

# Logical vector specifying reads from which to subset a sequence
includereads <- sample(c(TRUE,FALSE),length(bam$seq),replace=TRUE)

bam$layered.seq <- sequenceLayer(bam$seq,bam$cigar)

bam$subseq <- rep(NA,length(bam$seq))
bam$subseq[includereads] <- subseq(bam$layered.seq[includereads],start=bam$layered.start[includereads],end=bam$layered.end[includereads])

# Any code that subsets a range of items from bam$subseq causes the error. For example:
bam$subseq[includereads]

Error:

Value of SET_STRING_ELT() must be a 'CHARSXP' not a 'raw'
Execution halted

I am upgraded to the latest versions of Biostrings, GenomicAlignments, Rsamtools, etc, current as of yesterday.

Since I cannot share the input data here, if any of you has a sense of what this might be, I can connect off-line if you share your e-mail address to share with you example data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions