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/env bash | |
# bigWigRegions | |
# Kamil Slowikowski | |
# | |
# Depends on bigWigToBedGraph: http://hgdownload.cse.ucsc.edu/admin/exe/ | |
if [[ $# -ne 2 ]]; then | |
echo "bigWigRegions - Print bigWig data for each region in a bed file." | |
echo -e "usage:\n bigWigRegions in.bigWig in.bed > out.bedGraph" | |
echo " bigWigRegions in.bigWig <(zcat in.bed.gz) > out.bedGraph" |
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
function cd_dir_history() | |
{ | |
OLDPWD="$PWD" | |
echo "# $(date) $USER -> $@" >> "$HISTFILE" | |
command cd "$@" | |
# If this directory is writable then write to directory-based history file | |
# otherwise write history in the usual home-based history file. | |
touch "$PWD/.dir_bash_history" 2>/dev/null \ |
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/perl | |
# Author : Kamil Slowikowski <kslowikowski@gmail.com> | |
# Date : March 23, 2011 | |
# Version : 0.1 | |
# Description : Modified code from | |
# http://www.bioperl.org/wiki/HOWTO:EUtilities_Cookbook | |
use strict; | |
use warnings; |
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
# https://www.biostars.org/p/162853 | |
cache = {} | |
f2 = open('f2') | |
header2 = f2.next() | |
for line in f2: | |
fields = line.strip().split() | |
snp = fields[0] |
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/env python | |
"""merge_intervals.py | |
Merge tab-delimited intervals: | |
cat tissue1.txt | |
chr1,1-2 | |
chr1,3-4 | |
chr1,5-6 |
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/env python | |
"""ncbi_fetch.py | |
Query NCBI and fetch the results into gzipped files. Files will be saved in | |
the current directory as: 001-050.gz, 051-100.gz, etc. | |
You can then do: | |
zcat 001-050.gz | head |
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
""" | |
genomic_intervals.py | |
Kamil Slowikowski | |
February 27, 2014 | |
Genomic intervals: 0-based, 1-based, overlaps, and distance | |
=========================================================== | |
This document describes genomic intervals and includes source code for testing | |
overlap and calculating distance between intervals. |
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
""" | |
chromtree.py | |
Kamil Slowikowski | |
October 30, 2013 | |
This module is a simple extension of | |
bx.intervals.intersection.IntervalTree | |
to neatly handle a dictionary of interval trees. |
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/env python | |
# encoding: utf8 | |
""" | |
merge_lanes.py | |
Kamil Slowikowski | |
July 17, 2015 | |
Broad Technology labs provides sequencing data in a directory structure like | |
this: |
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/env python | |
""" | |
Kamil Slowikowski | |
fix_alleles.py | |
============== | |
Change the alleles in a dosage file to match the alleles specified in | |
a separate reference file. If a variant is not present in the reference file, | |
then it will not be changed. |