From 6171438b393e0fe8f3a5b5f51612cda161ac5019 Mon Sep 17 00:00:00 2001 From: Melvin Alappat <melvin.alappat@unibas.ch> Date: Thu, 30 Dec 2021 14:22:33 +0100 Subject: [PATCH] add: bin folder for nextflow --- .../db/CURRENT | 1 + .../db/LOCK | 0 .../db/MANIFEST-000002 | Bin 0 -> 50 bytes .../index.curious_bose | Bin 0 -> 17 bytes src/primingprob/bin/.nextflow/history | 1 + src/primingprob/bin/cli_priming_prob.py | 63 ++++++++++ .../.command.begin | 0 .../.command.err | 1 + .../.command.out | 0 .../.command.run | 108 ++++++++++++++++++ .../.command.sh | 3 + .../e44fcf5a9b873853ca63a43b531eb0/.exitcode | 1 + .../primer.fasta | 1 + .../transcript.fasta | 1 + 14 files changed, 180 insertions(+) create mode 100644 src/primingprob/bin/.nextflow/cache/7a063d50-5a1e-4286-aa35-9883474713bf/db/CURRENT create mode 100644 src/primingprob/bin/.nextflow/cache/7a063d50-5a1e-4286-aa35-9883474713bf/db/LOCK create mode 100644 src/primingprob/bin/.nextflow/cache/7a063d50-5a1e-4286-aa35-9883474713bf/db/MANIFEST-000002 create mode 100644 src/primingprob/bin/.nextflow/cache/7a063d50-5a1e-4286-aa35-9883474713bf/index.curious_bose create mode 100644 src/primingprob/bin/.nextflow/history create mode 100644 src/primingprob/bin/cli_priming_prob.py create mode 100644 src/primingprob/bin/work/36/e44fcf5a9b873853ca63a43b531eb0/.command.begin create mode 100644 src/primingprob/bin/work/36/e44fcf5a9b873853ca63a43b531eb0/.command.err create mode 100644 src/primingprob/bin/work/36/e44fcf5a9b873853ca63a43b531eb0/.command.out create mode 100644 src/primingprob/bin/work/36/e44fcf5a9b873853ca63a43b531eb0/.command.run create mode 100644 src/primingprob/bin/work/36/e44fcf5a9b873853ca63a43b531eb0/.command.sh create mode 100644 src/primingprob/bin/work/36/e44fcf5a9b873853ca63a43b531eb0/.exitcode create mode 120000 src/primingprob/bin/work/36/e44fcf5a9b873853ca63a43b531eb0/primer.fasta create mode 120000 src/primingprob/bin/work/36/e44fcf5a9b873853ca63a43b531eb0/transcript.fasta diff --git a/src/primingprob/bin/.nextflow/cache/7a063d50-5a1e-4286-aa35-9883474713bf/db/CURRENT b/src/primingprob/bin/.nextflow/cache/7a063d50-5a1e-4286-aa35-9883474713bf/db/CURRENT new file mode 100644 index 0000000..1a84852 --- /dev/null +++ b/src/primingprob/bin/.nextflow/cache/7a063d50-5a1e-4286-aa35-9883474713bf/db/CURRENT @@ -0,0 +1 @@ +MANIFEST-000002 diff --git a/src/primingprob/bin/.nextflow/cache/7a063d50-5a1e-4286-aa35-9883474713bf/db/LOCK b/src/primingprob/bin/.nextflow/cache/7a063d50-5a1e-4286-aa35-9883474713bf/db/LOCK new file mode 100644 index 0000000..e69de29 diff --git a/src/primingprob/bin/.nextflow/cache/7a063d50-5a1e-4286-aa35-9883474713bf/db/MANIFEST-000002 b/src/primingprob/bin/.nextflow/cache/7a063d50-5a1e-4286-aa35-9883474713bf/db/MANIFEST-000002 new file mode 100644 index 0000000000000000000000000000000000000000..bbbc585686bcbcc33686059c69d80b7b4e1291cd GIT binary patch literal 50 zcmWIhx#Ncn10$nUPHI_dPD+xVQ)NkNd1i5{bAE0?Vo_pAe$kRS-TOEg7@3$k8JJmE F7y#sj5K{mE literal 0 HcmV?d00001 diff --git a/src/primingprob/bin/.nextflow/cache/7a063d50-5a1e-4286-aa35-9883474713bf/index.curious_bose b/src/primingprob/bin/.nextflow/cache/7a063d50-5a1e-4286-aa35-9883474713bf/index.curious_bose new file mode 100644 index 0000000000000000000000000000000000000000..8c72049dfdc87edc90c895e431634b262f95cc78 GIT binary patch literal 17 YcmXqe;(tDBcDqIJspKWr!EzfI07;?;Z2$lO literal 0 HcmV?d00001 diff --git a/src/primingprob/bin/.nextflow/history b/src/primingprob/bin/.nextflow/history new file mode 100644 index 0000000..dfc43c6 --- /dev/null +++ b/src/primingprob/bin/.nextflow/history @@ -0,0 +1 @@ +2021-12-30 14:13:27 4.4s curious_bose ERR 0451f3cb7c837de5727f9314aa3308b7 7a063d50-5a1e-4286-aa35-9883474713bf nextflow run RIblast_process4.nf diff --git a/src/primingprob/bin/cli_priming_prob.py b/src/primingprob/bin/cli_priming_prob.py new file mode 100644 index 0000000..198235f --- /dev/null +++ b/src/primingprob/bin/cli_priming_prob.py @@ -0,0 +1,63 @@ +"""Command-line interface client.""" +import argparse +import os +from pathlib import Path +import sys +from src.primingprob.priming_prob import Probability as Pbt # type: ignore + + +def parse_args(): + """Parse CLI arguments. + + Returns: + Parsed CLI arguments. + """ + parser = argparse.ArgumentParser( + description="RIblast input", + add_help=False, + formatter_class=argparse.ArgumentDefaultsHelpFormatter, + ) + + parser.add_argument( + 'input_file', + type=lambda p: Path(p).absolute(), + metavar="PATH", + help="path to energy-file", + ) + + parser.add_argument( + 'fasta_file', + type=lambda p: Path(p).absolute(), + metavar="PATH", + help="path to fasta-file", + ) + + parser.add_argument( + 'output_file', + type=lambda p: Path(p).absolute(), + metavar="PATH", + help="path to output-file", + ) + + return parser.parse_args() + + +def main(): + """Start priming_prob.py.""" + args = parse_args() + + if os.path.exists(args.input_file) and os.path.exists(args.fasta_file): # pragma: no cover + paradata = Pbt.inter_para(args.input_file) + Pbt.inter_prob(paradata, args.fasta_file, args.output_file) + + if not os.path.exists(args.input_file) and os.path.exists(args.fasta_file): # pragma: no cover + sys.exit("Path to input-file does not exist") + + +def init(): + """Entry point for CLI executable.""" + if __name__ == '__main__': + main() + + +init() diff --git a/src/primingprob/bin/work/36/e44fcf5a9b873853ca63a43b531eb0/.command.begin b/src/primingprob/bin/work/36/e44fcf5a9b873853ca63a43b531eb0/.command.begin new file mode 100644 index 0000000..e69de29 diff --git a/src/primingprob/bin/work/36/e44fcf5a9b873853ca63a43b531eb0/.command.err b/src/primingprob/bin/work/36/e44fcf5a9b873853ca63a43b531eb0/.command.err new file mode 100644 index 0000000..49b6c12 --- /dev/null +++ b/src/primingprob/bin/work/36/e44fcf5a9b873853ca63a43b531eb0/.command.err @@ -0,0 +1 @@ +/Users/kegany44/Master/PythonCourse/Issue_4/scrna-seq-simulation/src/primingprob/bin/work/36/e44fcf5a9b873853ca63a43b531eb0/.command.sh: line 2: RIblast: command not found diff --git a/src/primingprob/bin/work/36/e44fcf5a9b873853ca63a43b531eb0/.command.out b/src/primingprob/bin/work/36/e44fcf5a9b873853ca63a43b531eb0/.command.out new file mode 100644 index 0000000..e69de29 diff --git a/src/primingprob/bin/work/36/e44fcf5a9b873853ca63a43b531eb0/.command.run b/src/primingprob/bin/work/36/e44fcf5a9b873853ca63a43b531eb0/.command.run new file mode 100644 index 0000000..f21b88e --- /dev/null +++ b/src/primingprob/bin/work/36/e44fcf5a9b873853ca63a43b531eb0/.command.run @@ -0,0 +1,108 @@ +#!/bin/bash +# NEXTFLOW TASK: RIblast_interaction +set -e +set -u +NXF_DEBUG=${NXF_DEBUG:=0}; [[ $NXF_DEBUG > 1 ]] && set -x +NXF_ENTRY=${1:-nxf_main} + + +nxf_date() { + local ts=$(date +%s%3N); + if [[ ${#ts} == 10 ]]; then echo ${ts}000 + elif [[ $ts == *%3N ]]; then echo ${ts/\%3N/000} + elif [[ $ts == *3N ]]; then echo ${ts/3N/000} + elif [[ ${#ts} == 13 ]]; then echo $ts + else echo "Unexpected timestamp value: $ts"; exit 1 + fi +} + +nxf_env() { + echo '============= task environment =============' + env | sort | sed "s/\(.*\)AWS\(.*\)=\(.\{6\}\).*/\1AWS\2=\3xxxxxxxxxxxxx/" + echo '============= task output ==================' +} + +nxf_kill() { + declare -a children + while read P PP;do + children[$PP]+=" $P" + done < <(ps -e -o pid= -o ppid=) + + kill_all() { + [[ $1 != $$ ]] && kill $1 2>/dev/null || true + for i in ${children[$1]:=}; do kill_all $i; done + } + + kill_all $1 +} + +nxf_mktemp() { + local base=${1:-/tmp} + if [[ $(uname) = Darwin ]]; then mktemp -d $base/nxf.XXXXXXXXXX + else TMPDIR="$base" mktemp -d -t nxf.XXXXXXXXXX + fi +} + +on_exit() { + exit_status=${nxf_main_ret:=$?} + printf $exit_status > /Users/kegany44/Master/PythonCourse/Issue_4/scrna-seq-simulation/src/primingprob/bin/work/36/e44fcf5a9b873853ca63a43b531eb0/.exitcode + set +u + [[ "$tee1" ]] && kill $tee1 2>/dev/null + [[ "$tee2" ]] && kill $tee2 2>/dev/null + [[ "$ctmp" ]] && rm -rf $ctmp || true + exit $exit_status +} + +on_term() { + set +e + [[ "$pid" ]] && nxf_kill $pid +} + +nxf_launch() { + /bin/bash -ue /Users/kegany44/Master/PythonCourse/Issue_4/scrna-seq-simulation/src/primingprob/bin/work/36/e44fcf5a9b873853ca63a43b531eb0/.command.sh +} + +nxf_stage() { + true + # stage input files + rm -f transcript.fasta + rm -f primer.fasta + ln -s /Users/kegany44/Master/PythonCourse/Issue_4/scrna-seq-simulation/inputs/transcript.fasta transcript.fasta + ln -s /Users/kegany44/Master/PythonCourse/Issue_4/scrna-seq-simulation/inputs/primer.fasta primer.fasta +} + +nxf_unstage() { + true + [[ ${nxf_main_ret:=0} != 0 ]] && return +} + +nxf_main() { + trap on_exit EXIT + trap on_term TERM INT USR2 + trap '' USR1 + + [[ "${NXF_CHDIR:-}" ]] && cd "$NXF_CHDIR" + NXF_SCRATCH='' + [[ $NXF_DEBUG > 0 ]] && nxf_env + touch /Users/kegany44/Master/PythonCourse/Issue_4/scrna-seq-simulation/src/primingprob/bin/work/36/e44fcf5a9b873853ca63a43b531eb0/.command.begin + set +u + set -u + [[ $NXF_SCRATCH ]] && echo "nxf-scratch-dir $HOSTNAME:$NXF_SCRATCH" && cd $NXF_SCRATCH + nxf_stage + + set +e + local ctmp=$(set +u; nxf_mktemp /dev/shm 2>/dev/null || nxf_mktemp $TMPDIR) + local cout=$ctmp/.command.out; mkfifo $cout + local cerr=$ctmp/.command.err; mkfifo $cerr + tee .command.out < $cout & + tee1=$! + tee .command.err < $cerr >&2 & + tee2=$! + ( nxf_launch ) >$cout 2>$cerr & + pid=$! + wait $pid || nxf_main_ret=$? + wait $tee1 $tee2 + nxf_unstage +} + +$NXF_ENTRY diff --git a/src/primingprob/bin/work/36/e44fcf5a9b873853ca63a43b531eb0/.command.sh b/src/primingprob/bin/work/36/e44fcf5a9b873853ca63a43b531eb0/.command.sh new file mode 100644 index 0000000..ea89100 --- /dev/null +++ b/src/primingprob/bin/work/36/e44fcf5a9b873853ca63a43b531eb0/.command.sh @@ -0,0 +1,3 @@ +#!/bin/bash -ue +RIblast db -i transcript.fasta -o test_db +RIblast ris -i primer.fasta -o Energies.txt -d test_db diff --git a/src/primingprob/bin/work/36/e44fcf5a9b873853ca63a43b531eb0/.exitcode b/src/primingprob/bin/work/36/e44fcf5a9b873853ca63a43b531eb0/.exitcode new file mode 100644 index 0000000..405e057 --- /dev/null +++ b/src/primingprob/bin/work/36/e44fcf5a9b873853ca63a43b531eb0/.exitcode @@ -0,0 +1 @@ +127 \ No newline at end of file diff --git a/src/primingprob/bin/work/36/e44fcf5a9b873853ca63a43b531eb0/primer.fasta b/src/primingprob/bin/work/36/e44fcf5a9b873853ca63a43b531eb0/primer.fasta new file mode 120000 index 0000000..3c8fce8 --- /dev/null +++ b/src/primingprob/bin/work/36/e44fcf5a9b873853ca63a43b531eb0/primer.fasta @@ -0,0 +1 @@ +/Users/kegany44/Master/PythonCourse/Issue_4/scrna-seq-simulation/inputs/primer.fasta \ No newline at end of file diff --git a/src/primingprob/bin/work/36/e44fcf5a9b873853ca63a43b531eb0/transcript.fasta b/src/primingprob/bin/work/36/e44fcf5a9b873853ca63a43b531eb0/transcript.fasta new file mode 120000 index 0000000..cbf803b --- /dev/null +++ b/src/primingprob/bin/work/36/e44fcf5a9b873853ca63a43b531eb0/transcript.fasta @@ -0,0 +1 @@ +/Users/kegany44/Master/PythonCourse/Issue_4/scrna-seq-simulation/inputs/transcript.fasta \ No newline at end of file -- GitLab