@@ -29,7 +29,7 @@ EOF | |||
while getopts ":hd:m:o:" arg; do | |||
case "$arg" in | |||
"e") | |||
"d") | |||
DATA_FILE="$OPTARG" | |||
;; | |||
"m") |
@@ -48,15 +48,15 @@ | |||
}, | |||
"ProtQC": { | |||
"Package": "ProtQC", | |||
"Version": "0.1.0", | |||
"Version": "0.1.3", | |||
"Source": "GitHub", | |||
"RemoteType": "github", | |||
"RemoteHost": "api.github.com", | |||
"RemoteRepo": "ProtQC", | |||
"RemoteUsername": "chinese-quartet", | |||
"RemoteRef": "v0.1.2", | |||
"RemoteSha": "22fbe4ad61d183530f737335d7c730de876d85bc", | |||
"Hash": "6ce010c606427ed07ea8f8925577564c" | |||
"RemoteRef": "v0.1.3", | |||
"RemoteSha": "01edb13db10e24e38aa06299bfe7b69e009cd134", | |||
"Hash": "c5ae657d64a2afd72770effa4767a049" | |||
}, | |||
"R6": { | |||
"Package": "R6", |
@@ -19,6 +19,7 @@ init: | |||
# Unpack environment file to the directory, repository/envs/quartet-protqc-report | |||
- step: unpack-env | |||
envname: quartet-protqc-report | |||
postunpack: chmod a+x {{ENV_DEST_DIR}}/quartet-protqc-report/bin/protqc.sh | |||
- step: load-namespace | |||
namespace: tservice.plugins.quartet-protqc-report | |||
- step: register-plugin |
@@ -4,7 +4,7 @@ | |||
[spec-tools.core :as st] | |||
[clojure.tools.logging :as log] | |||
[tservice.lib.files :as ff] | |||
[tservice.api.storage.fs :as fs-api] | |||
[clojure.string :as clj-str] | |||
[tservice.lib.fs :as fs-lib] | |||
[tservice.vendor.multiqc :as mq] | |||
[tservice.plugins.quartet-protqc-report.protqc :as protqc] | |||
@@ -60,7 +60,7 @@ | |||
(let [payload (merge {:description description} payload) | |||
data-file (protqc/correct-filepath data_file) | |||
metadata-file (protqc/correct-filepath metadata_file) | |||
workdir (fs-api/dirname data-file) | |||
workdir (protqc/dirname data-file) | |||
log-path (fs-lib/join-paths workdir "log") | |||
response {:report (format "%s/multireport.html" workdir) | |||
:log log-path | |||
@@ -74,7 +74,7 @@ | |||
:response response}) | |||
result-dir (fs-lib/join-paths workdir "results")] | |||
(fs-lib/create-directories! result-dir) | |||
(log/info (format "Create a report %s with %s" name payload)) | |||
(log/info (format "Create a report %s with %s in %s" name payload workdir)) | |||
(spit log-path (json/write-str {:status "Running" | |||
:msg ""})) | |||
(update-process! task-id 0) |
@@ -3,7 +3,8 @@ | |||
(:require [tservice.api.config :refer [add-env-to-path]] | |||
[tservice.lib.files :refer [is-localpath?]] | |||
[clojure.string :as clj-str] | |||
[clojure.java.shell :as shell :refer [sh]])) | |||
[clojure.java.shell :as shell :refer [sh]] | |||
[clojure.java.io :refer [file]])) | |||
(defn call-protqc! | |||
"Call protqc bash script. more details on https://github.com/chinese-quartet/ProtQC | |||
@@ -28,3 +29,24 @@ | |||
(if (is-localpath? filepath) | |||
(clj-str/replace filepath #"^file:\/\/" "") | |||
filepath)) | |||
(defn ^String basename | |||
"Returns the basename of 'path'. | |||
This works by calling getName() on a java.io.File instance. It's prefered | |||
over last-dir-in-path for that reason. | |||
Parameters: | |||
path - String containing the path for an item in iRODS. | |||
Returns: | |||
String containing the basename of path." | |||
[^String path] | |||
(.getName (file path))) | |||
(defn ^String dirname | |||
"Returns the dirname of 'path'. | |||
This works by calling getParent() on a java.io.File instance. | |||
Parameters: | |||
path - String containing the path for an item in iRODS. | |||
Returns: | |||
String containing the dirname of path." | |||
[^String path] | |||
(when path (.getParent (file path)))) |