Fixes and tests for readTranscriptFeatures #216
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Second round of improvements, the ultimate aim is to build unit-tested path towards
annotateWithGeneParts
.In this stage, we are improving
readTranscriptFeatures
:used Map instead of mapply when parsing introns/exons since it uses SIMPLIFY = FALSE. Mapply defaults to simplify = TRUE, which can cause unexpected issues in some limited cases (e.g., simplifying to a matrix).
added check if the input bed file has 12 columns, which are expected further down in pipeline. This more clearly communicates the intent, instead of getting crypting subsetting errors in the intron, exons, promoters, and TSS functions.
Added two valid bed files, one with 6 and one with 12 columns and unit tests for
readTranscriptFeatures
. In the presence, this is more of a regression test since I didn't checked in detail the correctness of the output.Knowing
readTranscriptFeatures
is correct and having a valid bed12 file, the next step is to use this with a sample GRanges object to annotate it withannotateWithGeneParts
(and then finally test thatas.data.frame
method).