Skip to content

Instantly share code, notes, and snippets.

Created August 11, 2010 04:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/518455 to your computer and use it in GitHub Desktop.
Save anonymous/518455 to your computer and use it in GitHub Desktop.
SELECT tmp.*,
td.protein_accession AS pacc,
a.doc_id,
confidence_score AS conf,
relationship_type AS rel,
a.description AS descr
FROM
(SELECT assay_id,
COUNT(molregno) AS nmol,
standard_type AS stype
FROM activities
GROUP BY assay_id,
standard_type
ORDER BY nmol DESC
) tmp,
assay2target a2t,
assays a,
target_dictionary td
WHERE nmol > 75
AND nmol < 500
AND a.assay_id = tmp.assay_id
AND a.assay_type = 'B'
AND tmp.assay_id = a2t.assay_id
AND a2t.assay_tax_id = 9606
AND a2t.confidence_score >= 8
AND td.tid = a2t.tid;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment