Skip to content
Snippets Groups Projects
Commit c44dce00 authored by Skander Hatira's avatar Skander Hatira
Browse files

GRanges to bed correctly + meth stats , seperate files

parent ce77c076
No related branches found
No related tags found
No related merge requests found
......@@ -15,5 +15,5 @@ params:
qValue: 0.01
minCov: 4
minDiff: 0.4
context: ["CpG", "CHG", "CHH"]
context: ["CG"]
species: "Malus Domestica"
......@@ -7,17 +7,13 @@ resources:
genome: ".test/resources/genome/Malus_domestica_cultivar_Golden_Delicious-chr4.fasta"
annot: ".test/resources/annot/WT_vs_Meth13-CG.bed" #optional must be "" empty string if not being used
params:
method: bins
binSize: 500
kernelFunction: triangular
test: fisher
pseudocountM: 1
pseudocountN: 2
pValueThreshold: 0.01
minCytosinesCount: 1 # default 4 in bins/noise_filter , must be 1 for neighbourhood method
minProportionDifference: 0.4
minGap: 50
minSize: 100
minReadsPerCytosine: 4
cores: 1
context: ["CG", "CHG"]
bins: TRUE
windowSize: 1000
stepSize: 1000
test: F # default F, Chisq for overdispersion
overdispersion: none # default none, NM for overdispersion
qValue: 0.01
minCov: 4
minDiff: 0.4
context: ["CG"]
species: "Malus Domestica"
......@@ -22,10 +22,12 @@ rule compute_methylkit:
clustersPdf=outdir+"methylkit_results/{id}-{context}/{id}-{context}-clusters.pdf",
pcaScreePdf=outdir+"methylkit_results/{id}-{context}/{id}-{context}-PCA-screeplot.pdf",
pcaPdf=outdir+"methylkit_results/{id}-{context}/{id}-{context}-PCA.pdf",
hyperMethylation=outdir+"methylkit_results/{id}-{context}/{id}-{context}-HyperMethylated.txt",
hypoMethylation=outdir+"methylkit_results/{id}-{context}/{id}-{context}-HypoMethylated.txt",
overAllMethylation=outdir+"methylkit_results/{id}-{context}/{id}-{context}-overallMethylation.txt",
hyperMethylation=outdir+"methylkit_results/{id}-{context}/{id}-{context}-HyperMethylated-stats.txt",
hypoMethylation=outdir+"methylkit_results/{id}-{context}/{id}-{context}-HypoMethylated-stats.txt",
overAllMethylation=outdir+"methylkit_results/{id}-{context}/{id}-{context}-overallMethylation-stats.txt",
hyperMethylationBed=outdir+"methylkit_results/{id}-{context}/{id}-{context}-HyperMethylated.bed",
hypoMethylationBed=outdir+"methylkit_results/{id}-{context}/{id}-{context}-HypoMethylated.bed",
overAllMethylationBed=outdir+"methylkit_results/{id}-{context}/{id}-{context}-overallMethylation.bed",
log:
outdir+"methylkit_results/{id}-{context}/{id}-{context}-log.out"
conda:
......
......@@ -106,19 +106,34 @@ methDiff=calculateDiffMeth(meth,overdispersion=overdispersion,test=testOverdispe
### filtering differential methylation ###
fileTxt<-file(snakemake@output[["hyperMethylation"]])
hyper <- getMethylDiff(methDiff,difference=minDiff,qvalue=qValue,type="hyper")
sink(fileTxt)
getMethylDiff(methDiff,difference=minDiff,qvalue=qValue,type="hyper")
hyper
sink()
close(fileTxt)
my.gr=as(hyper,"GRanges")
df <- data.frame(my.gr)
write.table(df, file=snakemake@output[["hyperMethylationBed"]], quote=F, sep="\t", row.names=F, col.names=F)
hypo <- getMethylDiff(methDiff,difference=minDiff,qvalue=qValue,type="hypo")
fileTxt<-file(snakemake@output[["hypoMethylation"]])
sink(fileTxt)
getMethylDiff(methDiff,difference=minDiff,qvalue=qValue,type="hypo")
hypo
sink()
close(fileTxt)
my.gr=as(hypo,"GRanges")
df <- data.frame(my.gr)
write.table(df, file=snakemake@output[["hypoMethylationBed"]], quote=F, sep="\t", row.names=F, col.names=F)
all <- getMethylDiff(methDiff,difference=minDiff,qvalue=qValue)
fileTxt<-file(snakemake@output[["overAllMethylation"]])
sink(fileTxt)
getMethylDiff(methDiff,difference=minDiff,qvalue=qValue)
all
sink()
close(fileTxt)
my.gr=as(all,"GRanges")
df <- data.frame(my.gr)
write.table(df, file=snakemake@output[["overAllMethylationBed"]], quote=F, sep="\t", row.names=F, col.names=F)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment