Skip to content

Commit

Permalink
When running GSAlign use whole-genome vs whole-genome
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrea Talenti committed Dec 7, 2020
1 parent 5e2b02f commit 8d92d5d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
9 changes: 9 additions & 0 deletions modules/processes/preprocess.nf
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,15 @@ process splittgt {
mkdir ./SPLIT_tgt && chmod a+rw ./SPLIT_tgt
faSplit size -oneFile -lift=target.lift -extra=500 ${target} 4500 SPLIT_tgt/tmp
"""
else if ( params.aligner == 'gsalign' )
"""
myvalue=`faSize -tab ${target} | awk '\$1=="maxSize" {print \$2}'`
if [ -z \$myvalue ]; then
myvalue=`faSize -tab ${target} | awk '\$1=="baseCount" {print \$2}'`
fi
mkdir ./SPLIT_tgt && chmod a+rw ./SPLIT_tgt
faSplit size -oneFile -lift=source.lift ${target} \$myvalue SPLIT_tgt/tgt
"""
else
"""
mkdir SPLIT_tgt && chmod a+rw SPLIT_tgt
Expand Down
13 changes: 9 additions & 4 deletions modules/subworkflows/preprocess.nf
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,24 @@ workflow PREPROC {
splitsrc(ch_source)
src_lift = splitsrc.out.src_lift_ch
if ( params.aligner == 'blat' || params.aligner == 'gsalign' || params.aligner == 'last' ){
ch_fragm_out = splitsrc.out.srcsplit_ch
ch_fragm_src_out = splitsrc.out.srcsplit_ch
} else {
groupsrc(splitsrc.out.srcsplit_ch)
ch_fragm_out = groupsrc.out.srcclst_ch
ch_fragm_src_out = groupsrc.out.srcclst_ch
}

// split and group target
splittgt(ch_target)
tgt_lift = splittgt.out.tgt_lift_ch
grouptgt(splittgt.out.tgtsplit_ch)
if ( params.aligner == 'blat' || params.aligner == 'gsalign' || params.aligner == 'last' ){
ch_fragm_tgt_out = splittgt.out.tgtsplit_ch
} else {
grouptgt(splittgt.out.tgtsplit_ch)
ch_fragm_tgt_out = grouptgt.out.tgtclst_ch
}

// prepare pairs
pairs( ch_fragm_out, grouptgt.out.tgtclst_ch )
pairs( ch_fragm_src_out, ch_fragm_tgt_out )
pairs.out.pairspath
.splitCsv(header: ['srcname', 'srcfile', 'tgtname', 'tgtfile'])
.map{ row-> tuple(row.srcname, row.srcfile, row.tgtname, row.tgtfile) }
Expand Down

0 comments on commit 8d92d5d

Please sign in to comment.