diff nanopolish_variants.pl @ 10:c00a942cfc0b draft

planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/nanopolish commit 1eeffb2cd0b8115ca185f7fcb2df2920dff33e3b
author jdv
date Mon, 12 Feb 2018 23:59:21 -0500
parents f1141f6a2d65
children 550ac6458c07
line wrap: on
line diff
--- a/nanopolish_variants.pl	Mon Feb 12 23:15:26 2018 -0500
+++ b/nanopolish_variants.pl	Mon Feb 12 23:59:21 2018 -0500
@@ -98,11 +98,13 @@
 my @regions :shared;
 
 # build region tags to pass to nanopolish
-my $parser = BioX::Seq::Stream->new($fn_genome);
-while (my $seq = $parser->next_seq) {
-    push @regions, join( ':', $seq->id,
-        join( '-', 1, length($seq) ),
-    );
+if (-s $fn_genome) { # gracefully handle empty inputs
+    my $parser = BioX::Seq::Stream->new($fn_genome);
+    while (my $seq = $parser->next_seq) {
+        push @regions, join( ':', $seq->id,
+            join( '-', 1, length($seq) ),
+        );
+    }
 }
 
 my @workers;