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/python | |
from sys import argv | |
import csv,StringIO | |
import math | |
expr = open(argv[1], 'r') | |
output = open(argv[1] + '.bed','w') | |
output_log = open(argv[1] + '_log2.bed','w') |
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 -w | |
# Convert JASPAR matrices to fasta-like format | |
# Written by Martin C Frith | |
# I intend that anyone who finds this code useful be free to use, | |
# modify, or redistribute it without any restrictions | |
=head1 NAME | |
jaspar2fasta - conversion of JASPAR database release for use with clover |
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
#!/bin/bash | |
# Pipeline for PE samples | |
# paths and variables to change | |
RAW=/sysdev/s3/share/data/oikopleura/chip-seq/raw | |
MAPPED=/sysdev/s3/share/data/oikopleura/chip-seq/mapped | |
GENOMEREF=~/data/oikopleura/assembly/Oikopleura_reference_unmasked_v3.0.fa | |
CHRSIZES=~/data/oikopleura/assembly/Oikopleura_reference_chrSizes.tsv |
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 | |
#original: http://www.korokithakis.net/posts/thomsonspeedtouch-routers-and-wpa-keys/ | |
#modified from: http://pastie.org/3108591 | |
import sys | |
import hashlib | |
from binascii import hexlify, unhexlify | |
from itertools import product | |
from multiprocessing import Process |
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
awk -v OFS='\t' '$6 == "+" {print $1, $2, $2+1, $4, $5, $6}' annotationFile.bed > tmp | |
awk -v OFS='\t' '$6 == "-" {print $1, $3, $3+1, $4, $5, $6}' annotationFile.bed >> tmp | |
bedtools sort -i tmp > annotationFile.TSSs.bed |
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
#Create a method that reads in a score (1-100) and prints out the corresponding character (grade). | |
#Assume the following grade assignment: 'A' = 100-81 points, 'B' = 80-61 points, 'C' = 60-41 points, 'D' = 40-21 points and 'E' = 20-1 points. | |
# Don't use the "if" control structure | |
score = 1 | |
scale = [range(81,100), range(61,80), range(41,60), range(21,40), range(1,20)] | |
grades = ["A", "B", "C", "D", "E"] | |
for grade in range(0, len(scale)): | |
while score in scale[grade]: |
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
import csv | |
from Bio import SeqIO | |
fastagenome = "data/oikopleura/assembly/Oikopleura_reference_unmasked_v3.0.fa" | |
output = "data/oikopleura/assembly/Oikopleura_reference_chrSizes.tsv" | |
myfile = open(output, "wb") | |
spamwriter = csv.writer(myfile, delimiter='\t', quoting=csv.QUOTE_MINIMAL) | |
for seq_record in SeqIO.parse(fastagenome, "fasta"): |
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
import numpy as np | |
import pandas as pd | |
class DifferentialRegions(object): | |
""" | |
Compute two-tailed empirical p-value for difference between values of two variables. | |
""" | |
def __init__(self, df, a, b, permutations=100, alpha=0.05, correct=True): | |
super(DifferentialRegions, self).__init__() |
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
# I just need to have these somewhere to remember them later | |
for F in `find . | grep -e 'CM[0-9]\{2,\}s'` | |
do | |
echo $F $(echo $F | sed 's/CM\([0-9]\{2,\}\)s/CM\1-/g') | |
mv $F $(echo $F | sed 's/CM\([0-9]\{2,\}\)s/CM\1-/g') | |
done | |
for F in `find . | grep -e '_[1-2]_' | grep -v PBMC` | |
do |
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/awk -f | |
# Author: Laurent Manchon (lmanchon@univ-montp2.fr) | |
# Split big blast output in xml format into severals files | |
# Type split_xml_blast without parameters to see usage. | |
BEGIN{ | |
{ |