changeset 0:3c5fd076f42b draft

Uploaded
author jbrayet
date Tue, 09 Feb 2016 10:47:45 -0500
parents
children 0144a29d6e1d
files peaks2bed.sh
diffstat 1 files changed, 43 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/peaks2bed.sh	Tue Feb 09 10:47:45 2016 -0500
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+while getopts "f:t:o:g:n:r:" optionName; do
+case "$optionName" in
+
+f) inputfile="$OPTARG";;
+t) minHeight="$OPTARG";;
+o) output="$OPTARG";;
+g) BUILD="$OPTARG";;
+n) nameBed="$OPTARG";;
+r) ROOT_DIR="$OPTARG";;
+esac
+done
+
+local_path=/usr/bin/peakstobed
+DATABASE_PATH=$ROOT_DIR/database/files
+mkdir -p $DATABASE_PATH/nebulaAnnotations
+mkdir -p $DATABASE_PATH/nebulaAnnotations/$BUILD
+nebulaAnnotationPath=$DATABASE_PATH/nebulaAnnotations
+nebulaGenomePath=$DATABASE_PATH/nebulaAnnotations/$BUILD
+
+############### Create annotations files ################
+
+FAIFILE='n'
+LENFILE='n'
+DICTFILE='n'
+CHROFILE='n'
+MAPFILE='n'
+
+if [ ! -f $nebulaGenomePath/$BUILD.len ]; then
+    FAIFILE='y'
+    LENFILE='y'
+fi
+  
+chrom_info_file=$nebulaGenomePath/$BUILD.len
+FILEPATH=$ROOT_DIR/tool-data
+  
+bash /usr/bin/create_annotation_files.sh $FAIFILE $LENFILE $DICTFILE $CHROFILE $FILEPATH $BUILD $MAPFILE $nebulaGenomePath
+  
+#################### END ANNOTATION FILES ###########################
+
+perl $local_path/peaks2bed.pl -f $inputfile -t $minHeight -o $output -g $chrom_info_file -n $nameBed
+