Skip to content

Instantly share code, notes, and snippets.

View meren's full-sized avatar

A. Murat Eren (Meren) meren

View GitHub Profile
#!/bin/bash
# this is how the directory in which you run this script looks like:
# $ ls *bam
# HUZ633103.bbmap.bam HUZ634093.bbmap.bam HUZ635444.bbmap.bam HUZ636473.bbmap.bam
# HUZ633103.bt1.bam HUZ634093.bt1.bam HUZ635444.bt1.bam HUZ636473.bt1.bam
# HUZ633103.bt2.bam HUZ634093.bt2.bam HUZ635444.bt2.bam HUZ636473.bt2.bam
# HUZ633103.bwa.bam HUZ634093.bwa.bam HUZ635444.bwa.bam HUZ636473.bwa.bam
# HUZ633103.clc.bam HUZ634093.clc.bam HUZ635444.clc.bam HUZ636473.clc.bam
# HUZ633103.gsnap.bam HUZ634093.gsnap.bam HUZ635444.gsnap.bam HUZ636473.gsnap.bam
@meren
meren / colormap.py
Created July 7, 2015 03:05
A simple class to get colors for a given list of values
from matplotlib.colors import LinearSegmentedColormap, Normalize, rgb2hex
import matplotlib.cm as cm
class ColorMap:
"""
A simple class to get colors for a given list of values
Here is an example use:
data_dict = dict(zip(['e_%d' % e for e in range(0, 10)], range(0, 10)))
meren ~/tmp $ git clone git://github.com/meren/oligotyping.git
Cloning into oligotyping...
remote: Counting objects: 71, done.
remote: Compressing objects: 100% (60/60), done.
remote: Total 71 (delta 39), reused 42 (delta 10)
Receiving objects: 100% (71/71), 27.87 KiB, done.
Resolving deltas: 100% (39/39), done.
meren ~/tmp $ ls
oligotyping
@meren
meren / sample-fasta
Last active October 4, 2015 11:28
Sample FASTA file for oligotyping pipeline
>Sample-01_ReadX
GTTGAAAAAGTTAGTGGTGAAATCCCAGA
>Sample-01_ReadY
GTTGAAAAAGTTAGTGGTGAAATCCCAGA
>Sample-01_ReadZ
GGTGAAAAAGTTAGTGGTGAAATCCCAGA
>Sample-02_ReadN
GTTGAAAAAGTTAGTGGTGAAATCCCAGA
>Sample-02_ReadM
GTTGAAAAAGTTAGTGGTGAAATCCCAGA
@meren
meren / config.ini
Created May 9, 2012 20:46
INI file for Pommunity
[general]
platform = 454
community = Environment-01
output_file = env01.fasta
total_sequences = 250
[member type A]
sequence = GTTGAAAAAGTTAGTGGTGAAATCCCAGAGCTTAACTCTGGAACTGCCATTAAAACTTTTCAGCTAGAGTATGATAGAGGAAAGCAGAATTTCTAGTGTAGAGGTGAAATTCGTAGATATTAGAAAGAATACCAATTGCGAAGGCAGCTTTCTGGATCATTACTGACACTGAGGAACGAAAGCATGGGTAGCGAAGAGGA
ratio = 10
@meren
meren / output
Last active October 4, 2015 14:07
Output files generated by oligotyping.py with --quick parameter
meren ~/tmp/sample-run $ ls mock-env-aligned-c2-s1-a1.0-A0-M0/
COLORS MATRIX-COUNT.txt OLIGOS.nexus RUNINFO.cPickle
ENVIRONMENT.txt MATRIX-PERCENT.txt READ-DISTRIBUTION.txt RUNINFO.log
FIGURES/ OLIGOS.fasta RUNINFO
@meren
meren / output
Created May 10, 2012 18:19
Output files generated by oligotyping.py without --quick parameter
meren ~/tmp/sample-run $ ls mock-env-aligned-c2-s1-a1.0-A0/
COLORS MATRIX-PERCENT.txt RUNINFO
ENVIRONMENT.cPickle OLIGO-REPRESENTATIVES RUNINFO.cPickle
ENVIRONMENT.txt OLIGOS.fasta STACKBAR.png
MATRIX-COUNT.txt OLIGOS.nexus
@meren
meren / output
Last active October 4, 2015 14:38
Output files generated in OLIGOTYPE-REPRESENTATIVES directory by oligotyping.py without --quick parameter
meren ~/tmp/sample-run $ ls mock-env-aligned-c2-s1-a1.0-A0-M0/OLIGO-REPRESENTATIVES
00000_GC 00001_AT
00000_GC_unique 00001_AT_unique
00000_GC_unique.png 00001_AT_unique.png
00000_GC_unique_BLAST.cPickle 00001_AT_unique_BLAST.cPickle
00000_GC_unique_BLAST.xml 00001_AT_unique_BLAST.xml
00000_GC_unique_color_per_column.cPickle 00001_AT_unique_color_per_column.cPickle
00000_GC_unique_distribution.cPickle 00001_AT_unique_distribution.cPickle
00000_GC_unique_entropy 00001_AT_unique_entropy
@meren
meren / perfect-v6-run-script.sh
Created July 13, 2012 18:09
BASH script to initiate overlapping V6 analysis.
#!/bin/bash
#
# put this in a directory where your FASTQ files reside. when you run it, it will
# generate an 'analyses' directory, in which you will find your perfect V6 reads
# per FASTQ file.
#
# (this script assumes that your FASTQ files are interleaved).
#
@meren
meren / gen_ENVIRONMENT_from_VAMPS_matrix.py
Created October 1, 2012 20:11
Generate ENVIRONMENT from VAMPS Matrix that was converted from BIOM format...
import sys
matrix = open(sys.argv[1])
env = open(sys.argv[1] + '.ENV', 'w')
matrix.readline()
samples = matrix.readline().strip().split('\t')[1:]
for line in matrix.readlines():
fields = line.strip().split('\t')