Skip to content

Commit

Permalink
Merge pull request #12 from mskcc/release_v1.1.0
Browse files Browse the repository at this point in the history
Release v1.1.0
  • Loading branch information
timosong authored Oct 21, 2024
2 parents 0662f35 + 8c1f6f7 commit 1890d5f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 25 deletions.
2 changes: 1 addition & 1 deletion container/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
[ -e report ] && rm -rf report
mkdir report
cp -r ../* report/
docker build -t "mskcc/argos_report:1.0.8" .
docker build -t "mskcc/argos_report:1.1.0" .
11 changes: 7 additions & 4 deletions cwl/project_level_report.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ requirements:
StepInputExpressionRequirement: {}
InlineJavascriptRequirement: {}
DockerRequirement:
dockerPull: mskcc/argos_report:1.0.8
dockerPull: mskcc/argos_report:1.1.0

inputs:
request_id:
type: string
sample_ids:
normal_ids:
type: string[]
tumor_ids:
type: string[]
portal_dir:
type: Directory
Expand All @@ -29,12 +31,13 @@ steps:
run: report.cwl
in:
request_id: request_id
sample_id: sample_ids
normal_id: normal_ids
tumor_id: tumor_ids
portal_dir: portal_dir
analysis_dir: analysis_dir
oncokb_file: oncokb_file

scatter: sample_id
scatter: [normal_id,tumor_id]
scatterMethod: dotproduct
out: [output_file]

Expand Down
11 changes: 8 additions & 3 deletions cwl/report.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,24 @@ class: CommandLineTool
baseCommand: [ "compile_sample_level.R" ]
requirements:
DockerRequirement:
dockerPull: mskcc/argos_report:1.0.8
dockerPull: mskcc/argos_report:1.1.0

inputs:
request_id:
type: string
inputBinding:
position: 1
prefix: '--request_id'
sample_id:
normal_id:
type: string
inputBinding:
position: 2
prefix: '--sample_id'
prefix: '--normal_id'
tumor_id:
type: string
inputBinding:
position: 2
prefix: '--tumor_id'
portal_dir:
type: Directory
inputBinding:
Expand Down
22 changes: 5 additions & 17 deletions report/compile_sample_level.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ suppressPackageStartupMessages({
library("argparse")
})

VERSION="1.0.3"
VERSION="1.1.0"
default_output_dir <- normalizePath(getwd())

# start arg parser
parser <- ArgumentParser()
parser$add_argument("--request_id", help="Request id")
parser$add_argument("--sample_id", help="Sample id")
parser$add_argument("--normal_id", help="Normal sample id")
parser$add_argument("--tumor_id", help="Tumor sample id")
parser$add_argument("--analysis_dir", help="analysis_dir path")
parser$add_argument("--portal_dir", help="portal_dir path")
parser$add_argument("--oncokb_file", help="oncokb file path")
Expand All @@ -25,29 +26,16 @@ parser$add_argument("--output_dir", default=default_output_dir, help="Output dir

args <- parser$parse_args()

#temporary solution to get normal id. if a sample has zero mutations Goliath code can not identify the normal id causeing the report to fail
#ideal solution would be getting the normal id and matching type (matched or POOLED) from the input but that requires the input.json to be updated
#until we get the change in the operator to create the input.json as needed, we place a temporary solution.

sample_pairing_file <- read_tsv(
file.path(args$portal_dir,"../sample_pairing.txt"),
col_names = c("Normal", "Tumor"),
progress=F
)

args$tumor_id <- args$sample_id
args$normal_id <- sample_pairing_file[sample_pairing_file$Tumor == args$tumor_id, ]$Normal

output_file_name=paste0("rpt_",args$request_id,"-",args$tumor_id,"__",VERSION,".html")
output_file_name=paste0("rpt_",args$request_id,"-",args$normal_id,"__",args$tumor_id,"__",VERSION,".html")

# compile the HTML report
rmarkdown::render(
input = "/usr/report/report_sample_level.Rmd",
params = list(
analysis_dir = args$analysis_dir,
portal_dir = args$portal_dir,
tumor_id = args$tumor_id,
normal_id = args$normal_id,
tumor_id = args$tumor_id,
oncokb_file = args$oncokb_file
# geneAnnotation_path = args$geneAnnotation_path,

Expand Down

0 comments on commit 1890d5f

Please sign in to comment.