-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
do a repetitive GapClose & SSpace scaffolding to improve a soap assse…
…mbly
- Loading branch information
Showing
2 changed files
with
118 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
### run | ||
|
||
echo "Prepare the SSPace library file" | ||
echo "" > sspace.config | ||
libname="" | ||
libcount=0 | ||
while read line | ||
do | ||
if [[ $line == \[* ]]; then | ||
if [[ -n "$libname" ]]; | ||
then | ||
echo $libname $fq1 $fq2 $insert 0.25 FR >> sspace.config | ||
fi | ||
let libcount+=1 | ||
libname=`echo $line | sed 's/[^[:alnum:]]//g'`$libcount | ||
elif [[ $line == q1* ]]; then | ||
fq1=`echo -n $line | sed "s/q1=//"` | ||
elif [[ $line == q2* ]]; then | ||
fq2=`echo -n $line | sed "s/q2=//"` | ||
elif [[ $line == avg_ins* ]]; then | ||
insert=`echo -n $line | sed "s/avg_ins=//"` | ||
fi | ||
done < {{ soapdir }}/soap.config | ||
|
||
if [[ -n "$libname" ]]; | ||
then | ||
echo $libname $fq1 $fq2 $insert 0.25 FR >> sspace.config | ||
fi | ||
|
||
|
||
echo "Start iterating" | ||
|
||
lastScaff={{ soapdir }}/output.scafSeq | ||
|
||
[[ -f before.stats ]] || \ | ||
fastaInfo -s -i $lastScaff length ncount > before.stats | ||
|
||
counter=0 | ||
for x in `seq 1 {{ noruns }}`; do | ||
let counter+=1 | ||
|
||
newScaff="output.scafSeq.gap.$x" | ||
|
||
echo "GapCloser run $x" | ||
if [[ -f $newScaff ]] | ||
then | ||
echo "Skipping $newScaff - file exists" | ||
else | ||
time GapCloser -a $lastScaff \ | ||
-b {{ soapdir }}/soap.config \ | ||
-t {{ threads }} \ | ||
-o $newScaff > gapcloser.${x}.report \ | ||
|| true | ||
fi | ||
|
||
lastScaff=$newScaff | ||
newScaff="output.scafSeq.scaf.$x.final.scaffolds.fasta" | ||
|
||
echo "Scaffolder run $x" | ||
if [[ -f "$newScaff" ]] | ||
then | ||
echo "Skipping $newScaff - file exists" | ||
else | ||
time {{ sspace_executable }} \ | ||
-l sspace.config \ | ||
-s ${lastScaff} \ | ||
-b output.scafSeq.scaf.$x \ | ||
{{ sspace_extra_variables }} \ | ||
-x 1 -T {{ threads }} -p 1 > sspace.${x}.output \ | ||
|| true | ||
fastaInfo -s -i $newScaff length ncount > $newScaff.stats | ||
fi | ||
lastScaff=$newScaff | ||
done | ||
|
||
echo "Run gapcloser one last time" | ||
echo "on $lastScaff" | ||
|
||
GapCloser -a $lastScaff \ | ||
-b {{ soapdir }}/soap.config \ | ||
-t {{ threads }} \ | ||
-o output.final.fasta \ | ||
> gapcloser.final.report || true | ||
|
||
fastaInfo -s -i output.final.fasta length ncount > output.final.stats |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
author: Mark Fiers | ||
backend: ruff | ||
commands: | ||
run: | ||
help: 'Postprocess - run GapCloser & SSpace' | ||
mode: simple | ||
creation_date: Mon, 21 Nov 2011 12:47:16 | ||
description: Run Soapdenovo | ||
moa_id: soapdenovo_postprocess | ||
modification_date: Mon, 21 Nov 2011 12:47:22 | ||
name: soapdenovo_postprocess | ||
parameters: | ||
soapdir: | ||
help: directory where soap ran | ||
optional: false | ||
threads: | ||
default: 8 | ||
help: 'no threads to use' | ||
optional: true | ||
type: integer | ||
noruns: | ||
default: 2 | ||
help: 'no times to run gapcloser & SSPace' | ||
type: integer | ||
optional: true | ||
sspace_executable: | ||
default: SSPACE_Basic_v2.0.pl | ||
optional: true | ||
help: SSPace executable | ||
sspace_extra_variables: | ||
default: '' | ||
optional: true | ||
help: Extra variables to pass to Sspace |