# HG changeset patch # User saharlcc # Date 1474337401 14400 # Node ID ce0a125b3cd16cba2ecee3f13bade6d3e03e25a1 # Parent dc8efad9c31b3252ef969ee2cd0836a9168f899a Uploaded diff -r dc8efad9c31b -r ce0a125b3cd1 FC_Filter_IsoDE_wrapper.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/FC_Filter_IsoDE_wrapper.sh Mon Sep 19 22:10:01 2016 -0400 @@ -0,0 +1,33 @@ +#!/bin/bash + +tempDir=/galaxy-prod/tmp + +inputfile=${1} +inputfile2=${2} +outputfile=${3} +inputFC=${4} + + +if [ "${inputfile2}" == "1" ] +then + echo + awk -v FC=$inputFC '{if (NR == 1 || ($2 != "NDE" && $2 <= -(log(FC)/log(2)))) print $0}' $inputfile > $outputfile +#exit; + +elif [ "${inputfile2}" == "2" ] +then + awk -v FC=${inputFC} '{if (NR == 1 || ($2 != "NDE" && $2 >= (log(FC)/log(2)))) print $0}' $inputfile > $outputfile +else + awk -v FC=${inputFC} '{if ((NR == 1 || ($2 != "NDE" && $2 <= -(log(FC)/log(2)))) || (NR == 1 || ($2 != "NDE" && $2 >= (log(FC)/log(2))))) print $0}' $inputfile > $outputfile +fi + +echo "done" +date + + + + + +#logx(y) = logn(y)/logn(x) + +#The NR==1 condition makes sure the file header gets printed \ No newline at end of file