Skip to content

Commit 487e8ab

Browse files
authored
Merge pull request #10 from UMCUGenetics/release/v2.0.0
Release/v2.0.0
2 parents c259673 + 40ee0cf commit 487e8ab

File tree

8 files changed

+45
-10
lines changed

8 files changed

+45
-10
lines changed

Kinship/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM --platform=linux/amd64 continuumio/miniconda3
2+
3+
LABEL base_image="continuumio/miniconda3"
4+
LABEL version="1.0.0"
5+
LABEL extra.binaries="vcftools, plink, king"
6+
7+
RUN conda config --add channels bioconda && \
8+
conda config --add channels conda-forge && \
9+
conda install -y vcftools=0.1.14 plink=1.90b4 king=2.2.7
10+
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
process Kinship {
2-
// Custom process to run Kinship tools
32
tag {"Kinship ${analysis_id}"}
43
label 'Kinship'
4+
container = 'docker.io/umcugenbioinf/kinship:1.0.0'
55
shell = ['/bin/bash', '-euo', 'pipefail']
66

77
input:
@@ -13,10 +13,10 @@ process Kinship {
1313

1414
script:
1515
"""
16-
${params.vcftools_path}/vcftools --vcf ${vcf_file} --plink
17-
${params.plink_path}/plink --file out --make-bed --noweb
18-
${params.king_path}/king -b plink.bed --kinship
16+
vcftools --vcf ${vcf_file} --plink
17+
plink --file out --make-bed --noweb
18+
king -b plink.bed --kinship
1919
cp king.kin0 ${analysis_id}.kinship
20-
python ${baseDir}/CustomModules/Utils/check_kinship.py ${analysis_id}.kinship ${ped_file} > ${analysis_id}.kinship_check.out
20+
python ${baseDir}/CustomModules/Kinship/check_kinship.py ${analysis_id}.kinship ${ped_file} > ${analysis_id}.kinship_check.out
2121
"""
2222
}
File renamed without changes.

MipsTrimDedup/MipsTrimDedup.nf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ process MipsTrimDedup {
1818
rg_id = "${sample_id}_MergedTrimmedDedup"
1919

2020
"""
21-
python ${params.mips_trim_dedup_path}/mips_trim_dedup.py -d ${params.dxtracks_path}/${params.mips_design_file} -l ${params.mips_uuid_length} -ur ${params.mips_uuid_read} -r1 ${r1_args} -r2 ${r2_args}
21+
python2 ${params.mips_trim_dedup_path}/mips_trim_dedup.py -d ${params.dxtracks_path}/${params.mips_design_file} -l ${params.mips_uuid_length} -ur ${params.mips_uuid_read} -r1 ${r1_args} -r2 ${r2_args}
2222
"""
2323
}

Utils/CreateHSmetricsSummary.nf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ process CreateHSmetricsSummary {
1212

1313
script:
1414
"""
15-
python ${baseDir}/CustomModules/Utils/create_hsmetrics_summary.py ${hsmetrics_files} > HSMetrics_summary.txt
15+
python2 ${baseDir}/CustomModules/Utils/create_hsmetrics_summary.py ${hsmetrics_files} > HSMetrics_summary.txt
1616
"""
1717
}

Utils/GetStatsFromFlagstat.nf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ process GetStatsFromFlagstat {
1212

1313
script:
1414
"""
15-
python ${baseDir}/CustomModules/Utils/get_stats_from_flagstat.py ${flagstat_files} > run_stats.txt
15+
python2 ${baseDir}/CustomModules/Utils/get_stats_from_flagstat.py ${flagstat_files} > run_stats.txt
1616
"""
1717
}

Utils/ParseChildFromFullTrio.nf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ process ParseChildFromFullTrio {
1515
script:
1616
def sample_ids = sample_id.join(" ")
1717
"""
18-
python ${baseDir}/CustomModules/Utils/parse_child_from_fulltrio.py ${ped_file} ${sample_ids} | tr -d '\n'
18+
python2 ${baseDir}/CustomModules/Utils/parse_child_from_fulltrio.py ${ped_file} ${sample_ids} | tr -d '\n'
1919
"""
2020
}

Utils/parse_child_from_fulltrio.py

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,31 @@
11
#! /usr/bin/env python
22
import argparse
3-
from check_kinship import parse_ped
3+
4+
5+
def parse_ped(ped_file):
6+
samples = {} # 'sample_id': {'family': 'fam_id', 'parents': ['sample_id', 'sample_id']}
7+
8+
for line in ped_file:
9+
ped_data = line.strip().split()
10+
family, sample, father, mother, sex, phenotype = ped_data
11+
12+
# Create samples
13+
if sample not in samples:
14+
samples[sample] = {'family': family, 'parents': [], 'children': []}
15+
if father != '0' and father not in samples:
16+
samples[father] = {'family': family, 'parents': [], 'children': []}
17+
if mother != '0' and mother not in samples:
18+
samples[mother] = {'family': family, 'parents': [], 'children': []}
19+
20+
# Save sample relations
21+
if father != '0':
22+
samples[sample]['parents'].append(father)
23+
samples[father]['children'].append(sample)
24+
if mother != '0':
25+
samples[sample]['parents'].append(mother)
26+
samples[mother]['children'].append(sample)
27+
return samples
28+
429

530
if __name__ == "__main__":
631
parser = argparse.ArgumentParser(description='Check kinship output based on ped file.')

0 commit comments

Comments
 (0)