Skip to content

Commit

Permalink
Merge pull request #42 from NBISweden/dev
Browse files Browse the repository at this point in the history
Bug fix to ensure functionality
  • Loading branch information
verku authored Mar 7, 2023
2 parents 1e6dd36 + 2830169 commit 4fc1faa
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .test/config/config_mitogenomes.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#################################################################
#################################################################
# Configuration settings for the GenErode pipeline 0.5.0 #
# Configuration settings for the GenErode pipeline 0.5.1 #
# for ancient or historical samples, and modern samples #
#################################################################
#################################################################
Expand Down
2 changes: 1 addition & 1 deletion .test/config/config_mlRho_options.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#################################################################
#################################################################
# Configuration settings for the GenErode pipeline 0.5.0 #
# Configuration settings for the GenErode pipeline 0.5.1 #
# for ancient or historical samples, and modern samples #
#################################################################
#################################################################
Expand Down
2 changes: 1 addition & 1 deletion .test/config/config_pca_roh.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#################################################################
#################################################################
# Configuration settings for the GenErode pipeline 0.5.0 #
# Configuration settings for the GenErode pipeline 0.5.1 #
# for ancient or historical samples, and modern samples #
#################################################################
#################################################################
Expand Down
2 changes: 1 addition & 1 deletion .test/config/config_snpeff_gerp.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#################################################################
#################################################################
# Configuration settings for the GenErode pipeline 0.5.0 #
# Configuration settings for the GenErode pipeline 0.5.1 #
# for ancient or historical samples, and modern samples #
#################################################################
#################################################################
Expand Down
2 changes: 1 addition & 1 deletion Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This is the Snakefile of the GenErode pipeline for historical or #
# ancient and modern samples to study patterns of genome erosion #
# #
# Pipeline version 0.5.0 #
# Pipeline version 0.5.1 #
# #
# Written by Verena Kutschera, Marcin Kierczak and Tom van der Valk #
# Email: generode@nbis.se #
Expand Down
6 changes: 4 additions & 2 deletions config/config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#################################################################
#################################################################
# Configuration settings for the GenErode pipeline 0.5.0 #
# Configuration settings for the GenErode pipeline 0.5.1 #
# for ancient or historical samples, and modern samples #
#################################################################
#################################################################
Expand Down Expand Up @@ -371,7 +371,9 @@ merge_vcfs_per_dataset: False

# Maximum allowed fraction of missing genotypes across all samples for a
# site to be kept in the BCF and BED file, to ensure that the same sites
# are compared between historical and modern samples.
# are compared between historical and modern samples. Has to be a floating
# point number between 0.0 (no missing data allowed) and 1.0 (sites are
# allowed that are completely missing).
f_missing: 0.1 # default: 0.1 (i.e. maximum 10% missing genotypes per site)
#####

Expand Down
2 changes: 1 addition & 1 deletion workflow/rules/0.2_repeat_identification.smk
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ rule repeatmasker:
RepeatMasker -pa {threads} -a -xsmall -gccalc -dir ./ -lib {params.repmo} {params.ref_upper} 2> {log} &&
# Check if *.cat file is compressed or uncompressed
if [ ! -f {output.rep_cat} ] # check if there are at least 2 files for merging. If there is only one file, copy the sorted bam file.
if [ ! -f {output.rep_cat} ]
then
gzip {params.rep_cat_unzip}
fi
Expand Down
2 changes: 1 addition & 1 deletion workflow/rules/3.1_bam_rmdup_realign_indels.smk
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ rule indel_realigner:

rule index_realigned_bams:
input:
bam="results/{dataset}/mapping/" + REF_NAME + "/{sample}.merged.rmdup.merged.bam",
bam="results/{dataset}/mapping/" + REF_NAME + "/{sample}.merged.rmdup.merged.realn.bam",
output:
index=temp("results/{dataset}/mapping/" + REF_NAME + "/{sample}.merged.rmdup.merged.realn.bam.bai"),
log:
Expand Down
15 changes: 14 additions & 1 deletion workflow/rules/9_merge_vcfs.smk
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,20 @@ rule filter_vcf_missing:
"docker://quay.io/biocontainers/bcftools:1.9--h68d8f2e_9"
shell:
"""
bcftools view -i 'F_MISSING < {params.fmiss}' -Oz -o {output.vcf} {input.bcf} 2> {log} &&
# only include sites with zero missing data
if [[ `echo 0.0 {params.fmiss} | awk '{{print ($1 == $2)}}'` == 1 ]]
then
bcftools view -i 'F_MISSING = {params.fmiss}' -Oz -o {output.vcf} {input.bcf} 2> {log}
# include all sites
elif [[ `echo 1.0 {params.fmiss} | awk '{{print ($1 == $2)}}'` == 1 ]]
then
bcftools view -i 'F_MISSING <= {params.fmiss}' -Oz -o {output.vcf} {input.bcf} 2> {log}
# include sites with less than the fraction f_missing of missing data
elif [[ `echo 0.0 {params.fmiss} 1.0 | awk '{{print ($1 < $2 && $2 < $3)}}'` == 1 ]]
then
bcftools view -i 'F_MISSING < {params.fmiss}' -Oz -o {output.vcf} {input.bcf} 2> {log}
fi
bcftools index -f {output.vcf} 2>> {log}
"""

Expand Down
2 changes: 1 addition & 1 deletion workflow/rules/common.smk
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import pandas as pd

min_version("5.19.0")

generode_version = "0.5.0"
generode_version = "0.5.1"

configfile: "config/config.yaml"

Expand Down

0 comments on commit 4fc1faa

Please sign in to comment.