From 16705a2bdb4757a520419409027ea128b2c7a819 Mon Sep 17 00:00:00 2001 From: Mahmoud Ibrahim Date: Thu, 21 Feb 2019 07:02:39 +0100 Subject: [PATCH 1/3] Update JAMM.sh change prestart checks --- JAMM.sh | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/JAMM.sh b/JAMM.sh index e5a5dd3..85cbb39 100644 --- a/JAMM.sh +++ b/JAMM.sh @@ -136,16 +136,11 @@ then usage exit 1 fi -if [[ -d "$out/peaks" ]]; then - printf "\n\nOutput directory $out/peaks already exists. I can't override existing results!\n\n" +if [ -f "$out/peaks/filtered.peaks.narrowPeak" ]; then + printf "\n\nOutput file $out/peaks/filtered.peaks.narrowPeak already exists. I can't override existing results!\n\n" exit 0 fi -if [ $fraglen == "ns" ]; then - if [[ -d "$out/xcorr" ]]; then - printf "\n\nOutput directory $out/xcorr already exists. I can't override existing results!\n\n" - exit 0 - fi -fi + nreps=$(ls -1 $sdir/*.bed | wc -l) #count how many sample files #no sample files if [ $nreps == "0" ]; then From 9ed065b3e36ff93683e59101309687802be07e6a Mon Sep 17 00:00:00 2001 From: mahmoudibrahim Date: Fri, 17 May 2019 10:53:06 +0200 Subject: [PATCH 2/3] input checks more compatible with pipeline tools. --- JAMM.sh | 52 +++++++++++++++++++++++++++++++++++++--------- SignalGenerator.sh | 8 +++---- bincalculator.r | 6 +++--- changelog | 7 ++++--- peakfilter.pl | 6 +++--- peakfinder.r | 6 +++--- peakhelper.r | 6 +++--- readme | 2 +- readshifter.pl | 6 +++--- signalmaker.r | 6 +++--- xcorr.r | 6 +++--- xcorrhelper.r | 6 +++--- 12 files changed, 75 insertions(+), 42 deletions(-) diff --git a/JAMM.sh b/JAMM.sh index 85cbb39..1b432db 100644 --- a/JAMM.sh +++ b/JAMM.sh @@ -1,6 +1,6 @@ ######################################################################## -# JAMMv1.0.7rev5 is a peak finder for joint analysis of NGS replicates. -# Copyright (C) 2014-2016 Mahmoud Ibrahim +# JAMMv1.0.7rev6 is a peak finder for joint analysis of NGS replicates. +# Copyright (C) 2014-2019 Mahmoud M Ibrahim # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -# Contact: mahmoud.ibrahim@mdc-berlin.de +# Contact: mmibrahim@pm.me ######################################################################## @@ -28,7 +28,7 @@ sPath="`( cd \"$sPath\" && pwd )`" usage() { cat << EOF -Welcome to JAMM v1.0.7rev5 (GNU GPLv3). Copyright (C) 2014-2016 Mahmoud Ibrahim. +Welcome to JAMM v1.0.7rev5 (GNU GPLv3). Copyright (C) 2014-2019 Mahmoud Ibrahim. This program comes with ABSOLUTELY NO WARRANTY; for details visit http://www.gnu.org/licenses/gpl.html. This is free software, and you are welcome to redistribute it under certain conditions; visit http://www.gnu.org/licenses/gpl.html for details. @@ -141,6 +141,15 @@ if [ -f "$out/peaks/filtered.peaks.narrowPeak" ]; then exit 0 fi +if [ $fraglen == "ns" ]; then + for j in $out/xcorr/*/xcorrsummary.txt; do + if [ -e "$j" ]; then + printf "\n\nOutput files in $out/xcorr already exist. I can't override existing results!\n\n" + exit 0 + fi + done +fi + nreps=$(ls -1 $sdir/*.bed | wc -l) #count how many sample files #no sample files if [ $nreps == "0" ]; then @@ -148,6 +157,23 @@ if [ $nreps == "0" ]; then exit 1 fi +if [ $fraglen != "ns" ]; then + IFS=',' read -ra numTemp <<< "$fraglen" + numFrags=$(echo "${#numTemp[@]}") + if [ $bdir != "None" ]; then + nrepsTemp=$(echo $((nreps + 1))) + if [ $numFrags != $nrepsTemp ]; then + printf "\n\nThe number of fragment lengths you gave is not the same as the number of sample replicates (and background). There should be as many fragment lengths as number of sample replicates+1\n\n" + exit 1 + fi + else + if [ $numFrags != $nreps ]; then + printf "\n\nThe number of fragment lengths you gave is not the same as the number of sample replicates. There should be as many fragment lengths as there are sample replicates\n\n" + exit 1 + fi + fi +fi + if [ $tempdir == "/tmp" ]; then wdir=$(mktemp -d -t -p $tempdir) else @@ -240,8 +266,9 @@ if [ $fraglen == "ns" ]; then ##Counting Where Reads Start and Calculating Cross Correlation mkdir $wdir/stats.$ran/ #store count files - mkdir $out/xcorr #final xcorr results - + if [ ! -d "$out/xcorr" ]; then + mkdir $out/xcorr #final xcorr results + fi printf "Calculating Fragment Length(s)...\n" for f in $wdir/sizes.$ran/*; do #for each chromosome @@ -285,7 +312,9 @@ if [ $fraglen == "ns" ]; then for f in $sdir/*.bed; do file=$(basename $f) samplefile=$(echo $file | awk -F"." '{print $1}'); - mkdir "$out/xcorr/$samplefile" #final xcorr results + if [ ! -d "$out/xcorr/$samplefile" ]; then + mkdir "$out/xcorr/$samplefile" #final xcorr results + fi if [ -f "$wdir/stats.$ran/xc.$samplefile.tab" ]; then cp $wdir/stats.$ran/xc.$samplefile.tab $out/xcorr/$samplefile/shifts.txt fi @@ -293,7 +322,9 @@ if [ $fraglen == "ns" ]; then done #report xcorr results (control) if [ $bdir != "None" ]; then - mkdir "$out/xcorr/ctrl" #final xcorr results + if [ ! -d "$out/xcorr/ctrl" ]; then + mkdir "$out/xcorr/ctrl" #final xcorr results + fi if [ -f "$wdir/stats.$ran/xc.ctrl.tab" ]; then cp $wdir/stats.$ran/xc.ctrl.tab $out/xcorr/ctrl/shifts.txt fi @@ -377,8 +408,9 @@ fi # Step Four: Calling Peaks # =========================== mkdir $wdir/peaks.$ran/ #store count files -mkdir $out/peaks #store peak files - +if [ ! -d "$out/peaks" ]; then + mkdir $out/peaks #store peak files +fi printf "Calling Peaks...(mode: $mode, resolution: $resol)\n" diff --git a/SignalGenerator.sh b/SignalGenerator.sh index 5f5493f..9bc2102 100644 --- a/SignalGenerator.sh +++ b/SignalGenerator.sh @@ -1,6 +1,6 @@ ######################################################################## -# JAMMv1.0.7rev5 is a peak finder for joint analysis of NGS replicates. -# Copyright (C) 2014-2016 Mahmoud Ibrahim +# JAMMv1.0.7rev6 is a peak finder for joint analysis of NGS replicates. +# Copyright (C) 2014-2019 Mahmoud Ibrahim # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -# Contact: mahmoud.ibrahim@mdc-berlin.de +# Contact: mmibrahim@pm.me ######################################################################## ##Finding out the path @@ -27,7 +27,7 @@ sPath="`( cd \"$sPath\" && pwd )`" usage() { cat << EOF -Welcome to JAMM v1.0.7rev5 Signal Generator Script (GNU GPLv3). Copyright (C) 2014-2016 Mahmoud Ibrahim. +Welcome to JAMM v1.0.7rev5 Signal Generator Script (GNU GPLv3). Copyright (C) 2014-2019 Mahmoud Ibrahim. This program comes with ABSOLUTELY NO WARRANTY; for details visit http://www.gnu.org/licenses/gpl.html. This is free software, and you are welcome to redistribute it under certain conditions; visit http://www.gnu.org/licenses/gpl.html for details. diff --git a/bincalculator.r b/bincalculator.r index 60dd935..dbea5bd 100644 --- a/bincalculator.r +++ b/bincalculator.r @@ -1,6 +1,6 @@ ######################################################################## -# JAMMv1.0.7rev5 is a peak finder for joint analysis of NGS replicates. -# Copyright (C) 2014-2016 Mahmoud Ibrahim +# JAMMv1.0.7rev6 is a peak finder for joint analysis of NGS replicates. +# Copyright (C) 2014-2019 Mahmoud Ibrahim # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -# Contact: mahmoud.ibrahim@mdc-berlin.de +# Contact: mmibrahim@pm.me ######################################################################## diff --git a/changelog b/changelog index 40d8f47..13ec2ab 100644 --- a/changelog +++ b/changelog @@ -1,6 +1,7 @@ =================== -Version 1.0.7rev5 +Version 1.0.7rev6 =================== -- add -T option to define a custom temporary directory (thanks to Anthony Mathelier[https://github.com/amathelier]) -- streamlined some code parts related to findpeak function and removed a bug there that affected peaks in some extreme parameter/data combinations +- changed some input checks to make it more compatible with pipeline tools +- added an input check for -f option +- updated contact info diff --git a/peakfilter.pl b/peakfilter.pl index 276bd3b..aa2c7e6 100644 --- a/peakfilter.pl +++ b/peakfilter.pl @@ -1,6 +1,6 @@ ######################################################################## -# JAMMv1.0.7rev5 is a peak finder for joint analysis of NGS replicates. -# Copyright (C) 2014-2016 Mahmoud Ibrahim +# JAMMv1.0.7rev6 is a peak finder for joint analysis of NGS replicates. +# Copyright (C) 2014-2019 Mahmoud Ibrahim # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -# Contact: mahmoud.ibrahim@mdc-berlin.de +# Contact: mmibrahim@pm.me ######################################################################## diff --git a/peakfinder.r b/peakfinder.r index f1a22ca..b4193d8 100644 --- a/peakfinder.r +++ b/peakfinder.r @@ -1,6 +1,6 @@ ######################################################################## -# JAMMv1.0.7rev5 is a peak finder for joint analysis of NGS replicates. -# Copyright (C) 2014-2016 Mahmoud Ibrahim +# JAMMv1.0.7rev6 is a peak finder for joint analysis of NGS replicates. +# Copyright (C) 2014-2019 Mahmoud Ibrahim # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -# Contact: mahmoud.ibrahim@mdc-berlin.de +# Contact: mmibrahim@pm.me ######################################################################## diff --git a/peakhelper.r b/peakhelper.r index be83d4c..9b874b6 100644 --- a/peakhelper.r +++ b/peakhelper.r @@ -1,6 +1,6 @@ ######################################################################## -# JAMMv1.0.7rev5 is a peak finder for joint analysis of NGS replicates. -# Copyright (C) 2014-2016 Mahmoud Ibrahim +# JAMMv1.0.7rev6 is a peak finder for joint analysis of NGS replicates. +# Copyright (C) 2014-2019 Mahmoud Ibrahim # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -# Contact: mahmoud.ibrahim@mdc-berlin.de +# Contact: mmibrahim@pm.me ######################################################################## diff --git a/readme b/readme index 2c2956e..e1745a2 100644 --- a/readme +++ b/readme @@ -16,7 +16,7 @@ To install JAMM: To get information about options available to JAMM users, run the JAMM bash script without any parameters or visit the documentation page at https://github.com/mahmoudibrahim/JAMM/wiki/Usage -If you encounter errors or have questions, please email mahmoud.ibrahim@mdc-berlin.de +If you encounter errors or have questions, please email mmibrahim@pm.me Important Note: JAMM produces a large number of peaks on purpose to allow you to choose your threshold the way you like. The peaks are scored and ranked by column 7 in the output narrowPeak file. If you want a confident list directly from JAMM, you could use the option "-e auto", although a better way is probably to see the peaks that are reproducible in your replicates. diff --git a/readshifter.pl b/readshifter.pl index 33374ff..823b6ca 100644 --- a/readshifter.pl +++ b/readshifter.pl @@ -1,6 +1,6 @@ ######################################################################## -# JAMMv1.0.7rev5 is a peak finder for joint analysis of NGS replicates. -# Copyright (C) 2014-2016 Mahmoud Ibrahim +# JAMMv1.0.7rev6 is a peak finder for joint analysis of NGS replicates. +# Copyright (C) 2014-2019 Mahmoud Ibrahim # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -# Contact: mahmoud.ibrahim@mdc-berlin.de +# Contact: mmibrahim@pm.me ######################################################################## diff --git a/signalmaker.r b/signalmaker.r index 4289b5a..9210850 100644 --- a/signalmaker.r +++ b/signalmaker.r @@ -1,6 +1,6 @@ ######################################################################## -# JAMMv1.0.7rev5 is a peak finder for joint analysis of NGS replicates. -# Copyright (C) 2014-2016 Mahmoud Ibrahim +# JAMMv1.0.7rev6 is a peak finder for joint analysis of NGS replicates. +# Copyright (C) 2014-2019 Mahmoud Ibrahim # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -# Contact: mahmoud.ibrahim@mdc-berlin.de +# Contact: mmibrahim@pm.me ######################################################################## diff --git a/xcorr.r b/xcorr.r index 829bc51..839fdb3 100644 --- a/xcorr.r +++ b/xcorr.r @@ -1,6 +1,6 @@ ######################################################################## -# JAMMv1.0.7rev5 is a peak finder for joint analysis of NGS replicates. -# Copyright (C) 2014-2016 Mahmoud Ibrahim +# JAMMv1.0.7rev6 is a peak finder for joint analysis of NGS replicates. +# Copyright (C) 2014-2019 Mahmoud Ibrahim # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -# Contact: mahmoud.ibrahim@mdc-berlin.de +# Contact: mmibrahim@pm.me ######################################################################## diff --git a/xcorrhelper.r b/xcorrhelper.r index 19b97d0..b86a808 100644 --- a/xcorrhelper.r +++ b/xcorrhelper.r @@ -1,6 +1,6 @@ ######################################################################## -# JAMMv1.0.7rev5 is a peak finder for joint analysis of NGS replicates. -# Copyright (C) 2014-2016 Mahmoud Ibrahim +# JAMMv1.0.7rev6 is a peak finder for joint analysis of NGS replicates. +# Copyright (C) 2014-2019 Mahmoud Ibrahim # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -# Contact: mahmoud.ibrahim@mdc-berlin.de +# Contact: mmibrahim@pm.me ######################################################################## From 03140f3fcb4ccfa7e83c0f8f0f0aade15d47964d Mon Sep 17 00:00:00 2001 From: mahmoudibrahim Date: Fri, 17 May 2019 11:09:36 +0200 Subject: [PATCH 3/3] updated some links. --- README.md | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index d1a6c95..fcb9ee5 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,18 @@ JAMM Peak Finder ====== -**JAMM is a peak finder for NGS datasets (ChIP-Seq, ATAC-Seq, DNase-Seq..etc.) that can integrate replicates and assign peak boundaries accurately. JAMM is applicable to both broad and narrow datasets. Read more [in JAMM's publication](http://bioinformatics.oxfordjournals.org/content/early/2014/09/15/bioinformatics.btu568).** +**JAMM is a peak finder for NGS datasets (ChIP-Seq, ATAC-Seq, DNase-Seq..etc.) that can integrate replicates and assign peak boundaries accurately. JAMM is applicable to both broad and narrow datasets. Read more [in JAMM's publication](https://academic.oup.com/bioinformatics/article/31/1/48/2365061).** -JAMM was developed at the [Ohler lab](http://ohlerlab.mdc-berlin.net/) at [BIMSB-MDC](http://www.mdc-berlin.de/13800178/en/bimsb) in Berlin. +JAMM was developed at the [Ohler lab](http://ohlerlab.mdc-berlin.net/) at [BIMSB-MDC](https://www.mdc-berlin.de/bimsb) in Berlin. -If you have questions or need help running JAMM please email us at [this email](http://www.google.com/recaptcha/mailhide/d?k=01vPijd2GG0LEbZV2NyE_rSA==&c=49GEiFp47dZQV_120clczwxYcP3tQ98VWBJtNl6_dBw=), we will be happy to help you. +If you have questions or need help running JAMM please email us at [this email](http://scr.im/jammpro), we will be happy to help you. Download JAMM ------ -**The latest JAMM version is _JAMMv1.0.7rev5_. [Click here to download it](https://github.com/mahmoudibrahim/JAMM/archive/JAMMv1.0.7.5.zip).** +**The latest JAMM version is _JAMMv1.0.7rev6_. [Click here to download it](https://github.com/mahmoudibrahim/JAMM/archive/JAMMv1.0.7.6.zip).** If you are interested in older versions, check the [Downloads Archive](https://github.com/mahmoudibrahim/JAMM/wiki/JAMM-Downloads-Archive) or the [Github release page](https://github.com/mahmoudibrahim/JAMM/releases). @@ -21,7 +21,7 @@ If you are interested in older versions, check the [Downloads Archive](https://g Latest News and Updates ------ -* **Jul 14 2016:** *New version of JAMM released (v1.0.7rev5)*. This version adds -T parameter for custom temporary directory (thanks to @amathelier) as well as streamlined code and fixed bugs in peakfinder.r. +* **May 17 2019:** *New version of JAMM released (v1.0.7rev6)*. This version features some small changes to input checks. _Visit the [the Wiki Homepage](https://github.com/mahmoudibrahim/JAMM/wiki) for older updates and news._ @@ -35,7 +35,7 @@ JAMM Documentation * [JAMM's Output](https://github.com/mahmoudibrahim/JAMM/wiki/JAMM%27s-Output) * [Frequently Asked Questions](https://github.com/mahmoudibrahim/JAMM/wiki/Frequently-Asked-Questions) * [Parameter Recommendations](https://github.com/mahmoudibrahim/JAMM/wiki/JAMM-Parameter-Recommendation) - * Of course it is always good to read [the actual paper](http://bioinformatics.oxfordjournals.org/content/31/1/48) :) + * Of course it is always good to read [the actual paper](https://academic.oup.com/bioinformatics/article/31/1/48/2365061) :) Please check [the Wiki Homepage](https://github.com/mahmoudibrahim/JAMM/wiki) for more information on JAMM. @@ -71,12 +71,10 @@ How to Cite JAMM? Please cite: -**Ibrahim MM, Lacadie SA, Ohler U (2015). JAMM: A Peak Finder for Joint Analysis of NGS Replicates. _Bioinformatics_, 31(1): 48-55. doi: [10.1093/bioinformatics/btu568] (http://bioinformatics.oxfordjournals.org/content/early/2014/09/15/bioinformatics.btu568)** +**Ibrahim MM, Lacadie SA, Ohler U (2015). JAMM: A Peak Finder for Joint Analysis of NGS Replicates. _Bioinformatics_, 31(1): 48-55. doi: [10.1093/bioinformatics/btu568] (https://academic.oup.com/bioinformatics/article/31/1/48/23650618)** --- *Hint: While you run JAMM, you can also go on jammin...* - - [![IMAGE ALT TEXT HERE](http://img.youtube.com/vi/HSs1HgM0Wos/0.jpg)](http://www.youtube.com/watch?v=HSs1HgM0Wos)