Commit cfeb8245 authored by Philippe BORDRON's avatar Philippe BORDRON
Browse files

update the pipeline where it crashes

parent 53232846
......@@ -15,7 +15,11 @@ option_list = list(
make_option(c("-a", "--sampleAbstract"), type="character", default=NULL,
help="sample abstract file path", metavar="character"),
make_option(c("-o", "--outdir"), type="character", default=".",
help="output directory [default= %default]", metavar="character")
help="output directory [default= %default]", metavar="character"),
make_option(c("--ignore-plate-effect"), dest="ignore_plate_effect", action="store_true", default=FALSE,
help="Ignore plate effect if multiplate design [default= %default]"),
make_option(c("--ignore-batch-effect"), dest="ignore_batch_effect", action="store_true", default=FALSE,
help="Ignore batch effect [default= %default]")
);
opt_parser = OptionParser(option_list=option_list);
......@@ -86,9 +90,9 @@ nboot=30 #if bootsrap, number of bootstrap replications
sampleAnnot<-lire(sampleTable)
# If column named "batchEffect" exists, apply batch correction
batchEffect<-FALSE; if(batchEffectCol %in% colnames(sampleAnnot)) batchEffect<-TRUE
batchEffect<-FALSE; if((!opt$ignore_batch_effect) && (batchEffectCol %in% colnames(sampleAnnot))) batchEffect<-TRUE
# If column named "plateBatch" exists, apply batch correction
plateBatch<-FALSE; if(plateBatchCol %in% colnames(sampleAnnot)) plateBatch<-TRUE
plateBatch<-FALSE; if((!opt$ignore_plate_effect) && (plateBatchCol %in% colnames(sampleAnnot))) plateBatch<-TRUE
if(batchEffect || plateBatch){
exprDatT=lire(paste(outputDir,"/exprTransformedAdjusted.tsv",sep=""))
......
......@@ -16,9 +16,7 @@ option_list = list(
make_option(c("--ignore-plate-effect"), dest="ignore_plate_effect", action="store_true", default=FALSE,
help="Ignore plate effect if multiplate design [default= %default]"),
make_option(c("--ignore-batch-effect"), dest="ignore_batch_effect", action="store_true", default=FALSE,
help="Ignore batch effect [default= %default]"),
make_option(c("--ignore-all-factors"), dest="ignore_factors", action="store_true", default=FALSE,
help="Ignore all factors [default= %default]")
help="Ignore batch effect [default= %default]")
);
opt_parser = OptionParser(option_list=option_list);
......@@ -53,9 +51,9 @@ exprDat<-lire(expressionData)
sampleAnnot<-lire(sampleTable)
# If column named "batchEffect" exists, apply batch correction
batchEffect<-FALSE; if((!(opt$ignore_factors || opt$ignore_batch_effect)) && (batchEffectCol %in% colnames(sampleAnnot))) batchEffect<-TRUE
batchEffect<-FALSE; if((!opt$ignore_batch_effect) && (batchEffectCol %in% colnames(sampleAnnot))) batchEffect<-TRUE
# If column named "plateBatch" exists, apply batch correction
plateBatch<-FALSE; if((!(opt$ignore_factors || opt$ignore_plate_effect)) && (plateBatchCol %in% colnames(sampleAnnot))) plateBatch<-TRUE
plateBatch<-FALSE; if((!opt$ignore_plate_effect) && (plateBatchCol %in% colnames(sampleAnnot))) plateBatch<-TRUE
sampleAnnot[,condCol]<-as.factor(as.character(sampleAnnot[,condCol]))
exprDat<-exprDat[,c(rownames(sampleAnnot))]
......
......@@ -11,7 +11,11 @@ option_list = list(
make_option(c("-s", "--sampleTable"), type="character", default=NULL,
help="sample table file path", metavar="character"),
make_option(c("-o", "--outdir"), type="character", default=".",
help="output directory [default= %default]", metavar="character")
help="output directory [default= %default]", metavar="character"),
make_option(c("--ignore-plate-effect"), dest="ignore_plate_effect", action="store_true", default=FALSE,
help="Ignore plate effect if multiplate design [default= %default]"),
make_option(c("--ignore-batch-effect"), dest="ignore_batch_effect", action="store_true", default=FALSE,
help="Ignore batch effect [default= %default]")
);
opt_parser = OptionParser(option_list=option_list);
......@@ -156,9 +160,9 @@ sampleAnnot<-lire(sampleTable)
# If column named "batchEffect" exists, apply batch correction
batchEffect<-FALSE; if(batchEffectCol %in% colnames(sampleAnnot)) batchEffect<-TRUE
batchEffect<-FALSE; if((!opt$ignore_batch_effect) && (batchEffectCol %in% colnames(sampleAnnot))) batchEffect<-TRUE
# If column named "plateBatch" exists, apply batch correction
plateBatch<-FALSE; if(plateBatchCol %in% colnames(sampleAnnot)) plateBatch<-TRUE
plateBatch<-FALSE; if((!opt$ignore_plate_effect) && (plateBatchCol %in% colnames(sampleAnnot))) plateBatch<-TRUE
acpT<-ACP(exprDatT)
compo=length(which(acpT$percentVar>0.05))+1
......
......@@ -107,10 +107,11 @@ rule deClusterHeatmap:
MAINDIR+"/{project}/"+config["de_folder"]+"/HeatmapCorPearson.png",
MAINDIR+"/{project}/"+config["de_folder"]+"/heatmap.RData"
params:
outdir = MAINDIR+"/{project}/"+config["de_folder"]
outdir = MAINDIR+"/{project}/"+config["de_folder"],
additional_params = lambda wildcards: config["comparisons"][wildcards.project].get("normalizationOptions", [])
shell:
"""
Rscript {wfbasedir}/SCRIPTS/DE/clusterHeatmap.R -e {input.expressionTable} -s {input.sampleTable} -a {input.sampleAbstract} -o {params.outdir}
Rscript {wfbasedir}/SCRIPTS/DE/clusterHeatmap.R -e {input.expressionTable} -s {input.sampleTable} -a {input.sampleAbstract} -o {params.outdir} {params.additional_params}
"""
rule deQualityControls:
......@@ -120,10 +121,11 @@ rule deQualityControls:
output:
MAINDIR+"/{project}/"+config["de_folder"]+"/PCA.png"
params:
outdir = MAINDIR+"/{project}/"+config["de_folder"]
outdir = MAINDIR+"/{project}/"+config["de_folder"],
additional_params = lambda wildcards: config["comparisons"][wildcards.project].get("normalizationOptions", [])
shell:
"""
Rscript {wfbasedir}/SCRIPTS/DE/qualityControl.R -e {input.expressionTable} -s {input.sampleTable} -o {params.outdir}
Rscript {wfbasedir}/SCRIPTS/DE/qualityControl.R -e {input.expressionTable} -s {input.sampleTable} -o {params.outdir} {params.additional_params}
"""
rule deNormalization:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment