Skip to content

Commit

Permalink
update syntax and add careful mode for polypolish
Browse files Browse the repository at this point in the history
  • Loading branch information
rpetit3 committed Mar 6, 2024
1 parent 4a404f9 commit 4978615
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/test-dragonflye.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Setup dragonflye Environment
run: |
conda install -y -c conda-forge -c bioconda mamba 'python=3.8.0'
mamba install -y -c conda-forge -c bioconda 'assembly-scan>=0.4.0' any2fasta bwa dnaapler fastp flye 'kmc>=3.1' 'medaka>=1.11.0' miniasm 'nanoq>=0.8.1' perl perl-file-spec perl-findbin polypolish pilon pigz racon rasusa raven-assembler samtools samclip seqtk porechop
mamba install -y -c conda-forge -c bioconda 'assembly-scan>=0.4.0' any2fasta bwa dnaapler fastp flye 'kmc>=3.1' 'medaka>=1.11.0' miniasm 'nanoq>=0.8.1' perl perl-file-spec perl-findbin 'polypolish>=0.6.0' pilon pigz racon rasusa raven-assembler samtools samclip seqtk porechop
- name: Environment Information
run: uname -a && env
Expand Down Expand Up @@ -95,9 +95,14 @@ jobs:
echo "Testing Raven Assembler + Racon & Polypolish Polish"
bin/dragonflye --reads bactopia-tests/data/species/portiera/nanopore/ERR3772599.fastq.gz --R1 bactopia-tests/data/species/portiera/illumina/SRR2838702_R1.fastq.gz --R2 bactopia-tests/data/species/portiera/illumina/SRR2838702_R2.fastq.gz --cpus 0 --outdir tests/raven-polypolish --gsize 300000 --assembler raven
- name: Test Raven Assembler + Racon & Polypolish Pilon
- name: Test Raven Assembler + Racon & Polypolish Careful Polish
run: |
echo "Testing Raven Assembler + Racon & Polypolish Polish"
echo "Testing Raven Assembler + Racon & Polypolish Careful Polish"
bin/dragonflye --reads bactopia-tests/data/species/portiera/nanopore/ERR3772599.fastq.gz --R1 bactopia-tests/data/species/portiera/illumina/SRR2838702_R1.fastq.gz --R2 bactopia-tests/data/species/portiera/illumina/SRR2838702_R2.fastq.gz --cpus 0 --outdir tests/raven-polypolish-careful --gsize 300000 --assembler raven --polypolish_careful
- name: Test Raven Assembler + Racon & Pilon Polish
run: |
echo "Testing Raven Assembler + Racon & Pilon Polish
bin/dragonflye --reads bactopia-tests/data/species/portiera/nanopore/ERR3772599.fastq.gz --R1 bactopia-tests/data/species/portiera/illumina/SRR2838702_R1.fastq.gz --R2 bactopia-tests/data/species/portiera/illumina/SRR2838702_R2.fastq.gz --cpus 0 --outdir tests/raven-pilon --gsize 300000 --assembler raven --polypolish 0 --pilon 1
- name: Test Miniasm Assembler
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Changelog

## v1.2.0 rpetit3/dragonflye "" - 2023/11/??
## v1.2.0 rpetit3/dragonflye "" - 2024/03/??

* add contig reorientation using dnaapler
* add careful more for Polypolish

## v1.1.2 rpetit3/dragonflye "Eastern amberwing" - 2023/10/23

Expand Down
13 changes: 8 additions & 5 deletions bin/dragonflye
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
# --list_models List the models available to Medaka (default: OFF)
# SHORT-READ POLISHER
# --polypolish N Number of polishing rounds to conduct with Polypolish (requires --R1 and --R2) (default: 1)
# --polypolish_careful Polypolish will ignore any reads with multiple alignments (default: OFF)
# --pilon N Number of polishing rounds to conduct with Pilon (requires --R1 and --R2) (default: 0)
# --R1 XXX Read 1 FASTQ to use for polishing (default: '')
# --R2 XXX Read 2 FASTQ to use for polishing (default: '')
Expand Down Expand Up @@ -116,9 +117,9 @@ my(@Options, $version,
$outdir, $prefix, $force, $cpus, $tmpdir, $keepfiles, $namefmt,
$kmers, $gsize, $READS, $assembler, $opts, $nanohq, $ram,
$depth, $model, $list_models, $racon, $medaka, $medaka_opts,
$R1, $R2, $pilon, $polypolish, $noreorient, $dnaapler_mode,
$dnaapler_opts, $nofilter, $trim, $trimopts, $nopolish,
$minreadlen, $minquality, $minlen, $mincov, $seed);
$R1, $R2, $pilon, $polypolish, $polypolish_careful, $noreorient,
$dnaapler_mode, $dnaapler_opts, $nofilter, $trim, $trimopts,
$nopolish, $minreadlen, $minquality, $minlen, $mincov, $seed);
setOptions();

# Say hello
Expand Down Expand Up @@ -398,6 +399,7 @@ unless ($nopolish) {
make_folder("$asmdir/polish/short_reads/polypolish");
my $polypolish_dir = "$asmdir/polish/short_reads/polypolish";
my $sort_ram = int($half_ram * 1024 / $sort_cpus); # RAM per thread, in Mb
my $careful_mode = $polypolish_careful ? "--careful" : "";

msg("Polishing with Polypolish ($polypolish rounds)");
for (my $i = 1; $i <= $polypolish; $i++) {
Expand All @@ -411,7 +413,7 @@ unless ($nopolish) {
run_cmd("bwa mem -t $cpus -a $POLISHED_FASTA $polish_dir/R1.fq.gz > $SAM_R1", "short read polishing - bwa-mem R1 ($i of $polypolish)");
run_cmd("bwa mem -t $cpus -a $POLISHED_FASTA $polish_dir/R2.fq.gz > $SAM_R2", "short read polishing - bwa-mem R2 ($i of $polypolish)");
msg("Polishing with Polypolish");
run_cmd("polypolish $POLISHED_FASTA $SAM_R1 $SAM_R2 > $round_dir/polypolish-$i.fasta", "short read polishing - polypolish ($i of $polypolish)");
run_cmd("polypolish polish $careful_mode $POLISHED_FASTA $SAM_R1 $SAM_R2 > $round_dir/polypolish-$i.fasta", "short read polishing - polypolish ($i of $polypolish)");
$POLISHED_FASTA = "$round_dir/polypolish-$i.fasta";
}
$has_polished = 1;
Expand Down Expand Up @@ -942,7 +944,8 @@ sub setOptions {
{OPT=>"model=s", VAR=>\$model, DEFAULT=>'', DESC=>"The model to be used by Medaka, (Assumes 1 polishing round, if --medaka not used)"},
{OPT=>"list_models!", VAR=>\$list_models, DEFAULT=>0, DESC=>"List the models available to Medaka"},
"SHORT-READ POLISHER",
{OPT=>"polypolish=i", VAR=>\$polypolish, DEFAULT=>1, DESC=>"Number of polishing rounds to conduct with Polypolish (requires --R1 and --R2)"},
{OPT=>"polypolish=i", VAR=>\$polypolish, DEFAULT=>1, DESC=>"Number of polishing rounds to conduct with Polypolish (requires --R1 and --R2)"},
{OPT=>"polypolish_careful!", VAR=>\$polypolish_careful, DEFAULT=>0, DESC=>"Polypolish will ignore any reads with multiple alignments"},
{OPT=>"pilon=i", VAR=>\$pilon, DEFAULT=>0, DESC=>"Number of polishing rounds to conduct with Pilon (requires --R1 and --R2)"},
{OPT=>"R1=s", VAR=>\$R1, DEFAULT=>'', DESC=>"Read 1 FASTQ to use for polishing"},
{OPT=>"R2=s", VAR=>\$R2, DEFAULT=>'', DESC=>"Read 2 FASTQ to use for polishing"},
Expand Down

0 comments on commit 4978615

Please sign in to comment.