Mercurial > repos > portiahollyoak > temp
comparison scripts/TEMP_Absence.sh @ 12:ca36262102d8 draft
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
| author | portiahollyoak |
|---|---|
| date | Fri, 29 Apr 2016 05:47:54 -0400 |
| parents | 28d1a6f8143f |
| children | 9672fe07a232 |
comparison
equal
deleted
inserted
replaced
| 11:e19d9742c99b | 12:ca36262102d8 |
|---|---|
| 24 -s Directory where all the scripts are | 24 -s Directory where all the scripts are |
| 25 -o Path to output directory. Default is current directory | 25 -o Path to output directory. Default is current directory |
| 26 -r Annotated transposon positions in the genome (e.g., repeakMask) in bed6 format with full path | 26 -r Annotated transposon positions in the genome (e.g., repeakMask) in bed6 format with full path |
| 27 -t 2bit file for the reference genome (can be downloaded from UCSC Genome Browser) | 27 -t 2bit file for the reference genome (can be downloaded from UCSC Genome Browser) |
| 28 -f An integer specifying the length of the fragments (inserts) of the library. Default is 500 | 28 -f An integer specifying the length of the fragments (inserts) of the library. Default is 500 |
| 29 -c An integer specifying the number of CUPs used. Default is 4 | 29 -x The minimum score difference between the best hit and the second best hit for considering a read as uniquely mapped. For BWA MEM. |
| 30 -c An integer specifying the number of CPUs used. Default is 4 | |
| 30 -h Show help message | 31 -h Show help message |
| 31 | 32 |
| 32 EOF | 33 EOF |
| 33 echo -en "\e[0m" | 34 echo -en "\e[0m" |
| 34 } | 35 } |
| 35 | 36 |
| 36 # taking options | 37 # taking options |
| 37 while getopts "hi:c:f:o:r:s:t:" OPTION | 38 while getopts "hi:c:f:o:r:s:t:x:" OPTION |
| 38 do | 39 do |
| 39 case $OPTION in | 40 case $OPTION in |
| 40 h) | 41 h) |
| 41 usage && exit 1 | 42 usage && exit 1 |
| 42 ;; | 43 ;; |
| 59 TEBED=$OPTARG | 60 TEBED=$OPTARG |
| 60 ;; | 61 ;; |
| 61 t) | 62 t) |
| 62 REF=$OPTARG | 63 REF=$OPTARG |
| 63 ;; | 64 ;; |
| 65 x) | |
| 66 SCORE=$OPTARG | |
| 67 ;; | |
| 64 ?) | 68 ?) |
| 65 usage && exit 1 | 69 usage && exit 1 |
| 66 ;; | 70 ;; |
| 67 esac | 71 esac |
| 68 done | 72 done |
| 71 then | 75 then |
| 72 usage && exit 1 | 76 usage && exit 1 |
| 73 fi | 77 fi |
| 74 [ ! -z "${CPU##*[!0-9]*}" ] || CPU=4 | 78 [ ! -z "${CPU##*[!0-9]*}" ] || CPU=4 |
| 75 [ ! -z "${INSERT##*[!0-9]*}" ] || INSERT=500 | 79 [ ! -z "${INSERT##*[!0-9]*}" ] || INSERT=500 |
| 80 [ ! -z "${SCORE##*[!0-9]*}" ] || SCORE=0 | |
| 76 [ ! -z $OUTDIR ] || OUTDIR=$PWD | 81 [ ! -z $OUTDIR ] || OUTDIR=$PWD |
| 77 | 82 |
| 78 mkdir -p "${OUTDIR}" || echo -e "\e[1;31mWarning: Cannot create directory ${OUTDIR}. Using the direcory of input fastq file\e[0m" | 83 mkdir -p "${OUTDIR}" || echo -e "\e[1;31mWarning: Cannot create directory ${OUTDIR}. Using the direcory of input fastq file\e[0m" |
| 79 cd ${OUTDIR} || echo -e "\e[1;31mError: Cannot access directory ${OUTDIR}... Exiting...\e[0m" || exit 1 | 84 cd ${OUTDIR} || echo -e "\e[1;31mError: Cannot access directory ${OUTDIR}... Exiting...\e[0m" || exit 1 |
| 80 touch ${OUTDIR}/.writting_permission && rm -rf ${OUTDIR}/.writting_permission || echo -e "\e[1;31mError: Cannot write in directory ${OUTDIR}... Exiting...\e[0m" || exit 1 | 85 touch ${OUTDIR}/.writting_permission && rm -rf ${OUTDIR}/.writting_permission || echo -e "\e[1;31mError: Cannot write in directory ${OUTDIR}... Exiting...\e[0m" || exit 1 |
| 91 checkExist "mv" | 96 checkExist "mv" |
| 92 checkExist "sort" | 97 checkExist "sort" |
| 93 checkExist "touch" | 98 checkExist "touch" |
| 94 checkExist "awk" | 99 checkExist "awk" |
| 95 checkExist "grep" | 100 checkExist "grep" |
| 101 checkExist "twoBitToFa" | |
| 96 checkExist "bwa" | 102 checkExist "bwa" |
| 97 checkExist "samtools" | 103 checkExist "samtools" |
| 98 echo -e "\e[1;35mDone with testing required softwares/scripts, starting pipeline...\e[0m" | 104 echo -e "\e[1;35mDone with testing required softwares/scripts, starting pipeline...\e[0m" |
| 99 | 105 |
| 100 name=`basename $BAM` | 106 name=`basename $BAM` |
| 132 # Identify breakpoints using soft-clipping information | 138 # Identify breakpoints using soft-clipping information |
| 133 perl $BINDIR/pickSoftClipping.over.pl $i.excision.cluster.rpmk $REF > $i.excision.cluster.rpmk.sfcp | 139 perl $BINDIR/pickSoftClipping.over.pl $i.excision.cluster.rpmk $REF > $i.excision.cluster.rpmk.sfcp |
| 134 perl $BINDIR/refine_breakpoint.ex.pl | 140 perl $BINDIR/refine_breakpoint.ex.pl |
| 135 | 141 |
| 136 # Estimate excision sites frequencies | 142 # Estimate excision sites frequencies |
| 137 perl $BINDIR/pickOverlapPair.ex.pl $i.excision.cluster.rpmk.refined.bp > $i.excision.cluster.rpmk.refined.bp.refsup | 143 if [[ $SCORE -eq 0 ]] |
| 144 then | |
| 145 perl $BINDIR/pickOverlapPair.ex.pl $i.excision.cluster.rpmk.refined.bp > $i.excision.cluster.rpmk.refined.bp.refsup | |
| 146 else | |
| 147 perl $BINDIR/pickOverlapPair.ex_MEM.pl $i.excision.cluster.rpmk.refined.bp $SCORE > $i.excision.cluster.rpmk.refined.bp.refsup | |
| 148 fi | |
| 149 | |
| 138 perl $BINDIR/summarize_excision.pl | 150 perl $BINDIR/summarize_excision.pl |
