Bioconductor / GenomicRanges

Representation and manipulation of genomic intervals
https://bioconductor.org/packages/GenomicRanges
41 stars 17 forks source link

add na.rm argument to makeGRangesFromDataFrame #59

Closed LiNk-NY closed 2 years ago

LiNk-NY commented 3 years ago

Hi Hervé,

I've added this option to makeGRangesFromDataFrame to make it a bit more convenient to use. It is FALSE by default.

I'd be interested in your feedback.

Best, Marcel

hpages commented 3 years ago

Nice.

Please use parenthesis here for readability:

not_missing <- !is.na(ans_start) | is.na(ans_end)

I think that the check for NAs should be performed even when na.rm=FALSE, and, if NAs are present, makeGRangesFromDataFrame() should fail early with an error message that suggests the use of na.rm=TRUE. This would produce a nicer and more useful error message than what we get at the moment (which comes from the IRanges() constructor).

Thanks!

LiNk-NY commented 3 years ago

Hi Hervé, I've updated the code based on your feedback. Thanks again!

hpages commented 3 years ago

Thanks Marcel.

A few more things:

LiNk-NY commented 2 years ago

Sorry this took me so long. I hadn't noticed the reply. Thanks for reviewing! Best, Marcel

hpages commented 2 years ago

Thanks Marcel!