A method of barcoding is provided. The method comprises performing a ligation assay on target nucleic acid molecules that are in or on cells or cell organelles to produce ligation products and adding cell-origination barcodes onto the ligation products or complements thereof by a split-pool barcoding process.