Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call2plink sub-workflow #41

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions modules/local/call2plink/bedify.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
process bedify {

input:
set file(ped), file(map)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
set file(ped), file(map)
tuple file(ped), file(map)

output:
file("${base}.bed"), emit: bed_ch
file ("${base}.bim"), emit: bim_ch
file("${base}.fam"), emit: fam_ch
script:
def base = ped.baseName
"""
echo $base

plink --file $base --no-fid --make-bed --out $base
"""
}
19 changes: 19 additions & 0 deletions modules/local/call2plink/combineBed.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Combine all plinks and possibly remove errprs
process combineBed {
input:
file(bed)
file(bim)
file(fam)
output:
tuple file("raw.bed"), file("raw.fam"), file("raw.log"), emit: plink_src
file("rawraw.bim"), emit: fill_in_bim_ch
script:
"""
ls *.bed | sort > beds
ls *.bim | sort > bims
ls *.fam | sort > fams
paste beds bims fams > mergelist
plink --merge-list mergelist --make-bed --out raw
mv raw.bim rawraw.bim
"""
}
10 changes: 10 additions & 0 deletions modules/local/call2plink/fillinbam.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
process fillInBim { // Deals with monomorphic or non-called SNPs
input:
file(inbim)
file(strand)
file(manifest)
output:
file("raw.bim"), emit: filled_bim_ch
script:
"fill_in_bim.py ${params.output_align} $strand $manifest $inbim raw.bim"
}
15 changes: 15 additions & 0 deletions modules/local/call2plink/illumina2lgen.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
process illumina2lgen {
input:
set file(report), file(array)

output:
tuple file("${output}.ped"), file("${output}.map"), emit: ped_ch
script:
def samplesize = params.samplesize
def idpat = params.idpat
def output = report.baseName
Comment on lines +8 to +10
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def samplesize = params.samplesize
def idpat = params.idpat
def output = report.baseName
def samplesize = params.samplesize
def idpat = params.idpat
def output = report.baseName

"""
hostname
topbottom.py $array $report $samplesize '$idpat' $output
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Davi, we'd also need to add this script to the bin

"""
}