A downhole system comprising: i) a quartz enhanced photoacoustic spectrometer, i.e., QEPAS configured to be positioned within a wellbore formed in a subterranean zone of a hydrocarbon formation, wherein the QEPAS comprises a first, passive quartz tuning fork, i.e. QTF, configured to detect a pressure wave created in a gas in the sample, a laser configured to emit light, wherein the pressure wave is created as the light is absorbed by the gas, and a second, active QTF configured to induce a pressure wave in the gas, wherein the first, passive QTF is coupled to the second, active QTF and configured to detect the induced pressure wave; ii) a sampling system coupled to the QEPAS, the sampling system configured to be positioned in the wellbore, the sampling system configured to obtain a sample of a wellbore fluid at a downhole location in the subterranean zone, the QEPAS configured to spectroscopically scan the sample and to determine a plurality of quantities of a corresponding plurality of hydrocarbons in the sample; and iii) a computer system connected to the QEPAS, the computer systen comprising one or more processors and a computer-readable medium storing instructions executable by the one or more processors to perform operations comprising receiving the plurality of quantities of the plurality of hydrocarbons in the sample and determining a plurality of ratios, each ratio being a ratio of one of the plurality of hydrocarbons with another of the plurality of hydrocarbons. i) a quartz enhanced photoacoustic spectrometer, i.e., QEPAS configured to be positioned within a wellbore formed in a subterranean zone of a hydrocarbon formation, wherein the QEPAS comprises a first, passive quartz tuning fork, i.e. QTF, configured to detect a pressure wave created in a gas in the sample, a laser configured to emit light, wherein the pressure wave is created as the light is absorbed by the gas, and a second, active QTF configured to induce a pressure wave in the gas, wherein the first, passive QTF is coupled to the second, active QTF and configured to detect the induced pressure wave; a first, passive quartz tuning fork, i.e. QTF, configured to detect a pressure wave created in a gas in the sample, a laser configured to emit light, wherein the pressure wave is created as the light is absorbed by the gas, and a second, active QTF configured to induce a pressure wave in the gas, wherein the first, passive QTF is coupled to the second, active QTF and configured to detect the induced pressure wave; ii) a sampling system coupled to the QEPAS, the sampling system configured to be positioned in the wellbore, the sampling system configured to obtain a sample of a wellbore fluid at a downhole location in the subterranean zone, the QEPAS configured to spectroscopically scan the sample and to determine a plurality of quantities of a corresponding plurality of hydrocarbons in the sample; and iii) a computer system connected to the QEPAS, the computer systen comprising one or more processors and a computer-readable medium storing instructions executable by the one or more processors to perform operations comprising receiving the plurality of quantities of the plurality of hydrocarbons in the sample and determining a plurality of ratios, each ratio being a ratio of one of the plurality of hydrocarbons with another of the plurality of hydrocarbons. one or more processors and a computer-readable medium storing instructions executable by the one or more processors to perform operations comprising receiving the plurality of quantities of the plurality of hydrocarbons in the sample and determining a plurality of ratios, each ratio being a ratio of one of the plurality of hydrocarbons with another of the plurality of hydrocarbons. receiving the plurality of quantities of the plurality of hydrocarbons in the sample and determining a plurality of ratios, each ratio being a ratio of one of the plurality of hydrocarbons with another of the plurality of hydrocarbons.