Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ db/cm/*.i1*
db/kingdom/*/sprot.p*
db/hmm/*.h3?
db/genus/*.p*

t/*.log
asm/
10 changes: 0 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,3 @@ install:
- "cpanm --quiet --notest Time::Piece XML::Simple Digest::MD5 Bio::Perl"
- "export PATH=$PWD/bin:$PATH"

script:
- "prokka --version"
- "prokka --help"
- "! prokka --doesnotexist"
- "prokka --depends"
- "prokka --setupdb"
- "prokka --listdb"
- "prokka --cpus 2 --outdir asm --prefix asm test/plasmid.fna"
- "grep '>' asm/asm.fna"
- "prokka --cleandb"
61 changes: 61 additions & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
.travis.yml
bin/prokka
bin/prokka-abricate_to_fasta_db
bin/prokka-biocyc_to_fasta_db
bin/prokka-build_kingdom_dbs
bin/prokka-cdd_to_hmm
bin/prokka-clusters_to_hmm
bin/prokka-genbank_to_fasta_db
bin/prokka-genpept_to_fasta_db
bin/prokka-hamap_to_hmm
bin/prokka-make_tarball
bin/prokka-tigrfams_to_hmm
bin/prokka-uniprot_to_fasta_db
binaries/common/minced
binaries/common/minced.jar
binaries/common/parallel
binaries/darwin/aragorn
binaries/darwin/blastp
binaries/darwin/cmpress
binaries/darwin/cmscan
binaries/darwin/hmmpress
binaries/darwin/hmmscan
binaries/darwin/makeblastdb
binaries/darwin/prodigal
binaries/darwin/tbl2asn
binaries/linux/aragorn
binaries/linux/blastp
binaries/linux/cmpress
binaries/linux/cmscan
binaries/linux/hmmpress
binaries/linux/hmmscan
binaries/linux/makeblastdb
binaries/linux/prodigal
binaries/linux/tbl2asn
db/cm/Bacteria
db/cm/README
db/cm/Viruses
db/genus/Enterococcus
db/genus/Escherichia
db/genus/Staphylococcus
db/hmm/HAMAP.hmm
db/kingdom/Archaea/sprot
db/kingdom/Bacteria/AMR
db/kingdom/Bacteria/IS
db/kingdom/Bacteria/sprot
db/kingdom/Mitochondria/sprot
db/kingdom/Viruses/sprot
doc/ChangeLog.txt
doc/LICENSE.HAMAP
doc/LICENSE.Pfam
doc/LICENSE.Prokka
doc/LICENSE.Rfam
doc/LICENSE.UniProt
doc/prokka-manual.txt
doc/ToDoList.txt
doc/update_manual.sh
Makefile.PL
MANIFEST This list of files
README.md
t/05_plasmid.t
test/plasmid.fna
87 changes: 87 additions & 0 deletions Makefile.PL
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
use strict;
use warnings;

#use 5.026; # commented in favor of MIN_PERL_VERSION

use ExtUtils::MakeMaker;

# Some help from
# http://blogs.perl.org/users/michal_wojciechowski/2011/11/github-friendly-readme-files-with-extutils-makemaker-and-module-build.html
my $preop = 'true';

WriteMakefile1(
NAME => 'Prokka',
VERSION_FROM => 'bin/prokka',
ABSTRACT => 'prokka genome annotator',
AUTHOR => 'Torsten Seemann',
EXE_FILES => [
"bin/prokka",
"bin/prokka-abricate_to_fasta_db",
"bin/prokka-biocyc_to_fasta_db",
"bin/prokka-build_kingdom_dbs",
"bin/prokka-cdd_to_hmm",
"bin/prokka-clusters_to_hmm",
"bin/prokka-genbank_to_fasta_db",
"bin/prokka-genpept_to_fasta_db",
"bin/prokka-hamap_to_hmm",
"bin/prokka-make_tarball",
"bin/prokka-tigrfams_to_hmm",
"bin/prokka-uniprot_to_fasta_db",
],
PREREQ_PM => {
# Core modules
# Other
"Time::Piece" => 0,
"XML::Simple" => 0,
"Digest::MD5" => 0,
"Bio::Perl" => 0,
},
BUILD_REQUIRES => {
'Test::More' => 0.47,
},
MIN_PERL_VERSION => '5.16.1',
LICENSE => "gpl_3",
dist=>{
COMPRESS => "gzip -9f",
SUFFIX => "gz",
PREOP => $preop,
},
META_MERGE => {
'meta-spec' => { version => 2 },
resources => {
repository => {
type => 'git',
url => 'git://github.com/tseemann/prokka.git',
web => 'https://github.com/tseemann/prokka',
},
},
},
);

sub WriteMakefile1 { #Compatibility code for old versions of EU::MM. Written by Alexandr Ciornii, version 2. Added by eumm-upgrade.
my %params=@_;
my $eumm_version=$ExtUtils::MakeMaker::VERSION;
$eumm_version=eval $eumm_version;
die "EXTRA_META is deprecated" if exists $params{EXTRA_META};
die "License not specified" if not exists $params{LICENSE};
if ($params{AUTHOR} and ref($params{AUTHOR}) eq 'ARRAY' and $eumm_version < 6.5705) {
$params{META_ADD}->{author}=$params{AUTHOR};
$params{AUTHOR}=join(', ',@{$params{AUTHOR}});
}
if ($params{TEST_REQUIRES} and $eumm_version < 6.64) {
$params{BUILD_REQUIRES}={ %{$params{BUILD_REQUIRES} || {}} , %{$params{TEST_REQUIRES}} };
delete $params{TEST_REQUIRES};
}
if ($params{BUILD_REQUIRES} and $eumm_version < 6.5503) {
#EUMM 6.5502 has problems with BUILD_REQUIRES
$params{PREREQ_PM}={ %{$params{PREREQ_PM} || {}} , %{$params{BUILD_REQUIRES}} };
delete $params{BUILD_REQUIRES};
}
delete $params{CONFIGURE_REQUIRES} if $eumm_version < 6.52;
delete $params{MIN_PERL_VERSION} if $eumm_version < 6.48;
delete $params{META_MERGE} if $eumm_version < 6.46;
delete $params{META_ADD} if $eumm_version < 6.46;
delete $params{LICENSE} if $eumm_version < 6.31;

WriteMakefile(%params);
}
21 changes: 19 additions & 2 deletions bin/prokka
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ my @CMDLINE = ($0, @ARGV);
my $OPSYS = $^O;
my $BINDIR = "$FindBin::RealBin/../binaries/$OPSYS";
my $EXE = $FindBin::RealScript;
my $VERSION = "1.13.7";
our $VERSION = "1.13.7";
my $AUTHOR = 'Torsten Seemann <torsten.seemann@gmail.com>';
my $URL = 'https://github.com/tseemann/prokka';
my $PROKKA_PMID = '24642063';
Expand All @@ -56,6 +56,16 @@ my $MAXCONTIGIDLEN = 37; # Genbank rule
my $SIGNALP_MAXSEQ = 10_000; # maximum allowed input for signalp
my @LOG; # buffer up log lines before we have log file ready

=pod

=head1 NAME

prokka - genome annotator

=head1 AUTHOR tseemann

=cut

# list of exceptions to /product annotations
my @GOOD_PROD = (
'rep',
Expand Down Expand Up @@ -1370,7 +1380,14 @@ delfile("$outdir/errorsummary.val");
delfile( map { "$outdir/$prefix.$_" } qw(dr fixedproducts ecn val) );

msg("Repairing broken .GBK output that tbl2asn produces...");
runcmd("sed 's/COORDINATES: profile/COORDINATES:profile/' < \Q$outdir/$prefix.gbf\E > \Q$outdir/$prefix.gbk\E");
open(my $gbfFh, "<", "$outdir/$prefix.gbf") or die "ERROR: could not read $outdir/$prefix.gbf: $!";
open(my $gbkFh, ">", "$outdir/$prefix.gbk") or die "ERROR: could not write to $outdir/$prefix.gbk: $!";
while(<$gbfFh>){
s/COORDINATES: profile/COORDINATES:profile/;
print $gbkFh $_;
}
close $gbkFh;
close $gbfFh;
delfile("$outdir/$prefix.gbf");

# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Expand Down
42 changes: 42 additions & 0 deletions t/05_plasmid.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env perl

use strict;
use warnings;
use FindBin qw/$RealBin/;
use Test::More tests=>9;

# Set up the path to include this instance of prokka
$ENV{PATH}="$RealBin/../bin:".$ENV{PATH};

my $log = "$0.log";
# truncate the log file
open(my $fh, ">", $log) or BAIL_OUT("ERROR: could not truncate log file $log: $!");
close $fh;

# Ensure any previous tests do not override this one
unlink $_ for(glob("asm/*"));
rmdir "asm";

for my $cmd(
"prokka --version",
"prokka --help",
"! prokka --doesnotexist",
"prokka --depends",
"prokka --setupdb",
"prokka --listdb",
"prokka --cpus 2 --outdir asm --prefix asm test/plasmid.fna",
"grep '>' asm/asm.fna",
"prokka --cleandb",
){
my $hr = '=' x 10;
open(my $fh, ">>", $log) or BAIL_OUT("ERROR: could not write to log file $log: $!");
print $fh "\n$hr\n$cmd\n$hr\n";
close $fh;

system($cmd ." >> $log 2>&1");
is($?, 0, "Command: $cmd");
}

END{
diag "Log file can be found in $log";
}