tidygenomics icon indicating copy to clipboard operation
tidygenomics copied to clipboard

Wishlists and potential pull requests

Open liutiming opened this issue 3 years ago • 1 comments

I am really enjoying this package and I think a few functionalities may be added to this package. Wondering what your thoughts are?

  • check data.frames: avoid a few common pitfalls in bioinformatics like chr# vs #, inconsistent headers etc.

Currently, the error message is a bit cryptic when chr numbering does not match:

x1 <- data.frame(id = 1:4, 
                chromosome = c("chr1", "chr1", "chr2", "chr2"),
                start = c(100, 200, 300, 400),
                end = c(150, 250, 350, 450))

x2 <- data.frame(id = 1:4,
                 chromosome = c("1", "2", "2", "1"),
                 start = c(140, 210, 400, 300),
                 end = c(160, 240, 415, 320))

tidygenomics::genome_intersect(x1, x2, by=c("chromosome", "start", "end"), mode="both")
> tidygenomics::genome_intersect(x1, x2, by=c("chromosome", "start", "end"), mode="both")
Error: arrange() failed at implicit mutate() step. 
✖ Could not create a temporary column for `..1`.
ℹ `..1` is `x`.
Run `rlang::last_error()` to see where the error occurred.
  • strict conversion (in column headers) when converting between data.frame and GRanges
  • other functionalities like merge

liutiming avatar Apr 15 '21 07:04 liutiming

I am really enjoying this package and I think a few functionalities may be added to this package. Wondering what your thoughts are?

I am happy to accept PRs if you want to help improve the package :)

Currently, the error message is a bit cryptic when chr numbering does not match:

I agree especially the error message if the chromosome columns mis-match is horrible, it would be great if that could be improved. If you add functionality, please also add unit tests for example to https://github.com/const-ae/tidygenomics/blob/master/tests/testthat/test_intersect.R

strict conversion (in column headers) when converting between data.frame and GRanges

I am not sure I understand what you mean by this.

other functionalities like merge

Sure, I am happy to add additional function. How exactly would the merge that you have in mind differ from the fuzzyjoin::genome_join function?


If you want to contribute, I would suggest that you open an issue / PR for each individual feature and then we can continue the discussion in those :)

const-ae avatar Apr 15 '21 07:04 const-ae