Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactored flatfile-to-json.pl to use Bio::GFF3::LowLevel::Parser,
which is not broken for files with sync marks
- Loading branch information
Showing
7 changed files
with
465 additions
and
291 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
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,56 @@ | ||
package Script; | ||
use strict; | ||
use warnings; | ||
|
||
use Getopt::Long (); | ||
use Pod::Usage (); | ||
|
||
=head1 NAME | ||
Script - base class for a JBrowse command-line script | ||
=head1 DESCRIPTION | ||
This wheel is smaller than the ones on CPAN, but not really rounder. | ||
=cut | ||
|
||
sub new { | ||
my $class = shift; | ||
my $opts = $class->getopts(@_); | ||
return bless { opt => $opts }, $class; | ||
} | ||
|
||
sub getopts { | ||
my $class = shift; | ||
my $opts = { | ||
$class->option_defaults, | ||
}; | ||
local @ARGV = @_; | ||
Getopt::Long::GetOptions( $opts, $class->option_definitions ); | ||
Pod::Usage::pod2usage( -verbose => 2 ) if $opts->{help}; | ||
return $opts; | ||
} | ||
|
||
sub opt { | ||
if( @_ > 2 ) { | ||
return $_[0]->{opt}{$_[1]} = $_[2]; | ||
} else { | ||
return $_[0]->{opt}{$_[1]} | ||
} | ||
} | ||
|
||
#override me | ||
sub option_defaults { | ||
( ) | ||
} | ||
|
||
#override me | ||
sub option_definitions { | ||
( "help|h|?" ) | ||
} | ||
|
||
sub run { | ||
} | ||
|
||
1; |
Oops, something went wrong.