bartongroup / RATS

Relative Abundance of Transcripts: An R package for the detection of Differential Transcript isoform Usage.
MIT License
32 stars 1 forks source link

Empty isoform switching reports are not empty #34

Closed fruce-ki closed 7 years ago

fruce-ki commented 7 years ago

The isoform switching summary has an off-by-one error when there are no results to report. The ID lists, instead of being empty vectors, contain a NA value. As a result, the tallies report values of 1 instead of 0. When there are results to report, the NAs and the off-by-one error do not apply.

This is likely a data.table subsetting error. When nothing matches the subset criteria, data.table returns a row of NA. I need to catch this.

A similar issue used to happen with the DTU summary, so that should serve as a template for the solution here too.

fruce-ki commented 7 years ago

Actually the NA values are explicitly coded in case of no results, to ensure that the named fields are created and to prevent the return value from being an empty list or data.frame. Instead, this should have been achieved by assigning empty character vectors instead of NA values.