A method for identifying a location of an analyte in a biological sample, the method comprising: (a) contacting the biological sample with a first probe, a second probe, and a plurality of undesirable RNA depletion probes, wherein the first probe and the second probe are substantially complementary to adjacent sequences of the analyte, wherein the second probe comprises a capture probe binding domain that is capable of binding to a capture domain of a capture probe, and wherein an undesirable RNA depletion probe of the plurality of undesirable RNA depletion probes is substantially complementary to a sequence of an undesirable RNA molecule in the biological sample; (b) hybridizing the first probe and the second probe to the analyte; (c) hybridizing the undesirable RNA depletion probe to the undesirable RNA molecule, thereby forming undesirable RNA depletion probe-undesirable RNA complexes; (d) ligating the first probe and the second probe, thereby creating a ligated probe that is substantially complementary to the analyte; (e) removing the undesirable RNA depletion probe-undesirable RNA complexes and releasing the ligated probe from the analyte; (f) hybridizing the capture probe binding domain of the ligated probe to the capture domain of the capture probe that is affixed to a substrate, wherein the capture probe further comprises a spatial barcode; and (g) determining (i) all or a part of the sequence of the ligated probe specifically bound to the capture domain, or a complement thereof, and (ii) the spatial barcode, or a complement thereof, and using the determined sequence of (i) and (ii) to identify the location of the analyte in the biological sample. (a) contacting the biological sample with a first probe, a second probe, and a plurality of undesirable RNA depletion probes, wherein the first probe and the second probe are substantially complementary to adjacent sequences of the analyte, wherein the second probe comprises a capture probe binding domain that is capable of binding to a capture domain of a capture probe, and wherein an undesirable RNA depletion probe of the plurality of undesirable RNA depletion probes is substantially complementary to a sequence of an undesirable RNA molecule in the biological sample; (b) hybridizing the first probe and the second probe to the analyte; (c) hybridizing the undesirable RNA depletion probe to the undesirable RNA molecule, thereby forming undesirable RNA depletion probe-undesirable RNA complexes; (d) ligating the first probe and the second probe, thereby creating a ligated probe that is substantially complementary to the analyte; (e) removing the undesirable RNA depletion probe-undesirable RNA complexes and releasing the ligated probe from the analyte; (f) hybridizing the capture probe binding domain of the ligated probe to the capture domain of the capture probe that is affixed to a substrate, wherein the capture probe further comprises a spatial barcode; and (g) determining (i) all or a part of the sequence of the ligated probe specifically bound to the capture domain, or a complement thereof, and (ii) the spatial barcode, or a complement thereof, and using the determined sequence of (i) and (ii) to identify the location of the analyte in the biological sample. <EOS>