where ncsq,r is the normalized connectivity score for signature r w.r.t query q, ncsi,r is the normalized connectivity score for signature r relative to the i-th query in Qref and N is the number of queries in Qref Our standard practice is that Qref be comprised of queries obtained from exemplar signatures of Touchstone perturbagens that match the cell line and perturbation type of signature r. In principle any arbitrary compendium of gene sets (as long as they are large enough) could be used.