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
#!/usr/bin/python3 | |
# This Script parses a couple of genotyping-files downloaded from openSNP. | |
# It supports deCODEme, FamilyTreeDNA and 23andme-files. | |
# If you don't like the Object Oriented Magic just comment out the lines with allSnps.append | |
# and do your own magic. | |
# Example-Useage is name of the script followed by as many filenames as you like. | |
# ./megaparser.py 200.23andme.12 92.decodeme.1 [...] | |
# or: |
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
$ python2.7 parse.py | |
0.797344923019 | |
$ julia parse.jl | |
16789.66212272644 | |
o.O | |
Tested against a 91mb big tab-delimited input-file. | |
With a 800mb big file: |
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
min = 1000000000 | |
5.times do | |
t = Time.now | |
File.open("./backParsedTapidorContigs.csv").each do |r| | |
r.split("\t") | |
end | |
finish = (Time.now - t) | |
if finish < min | |
min = finish | |
end |
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
------------------------------------------------------- | |
C++: | |
#include <iostream> | |
#include <string> | |
#include <fstream> | |
#include <boost/tokenizer.hpp> | |
#include <vector> | |
#include <iterator> | |
#include <sys/time.h> |
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
return_dict = {} | |
for line in file_handle: | |
line_list = line.split() | |
if line_list[0] in return_dict.keys(): | |
return_dict[line_list[0]].append(line_list) | |
else: | |
return_dict[line_list[0]] = [line_list] |
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
return_dict = {} | |
for line in file_handle: | |
line_list = line.split() | |
try: | |
return_dict[line_list[0]].append(line_list) | |
except KeyError: | |
return_dict[line_list[0]] = [line_list] |
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
from collections import defaultdict | |
d = defaultdict(list) | |
for line in file_handle: | |
line_list = line.split | |
d[line_list[0]].append(line_list) |
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
package main | |
import ( | |
"bufio" | |
"fmt" | |
"os" | |
) | |
func main() { | |
f, err := os.Open("./example") |
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
>>python -m timeit "100 + 0.0" | |
10000000 loops, best of 3: 0.0217 usec per loop | |
>>python -m timeit "float(100)" | |
10000000 loops, best of 3: 0.17 usec per loop |
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
PRIMUS_VERBOSE=2 primusrun ./Buddha.bin.x86 | |
[S_API FAIL] SteamAPI_Init() failed; SteamAPI_IsSteamRunning() failed. | |
[S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.dll. | |
primus: profiling: display: 45.6 fps, 24.3% wait, 20.0% upload, 55.7% draw+swap | |
primus: profiling: readback: 45.9 fps, 28.0% app, 18.6% map, 53.4% wait | |
primus: profiling: display: 59.9 fps, 0.7% wait, 27.1% upload, 72.2% draw+swap | |
primus: profiling: readback: 59.8 fps, 5.1% app, 20.8% map, 74.1% wait | |
primus: profiling: display: 51.3 fps, 15.4% wait, 23.5% upload, 61.1% draw+swap | |
primus: profiling: readback: 51.3 fps, 16.6% app, 19.2% map, 64.2% wait | |
primus: profiling: display: 59.9 fps, 0.7% wait, 26.8% upload, 72.5% draw+swap |
OlderNewer