Skip to content

Instantly share code, notes, and snippets.

View gedankenstuecke's full-sized avatar
🥽
Doing Research

Bastian Greshake Tzovaras gedankenstuecke

🥽
Doing Research
View GitHub Profile
@gedankenstuecke
gedankenstuecke / _edit.html.erb
Created September 11, 2011 14:26 — forked from scy/_edit.html.erb
Initializing a jQuery UI autocomplete with data from a Rails array
<script type="text/javascript">
// Trying to help @gedankenstuecke here. A bit hard because I don’t speak Rails (neither Ruby) and can’t try live what the output looks like.
$(function () {
$("#<%=p.object.phenotype_id.to_json%>").autocomplete({
source: <%=raw(Phenotype.find_by_id(p.object.phenotype_id).known_phenotypes.to_json)%>
});
});
</script>
@gedankenstuecke
gedankenstuecke / opensnp-log #2
Created September 29, 2011 18:22
Server-Log openSNP: This does not work, was done in chrome
Started GET "/users/6/edit" for $IP at 2011-09-29 10:41:56 -0700
Processing by UsersController#edit as HTML
Parameters: {"id"=>"6"}
User Load (2.7ms) SELECT "users".* FROM "users" WHERE "users"."persistence_token" = 'some_token' LIMIT 1
User Load (4.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 6 LIMIT 1
CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = 6 LIMIT 1
CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = 6 LIMIT 1
Rendered shared/_error_messages.html.erb (0.1ms)
UserPhenotype Load (0.3ms) SELECT "user_phenotypes".* FROM "user_phenotypes" WHERE ("user_phenotypes".user_id = 6)
Phenotype Load (4.2ms) SELECT "phenotypes".* FROM "phenotypes" WHERE "phenotypes"."id" = 3 LIMIT 1
@gedankenstuecke
gedankenstuecke / opensnp-log #1
Created September 29, 2011 18:25
Server-Log openSNP: This does work, done in firefox
Started GET "/users/6/edit" for $IP at 2011-09-29 11:05:57 -0700
Processing by UsersController#edit as HTML
Parameters: {"id"=>"6"}
User Load (3.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 6 LIMIT 1
CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = 6 LIMIT 1
CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = 6 LIMIT 1
CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = 6 LIMIT 1
Rendered shared/_error_messages.html.erb (0.1ms)
UserPhenotype Load (2.3ms) SELECT "user_phenotypes".* FROM "user_phenotypes" WHERE ("user_phenotypes".user_id = 6)
Phenotype Load (2.9ms) SELECT "phenotypes".* FROM "phenotypes" WHERE "phenotypes"."id" = 3 LIMIT 1
@gedankenstuecke
gedankenstuecke / 23andme-compare.py
Created February 13, 2012 23:34
compare 2 23andMe plaintext files to get the number of SNPs which have the identical genotype over both files
# usage: just run "./compare_snps.py 23andme_file_1.txt 23andme_file_2.txt"
import sys
def read_23andme(filename):
handle = open(filename,"r")
snps = {}
for line in handle:
if line[0] != "#":
line_array = line.split("\t")
@gedankenstuecke
gedankenstuecke / denisova_23andme.py
Created February 14, 2012 07:46
Convert the SNPedia VCF into 23andMe-style file
# create a 23andMe-style file that includes all openSNP-listed SNPs out of the denisova-genome
import sys
class snp():
def __init__(self,chromosome,position,major_allele,minor_allele,rsid):
self.chromosome = chromosome
self.position = position
self.major_allele = major_allele
self.minor_allele = minor_allele
@gedankenstuecke
gedankenstuecke / variations_for_phenotype.json
Created July 26, 2012 15:55
results of http://localhost:3000/phenotypes/json/variations/1.json
{"id":1,"characteristic":"Eye color","description":"There is still work done on the genetics of the eye color and it is already known that different genes participate in the outcome and some associated SNPs have already been identified. \r\n\r\nFor more information about the genetics of eye color you can read the Wikipedia: http://en.wikipedia.org/wiki/Eye_color \r\n\r\nThe SNPedia did already start a project to self-report eye color. See: http://www.snpedia.com/index.php/Eye_color","known_variations":["Brown","Blue-grey","Green","Blue","Blue-green","Hazel","Mixed","Brown-green","Dark blue","Dark brown","Blue-green ","Light-mixed green","Hazel::Light brown","Braun","Blue grey","Gray-blue","Green-brown","Gray-blue with a center ring of yellowish light brown","Indeterminate brown-green with a subtle grey caste","Blue-grey; broken amber collarette"],"users":[{"user_id":6,"variation":"brown"},{"user_id":8,"variation":"Brown"},{"user_id":11,"variation":"brown"},{"user_id":13,"variation":"brown"},{"user_id":14,"var
@gedankenstuecke
gedankenstuecke / phenotypes.json
Created July 26, 2012 15:57
results of http://localhost:3000/phenotypes.json
[{"id":1,"characteristic":"Eye color","known_variations":["Brown","Blue-grey","Green","Blue","Blue-green","Hazel","Mixed","Brown-green","Dark blue","Dark brown","Blue-green ","Light-mixed green","Hazel::Light brown","Braun","Blue grey","Gray-blue","Green-brown","Gray-blue with a center ring of yellowish light brown","Indeterminate brown-green with a subtle grey caste","Blue-grey; broken amber collarette"],"number_of_users":152},{"id":3,"characteristic":"Handedness","known_variations":["Right-handed","Left-handed","Ambidexterous","Left-handed for small motor movement, writing. right-handed for large motor movement, throwing","Right","Right handed","Right handed, only in golfsport left handed!"],"number_of_users":131},{"id":15,"characteristic":"Height","known_variations":["Tall ( >180cm )","188cm","Average 173cm","5'1\" or 155cm","Average ( 165cm < x < 180cm )","183 cm","Average","180cm","5'6\"","Tall ","5'10''","190cm","6'3\"","177.8 cm","193cm","188 cm","5'10\"","189cm","5'2\"","179cm","180 cm","5'5\"","5'4\
@gedankenstuecke
gedankenstuecke / snp_annotation.json
Created July 26, 2012 15:57
results of http://localhost:3000/snps/json/annotation/rs1800795.json
{"snp":{"name":"rs1800795","chromosome":"7","position":"22733170","annotations":{"mendeley":[{"author":"Brandon L Pierce","title":"C-reactive protein, interleukin-6, and prostate cancer risk in men aged 65 years and older.","publication_year":2009,"number_of_readers":2,"open_access":false,"url":"http://www.mendeley.com/research/creactive-protein-interleukin6-and-prostate-cancer-risk-in-men-aged-65-years-and-older/","doi":null},{"author":"Petter Ljungman","title":"DNA variants, plasma levels and variability of interleukin-6 in myocardial infarction survivors: results from the AIRGENE study.","publication_year":2009,"number_of_readers":3,"open_access":false,"url":"http://www.mendeley.com/research/dna-variants-plasma-levels-and-variability-of-interleukin6-in-myocardial-infarction-survivors-results-from-the-airgene-study/","doi":null},{"author":"Joanne P Lagmay","title":"Prognostic significance of interleukin-6 single nucleotide polymorphism genotypes in neuroblastoma: rs1800795 (promoter) and rs8192284 (receptor
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
DATE; STEPS; NOTES
2013-01-18; 7542
2013-01-17; 3846
2013-01-16; 10765
2013-01-15; 16252
2013-01-14; 10039
2013-01-13; 11016
2013-01-12; 6307
2013-01-11; 3415
2013-01-10; 6269
date fitbit fuelband
2012-11-16 14161 12958
2012-11-17 15224 14487
2012-11-18 4690 4491
2012-11-19 16504 16925
2012-11-20 11906 12314
2012-11-21 11559 10322
2012-11-22 11095 9472
2012-11-23 7396 7548
2012-11-24 13568 12194