Skip to content

Instantly share code, notes, and snippets.

View dalloliogm's full-sized avatar

Giovanni Dall'Olio dalloliogm

View GitHub Profile
#!/usr/bin/env bash
# Wrapper to launch a single cosi iteration
#
# COSI ( http://www.broadinstitute.org/~sfs/cosi/ ) is a software to simulate Human Genetic Variation
# (see http://genome.cshlp.org/content/15/11/1576.full for the reference).
# It can be used to simulate SNP data of 3 human populations, EUR, AFR and ASN.
#
# This script is a wrapper to launch multiple COSI simulations in parallel, using the GNU/parallel tool
#
#
@dalloliogm
dalloliogm / average_path_length.py
Created November 21, 2012 12:52 — forked from anonymous/average_path_length.py
igraph: average path length
#!/usr/bin/env python
"""
"""
import random
import igraph
from numpy import mean, nan_to_num, nan
from pprint import pprint
import nose
import logging
logging.basicConfig(level=logging.DEBUG)
@dalloliogm
dalloliogm / launch_single_cosi_iteration_local.sh
Created July 11, 2012 09:36
launch_single_cosi_iteration_local.sh
#!/usr/bin/env bash
# Launch a single cosi iteration.
#
# Standard usage (to run one single simulation)
#
# $: ./launch_single_cosi_iteration_local.sh simulation1 data/simulation_output/
#
#
# Description of parameters:
#
@dalloliogm
dalloliogm / get_snpannotation_from_biomart.R
Created July 11, 2012 09:35
get_snpannotation_from_biomart.R
#/!usr/bin/env Rscript
description = "
Given a list of SNPs, get their disease-association status from Biomart.
++++++++++++++++++
Parameters
++++++++++++++++++
@dalloliogm
dalloliogm / get_genotypes.py
Created June 18, 2012 16:05
get genotypes from 1000genomes
#!/usr/bin/env python
"""
Given a file containing a table of genes and their coordinates (see "Inputs"), get their genotypes from 1000genomes.
This in reality is a wrapper to tabix. You need to have tabix installed in the .bin folder, and you also need to have a ./data/tabix_indexes folder on your file system.
Usage
=========
$: python get_genotypes.py -l data/n-glycan.coords
@dalloliogm
dalloliogm / gist:1854319
Created February 17, 2012 16:48
generate Hamming graph H(n, 2)
#!/usr/bin/env python
"""
Generate a Hamming Graph
"""
import networkx
import itertools
import logging
def hamming_binary(chromosome_len):
makeSearchCommand({
name: "molecularlab",
url: "http://www.molecularlab.it/forum/search.asp?q={QUERY}",
description: "Searches the Molecularlab forum for your words."
});
makeSearchCommand({
name: "hgdp",
url: "http://hgdp.uchicago.edu/cgi-bin/gbrowse/HGDP/?name={QUERY}",
description: "Searches HGDP gbrowse for a keyword or SNP."