pgx-main from prod added
This commit is contained in:
36
pgx-main/tests/simulations/gen_dips.nf
Normal file
36
pgx-main/tests/simulations/gen_dips.nf
Normal file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env nextflow
|
||||
|
||||
//haps1 = Channel.fromFilePairs(params.in_pgvcf, type: 'file') { file -> file.name.replaceAll(/.vcf.gz|.tbi$/,'') }
|
||||
|
||||
haps1 = Channel.fromPath(params.in_hap1, type: 'file')
|
||||
haps2 = Channel.fromPath(params.in_hap2, type: 'file')
|
||||
|
||||
//haps2 = Channel.fromFilePairs(params.in_haplo, type: 'file') { file -> file.name.replaceAll(/.vcf.gz|.tbi$/,'') }
|
||||
|
||||
haps1
|
||||
.combine(haps2)
|
||||
.set {data}
|
||||
// .println()
|
||||
|
||||
|
||||
process make_diplo {
|
||||
// maxForks 10
|
||||
// errorStrategy 'ignore'
|
||||
// tag "${name}"
|
||||
// label 'big_mem'
|
||||
publishDir params.out_dir, mode: 'copy', overwrite: 'true'
|
||||
|
||||
input:
|
||||
file(vcfs) from data
|
||||
|
||||
output:
|
||||
file("*_diplo.vcf.gz") into diplotypes_ch
|
||||
|
||||
script:
|
||||
"""
|
||||
tabix ${vcfs.get(0)}
|
||||
tabix ${vcfs.get(1)}
|
||||
bcftools merge ${vcfs.get(0)} ${vcfs.get(1)} | bgzip -c > ${vcfs.get(0).name.replace(/.vcf.gz/, "")}_${vcfs.get(1).name.replace(/.vcf.gz/, "")}_diplo.vcf.gz
|
||||
"""
|
||||
|
||||
}
|
||||
32
pgx-main/tests/simulations/nextflow.config
Normal file
32
pgx-main/tests/simulations/nextflow.config
Normal file
@@ -0,0 +1,32 @@
|
||||
params {
|
||||
in_hap1 = "/path/to/haplotype_files/*.vcf.gz"
|
||||
in_hap2 = "/path/to/haplotype_files/*.p.vcf.gz"
|
||||
out_dir = "/path/to/output_directory"
|
||||
}
|
||||
|
||||
|
||||
|
||||
process {
|
||||
withLabel: big_mem {
|
||||
cpus = 8
|
||||
memory = 32.GB
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
profiles {
|
||||
|
||||
// For execution on a local machine, no containerization. -- Default
|
||||
standard {
|
||||
process.executor = 'local'
|
||||
}
|
||||
|
||||
|
||||
// For execution on a SLURM scheduler, no containerization.
|
||||
slurm {
|
||||
process.executor = 'slurm'
|
||||
process.queue = 'batch'
|
||||
}
|
||||
}
|
||||
32
pgx-main/tests/simulations/sim_zygosity.py
Normal file
32
pgx-main/tests/simulations/sim_zygosity.py
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
|
||||
# Script: sim_zygosity.py
|
||||
# Author: David Twesigomwe
|
||||
# Date modified: 15-Dec-2020
|
||||
# Purpose: This script simulates the zygosity of variants after concatenating 2 haplotype VCF files.
|
||||
# Usage: python3 sim_zygosity.py in_database.txt > output.txt
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
in_file = sys.argv[1]
|
||||
|
||||
f = open (in_file, "r")
|
||||
|
||||
|
||||
for line in f:
|
||||
list1 = line.strip().split(";")
|
||||
new_list = []
|
||||
for i in list1:
|
||||
x = i + '~0/1'
|
||||
y = i + '~1/1'
|
||||
if x not in new_list:
|
||||
new_list.append(x)
|
||||
|
||||
else:
|
||||
new_list = list(map(lambda st: str.replace(st, x, y), new_list))
|
||||
|
||||
print(";".join(new_list))
|
||||
|
||||
f.close()
|
||||
Reference in New Issue
Block a user