welch-lab / liger

R package for integrating and analyzing multiple single-cell datasets
GNU General Public License v3.0
381 stars 78 forks source link

Use Seurat's object creation and data setter functions #190

Closed mojaveazure closed 3 years ago

mojaveazure commented 3 years ago

ligerToSeurat was creating DimReduc objects using new instead of CreateDimReducObject; this caused issues where the DimReduc object was incomplete due to lack of embedding names and empty slots (see satijalab/seurat#3574).

This PR uses Seurat::CreateDimReduc object (called using the :: construct to avoid importing and depending on Seurat) to create dimensional reduction objects to ensure the DimReduc objects are complete. In addition, it uses [[<- to add the dimensional reduction information to ensure that all DimReducs go through proper validation.