Created
May 28, 2024 03:32
-
-
Save lfy79001/1718fad192204afb58974526162bc0ba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH | |
mutCounts AS ( | |
SELECT | |
COUNT(DISTINCT( Tumor_SampleBarcode )) AS CaseCount, | |
Hugo_Symbol, | |
HGVSc | |
FROM | |
`isb-cgc-bq.pancancer_atlas.Filtered_MC3_MAF_V5_one_per_tumor_sample` | |
GROUP BY | |
Hugo_Symbol, | |
HGVSc | |
), | |
mutRatios AS ( | |
SELECT | |
HGVSc, | |
Hugo_Symbol, | |
CaseCount, | |
(CaseCount/SUM(CaseCount) OVER (PARTITION BY Hugo_Symbol)) AS ratio | |
FROM | |
mutCounts | |
) | |
SELECT * | |
FROM | |
mutRatios | |
WHERE | |
CaseCount>=10 | |
AND ratio>=0.2 | |
AND HGVSc is not null | |
ORDER BY | |
ratio DESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment