jtleek / sva-devel

28 stars 45 forks source link

Fixes for edge cases of n.sv <= 1 #25

Closed DarwinAwardWinner closed 7 years ago

DarwinAwardWinner commented 7 years ago

I've done my best to root out all edge cases relating to n.sv being 1 or 0. For 1 SV, all sva variants should now return a 1-column matrix of surrogate variables rather than a numeric vector. For 0 SV, they should return a 0-column matrix of surrogate variables, a pprob.gam of all zeros (except for ssva, where pprob.gam = controls), a pprob.B of NULL, and n.sv = 0.

A test should probably be added running all the sva variants with 0, 1, and 2 or more SVs and assertting that the SVs are always returned in a matrix.

jtleek commented 7 years ago

Great thanks!