Execution halted for geneCounts() on c_call

Issue #86 new
Scott Christley created an issue

When I run countGenes() on c_call where the field doesn’t have any data, I get an execution halted, which kills the whole batch processing of the file. Is there any way for this to gracefully fail? E.g., return count with NA value, or not abort the script so it can continue running?

> genes <- countGenes(db, gene='c_call', group='repertoire_id', mode='allele')
Error in countGenes(db, gene = "c_call", group = "repertoire_id", mode = "allele") : 
  The column c_call contains no data
Execution halted

Comments (6)

  1. Jason Vander Heiden

    Hrm. What would be the ideal output in this case? And can you get there via a tryCatch? Eg:

    genes <- tryCatch(countGenes(ExampleDb, gene="c_call", mode="asis"), error=function(e) NA)

    Also, it looks like the allele regex isn’t working for C regions right now (IGHD specifically), so use mode="asis" with c_call. I’ll open a separate issue to fix that.

  2. Scott Christley reporter

    I think for the other gene calls, maybe specifically d_call, I get a NA row. I’m guessing those are the rows which have a blank d_call

    Ok, I’ll try the tryCatch. Do the gene and familymodes made sense for c_call?

  3. Jason Vander Heiden

    Oh, I don’t think you should get NA for a row… If the gene is missing in a given group then the row for that gene should either be missing (default; fill=FALSE) or assigned a count of 0 (fill=TRUE). If you’re getting NA rows, then I suspect there’s a bug.

  4. Scott Christley reporter

    I thought maybe because using readChangeoDb() was causing the NA row, but I get it with airr::read_rearrangement as well. I’ll file a separate issue and provide the input file.

  5. Log in to comment