Details for Sense Of Smell and openSNP Data (New SNPs).ipynb

Published by dnvrdavid

Description

The notebook uses three genetic locations (SNPs) to try to predict sense of smell. The association of these SNPs with smell is based solely on recent (amateur) analysis of genotypes and reported phenotypes from openSNP.

0

Tags & Data Sources

smell rs6424618 rs723898 rs1542713 gwas snpedia 23andme openhumans opensnp 23andMe Upload

Comments

Please log in to comment.

Notebook
Last updated 5 months, 1 week ago

Sense Of Smell and openSNP Data (New SNPs)

This notebook explores the connection between genetics and sense of smell. It compares your genetic data to public data from openSNP to ask this question:

Do people with genotypes like yours have a similar smell sensitivity as you?

Data you need

This notebook was designed to work with data from openSNP (including 23andMe, Ancestry, and Illumina data). For example, if you have 23andMe data, you can add it to Open Humans using this tool: https://www.openhumans.org/activity/23andme-upload/

How it works

This compares your data to people participating in openSNP, where people have publicly shared genetic data along with responses to surveys - including one about sense of smell.

(Do you have an openSNP account? You can use connect it to Open Humans!)

The notebook uses three genetic locations (SNPs) that appear to be associated with sense of smell based solely on recent analysis of genotypes and reported phenotypes from openSNP (not from GWAS, SNPedia, or any other source). Since datasets are small and published studies have not been found for these SNPs, these associations are considered preliminary and could possibly be the result of random chance.

Hit "Run" to start!

Hit the "Run" button above to run each step in the code below. (Or select "Run All" from the "Cell" menu above to run everything at once.) First, we'll get your genetic data that is stored in Open Humans.

In [8]:
import os
import requests
import tempfile

print("Checking for 23andMe data in Open Humans...\n")

response = requests.get(
    "https://www.openhumans.org/api/direct-sharing/project/exchange-member/"
    "?access_token={}".format(os.environ.get('OH_ACCESS_TOKEN')))
for entry in response.json()['data']:
    if entry['source'] == "direct-sharing-128" and 'vcf' not in entry['metadata']['tags']:
        file_url_23andme = entry['download_url']
        break
        
if 'file_url_23andme' not in locals():
    print("Sorry, you first need to add 23andMe data to Open Humans!\n"
          "You can do that here: https://www.openhumans.org/activity/23andme-upload/")
else:
    print("Great, you have 23andMe data in Open Humans! We'll retrieve this...\n")

file_23andme = tempfile.NamedTemporaryFile()
file_23andme.write(requests.get(file_url_23andme).content)
file_23andme.flush()

print("Done!")
Checking for 23andMe data in Open Humans...

Great, you have 23andMe data in Open Humans! We'll retrieve this...

Done!

Step 2: Find your data at the SNP locations.

Each line of 23andMe data represents your genetic information at a particular location, called a single nucleotide polymorphism (SNP).

This notebook's smell sensitivity prediction method uses data from three SNP locations near each other on chromosome 1 (Gene ADGRL4, also known as ELTD1). Their association to sense of smell was recently discovered (by an amateur) by analyzing data from openSNP along with reported phenotypes. These three SNPs rs723898, rs1542713, rs6424618 were found to be highly correlated with each other, i.e. having a particular genotype on one of them is highly predicive of the genotypes on the other two SNPs.

Keep hitting "Run" to continue running the notebook. The code below will scan your data and get your genetic information at these locations.

In [9]:
snps = {
     'rs723898': None,
    'rs1542713': None,
    'rs6424618': None
}

file_23andme.seek(0)
for line in file_23andme:
    line = line.decode('utf-8').strip()
    if line.startswith('#'):
        continue
    line_data = line.split('\t')
    if line_data[0] in snps.keys():
        snps[line_data[0]] = line_data[3]

genostring = snps['rs723898'] + snps['rs1542713'] + snps['rs6424618']

for snp in snps.keys():
    print('{}:\t{}'.format(snp, snps[snp] if snps[snp] else 'Unknown'))

your_genotype = ('{}'.format(snps['rs723898']),'{}'.format(snps['rs1542713']),'{}'.format(snps['rs6424618']))
rs723898:	CC
rs1542713:	TT
rs6424618:	TT

Get an openSNP summary for your genotype

Summary statistics were generated using data downloaded from openSNP for various reported phenotypes. Currently, this process requires genotypes from all three SNPs. If you have all three genotypes, you should see a summary below after running. The three SNPs are so correlated that only three different combinations have been seen so far!

In [10]:
cctttt = r'''
Out of 45 people sharing this genotype in openSNP data...
  28.9% reported     AboveAvg sense of smell
  24.4% reported      Average sense of smell
  24.4% reported   SuperPower sense of smell
   8.9% reported        Great sense of smell
   6.7% reported         Good sense of smell
   4.4% reported         Poor sense of smell
   2.2% reported  LessWithAge sense of smell'''
ctgtct = r'''
Out of 43 people sharing this genotype in openSNP data...
  30.2% reported     AboveAvg sense of smell
  18.6% reported      Average sense of smell
  16.3% reported        Great sense of smell
  11.6% reported   SuperPower sense of smell
   9.3% reported         Good sense of smell
   7.0% reported         Poor sense of smell
   7.0% reported  LessWithAge sense of smell'''
ttggcc = r'''
Out of 30 people sharing this genotype in openSNP data...
  33.3% reported         Poor sense of smell
  20.0% reported         Good sense of smell
  20.0% reported     AboveAvg sense of smell
  13.3% reported      Average sense of smell
   6.7% reported        Great sense of smell
   3.3% reported  LessWithAge sense of smell
   3.3% reported   SuperPower sense of smell'''

print ('As of 17 June 2018...')
if genostring == 'CCTTTT':
    print(cctttt)
elif genostring == 'CTGTCT':
    print(ctgtct)
elif genostring == 'TTGGCC':
    print(ttggcc)
else:
    print('Sorry, no results found. Genotypes are required for all 3 SNPs.')
As of 17 June 2018...

Out of 45 people sharing this genotype in openSNP data...
  28.9% reported     AboveAvg sense of smell
  24.4% reported      Average sense of smell
  24.4% reported   SuperPower sense of smell
   8.9% reported        Great sense of smell
   6.7% reported         Good sense of smell
   4.4% reported         Poor sense of smell
   2.2% reported  LessWithAge sense of smell
In [ ]: