Skip to content

Commit 5d310bd

Browse files
author
Ubuntu
committed
add output and modified fusion
1 parent 23565b0 commit 5d310bd

File tree

8 files changed

+23
-15
lines changed

8 files changed

+23
-15
lines changed

modules/mutation/mutation_cohort.snakefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ metadata = pd.read_csv(config["metasheet"], index_col=0, sep=',')
66
metadata = pd.read_csv(config["metasheet"], index_col=0, sep=',')
77
options = [config["Treatment"],config["Control"]]
88
design = config["design"]
9+
#batch = config["batch"]
910

1011
def getsampleIDs(meta):
1112
return meta[meta[design].isin(options)].index
@@ -57,13 +58,13 @@ rule preprocess_prada:
5758
"benchmarks/fusion/{design}_preprocess_prada.benchmark"
5859
conda: "../envs/stat_perl_r.yml"
5960
params:
60-
outdir = "analysis/fusion/",
61+
outdir = "analysis/fusion/{design}_",
6162
path = "set +eu;source activate %s" % config['stat_root'],
62-
pheno = config["design"],
63+
#pheno = config["design"],
6364
gtf = config['annotation_pyprada'],
6465
anno = 'analysis/fusion/pyprada_annotation.txt'
6566
shell:
66-
"{params.path}; Rscript src/mutation/preprocess_prada.R --fusion {input} --outdir {params.outdir} --phenotype {params.pheno}"
67+
"{params.path}; Rscript src/mutation/preprocess_prada.R --fusion {input} --outdir {params.outdir} "
6768
""" && cat {output.table} | sed 's/\\t/\\n/g' | sort | uniq > {output.uniquegene} """
6869
""" && grep -f {output.uniquegene} {params.gtf} > {params.anno} """
6970

modules/preprocess/preprocess_cohort.snakefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ rule batch_removal:
139139
"analysis/salmon/tpm.genesymbol.csv"
140140
output:
141141
after = "analysis/batchremoval/{design}_{covariates}_tpm.genesymbol.batchremoved.csv",
142-
before = "analysis/batchremoval/{design}_{covariates}_tpm.genesymbol.csv"
142+
before = "analysis/batchremoval/{design}_{covariates}_tpm.genesymbol.csv",
143143
message:
144144
"Running batch removal using limma method"
145145
benchmark:
@@ -148,13 +148,16 @@ rule batch_removal:
148148
covariates = config["batch"],
149149
design = config["design"],
150150
path="set +eu;source activate %s" % config['stat_root'],
151-
meta = config["metasheet"]
151+
meta = config["metasheet"],
152+
rename = "analysis/batchremoval/tpm.genesymbol.batchremoved.csv"
152153
log:
153154
"logs/batchremoval/{design}_{covariates}_batch_removal.log"
154155
conda: "../envs/stat_perl_r.yml"
155156
shell:
156157
"{params.path}; Rscript src/preprocess/batch_removal.R -e {input} -c {params.covariates} \
157-
-d {params.design} -m {params.meta} -b {output.before} -a {output.after}"
158+
-d {params.design} -m {params.meta} -b {output.before} -a {output.after} \
159+
&& cp {output.after} {params.rename}"
160+
158161

159162

160163
rule pca_sample_clustering:

src/mutation/fusion_plot.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ suppressMessages(library(tidyverse))
1313
option_list = list(
1414
make_option(c("-i", "--input"), type="character", default=NULL,
1515
help="merged fusion prediction file", metavar="character"),
16-
make_option(c("-pf", "--pradafusion"), type="character",default=NULL,
16+
make_option(c("-f", "--pradafusion"), type="character",default=NULL,
1717
help="prada fusion prediction file", metavar="character"),
1818
make_option(c("-m", "--meta"), type="character", default=NULL,
1919
help="metasheet file", metavar="character"),

src/mutation/preprocess_prada.R

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
#!/usr/bin/env Rscript
22

33
#dependencies
4-
library(dplyr)
5-
library(ggrepel)
6-
library(optparse)
7-
library(ggplot2)
8-
library(tidyverse)
9-
library(data.table)
4+
suppressMessages(library(dplyr))
5+
suppressMessages(library(ggrepel))
6+
suppressMessages(library(optparse))
7+
suppressMessages(library(ggplot2))
8+
suppressMessages(library(tidyverse))
9+
suppressMessages(library(data.table))
1010

1111
option_list = list(
1212
make_option(c("-f", "--fusion"), type="character", default=NULL,
1313
help="merged fusion prediction file", metavar="character"),
14-
make_option(c("-out", "--outdir"), type="character", default=NULL,
14+
make_option(c("-o", "--outdir"), type="character", default=NULL,
1515
help="output directory", metavar="character")
1616

1717
);

static/environment/AWS/prada_env.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@ channels:
55
- defaults
66
dependencies:
77
- python=2.7.13=1
8+
- biopython
9+
810

911

static/environment/AWS/stat_perl_r.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ dependencies:
1313
- r-reshape2
1414
- bioconductor-sva
1515
- r-optparse
16+
- r-ggnewscale
1617
- r-ggfortify
1718
- r-e1071
1819
- r-vegan

static/environment/GCP/prada_env.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ channels:
55
- defaults
66
dependencies:
77
- python=2.7.13=1
8+
- biopython
89

910

static/fusion/prada_config.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
--REF--
2-
tx_seq_file = ./ref_files/annotations/v22/gencode.v22.ts.fa
2+
tx_seq_file = ./ref_files/salmon_index/gencode.v22.ts.fa
33
feature_file = analysis/fusion/pyprada_annotation.txt

0 commit comments

Comments
 (0)