Procházet zdrojové kódy

Remove parameters.

tags/v0.1.3
YJC před 3 roky
rodič
revize
92eb545718
4 změnil soubory, kde provedl 24 přidání a 72 odebrání
  1. +1
    -0
      .gitignore
  2. +1
    -1
      project.clj
  3. +2
    -1
      resources/tservice-plugin.yaml
  4. +20
    -70
      src/tservice/plugins/quartet_rnaseq_report.clj

+ 1
- 0
.gitignore Zobrazit soubor

@@ -9,3 +9,4 @@ pom.xml.asc
/.nrepl-port
.hgignore
.hg/
.lsp

+ 1
- 1
project.clj Zobrazit soubor

@@ -1,4 +1,4 @@
(defproject tservice-plugins/quartet-rnaseq-report "v0.1.2"
(defproject tservice-plugins/quartet-rnaseq-report "v0.1.3"
:description "QC Report for Quartet RNA-Seq."
:url "https://github.com/tservice-plugins/quartet-rnaseq-report"
:license {:name "Eclipse Public License"

+ 2
- 1
resources/tservice-plugin.yaml Zobrazit soubor

@@ -3,7 +3,7 @@ info:
version: v0.1.0
description: Generate the QC Report for Quartet RNA-Seq data.
category: Report
home: https://github.com/clinico-omics/tservice-plugins
home: https://github.com/tservice-plugins/quartet-rnaseq-report
source: PGx
short_name: quartet-rnaseq-report
icons:
@@ -19,6 +19,7 @@ init:
# Unpack environment file to the directory, repository/envs/quartet-rnaseq-report
- step: unpack-env
envname: quartet-rnaseq-report
postunpack: chmod a+x {{ENV_DEST_DIR}}/bin/exp2qcdt.sh
- step: load-namespace
namespace: tservice.plugins.quartet-rnaseq-report
- step: register-plugin

+ 20
- 70
src/tservice/plugins/quartet_rnaseq_report.clj Zobrazit soubor

@@ -72,74 +72,9 @@
(s/def ::metadata
(s/coll-of ::metadat-item))

(s/def ::lab
(st/spec
{:spec string?
:type :string
:description "Lab name."
:swagger/default []
:reason "The lab_name must be string."}))

(s/def ::sequencing_platform
(st/spec
{:spec string?
:type :string
:description "Sequencing Platform."
:swagger/default []
:reason "The sequencing_platform must be string."}))

(s/def ::sequencing_method
(st/spec
{:spec string?
:type :string
:description "Sequencing Method"
:swagger/default []
:reason "The sequencing_method must be string."}))

(s/def ::library_protocol
(st/spec
{:spec string?
:type :string
:description "Library protocol."
:swagger/default []
:reason "The library_protocol must be string."}))

(s/def ::library_kit
(st/spec
{:spec string?
:type :string
:description "Library kit."
:swagger/default []
:reason "The library_kit must be string."}))

(s/def ::read_length
(st/spec
{:spec string?
:type :string
:description "Read length"
:swagger/default []
:reason "The read_length must be string."}))

(s/def ::date
(st/spec
{:spec string?
:type :string
:description "Date"
:swagger/default []
:reason "The date must be string."}))

(s/def ::parameters
(s/keys :req-un [::lab
::sequencing_platform
::sequencing_method
::library_protocol
::library_kit
::read_length
::date]))

(def quartet-rna-report-params-body
"A spec for the body parameters."
(s/keys :req-un [::name ::description ::filepath ::metadata ::parameters]
(s/keys :req-un [::name ::description ::filepath ::metadata]
:opt-un [::description]))

;;; ------------------------------------------------ Event Metadata ------------------------------------------------
@@ -148,7 +83,7 @@
{:name "quartet-rnaseq-report"
:summary "Generate the QC Report for Quartet RNA-Seq data."
:params-schema quartet-rna-report-params-body
:handler (fn [{:keys [name description filepath metadata parameters] :as payload}]
:handler (fn [{:keys [name description filepath metadata] :as payload}]
(let [workdir (ff/get-workdir)
report-file (fs-lib/join-paths workdir "multireport.html")
log-path (fs-lib/join-paths workdir "log")
@@ -160,14 +95,17 @@
:payload payload
:plugin-name "quartet-rnaseq-report"
:plugin-type "ReportPlugin"
:plugin-version "v0.1.1"
:plugin-version "v0.1.3"
:response response})]
(fs-lib/create-directories! workdir)
(spit log-path (json/write-str {:status "Running" :msg ""}))
(update-process! task-id 0)
(publish-event! "quartet_rnaseq_report"
{:data-dir filepath
:parameters parameters
:parameters {:name name
:description description
:plugin-name "quartet-rnaseq-report"
:plugin-version "v0.1.3"}
:metadata metadata
:dest-dir workdir
:task-id task-id})
@@ -197,9 +135,14 @@
(fs-lib/create-directories! files-keep-dir)
(fs-api/copy-files! files-keep files-keep-dir {:replace-existing true})))

(defn date
[]
(.format (java.text.SimpleDateFormat. "yyyy-MM-dd")
(new java.util.Date)))

(defn- quartet-rnaseq-report!
"Chaining Pipeline: filter-files -> copy-files -> merge_exp_file -> exp2qcdt -> multiqc."
[datadir parameters metadata dest-dir task-id]
[{:keys [datadir parameters metadata dest-dir task-id]}]
(log/info "Generate quartet rnaseq report: " datadir parameters metadata dest-dir)
(let [metadata-file (fs-lib/join-paths dest-dir
"results"
@@ -239,6 +182,13 @@
(decompression-tar files-qualimap-RNA-tar))
(update-process! task-id 50)
(gen-multiqc-config config-path)
(spit parameters-file (json/write-str {"Report Name" (:name parameters)
"Description" (:description parameters)
"Report Tool" (format "%s-%s"
(:plugin-name parameters)
(:plugin-version parameters))
"Team" "Quartet Team"
"Date" (date)}))
(let [exp2qcdt-result (exp2qcdt/call-exp2qcdt! exp-fpkm-filepath exp-count-filepath metadata-file result-dir)
multiqc-result (if (= (:status exp2qcdt-result) "Success")
(mq/multiqc result-dir dest-dir {:config config-path :template "default" :title "Quartet RNA report"})

Načítá se…
Zrušit
Uložit