Package: rliger 2.1.0
rliger: Linked Inference of Genomic Experimental Relationships
Uses an extension of nonnegative matrix factorization to identify shared and dataset-specific factors. See Welch J, Kozareva V, et al (2019) <doi:10.1016/j.cell.2019.05.006>, and Liu J, Gao C, Sodicoff J, et al (2020) <doi:10.1038/s41596-020-0391-8> for more details.
Authors:
rliger_2.1.0.tar.gz
rliger_2.1.0.tar.gz(r-4.5-noble)rliger_2.1.0.tar.gz(r-4.4-noble)
rliger_2.1.0.tgz(r-4.4-emscripten)rliger_2.1.0.tgz(r-4.3-emscripten)
rliger.pdf |rliger.html✨
rliger/json (API)
NEWS
# Install 'rliger' in R: |
install.packages('rliger', repos = 'https://cloud.r-project.org') |
Bug tracker:https://github.com/welch-lab/liger/issues
Pkgdown site:https://welch-lab.github.io
- bmmc - Liger object of bone marrow subsample data with RNA and ATAC modality
- deg.marker - Data frame for example marker DEG test result
- deg.pw - Data frame for example pairwise DEG test result
- pbmc - Liger object of PBMC subsample data with Control and Stimulated datasets
- pbmcPlot - Liger object of PBMC subsample data with plotting information available
Last updated 5 months agofrom:bf9469b474. Checks:1 OK, 2 ERROR. Indexed: no.
Target | Result | Latest binary |
---|---|---|
Doc / Vignettes | OK | Mar 29 2025 |
R-4.5-linux-x86_64 | ERROR | Mar 29 2025 |
R-4.4-linux-x86_64 | ERROR | Mar 29 2025 |
Exports:%<>%%>%alignFactorsas.ligeras.ligerDatasetcalcAgreementcalcAlignmentcalcARIcalcDatasetSpecificitycalcNMIcalcPuritycellMetacellMeta<-centroidAligncloseAllH5commandDiffcommandsconvertOldLigercoordinatecoordinate<-createH5LigerDatasetcreateLigercreateLigerDatasetdatasetdataset<-datasetsdatasets<-defaultClusterdefaultCluster<-defaultDimReddefaultDimRed<-dimReddimRed<-dimRedsdimReds<-downsampleexportInteractTrackfeatureMetafeatureMeta<-getFactorMarkersgetH5FilegetMatrixgetProportionMitoh5fileInfoh5fileInfo<-importBMMCimportCGEimportPBMCimputeKNNis.newLigerisH5LigerligerATACDatasetligerCommandligerMethDatasetligerRNADatasetligerSpatialDatasetligerToSeuratlinkGenesAndPeakslouvainClustermakeFeatureMatrixmakeInteractTrackmakeRiverplotmapCellMetamergeDenseAllmergeH5mergeSparseAllmodalOfnormalizenormalizePeaknormDatanormData<-normPeaknormPeak<-online_iNMFoptimizeALSoptimizeNewDataoptimizeNewKoptimizeNewLambdaoptimizeSubsetplotBarcodeRankplotByDatasetAndClusterplotCellViolinplotClusterDimRedplotClusterFactorDotplotClusterGeneDotplotClusterGeneViolinplotClusterProportionsplotDatasetDimRedplotDensityDimRedplotDimRedplotEnhancedVolcanoplotFactorDimRedplotFactorHeatmapplotGeneDetectedViolinplotGeneDimRedplotGeneHeatmapplotGeneLoadingRankplotGeneLoadingsplotGeneViolinplotGODotplotGroupClusterDimRedplotMarkerHeatmapplotPairwiseDEGHeatmapplotPeakDimRedplotProportionplotProportionBarplotProportionBoxplotProportionDotplotProportionPieplotSankeyplotSpatial2DplotTotalCountViolinplotVarFeaturesplotVolcanoquantile_normquantileAlignSNFquantileNormrawDatarawData<-rawPeakrawPeak<-read10Xread10XATACread10XFilesread10XRNAreadLigerreadSubsetremoveMissingremoveMissingObsrestoreH5LigerrestoreOnlineLigerretrieveCellFeaturereverseMethDatarunCINMFrunClusterrunDoubletFinderrunGeneralQCrunGOEnrichrunGSEArunINMFrunIntegrationrunMarkerDEGrunOnlineINMFrunPairwiseDEGrunTSNErunUINMFrunUMAPrunWilcoxonscaleDatascaleData<-scaleNotCenterscaleUnsharedDatascaleUnsharedData<-selectGenesselectGenesVSTseuratToLigershowsubsetH5LigerDatasetsubsetLigersubsetLigerDatasetsubsetMemLigerDatasetupdateLigerObjectvarFeaturesvarFeatures<-varUnsharedFeaturesvarUnsharedFeatures<-writeH5
Dependencies:BHBiocGenericsbitbit64circlizecliclueclustercodetoolscolorspaceComplexHeatmapcowplotcpp11crayondigestdoParalleldplyrdqrngfansifarverFNNforeachgenericsGetoptLongggplot2ggrepelGlobalOptionsgluegridExtragtablehdf5rigraphIRangesirlbaisobanditeratorslabelinglatticeleidenAlglifecyclemagrittrMASSMatrixmatrixStatsmgcvmunsellnlmepbmcapplypillarpkgconfigplyrpngpROCR6RANNRColorBrewerRcppRcppAnnoyRcppArmadilloRcppEigenRcppProgressrjsonrlangRSpectraRtsneS4Vectorsscalessccoreshapesitmotibbletidyselectutf8uwotvctrsviridisviridisLitewithr
Citation
To cite package ‘rliger’ in publications use:
Welch J, Wang Y, Gao C, Liu J, Sodicoff J, Kozareva V, Macosko E (2024). rliger: Linked Inference of Genomic Experimental Relationships. R package version 2.1.0, https://CRAN.R-project.org/package=rliger.
Corresponding BibTeX entry:
@Manual{, title = {rliger: Linked Inference of Genomic Experimental Relationships}, author = {Joshua Welch and Yichen Wang and Chao Gao and Jialin Liu and Joshua Sodicoff and Velina Kozareva and Evan Macosko}, year = {2024}, note = {R package version 2.1.0}, url = {https://CRAN.R-project.org/package=rliger}, }
Readme and manuals

LIGER (Linked Inference of Genomic Experimental Relationships)
NEWS Oct., 2024
- Checkout new cell factor alignment method (function
centroidAlign()
), which aligns cell factor loading by moving soft clustering centroids. Its overall performance, in terms of batch effect removal and especially biological information conservation, out performs many public well-known methods. See benchmarking article here.- Checkout Consensus iNMF method (function
runCINMF()
), which runs regular iNMF multiple times with different random initialization and summarizes a consensus result with better confidence.- Please visit rliger website for comprehensive documentation and revised tutorial that walks through scRNAseq integration and analysis in detail
- More changelogs
LIGER (installed as rliger
) is a package for integrating and analyzing multiple single-cell datasets, developed by the Macosko lab and maintained/extended by the Welch lab. It relies on integrative non-negative matrix factorization to identify shared and dataset-specific factors.
Check out our Cell paper for a more complete description of the methods and analyses. To access data used in our SN and BNST analyses, visit our study "SCP466" on the Single Cell Portal.
LIGER can be used to compare and contrast experimental datasets in a variety of contexts, for instance:
- Across experimental batches
- Across individuals
- Across sex
- Across tissues
- Across species (e.g., mouse and human)
- Across modalities (e.g., scRNAseq and spatial transcriptomics data, scMethylation, or scATAC-seq)
Once multiple datasets are integrated, the package provides functionality for further data exploration, analysis, and visualization. Users can:
- Identify clusters
- Find significant shared (and dataset-specific) gene markers
- Compare clusters with previously identified cell types
- Visualize clusters and gene expression using t-SNE and UMAP
We have also designed LIGER to interface with existing single-cell analysis packages, including Seurat.
Citation
If you use LIGER in your research please cite our paper correspondingly:
- Generally the Cell paper should be cited:
Joshua D. Welch and et al., Single-Cell Multi-omic Integration Compares and Contrasts Features of Brain Cell Identity, Cell, VOLUME 177, ISSUE 7, P1873-1887.E17 (2019), https://doi.org/10.1016/j.cell.2019.05.006
- For the rliger package:
Liu, J., Gao, C., Sodicoff, J. et al. Jointly defining cell types from multiple single-cell datasets using LIGER. Nat Protoc 15, 3632–3662 (2020), https://doi.org/10.1038/s41596-020-0391-8
- For online iNMF integration method:
Gao, C., Liu, J., Kriebel, A.R. et al. Iterative single-cell multi-omic integration using online learning. Nat Biotechnol 39, 1000–1007 (2021), https://doi.org/10.1038/s41587-021-00867-x
- For UINMF integration method:
Kriebel, A.R., Welch, J.D. UINMF performs mosaic integration of single-cell multi-omic datasets using nonnegative matrix factorization. Nat Commun 13, 780 (2022), https://doi.org/10.1038/s41467-022-28431-4
Feedback
If you have any questions, comments, or suggestions, you are welcomed to open an Issue!
Usage
For usage examples and guided walkthroughs of specific use cases, please check our articles below:
- Integrating Multiple Single-Cell RNA-seq Datasets
- Jointly Defining Cell Types from scRNA-seq and scATAC-seq
- Iterative Single-Cell Multi-Omic Integration Using Online iNMF
- Integrating datasets using unshared features with UINMF
- Integrating spatial transcriptomic and transcriptomic datasets using UINMF
- Integrating scATAC and scRNA using unshared features (UINMF)
- Cross-species Analysis with UINMF
- Jointly Defining Cell Types from Single-Cell RNA-seq and DNA Methylation
Meanwhile, since version 2.0.0, LIGER is massively updated for usability and interoperability with other packages. Below are links to the introduction of new features.
If you need to refer to the tutorials for the old version of rliger, please check the GitHub archive v1.0.1, download the desired rendered HTML files and open them in your browser.
Sample Datasets
The rliger
package provides different types of small toy dataset for basic demos of the functions. After attaching the package in an R session, you can load them with:
data("pbmc")
data("pbmcPlot")
data("bmmc")
We also provide a set of datasets for real-world style demos, including scRNAseq, scATACseq, spatial transcriptomics and DNA methylation data. They are described in detail in the articles that make use of them. Please check them out from the links above.
Help Manual
Help page | Topics |
---|---|
Generate dot plot from input matrix with ComplexHeatmap | .complexHeatmapDotPlot |
Produce single violin plot with data frame passed from upstream | .ggCellViolin |
Generic ggplot theme setting for rliger package | .ggplotLigerTheme |
Produce single scatter plot with data frame passed from upstream | .ggScatter |
General heatmap plotting with prepared matrix and data.frames | .plotHeatmap |
Align factor loadings to get final integration | alignFactors alignFactors.liger alignFactors.Seurat |
Converting other classes of data to a liger object | as.liger as.liger.dgCMatrix as.liger.Seurat as.liger.SingleCellExperiment seuratToLiger |
Converting other classes of data to a ligerDataset object | as.ligerDataset as.ligerDataset.default as.ligerDataset.ligerDataset as.ligerDataset.matrix as.ligerDataset.Seurat as.ligerDataset.SingleCellExperiment |
liger object of bone marrow subsample data with RNA and ATAC modality | bmmc |
Calculate agreement metric after integration | calcAgreement |
Calculate alignment metric after integration | calcAlignment |
Calculate adjusted Rand index (ARI) by comparing two cluster labeling variables | calcARI |
Calculate a dataset-specificity score for each factor | calcDatasetSpecificity |
Calculate Normalized Mutual Information (NMI) by comparing two cluster labeling variables | calcNMI |
Calculate purity by comparing two cluster labeling variables | calcPurity |
*[Experimental]* Align factor loading by centroid alignment (beta) | centroidAlign centroidAlign.liger centroidAlign.Seurat |
Close all links (to HDF5 files) of a liger object | closeAllH5 closeAllH5.liger closeAllH5.ligerDataset |
Check difference of two liger command | commandDiff |
Convert old liger object to latest version | convertOldLiger |
Access ligerSpatialDataset coordinate data | coordinate coordinate,liger,character-method coordinate,ligerSpatialDataset,missing-method coordinate<- coordinate<-,liger,character-method coordinate<-,ligerSpatialDataset,missing-method |
Create on-disk ligerDataset Object | createH5LigerDataset |
Create liger object | createLiger |
Create in-memory ligerDataset object | createLigerDataset |
Data frame for example marker DEG test result | deg.marker |
Data frame for example pairwise DEG test result | deg.pw |
Downsample datasets | downsample |
Export predicted gene-pair interaction | exportInteractTrack |
Find shared and dataset-specific markers | getFactorMarkers |
Calculate proportion mitochondrial contribution | getProportionMito |
Apply function to chunks of H5 data in ligerDataset object | H5Apply |
Import prepared dataset publically available | importBMMC importCGE importPBMC |
Impute the peak counts from gene expression data referring to an ATAC dataset after integration | imputeKNN |
Check if given liger object if under new implementation | is.newLiger |
Check if a liger or ligerDataset object is made of HDF5 file | isH5Liger |
liger class | $.liger $<-.liger c.liger cellMeta cellMeta,liger,character-method cellMeta,liger,missing-method cellMeta,liger,NULL-method cellMeta<- cellMeta<-,liger,character-method cellMeta<-,liger,missing-method commands commands,liger-method dataset dataset,liger,character_OR_NULL-method dataset,liger,missing-method dataset,liger,numeric-method dataset<- dataset<-,liger,character,ANY,ANY,matrixLike-method dataset<-,liger,character,missing,ANY,ligerDataset-method dataset<-,liger,character,missing,ANY,NULL-method datasets datasets,liger-method datasets<- datasets<-,liger,logical-method datasets<-,liger,missing-method defaultCluster defaultCluster,liger-method defaultCluster<- defaultCluster<-,liger,ANY,ANY,character-method defaultCluster<-,liger,ANY,ANY,factor-method defaultCluster<-,liger,ANY,ANY,NULL-method defaultDimRed defaultDimRed,liger-method defaultDimRed<- defaultDimRed<-,liger,character-method dim,liger-method dimnames,liger-method dimnames<-,liger,list-method dimRed dimRed,liger,index-method dimRed,liger,missing_OR_NULL-method dimRed<- dimRed<-,liger,character,ANY,ANY,matrixLike-method dimRed<-,liger,index,ANY,ANY,NULL-method dimReds dimReds,liger-method dimReds<- dimReds<-,liger,list-method fortify.liger getH5File,liger,ANY-method getMatrix,liger,ANY,ANY,ANY-method length.liger lengths.liger liger liger-class names.liger names<-.liger normData,liger-method normData<-,liger,ANY,ANY,H5D-method normData<-,liger,ANY,ANY,matrixLike_OR_NULL-method rawData,liger-method rawData<-,liger,ANY,ANY,H5D-method rawData<-,liger,ANY,ANY,matrixLike_OR_NULL-method scaleData,liger,ANY-method scaleData<-,liger,ANY,ANY,H5D-method scaleData<-,liger,ANY,ANY,H5Group-method scaleData<-,liger,ANY,ANY,matrixLike_OR_NULL-method scaleUnsharedData,liger,character-method scaleUnsharedData,liger,numeric-method scaleUnsharedData<-,liger,ANY,ANY,H5D-method scaleUnsharedData<-,liger,ANY,ANY,H5Group-method scaleUnsharedData<-,liger,ANY,ANY,matrixLike_OR_NULL-method show,liger-method varFeatures varFeatures,liger-method varFeatures<- varFeatures<-,liger,ANY,character-method varUnsharedFeatures varUnsharedFeatures,liger,ANY-method varUnsharedFeatures,ligerDataset,missing-method varUnsharedFeatures<- varUnsharedFeatures<-,liger,ANY,ANY,character-method varUnsharedFeatures<-,ligerDataset,missing,ANY,character-method [[<-.liger |
Subclass of ligerDataset for ATAC modality | ligerATACDataset ligerATACDataset-class |
ligerCommand object: Record the input and time of a LIGER function call | ligerCommand ligerCommand-class show,ligerCommand-method |
ligerDataset class | cbind.ligerDataset dim,ligerDataset-method dimnames,ligerDataset-method dimnames<-,ligerDataset,list-method featureMeta featureMeta,ligerDataset-method featureMeta<- featureMeta<-,ligerDataset-method getH5File getH5File,ligerDataset,missing-method getMatrix getMatrix,ligerDataset,ANY,missing,missing-method h5fileInfo h5fileInfo,ligerDataset-method h5fileInfo<- h5fileInfo<-,ligerDataset-method ligerDataset ligerDataset-class normData normData,ligerDataset-method normData<- normData<-,ligerDataset,ANY,ANY,H5D-method normData<-,ligerDataset,ANY,ANY,matrixLike_OR_NULL-method rawData rawData,ligerDataset-method rawData<- rawData<-,ligerDataset,ANY,ANY,H5D-method rawData<-,ligerDataset,ANY,ANY,matrixLike_OR_NULL-method scaleData scaleData,ligerDataset,missing-method scaleData<- scaleData<-,ligerDataset,ANY,ANY,H5D-method scaleData<-,ligerDataset,ANY,ANY,H5Group-method scaleData<-,ligerDataset,ANY,ANY,matrixLike_OR_NULL-method scaleUnsharedData scaleUnsharedData,ligerDataset,missing-method scaleUnsharedData<- scaleUnsharedData<-,ligerDataset,missing,ANY,H5D-method scaleUnsharedData<-,ligerDataset,missing,ANY,H5Group-method scaleUnsharedData<-,ligerDataset,missing,ANY,matrixLike_OR_NULL-method show,ligerDataset-method |
Subclass of ligerDataset for Methylation modality | ligerMethDataset ligerMethDataset-class |
Subclass of ligerDataset for RNA modality | ligerRNADataset ligerRNADataset-class |
Subclass of ligerDataset for Spatial modality | ligerSpatialDataset ligerSpatialDataset-class |
Convert between liger and Seurat object | ligerToSeurat |
Linking genes to putative regulatory elements | linkGenesAndPeaks |
*[Superseded]* Louvain algorithm for community detection | louvainCluster-deprecated |
Fast calculation of feature count matrix | makeFeatureMatrix |
*[Deprecated]* Export predicted gene-pair interaction | makeInteractTrack-deprecated |
*[Deprecated]* Generate a river (Sankey) plot | makeRiverplot-deprecated |
Create new variable from categories in cellMeta | mapCellMeta |
Merge hdf5 files | mergeH5 |
Merge matrices while keeping the union of rows | mergeDenseAll mergeSparseAll |
Return preset modality of a ligerDataset object or that of all datasets in a liger object | modalOf |
Normalize raw counts data | normalize normalize.dgCMatrix normalize.liger normalize.ligerDataset normalize.matrix normalize.Seurat normalizePeak |
*[Deprecated]* Perform online iNMF on scaled datasets | online_iNMF-deprecated |
*[Deprecated]* Perform iNMF on scaled datasets | optimizeALS-deprecated |
Perform factorization for new data | optimizeNewData |
Perform factorization for new value of k | optimizeNewK |
Perform factorization for new lambda value | optimizeNewLambda |
Perform factorization for subset of data | optimizeSubset |
liger object of PBMC subsample data with Control and Stimulated datasets | pbmc |
liger object of PBMC subsample data with plotting information available | pbmcPlot |
Create barcode-rank plot for each dataset | plotBarcodeRank |
Generate violin/box plot(s) using liger object | plotCellViolin |
Make dot plot of factor loading in cell groups | plotClusterFactorDot |
Make dot plot of gene expression in cell groups | plotClusterGeneDot |
Create violin plot for multiple genes grouped by clusters | plotClusterGeneViolin |
Create density plot basing on specified coordinates | plotDensityDimRed |
Generate scatter plot(s) using liger object | plotByDatasetAndCluster plotClusterDimRed plotDatasetDimRed plotDimRed plotFactorDimRed plotGeneDimRed plotPeakDimRed |
Create volcano plot with EnhancedVolcano | plotEnhancedVolcano |
Plot Heatmap of Gene Expression or Factor Loading | plotFactorHeatmap plotGeneHeatmap |
Visualize factor expression and gene loading | plotGeneLoadingRank plotGeneLoadings |
Visualize gene expression or cell metadata with violin plot | plotGeneDetectedViolin plotGeneViolin plotTotalCountViolin |
Visualize GO enrichment test result in dot plot | plotGODot |
Comprehensive group splited cluster plot on dimension reduction with proportion | plotGroupClusterDimRed |
Create heatmap for showing top marker expression in conditions | plotMarkerHeatmap |
Create heatmap for pairwise DEG analysis result | plotPairwiseDEGHeatmap |
Visualize proportion across two categorical variables | plotClusterProportions plotProportion plotProportionBar plotProportionDot plotProportionPie |
Box plot of cluster proportion in each dataset, grouped by condition | plotProportionBox |
Make Riverplot/Sankey diagram that shows label mapping across datasets | plotSankey |
Visualize a spatial dataset | plotSpatial2D plotSpatial2D.liger plotSpatial2D.ligerSpatialDataset |
Plot the variance vs mean of feature expression | plotVarFeatures |
Create volcano plot for Wilcoxon test result | plotVolcano |
*[Superseded]* Quantile align (normalize) factor loading | quantile_norm-deprecated |
*[Superseded]* Quantile align (normalize) factor loadings | quantileAlignSNF |
Quantile Align (Normalize) Factor Loadings | quantileNorm quantileNorm.liger quantileNorm.Seurat |
Access ligerATACDataset peak data | normPeak normPeak,liger,character-method normPeak,ligerATACDataset,missing-method normPeak<- normPeak<-,liger,character-method normPeak<-,ligerATACDataset,missing-method rawPeak rawPeak,liger,character-method rawPeak,ligerATACDataset,missing-method rawPeak<- rawPeak<-,liger,character-method rawPeak<-,ligerATACDataset,missing-method |
Load in data from 10X | read10X read10XATAC read10XRNA |
Read 10X cellranger files (matrix, barcodes and features) into R session | read10XFiles |
Read liger object from RDS file | readLiger |
*[Superseded]* See 'downsample' | readSubset |
Remove missing cells or features from liger object | removeMissing removeMissingObs |
Restore links (to HDF5 files) for reloaded liger/ligerDataset object | restoreH5Liger restoreOnlineLiger |
Retrieve a single matrix of cells from a slot | retrieveCellFeature |
Create "scaled data" for DNA methylation datasets | reverseMethData |
Perform consensus iNMF on scaled datasets | runCINMF runCINMF.liger runCINMF.Seurat |
SNN Graph Based Community Detection | runCluster |
Doublet detection with DoubletFinder | runDoubletFinder |
General QC for liger object | runGeneralQC |
Run Gene Ontology enrichment analysis on differentially expressed genes. | runGOEnrich |
Analyze biological interpretations of metagene | runGSEA |
Perform iNMF on scaled datasets | runINMF runINMF.liger runINMF.Seurat |
Integrate scaled datasets with iNMF or variant methods | runIntegration runIntegration.liger runIntegration.Seurat |
Perform online iNMF on scaled datasets | runOnlineINMF runOnlineINMF.liger runOnlineINMF.Seurat |
Find DEG between groups | runMarkerDEG runPairwiseDEG runWilcoxon |
Perform t-SNE dimensionality reduction | runTSNE |
Perform Mosaic iNMF (UINMF) on scaled datasets with unshared features | runUINMF runUINMF.liger |
Perform UMAP Dimensionality Reduction | runUMAP |
Scale genes by root-mean-square across cells | scaleNotCenter scaleNotCenter.dgCMatrix scaleNotCenter.liger scaleNotCenter.ligerDataset scaleNotCenter.ligerMethDataset scaleNotCenter.Seurat |
Select a subset of informative genes | selectGenes selectGenes.liger selectGenes.Seurat |
Select variable genes from one dataset with Seurat VST method | selectGenesVST |
Subset liger with brackets | sub-liger [.liger |
Subset ligerDataset object | sub-ligerDataset [.ligerDataset |
Get cell metadata variable | sub-sub-liger [[.liger |
Subset liger object | subsetLiger |
Subset ligerDataset object | subsetH5LigerDataset subsetLigerDataset subsetMemLigerDataset |
Update old liger object to up-to-date structure | updateLigerObject |
Write in-memory data into H5 file | writeH5 writeH5.default writeH5.dgCMatrix writeH5.liger writeH5.ligerDataset |