dogsheep / genome-to-sqlite

Import your genome into a SQLite database
Apache License 2.0
21 stars 1 forks source link

Figure out some interesting example SQL queries #1

Open simonw opened 5 years ago

simonw commented 5 years ago

My knowledge of genetics has left me short here. I'd love to be able to provide some interesting example SELECT queries - maybe one that spots if you are likely to have red hair?

simonw commented 5 years ago

Thanks to help from Dr. Laura Cantino at Science Hack Day San Francisco I've been able to pull together this query:

select rsid, genotype, case genotype
  when 'AA' then 'brown eye color, 80% of the time'
  when 'AG' then 'brown eye color'
  when 'GG' then 'blue eye color, 99% of the time'
end as interpretation from genome where rsid = 'rs12913832'

See also https://www.snpedia.com/index.php/Rs12913832 - in particular this table:

rs12913832_-_SNPedia
simonw commented 5 years ago
natalie__select_rsid__genotype__case_genotype_when__AA__then__brown_eye_color__80__of_the_time__when__AG__then__brown_eye_color__when__GG__then__blue_eye_color__99__of_the_time__end_as_interpretation_from_genome_where_rsid____rs12913832__an
cobiadigital commented 3 years ago

Risk of autoimmune disorders: https://www.snpedia.com/index.php/Genotype

select rsid, genotype, case genotype
  when 'AA' then '2x risk of rheumatoid arthritis and other autoimmune diseases'
  when 'GG' then 'Normal risk for autoimmune disorders'
end as interpretation from genome where rsid = 'rs2476601'
cobiadigital commented 3 years ago

The "Warrior Gene" https://www.snpedia.com/index.php/Rs4680

select rsid, genotype, case genotype
  when 'AA' then '(worrier) advantage in memory and attention tasks'
  when 'AG' then 'Intermediate dopamine levels, other effects'
  when 'GG' then '(warrior) multiple associations, see details'
end as interpretation from genome where rsid = 'rs4680'
cobiadigital commented 3 years ago

rs7903146 Influences risk of Type-2 diabetes https://www.snpedia.com/index.php/Rs7903146

select rsid, genotype, case genotype
  when 'CC' then 'Normal (lower) risk of Type 2 Diabetes and Gestational Diabetes.'
  when 'CT' then '1.4x increased risk for diabetes (and perhaps colon cancer).'
  when 'TT' then '2x increased risk for Type-2 diabetes'
end as interpretation from genome where rsid = 'rs7903146'
cobiadigital commented 3 years ago

Both rs10757274 and rs2383206 can both indicate higher risks of heart disease https://www.snpedia.com/index.php/Rs2383206

select rsid, genotype, case genotype
  when 'AA' then 'Normal'
  when 'AG' then '~1.2x increased risk for heart disease'
  when 'GG' then '~1.3x increased risk for heart disease'
end as interpretation from genome where rsid = 'rs10757274'
select rsid, genotype, case genotype
  when 'AA' then 'Normal'
  when 'AG' then '1.4x increased risk for heart disease'
  when 'GG' then '1.7x increased risk for heart disease'
end as interpretation from genome where rsid = 'rs2383206'
cobiadigital commented 3 years ago

rs53576: the oxytocin receptor (OXTR) gene

select rsid, genotype, case genotype
  when 'AA' then 'Lack of empathy?'
  when 'AG' then 'Lack of empathy?'
  when 'GG' then 'Optimistic and empathetic; handle stress well'
end as interpretation from genome where rsid = 'rs53576'
cobiadigital commented 3 years ago

rs1333049 associated with coronary artery disease https://www.snpedia.com/index.php/Rs1333049


select rsid, genotype, case genotype
  when 'CC' then '1.9x increased risk for coronary artery disease'
  when 'CG' then '1.5x increased risk for CAD'
  when 'GG' then 'normal'
end as interpretation from genome where rsid = 'rs1333049'
cobiadigital commented 3 years ago

RS1800955 is related to novelty seeking and ADHD https://www.snpedia.com/index.php/Rs1800955

select rsid, genotype, case genotype when 'CC' then 'increased susceptibility to novelty seeking' when 'CT' then 'increased susceptibility to novelty seeking' when 'TT' then 'normal' end as interpretation from genome where rsid = 'rs1800955'