From eeb57271dd90284dc3e90b9784faf302c68d65d8 Mon Sep 17 00:00:00 2001 From: JannikHamp Date: Wed, 16 Jan 2019 21:21:57 +0100 Subject: [PATCH 1/2] corrected the wrong stats output of number of footprints after filter wrong file was chosen. filtered_flagged.bed is the corresct one instead of filtered.bed --- bin/1.2_filter_motifs/compareBed.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/1.2_filter_motifs/compareBed.sh b/bin/1.2_filter_motifs/compareBed.sh index 2c4c9ba..8534f1b 100644 --- a/bin/1.2_filter_motifs/compareBed.sh +++ b/bin/1.2_filter_motifs/compareBed.sh @@ -279,7 +279,7 @@ then # add some final values to the log file fp_initial=`cat $data | wc -l` fp_initial=`expr $fp_initial - 1` - fp_final=`cat "$workdir"/filtered.bed | wc -l` + fp_final=`cat "$workdir"/filtered_flagged.bed | wc -l` fp_final=`expr $fp_final - 1` echo $fp_initial | sed 's/^/initial number of footprints: /g' >> "$workdir"/compareBed.stats echo $fp_final | sed 's/^/number of footprints after subtract: /g' >> "$workdir"/compareBed.stats @@ -288,7 +288,7 @@ else rm -f $output # add some final values to the log file cat $data | wc -l | sed 's/^/initial number of footprints: /g' >> "$workdir"/compareBed.stats - cat "$workdir"/filtered.bed | wc -l | sed 's/^/number of footprints after subtract: /g' >> "$workdir"/compareBed.stats + cat "$workdir"/filtered_flagged.bed | wc -l | sed 's/^/number of footprints after subtract: /g' >> "$workdir"/compareBed.stats fi # add fasta sequences to bed and create fasta file From 654c5f8ab21a3eb49866d210e11eb02d16765a4d Mon Sep 17 00:00:00 2001 From: JannikHamp Date: Fri, 18 Jan 2019 11:24:48 +0100 Subject: [PATCH 2/2] this should fix the 1 off count of footprins discrepacy The input file $data might still have or have not the header, thus it is checked. The file "filtered_flagged.bed" however has no header, thus no check needs to be made. --- bin/1.2_filter_motifs/compareBed.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/bin/1.2_filter_motifs/compareBed.sh b/bin/1.2_filter_motifs/compareBed.sh index 8534f1b..aa97c95 100644 --- a/bin/1.2_filter_motifs/compareBed.sh +++ b/bin/1.2_filter_motifs/compareBed.sh @@ -276,20 +276,18 @@ first_line=`sed -n 1p $data | sed "s/$/\tcontains_maxpos\tsequence/"` if [[ ${first_line:0:1} == "#" ]] then echo "$first_line" > $output - # add some final values to the log file + # add initial number of footprints to the log file fp_initial=`cat $data | wc -l` fp_initial=`expr $fp_initial - 1` - fp_final=`cat "$workdir"/filtered_flagged.bed | wc -l` - fp_final=`expr $fp_final - 1` echo $fp_initial | sed 's/^/initial number of footprints: /g' >> "$workdir"/compareBed.stats - echo $fp_final | sed 's/^/number of footprints after subtract: /g' >> "$workdir"/compareBed.stats else # output will be overwritten if it exists rm -f $output - # add some final values to the log file + # add initial number of footprints to the log file cat $data | wc -l | sed 's/^/initial number of footprints: /g' >> "$workdir"/compareBed.stats - cat "$workdir"/filtered_flagged.bed | wc -l | sed 's/^/number of footprints after subtract: /g' >> "$workdir"/compareBed.stats fi +# add number of footprints after filtering to the log file +cat "$workdir"/filtered_flagged.bed | wc -l | sed 's/^/number of footprints after subtract: /g' >> "$workdir"/compareBed.stats # add fasta sequences to bed and create fasta file out_fasta=`echo $output | sed "s|.bed$|.fasta|g"`