#!/bin/bash # Run this from day.1/data DATA=. SCRIPTS=../../scripts # Change this to the directory where Circos is installed CIRCOS=/home/martink/work/circos/svn/ echo "Creating list of 16,000 genes" cat conservation/coords.txt | awk '{print $2,$3,$4,$4-$3+1,"name="$1}' > genes.txt BINS="5 10 20 50 100" for ws in $BINS; do echo "Counting genes in $ws kb bins" bin=$((ws * 1000)) cat genes.txt | ~/work/circos/svn/tools/resample/bin/resample -bin $bin -count > genes.count.${ws}kb.txt done for ws in $BINS; do bin=$((ws * 1000)) echo "Counting genes in $ws kb bins" cat genes.txt | $CIRCOS/tools/resample/bin/resample -bin $bin -count > genes.count.${ws}kb.txt echo "Calculating gene average size in $ws kb bins" cat genes.txt | $CIRCOS/tools/resample/bin/resample -bin $bin -avg > genes.avgsize.${ws}kb.txt done for type in conservation duplication; do echo "Creating $type links" cat $type/C* $type/S* $type/Z* | $SCRIPTS/create.yeast.links -coord $type/coords.txt > links.$type.txt echo "...extracting largest 10,000 links" N=10000 cat links.$type.txt | awk '{print $3-$2+1,$0}' | sort -nr | head -$N | cut -d " " -f 2- > links.$type.$N.txt for ws in $BINS; do bin=$((ws * 1000)) echo "...counting links in $ws kb bins" cat links.$type.txt | $CIRCOS/tools/binlinks/bin/binlinks -bin $bin -num > links.$type.count.${ws}kb.txt done done