Skip to content

Instantly share code, notes, and snippets.

@pjbriggs
pjbriggs / make_bw_files.sh
Created May 2, 2013 11:26
Utility script to create bigWig files from phastCons wig data files. Needs the chromosome sizes which can be obtained by doing e. "fetchChromSizes mm9 > mm9chromSizes". For each .data file in the specified directory, runs wigToBigWig to generate corresponding .bw file.
#!/bin/sh
#
CHROMSIZE_FILE=$1
if [ -z "$CHROMSIZE_FILE" ] ; then
echo "Usage: $0 CHROMSIZE_FILE [ DATA_DIR ]"
exit
fi
if [ -z "$2" ] ; then
DATA_DIR=`pwd`
else
@pjbriggs
pjbriggs / usage.sh
Created January 30, 2013 12:40
Report disk usage under specified directory (largest subdirectories and largest files)
#!/bin/sh
#
# Report disk usage
#
# Usage: usage.sh DIR
#
if [ $# -eq 0 ] ; then
echo "Usage: $0 DIR"
exit
fi
@pjbriggs
pjbriggs / report_barcodes.py
Created January 24, 2013 11:20
Count and report the index sequences (aka barcode tags) in an Illumina FASTQ file
#!/bin/env python
#
# Count and report the barcode tags in a fastq file from Illumina
# sequencing platform
#
import sys
import FASTQFile
fastq_file = sys.argv[1]
tags = {}
for read in FASTQFile.FastqIterator(fastq_file):
@pjbriggs
pjbriggs / make_nibs.sh
Created January 21, 2013 15:54
Example script for generating sequence alignment files (.nib) using faToNib submitted to a Grid Engine cluster
#!/bin/sh
#
# make_nibs.sh
#
chroms=`ls chr*.fa`
for chrom in $chroms; do
echo $chrom
nib=${chrom%.*}.nib
qsub -cwd -V -b y faToNib $chrom $nib
done