Skip to content

Commit 5772a7e

Browse files
author
alvinwt
committed
Merge branch 'main' of https://github.com/icgc-argo-workflows/icgc-argo-mutational-signatures into matrixgenerator@0.1.0
2 parents 244b6d7 + 7c8162f commit 5772a7e

9 files changed

Lines changed: 22 additions & 27 deletions

File tree

.github/workflows/build-test-release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ jobs:
9595
9696
- name: Install Nextflow
9797
run: |
98+
export NXF_VER=21.10.6
9899
wget --tries=10 -qO- https://get.nextflow.io | bash
99100
sudo chmod 755 nextflow
100101
sudo mv nextflow /usr/local/bin/

nextflow.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
manifest {
22
homePage = 'https://github.com/icgc-argo-workflows/icgc-argo-mutational-signatures'
33
description = 'ICGC ARGO Mutational Signatures Workflow Packages'
4-
nextflowVersion = '>=20.10'
4+
nextflowVersion = '21.10'
55
}
66

77
docker {

signaturetoolslib/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ RUN wget https://cdn.rstudio.com/r/${OS_IDENTIFIER}/pkgs/R-${R_VERSION}-1-1.x86_
2020
yum clean all
2121

2222

23-
RUN R -e "install.packages("remotes", dependencies=TRUE,repos='http://cran.rstudio.com/')"
23+
RUN R -e "install.packages('remotes', dependencies=TRUE,repos='http://cran.rstudio.com/')"
2424

2525

2626
## Installing packages from Bioconductor
Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
#!/usr/bin/Rscript
22

3-
# Library
43
library(signature.tools.lib)
54
library("optparse")
65

7-
#####INPUT
8-
9-
###
106
option_list = list(
117
make_option(c("-i", "--input_file"), type="character", default=NULL,
128
help="Matrix of counts", metavar="character"),
@@ -23,38 +19,36 @@ if (is.null(opt$input_file) | is.null(opt$output_dir) ){
2319
stop("Missing some input arguments... Exiting...", call.=FALSE)
2420
}
2521

26-
### Set seed
22+
## Set seed used to match expected output
2723
set.seed(164)
2824

29-
##### Input variables
25+
## Input variables
3026
DIR_RES <- opt$output_dir
3127
INPUT_MAT <- opt$input_file
3228

33-
# Import variables
29+
## Import matrix of counts
3430
mut_mat_ICGC <- read.table(INPUT_MAT, row.names = 1, header=TRUE)
3531

36-
## Function for extracting signatures
37-
extractSignatures <- function(input_matrix, sig_matrix) {
32+
## Function for signature attribution
33+
assignSignatures <- function(input_matrix, sig_matrix) {
3834

35+
## use Fit function, FitMS is still undergoing testing
3936
subs_fit_res <- signature.tools.lib::Fit(catalogues = input_matrix,
4037
exposureFilterType = "giniScaledThreshold",
4138
signatures = sig_matrix,
4239
useBootstrap = TRUE,
4340
nboot = 100,
4441
nparallel = 6 )
45-
# Save
46-
#snv_exp <- subs_fit_res$E_median_filtered
47-
# Return
4842
return(subs_fit_res)
4943
}
5044

51-
52-
# Extract the signatures
53-
sign_res <- extractSignatures(mut_mat_ICGC, COSMIC30_subs_signatures)
45+
## Assign the signatures
46+
## Currently testing with COSMIC 30 signatures (To update)
47+
sign_res <- assignSignatures(mut_mat_ICGC, COSMIC30_subs_signatures)
5448

5549
### Save output as JSON
56-
fitToJSON(sign_res,
57-
paste0(DIR_RES, "/export_signatures.json") )
50+
signature.tools.lib::fitToJSON(sign_res,
51+
paste0(DIR_RES, "/export_assignments.json") )
5852

5953

60-
54+

signaturetoolslib/main.nf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
/* this block is auto-generated based on info from pkg.json where */
3030
/* changes can be made if needed, do NOT modify this block manually */
3131
nextflow.enable.dsl = 2
32-
version = '0.1.0' // package version
32+
version = '0.1.1'
3333

3434
container = [
3535
'ghcr.io': 'ghcr.io/icgc-argo-workflows/icgc-argo-mutational-signatures.signaturetoolslib'
@@ -63,7 +63,7 @@ process signaturetoolslib {
6363
path input_file
6464

6565
output: // output, make update as needed
66-
path "${params.output_dir}/export_signatures.json", emit: output_file
66+
path "${params.output_dir}/export_assignments.json", emit: output_file
6767

6868
script:
6969
// add and initialize variables here as needed

signaturetoolslib/pkg.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "signaturetoolslib",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "Mutational signature tool",
55
"main": "main.nf",
66
"deprecated": false,

signaturetoolslib/tests/checker.nf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
/* this block is auto-generated based on info from pkg.json where */
3535
/* changes can be made if needed, do NOT modify this block manually */
3636
nextflow.enable.dsl = 2
37-
version = '0.1.0' // package version
37+
version = '0.1.1'
3838

3939
container = [
4040
'ghcr.io': 'ghcr.io/icgc-argo-workflows/icgc-argo-mutational-signatures.signaturetoolslib'

signaturetoolslib/tests/expected/test_signatures.json renamed to signaturetoolslib/tests/expected/test_assignments.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"fitAlgorithm": Fit,
2+
"fitAlgorithm": "Fit",
33
"nsamples": 10,
44
"nsignatures": 30,
55
"nchannels": 96,
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"input_file": "input/Synthetic.eso.mutation.counts-10-samples.tsv",
3-
"expected_output": "expected/test_signatures.json",
3+
"expected_output": "expected/test_assignments.json",
44
"output_dir": "outdir_dir",
55
"cpus": 2,
66
"mem": 6
7-
}
7+
}

0 commit comments

Comments
 (0)