# HG changeset patch # User nikos # Date 1406894820 14400 # Node ID 52e9cfd72b2109cf48ca720aeedb37b7ca932505 # Parent 41e2861b6ab79ff039aa62e9511d7c547f8e98c3 Deleted selected files diff -r 41e2861b6ab7 -r 52e9cfd72b21 bigwig_to_wig/bigwig_to_wig.sh --- a/bigwig_to_wig/bigwig_to_wig.sh Fri Aug 01 08:06:20 2014 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,77 +0,0 @@ -#!/bin/bash -#$Id: bigwig2wig 23 2014-01-28 12:09:22Z jens $ - -#SCRIPT CONVERTS BIGWIG FILE TO FIXED-STEP WIGGLE FORMAT FILE -#RESOLUTION IS CONTROLLED THROUGH THE BIN SIZE - -#default bin_size -bin_size=500 -mylab="wiggle file" - -#parse input -while getopts hf:b:l: myarg -do case "$myarg" in - h) echo "Usage: bigwig_correlation -f -b " - echo "Ex: bigwig_correlation -f -b 600" - exit ;; - f) bigwig_file="$OPTARG" ;; #required - l) mylab="$OPTARG" ;; #optional - b) bin_size="$OPTARG" ;; #optional - [?]) echo "Usage: bigwig_correlation -f -b " - exit 1 ;; - esac -done - -################################################### -###VALIDATE INPUT -################################################### - -#make tmp-filename to hold chromosome info -org_assembly_file=`mktemp -u` -bigWigInfo -chroms $bigwig_file | perl -ne "/^\tchr/ && print" | perl -pe "s/ +/\t/g" | cut -f2,4 > $org_assembly_file - -#check bin_size & define step_size -bin_size_mod=`expr $bin_size % 2` #determine modulus -if [ $bin_size_mod -ne 0 ]; then - echo "Chosen bin_size must be an even positive number, added +1 to bin_size" - bin_size=$(($bin_size + 1)) -fi - -if [ $bin_size -lt 100 ]; then - echo "ERROR: Chosen bin_size must be a positive number >=100" - exit 1 -fi -#set stetp size equal to bin size i.e. non-overlapping intervals -step_size=$bin_size - -################################################### -###EXTRACT DENSITIES FROM NORMALIZED BIGWIG FILES -################################################### - - -#make track definition line -echo "track type=wiggle_0 name=$mylab description=\"fixedStep format\"" - -#for each chromsome -cat $org_assembly_file | while read line; do - - cur_chr=`echo $line | cut --delimiter=" " -f1` - cur_length=`echo $line | cut --delimiter=" " -f2` - - n_bins=`echo "scale=0; (${cur_length}-${step_size})/${bin_size}" | bc` - - start=1 - stop=`echo "$n_bins * $bin_size" | bc` - - #write header line for each chromosome - echo "fixedStep chrom=$cur_chr start=$start step=$step_size span=$step_size" - - #get densities along chr in n_bins with chosen bin_size and step_size (giving overlap in bins) - nice bigWigSummary $bigwig_file $cur_chr $start $stop $n_bins | perl -pe 's/\t/\n/g' | perl -pe "s/n\/a/0/" - #gives warning if no data in/for current chromosome - -done - -#rm tmp -rm $org_assembly_file - diff -r 41e2861b6ab7 -r 52e9cfd72b21 bigwig_to_wig/bigwig_to_wig.xml --- a/bigwig_to_wig/bigwig_to_wig.xml Fri Aug 01 08:06:20 2014 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ - - converter - bigwig_to_wig.sh -f $input -b $bin_size -l $mylab > $output - - bigWigSummary - bigWigInfo - - - - - - - - - - - - - - - - - - -This tool converts a **BigWig** file to fixed step **Wiggle** format. -Resolution is controlled through the bin size (the higher the size, the lower the resolution). - -The script this tool is based on is written by Jens Vilstrup Johansen and uses bigWigInfo_ and bigWigSummary_. - -.. _bigWigInfo: https://github.com/adamlabadorf/ucsc_tools/blob/master/executables/bigWigInfo -.. _bigWigSummary: https://github.com/adamlabadorf/ucsc_tools/blob/master/executables/bigWigSummary - - - diff -r 41e2861b6ab7 -r 52e9cfd72b21 bigwig_to_wig/test-data/1.bigwig Binary file bigwig_to_wig/test-data/1.bigwig has changed diff -r 41e2861b6ab7 -r 52e9cfd72b21 bigwig_to_wig/tool_dependencies.xml --- a/bigwig_to_wig/tool_dependencies.xml Fri Aug 01 08:06:20 2014 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ - - - - - - - http://hgdownload.soe.ucsc.edu/admin/exe/linux.x86_64/bigWigSummary - - . - $INSTALL_DIR - - - - - - $INSTALL_DIR - - - - - - - - - - - http://hgdownload.soe.ucsc.edu/admin/exe/linux.x86_64/bigWigInfo - - . - $INSTALL_DIR - - - - - - $INSTALL_DIR - - - - - - -