Package: rliger 2.1.0

Yichen Wang

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:Joshua Welch [aut], Yichen Wang [aut, cre], Chao Gao [aut], Jialin Liu [aut], Joshua Sodicoff [aut, ctb], Velina Kozareva [aut, ctb], Evan Macosko [aut, ctb], Paul Hoffman [ctb], Ilya Korsunsky [ctb], Robert Lee [ctb], Andrew Robbins [ctb]

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

Uses libs:
  • openblas– Optimized BLAS
  • c++– GNU Standard C++ Library v3
Datasets:
  • 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

On CRAN:

Conda:

openblascpp

3.56 score 1 packages 1.2k downloads 167 exports 78 dependencies

Last updated 5 months agofrom:bf9469b474. Checks:1 OK, 2 ERROR. Indexed: no.

TargetResultLatest binary
Doc / VignettesOKMar 29 2025
R-4.5-linux-x86_64ERRORMar 29 2025
R-4.4-linux-x86_64ERRORMar 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

Data integration with LIGER

Rendered fromliger_vignette.Rmdusingknitr::rmarkdownon Mar 29 2025.

Last update: 2024-10-29
Started: 2024-10-29

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:

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 pageTopics
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 integrationalignFactors alignFactors.liger alignFactors.Seurat
Converting other classes of data to a liger objectas.liger as.liger.dgCMatrix as.liger.Seurat as.liger.SingleCellExperiment seuratToLiger
Converting other classes of data to a ligerDataset objectas.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 modalitybmmc
Calculate agreement metric after integrationcalcAgreement
Calculate alignment metric after integrationcalcAlignment
Calculate adjusted Rand index (ARI) by comparing two cluster labeling variablescalcARI
Calculate a dataset-specificity score for each factorcalcDatasetSpecificity
Calculate Normalized Mutual Information (NMI) by comparing two cluster labeling variablescalcNMI
Calculate purity by comparing two cluster labeling variablescalcPurity
*[Experimental]* Align factor loading by centroid alignment (beta)centroidAlign centroidAlign.liger centroidAlign.Seurat
Close all links (to HDF5 files) of a liger objectcloseAllH5 closeAllH5.liger closeAllH5.ligerDataset
Check difference of two liger commandcommandDiff
Convert old liger object to latest versionconvertOldLiger
Access ligerSpatialDataset coordinate datacoordinate coordinate,liger,character-method coordinate,ligerSpatialDataset,missing-method coordinate<- coordinate<-,liger,character-method coordinate<-,ligerSpatialDataset,missing-method
Create on-disk ligerDataset ObjectcreateH5LigerDataset
Create liger objectcreateLiger
Create in-memory ligerDataset objectcreateLigerDataset
Data frame for example marker DEG test resultdeg.marker
Data frame for example pairwise DEG test resultdeg.pw
Downsample datasetsdownsample
Export predicted gene-pair interactionexportInteractTrack
Find shared and dataset-specific markersgetFactorMarkers
Calculate proportion mitochondrial contributiongetProportionMito
Apply function to chunks of H5 data in ligerDataset objectH5Apply
Import prepared dataset publically availableimportBMMC importCGE importPBMC
Impute the peak counts from gene expression data referring to an ATAC dataset after integrationimputeKNN
Check if given liger object if under new implementationis.newLiger
Check if a liger or ligerDataset object is made of HDF5 fileisH5Liger
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 modalityligerATACDataset ligerATACDataset-class
ligerCommand object: Record the input and time of a LIGER function callligerCommand ligerCommand-class show,ligerCommand-method
ligerDataset classcbind.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 modalityligerMethDataset ligerMethDataset-class
Subclass of ligerDataset for RNA modalityligerRNADataset ligerRNADataset-class
Subclass of ligerDataset for Spatial modalityligerSpatialDataset ligerSpatialDataset-class
Convert between liger and Seurat objectligerToSeurat
Linking genes to putative regulatory elementslinkGenesAndPeaks
*[Superseded]* Louvain algorithm for community detectionlouvainCluster-deprecated
Fast calculation of feature count matrixmakeFeatureMatrix
*[Deprecated]* Export predicted gene-pair interactionmakeInteractTrack-deprecated
*[Deprecated]* Generate a river (Sankey) plotmakeRiverplot-deprecated
Create new variable from categories in cellMetamapCellMeta
Merge hdf5 filesmergeH5
Merge matrices while keeping the union of rowsmergeDenseAll mergeSparseAll
Return preset modality of a ligerDataset object or that of all datasets in a liger objectmodalOf
Normalize raw counts datanormalize normalize.dgCMatrix normalize.liger normalize.ligerDataset normalize.matrix normalize.Seurat normalizePeak
*[Deprecated]* Perform online iNMF on scaled datasetsonline_iNMF-deprecated
*[Deprecated]* Perform iNMF on scaled datasetsoptimizeALS-deprecated
Perform factorization for new dataoptimizeNewData
Perform factorization for new value of koptimizeNewK
Perform factorization for new lambda valueoptimizeNewLambda
Perform factorization for subset of dataoptimizeSubset
liger object of PBMC subsample data with Control and Stimulated datasetspbmc
liger object of PBMC subsample data with plotting information availablepbmcPlot
Create barcode-rank plot for each datasetplotBarcodeRank
Generate violin/box plot(s) using liger objectplotCellViolin
Make dot plot of factor loading in cell groupsplotClusterFactorDot
Make dot plot of gene expression in cell groupsplotClusterGeneDot
Create violin plot for multiple genes grouped by clustersplotClusterGeneViolin
Create density plot basing on specified coordinatesplotDensityDimRed
Generate scatter plot(s) using liger objectplotByDatasetAndCluster plotClusterDimRed plotDatasetDimRed plotDimRed plotFactorDimRed plotGeneDimRed plotPeakDimRed
Create volcano plot with EnhancedVolcanoplotEnhancedVolcano
Plot Heatmap of Gene Expression or Factor LoadingplotFactorHeatmap plotGeneHeatmap
Visualize factor expression and gene loadingplotGeneLoadingRank plotGeneLoadings
Visualize gene expression or cell metadata with violin plotplotGeneDetectedViolin plotGeneViolin plotTotalCountViolin
Visualize GO enrichment test result in dot plotplotGODot
Comprehensive group splited cluster plot on dimension reduction with proportionplotGroupClusterDimRed
Create heatmap for showing top marker expression in conditionsplotMarkerHeatmap
Create heatmap for pairwise DEG analysis resultplotPairwiseDEGHeatmap
Visualize proportion across two categorical variablesplotClusterProportions plotProportion plotProportionBar plotProportionDot plotProportionPie
Box plot of cluster proportion in each dataset, grouped by conditionplotProportionBox
Make Riverplot/Sankey diagram that shows label mapping across datasetsplotSankey
Visualize a spatial datasetplotSpatial2D plotSpatial2D.liger plotSpatial2D.ligerSpatialDataset
Plot the variance vs mean of feature expressionplotVarFeatures
Create volcano plot for Wilcoxon test resultplotVolcano
*[Superseded]* Quantile align (normalize) factor loadingquantile_norm-deprecated
*[Superseded]* Quantile align (normalize) factor loadingsquantileAlignSNF
Quantile Align (Normalize) Factor LoadingsquantileNorm quantileNorm.liger quantileNorm.Seurat
Access ligerATACDataset peak datanormPeak 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 10Xread10X read10XATAC read10XRNA
Read 10X cellranger files (matrix, barcodes and features) into R sessionread10XFiles
Read liger object from RDS filereadLiger
*[Superseded]* See 'downsample'readSubset
Remove missing cells or features from liger objectremoveMissing removeMissingObs
Restore links (to HDF5 files) for reloaded liger/ligerDataset objectrestoreH5Liger restoreOnlineLiger
Retrieve a single matrix of cells from a slotretrieveCellFeature
Create "scaled data" for DNA methylation datasetsreverseMethData
Perform consensus iNMF on scaled datasetsrunCINMF runCINMF.liger runCINMF.Seurat
SNN Graph Based Community DetectionrunCluster
Doublet detection with DoubletFinderrunDoubletFinder
General QC for liger objectrunGeneralQC
Run Gene Ontology enrichment analysis on differentially expressed genes.runGOEnrich
Analyze biological interpretations of metagenerunGSEA
Perform iNMF on scaled datasetsrunINMF runINMF.liger runINMF.Seurat
Integrate scaled datasets with iNMF or variant methodsrunIntegration runIntegration.liger runIntegration.Seurat
Perform online iNMF on scaled datasetsrunOnlineINMF runOnlineINMF.liger runOnlineINMF.Seurat
Find DEG between groupsrunMarkerDEG runPairwiseDEG runWilcoxon
Perform t-SNE dimensionality reductionrunTSNE
Perform Mosaic iNMF (UINMF) on scaled datasets with unshared featuresrunUINMF runUINMF.liger
Perform UMAP Dimensionality ReductionrunUMAP
Scale genes by root-mean-square across cellsscaleNotCenter scaleNotCenter.dgCMatrix scaleNotCenter.liger scaleNotCenter.ligerDataset scaleNotCenter.ligerMethDataset scaleNotCenter.Seurat
Select a subset of informative genesselectGenes selectGenes.liger selectGenes.Seurat
Select variable genes from one dataset with Seurat VST methodselectGenesVST
Subset liger with bracketssub-liger [.liger
Subset ligerDataset objectsub-ligerDataset [.ligerDataset
Get cell metadata variablesub-sub-liger [[.liger
Subset liger objectsubsetLiger
Subset ligerDataset objectsubsetH5LigerDataset subsetLigerDataset subsetMemLigerDataset
Update old liger object to up-to-date structureupdateLigerObject
Write in-memory data into H5 filewriteH5 writeH5.default writeH5.dgCMatrix writeH5.liger writeH5.ligerDataset