Skip to content
Snippets Groups Projects
Commit d580c130 authored by Tobias Marschall's avatar Tobias Marschall
Browse files

Add config option snv_calls to use existing SNV call sets

parent 7947b787
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,7 @@
"samtools" : "samtools",
"bcftools" : "bcftools",
"snv_calls" : "",
"exclude_file" : "/g/korbel/meiers/tools/mosaicatcher/mosaicatcher/data/exclude/hg19.exclude",
"variable_bins" : {
......
......@@ -289,13 +289,16 @@ rule prepare_strandphaser_config_per_chrom:
print("bsGenome = '", config["R_reference"], "'", sep = "", file = f)
def locate_snv_vcf(wildcards):
if config["snv_calls"] == "":
return "snv_calls/{}.{}.vcf".format(config["sample"], wildcards.chrom)
else:
return "external_snv_calls/{}.{}.vcf".format(config["sample"], wildcards.chrom)
rule run_strandphaser_per_chrom:
input:
mergedbam = "snv_calls/merged.bam",
wcregions = "strand_states/" + config["sample"] + ".strandphaser_input.txt",
snppositions = "snv_calls/" + config["sample"] + ".{chrom}.vcf",
snppositions = locate_snv_vcf,
configfile = "log/StrandPhaseR.{chrom}.config",
strandphaser = "utils/R-packages/StrandPhaseR/R/StrandPhaseR",
bamfolder = "bam"
......@@ -402,3 +405,15 @@ rule merge_SNV_calls:
shell:
config["bcftools"] + " concat -O v -o {output} {input}"
rule split_external_snv_calls:
input:
vcf = config["snv_calls"]
output:
vcf = "external_snv_calls/" + config["sample"] + ".{chrom}.vcf"
log: "external_snv_calls/" + config["sample"] + ".{chrom}.vcf.log"
params:
bcftools = config["bcftools"],
#sample = config["sample"]
shell:
"({params.bcftools} view --samples " + config["sample"] + " --types snps {input.vcf} {wildcards.chrom} | bcftools view --genotype het - > {output.vcf}) > {log} 2>&1"
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