changeset 3:a1d433401bc2 draft

planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/nanopolish commit e9238df905c413aaab086ea146cb1b97e3ffa0fd
author jdv
date Sat, 14 Oct 2017 00:05:43 -0400
parents e4b6d4a53f2e
children bdd6c1ab07c5
files nanopolish_variants.pl nanopolish_variants.xml
diffstat 2 files changed, 23 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/nanopolish_variants.pl	Tue Oct 03 21:23:56 2017 -0400
+++ b/nanopolish_variants.pl	Sat Oct 14 00:05:43 2017 -0400
@@ -17,6 +17,7 @@
 my $fn_outfile;
 my $fn_consensus;
 my $fn_fast5;
+my $fn_reads;
 
 # remember full command string (with proper binary)
 
@@ -27,26 +28,40 @@
     'outfile=s'   => \$fn_outfile,
     'consensus=s' => \$fn_consensus,
     'fast5=s'     => \$fn_fast5,
+    'reads=s'     => \$fn_reads,
 );
 
 my $tmp_dir = 'tmp_dir';
 mkdir $tmp_dir;
 
-#extract FAST5 files to path where they are expected
-my $in_dir = 'in_dir';
-mkdir $in_dir;
+$fn_fast5 = abs_path($fn_fast5);
+
+# extract FAST5 files to path where they are expected
+my $fast5_dir = 'fast5';
+mkdir $fast5_dir;
 my $cwd = abs_path( getcwd() );
-chdir $in_dir;
+chdir $fast5_dir;
 my $tar = Archive::Tar->new();
 $tar->read($fn_fast5);
 $tar->extract();
+say "done extracting $fn_fast5 here";
 chdir $cwd;
 
+
+# index reads
+my $ret = system(
+    'nanopolish',
+    'index',
+    '--directory' => $fast5_dir,
+    $fn_reads,
+);
+die "Failed nanopolish indexing: $!\n"
+    if ($ret);
+
 my @cmd = @ARGV;
 unshift @cmd, 'nanopolish';
 push @cmd, '--genome', $fn_genome;
-
-say join ' ', @cmd;
+push @cmd, '--reads', $fn_reads;
 
 my @regions :shared;
 
@@ -116,7 +131,6 @@
         push @cmd_local, '--consensus', $fn_cons;
 
         my $ret = system @cmd_local;
-        warn "RET: $ret ($!)\n";
 
         my $cmd_string = join ' ', @cmd_local;
         die "Non-zero exit value for command: $cmd_string\n"
--- a/nanopolish_variants.xml	Tue Oct 03 21:23:56 2017 -0400
+++ b/nanopolish_variants.xml	Sat Oct 14 00:05:43 2017 -0400
@@ -30,7 +30,7 @@
         --consensus $out_consensus
         --outfile   $out_variants
         --threads \${GALAXY_SLOTS:-1}
-        --max-round $max_rounds
+        --max-rounds $max_rounds
         --max-haplotypes $max_haplotypes
         --min-candidate-depth $min_candidate_depth
         --min-candidate-frequency $min_candidate_frequency
@@ -87,7 +87,7 @@
 as input, such as can be produced by `poretools combine`, and always outputs a
 single FASTQ file.
 
-This is the `extract` module.
+This is the `variants` module.
 
     ]]>
     </help>