Skip to content

Instantly share code, notes, and snippets.

@xiaojay
Created July 9, 2016 09:43
Show Gist options
  • Save xiaojay/32b246cc48ae387a43939c52b8c3a722 to your computer and use it in GitHub Desktop.
Save xiaojay/32b246cc48ae387a43939c52b8c3a722 to your computer and use it in GitHub Desktop.
bigquery on 1000 genomes
SELECT
reference_name,
names,
start,
END,
reference_bases,
alt,
sample_id,
genotype from(
SELECT
reference_name,
names,
start,
END,
reference_bases,
GROUP_CONCAT(alternate_bases) WITHIN RECORD AS alt,
call.call_set_name AS sample_id,
GROUP_CONCAT(STRING(call.genotype)) WITHIN call AS genotype
FROM
FLATTEN([genomics-public-data:1000_genomes.variants],names)
WHERE
names = 'rs13266634')
WHERE
sample_id = "NA18525"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment