Skip to content

read_gff3 can't parse when exons are defined and CDS is called 'cds' instead of 'CDS' #238

@henni164

Description

@henni164

There seems to be some kind of parsing bug (well, maybe not a bug per se) that causes read_gff3() to fail when trying to map exon and CDS information if the feature type label for CDS is lowercase instead of uppercase. If only gene/mRNA/cds features are present, it does not matter if the cds feature label is lowercase or uppercase.

Running R4.4.2 in RStudio for Windows

Full error message:

gff <- read_feats("C:/Users/hen294/my.gff", format = "gff3")
Reading 'gff3' with read_gff3():

  • file_id: my [C:/Users/hen294/my.gff]
    Harmonizing attribute names
    • ID -> feat_id
    • Parent -> parent_ids
    Error in map2():
    ℹ In index: 1.
    ℹ With name: my.
    Caused by error in bind_rows():
    ! Can't combine ..1$feat_id and ..2$feat_id .
    Run rlang::last_trace() to see where the error occurred.

rlang::last_trace()
<error/purrr_error_indexed>
Error in map2():
ℹ In index: 1.
ℹ With name: my.
Caused by error in bind_rows():
! Can't combine ..1$feat_id and ..2$feat_id .


Backtrace:

  1. ├─gggenomes::read_feats(...)
  2. │ └─gggenomes::read_context(...)
  3. │ └─purrr::map2_df(...)
  4. │ └─purrr::map2(.x, .y, .f, ...)
  5. │ └─purrr:::map2_("list", .x, .y, .f, ..., .progress = .progress)
  6. │ ├─purrr:::with_indexed_errors(...)
  7. │ │ └─base::withCallingHandlers(...)
  8. │ ├─purrr:::call_with_cleanup(...)
  9. │ └─gggenomes (local) .f(.x[[i]], .y[[i]], ...)
  10. │ ├─rlang::exec(parser, file, ...)
  11. │ └─gggenomes::read_gff3("C:/Users/hen294/my.gff")
  12. │ ├─bind_rows(mrna_exon_introns, mrna_cds_introns) %>% ...
  13. │ └─dplyr::bind_rows(mrna_exon_introns, mrna_cds_introns)
  14. └─dplyr::mutate(., feat_id = as.character(.data$feat_id))

Minor issue but may be worth including case insensitivity for the feature type column.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions