Mercurial > repos > jdv > nanopolish
diff nanopolish_variants.pl @ 7:32cb27adeb34 draft
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/nanopolish commit 2dabc22c3707cc87100b094b25705160b842e9f9-dirty
author | jdv |
---|---|
date | Mon, 12 Feb 2018 00:58:10 -0500 |
parents | bdd6c1ab07c5 |
children | b437c0a7ca04 |
line wrap: on
line diff
--- a/nanopolish_variants.pl Mon Dec 04 02:03:21 2017 -0500 +++ b/nanopolish_variants.pl Mon Feb 12 00:58:10 2018 -0500 @@ -17,6 +17,7 @@ my $fn_consensus; my $fn_fast5; my $fn_reads; +my $fn_index; # remember full command string (with proper binary) @@ -28,10 +29,12 @@ 'consensus=s' => \$fn_consensus, 'fast5=s' => \$fn_fast5, 'reads=s' => \$fn_reads, + 'index=s' => \$fn_index, ); my $ret; +my $fn_link = 'reads'; my $tmp_dir = 'tmp_dir'; mkdir $tmp_dir; @@ -45,28 +48,42 @@ chdir $fast5_dir; $ret = system( 'tar', - '-xvf', + '-xf', $fn_fast5 ); die "Failed to extract tarball: $!\n" if ($ret); chdir $cwd; +symlink( $fn_reads, $fn_link ) + or die "Failed to create symlink"; + # index reads -$ret = system( - 'nanopolish', - 'index', - '--directory' => $fast5_dir, - $fn_reads, -); -die "Failed nanopolish indexing: $!\n" - if ($ret); +if (defined $fn_index) { + $ret = system( + 'tar', + '-xf', + $fn_index + ); + die "Failed to extract tarball: $!\n" + if ($ret); +} +else { + $ret = system( + 'nanopolish', + 'index', + '--directory' => $fast5_dir, + $fn_link, + ); + die "Failed nanopolish indexing: $!\n" + if ($ret); +} my @cmd = @ARGV; unshift @cmd, 'nanopolish'; push @cmd, '--genome', $fn_genome; -push @cmd, '--reads', $fn_reads; +push @cmd, '--reads', $fn_link; my @regions :shared;