Commit 8f56d319 authored by nchernia's avatar nchernia
Browse files

reconciling scripts before another dev push

parent f69ad69a
Loading
Loading
Loading
Loading
+0 −15
Changes for AWS/scripts/check.sh: 0 added lines, 15 removed lines.
Original line number Diff line number Diff line
@@ -55,8 +55,6 @@ fi

wctotal=`cat ${splitdir}/*_linecount.txt | awk '{sum+=$1}END{print sum/4}'`
check2=`cat ${splitdir}/*norm*res* | awk '{s2+=$2;}END{print s2}'`
# the below, check4, is still buggy and needs to be corrected
check4=`cat ${splitdir}/*norm*res* | awk '{s+=$3+$4+$5+$6;}END{print s}'`
 
if [ -z $ARG1 ] 
then
@@ -66,19 +64,6 @@ then
        echo "Reads don't add up.  Check ${outputdir} for results"
        exit 100
    fi
else
   # Alternate aligner check
   unmapamb=`awk 'NR%4==1{split($1,a,"_");split(a[1],b,"@"); c[b[2]]++}END{print length(c)}' ${splitdir}/*.fq`
   calctotal=`expr $check4 + $unmapamb`
   if [ $wctotal -ne $calctotal ]
   then
        echo "***! Error! The number of reads in the fastqs (${wctotal}) is not the same as the number of alignable reads reported in the stats (${check4}) plus unmapped/ambiguous (${unmapamb}), likely due to a failure during alignment. Run relaunch_prep.sh"
        echo "Reads don't add up.  Check ${outputdir} for results"
        exit 100
   else
       echo "Total: $wctotal"
       echo "Unalignable: $unmapamb"
   fi
fi

if [ -f ${outputdir}/inter.hic ] && [ -s ${outputdir}/inter.hic ] && [ -f ${outputdir}/inter_30.hic ] && [ -s ${outputdir}/inter_30.hic ]
+18 −2
Changes for AWS/scripts/cleanup.sh: 18 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -27,5 +27,21 @@
# Juicer version 1.5
total=`ls -l aligned/merged_sort.txt | awk '{print $5}'`
total2=`ls -l aligned/merged_nodups.txt aligned/dups.txt aligned/opt_dups.txt | awk '{sum = sum + $5}END{print sum}'`
if [ $total -eq $total2 ]; then rm aligned/merged_sort.txt; rm -r splits; else echo "Problem: The sum of merged_nodups and the dups files is not the same size as merged_sort.txt"; fi
#bzip2 fastq/*.fastq
if [ $total -eq $total2 ] 
then 
    rm aligned/merged_sort.txt 
    rm -r splits 
    for i in fastq/*.fastq
    do
        gzip $i
    done
    gzip aligned/merged_nodups.txt
    gzip aligned/dups.txt
    gzip aligned/opt_dups.txt
    gzip aligned/abnormal.sam
    gzip aligned/collisions.txt
    gzip aligned/unmapped.sam
else 
    echo "Problem: The sum of merged_nodups and the dups files is not the same size as merged_sort.txt"
    echo "Did NOT clean up";
fi
+1 −0
Changes for AWS/scripts/fragment.pl: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@
# each line, the sorted locations of the enzyme restriction sites.
#
# Usage:  fragment.pl <infile>
# Juicer 1.5

use POSIX;

+1 −0
Changes for AWS/scripts/juicer_arrowhead.sh: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@
##########
# Juicer postprocessing script.
# This will find contact domains with Arrowhead.
# Juicer 1.5

## Read arguments
usageHelp="Usage: ${0} [-h] -j <juicer_tools_file_path> -i <hic_file_path>"
+2 −3
Changes for AWS/scripts/relaunch_prep.sh: 2 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -22,12 +22,13 @@
#  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
#  THE SOFTWARE.
##########

# Helper script for finding what files successfully aligned and preparing the directory for
# rerunning juicer.sh
# Juicer version 1.5
ls -l splits > ls_splits

awk '($9 ~/R1/ && $9 ~/fastq$/) || ($9 ~/R1/ && $9 ~/gz$/) {split($9, a, "_R1");  print a[1]a[2], $9}($9 ~/R2/ && $9 ~/fastq$/) || ($9 ~/R2/ && $9 ~/gz$/){split($9,a,"_R2");print a[1]a[2], $9}' ls_splits > fastq.txt
awk '($9 ~/_R1/ && $9 ~/fastq$/) || ($9 ~/_R1/ && $9 ~/gz$/) {split($9, a, "_R1");  print a[1]a[2], $9}($9 ~/_R2/ && $9 ~/fastq$/) || ($9 ~/_R2/ && $9 ~/gz$/){split($9,a,"_R2");print a[1]a[2], $9}' ls_splits > fastq.txt
awk '{name="splits/"$1"_norm.txt.res.txt"; if ((getline line < name) > 0){ split(line, a); if (length(a)<6 || a[2] != a[3]+a[4]+a[5]+a[6] || a[2] == 0){print "mv splits/"$2, "not_done; rm -f splits/"$1"*; rm -f splits/"$2"*;"} close(name);}else {print "mv splits/"$2, "not_done; rm -f splits/"$1"*; rm -f splits/"$2"*;"}}' fastq.txt > mv_me.sh
mkdir not_done
chmod 755 mv_me.sh
@@ -42,8 +43,6 @@ if [ "$(ls -A not_done)" ]
            mv splits done_splits
        fi
        mv not_done splits
        cat lsf.out >> done_lsf.out
        rm lsf.out
else
    rmdir not_done
    echo "Fastqs are aligned, run juicer.sh with -S merge flag";
Loading