diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index c230c26..71d307e 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -13,7 +13,7 @@ env: IMAGE_NAME: recap CONTEXT: "./" NAMESPACE: nciccbr - VERSION_TAG: 0.2.2 + VERSION_TAG: 0.3.0 jobs: build-docker: diff --git a/RECAP_MACS.sh b/RECAP_MACS.sh index 10ad2d9..8a7298c 100755 --- a/RECAP_MACS.sh +++ b/RECAP_MACS.sh @@ -92,7 +92,7 @@ then fi # 1) Re-mix ChIP and control bed files -bash $REMIX_PATH -i $INPUT_DIR -t $CHIP_NAME -c $CONTROL_NAME -o $OUTPUT_DIR -m unequal -b $BOOTSTRAP +bash $REMIX_PATH -i $INPUT_DIR -t $CHIP_NAME -c $CONTROL_NAME -o $OUTPUT_DIR -m unequal -b $BOOTSTRAP -s $SEED # 2) Call original peaks using MACS # Please specify your own MACS parameters! @@ -186,9 +186,10 @@ while [[ $1 = -?* ]]; do -t|--treatment) shift; CHIP_NAME=${1} ;; -c|--control) shift; CONTROL_NAME=${1} ;; -o|--output) shift; OUTPUT_DIR=${1} ;; - -b|--bootstrap) shift; BOOTSTRAP=${1} ;; - -e|--header) shift; HEADER=${1} ;; - -h|--help) usage >&2; exit 0 ;; + -b|--bootstrap) shift; BOOTSTRAP=${1} ;; + -s|--seed) shift; SEED=${1} ;; + -e|--header) shift; HEADER=${1} ;; + -h|--help) usage >&2; exit 0 ;; *) echo "ERROR: Bad argument ${1}" ; exit 1 ;; esac shift diff --git a/RECAP_Re-Mix.sh b/RECAP_Re-Mix.sh index 8db53d6..25084fa 100755 --- a/RECAP_Re-Mix.sh +++ b/RECAP_Re-Mix.sh @@ -44,6 +44,12 @@ normal=$(tput sgr0) # Default values are below # =============================================================== +# source: https://www.gnu.org/software/coreutils/manual/html_node/Random-sources.html +function get_seeded_random() { + seed="$1" + openssl enc -aes-256-ctr -pass pass:"$seed" -nosalt \ + /dev/null +} function mainRemix() { ####################### Begin Script Here ####################### @@ -61,6 +67,7 @@ echo "Control library: $CONTROL_NAME" echo "Output directory (absolute path): $OUTPUT_DIR" echo "Re-mix method: $METHOD_NAME" echo "Number of re-mixes: $BOOTSTRAP" +echo "Random seed: $SEED" if [[ ! -d $INPUT_DIR ]] then @@ -125,7 +132,7 @@ do fi echo "Re-mixing..." - shuf -o $TREATMENT_NAME_BASE.bootstrap_$BOOTSTRAP_COUNT.tmp < $TREATMENT_NAME_BASE.bootstrap_$BOOTSTRAP_COUNT.tmp + shuf --random-source=<(get_seeded_random $SEED) -o $TREATMENT_NAME_BASE.bootstrap_$BOOTSTRAP_COUNT.tmp < $TREATMENT_NAME_BASE.bootstrap_$BOOTSTRAP_COUNT.tmp echo "Check!" echo "Creating re-mixed treatment library" @@ -221,6 +228,7 @@ while [[ $1 = -?* ]]; do exit 1 fi ;; -b|--bootstrap) shift; BOOTSTRAP=${1} ;; + -s|--seed) shift; SEED=${1} ;; -h|--help) usage >&2; exit 0 ;; *) echo "ERROR: Bad argument ${1}" ; exit 1 ;; esac