satijalab / PASTA

Other
12 stars 5 forks source link

Bug fix for CalcPolyAResiduals #8

Open danielduyvo opened 11 months ago

danielduyvo commented 11 months ago

For some features, DirichletMultinomial cannot fit a model and returns NULL. CalcPolyAResiduals avoids adding those features to the ec and var dataframe., but it assumes that the first feature is fit. If the first feature is not fit, ec and var are not properly initialized and cbind on R/fit.R:119 will throw an error. Pull request initializes the dataframes with a dummy column with the appropriate number of rows, which is dropped after the construction of the full dataframe.