-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from mahmoudibrahim/mahmoudibrahim-patch-1
Mahmoudibrahim patch 1
- Loading branch information
Showing
13 changed files
with
83 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <http://www.gnu.org/licenses/>. | ||
# | ||
# Contact: [email protected] | ||
# Contact: [email protected] | ||
######################################################################## | ||
|
||
|
||
|
@@ -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. | ||
|
@@ -136,23 +136,44 @@ 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 | ||
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 | ||
echo "No Sample Files Found!" | ||
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 | ||
|
@@ -245,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 | ||
|
@@ -290,15 +312,19 @@ 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 | ||
Rscript "$sPath/xcorrhelper.r" -infile="$out/xcorr/$samplefile/shifts.txt" -out="$out/xcorr/$samplefile" | ||
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 | ||
|
@@ -382,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" | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <http://www.gnu.org/licenses/>. | ||
# | ||
# Contact: [email protected] | ||
# Contact: [email protected] | ||
######################################################################## | ||
|
||
##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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <http://www.gnu.org/licenses/>. | ||
# | ||
# Contact: [email protected] | ||
# Contact: [email protected] | ||
######################################################################## | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <http://www.gnu.org/licenses/>. | ||
# | ||
# Contact: [email protected] | ||
# Contact: [email protected] | ||
######################################################################## | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <http://www.gnu.org/licenses/>. | ||
# | ||
# Contact: [email protected] | ||
# Contact: [email protected] | ||
######################################################################## | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <http://www.gnu.org/licenses/>. | ||
# | ||
# Contact: [email protected] | ||
# Contact: [email protected] | ||
######################################################################## | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 [email protected] | ||
If you encounter errors or have questions, please email [email protected] | ||
|
||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <http://www.gnu.org/licenses/>. | ||
# | ||
# Contact: [email protected] | ||
# Contact: [email protected] | ||
######################################################################## | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <http://www.gnu.org/licenses/>. | ||
# | ||
# Contact: [email protected] | ||
# Contact: [email protected] | ||
######################################################################## | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <http://www.gnu.org/licenses/>. | ||
# | ||
# Contact: [email protected] | ||
# Contact: [email protected] | ||
######################################################################## | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <http://www.gnu.org/licenses/>. | ||
# | ||
# Contact: [email protected] | ||
# Contact: [email protected] | ||
######################################################################## | ||
|
||
|
||
|