Skip to content

Commit

Permalink
Merge pull request #264 from andrewjpage/fix_empty_accessory_binary
Browse files Browse the repository at this point in the history
Fix empty accessory binary
  • Loading branch information
andrewjpage authored Jul 25, 2016
2 parents 4d8b55e + 3e1a8e6 commit 84f713f
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 7 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ addons:
cache:
directories:
- build/parallel-20150522
- build/parallel-20141022
- build/parallel-20130922
- build/bedtools2
- build/cd-hit-v4.6.3-2015-0515
Expand All @@ -22,7 +21,6 @@ perl:
- "5.24"
env:
- PARALLEL_VERSION=20150522
- PARALLEL_VERSION=20141022
- PARALLEL_VERSION=20130922
install:
- "source ./install_dependencies.sh"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,6 @@ The code will not work with perl 5.8 or below (pre-modern perl). We no longer te
* cdhit 4.6.1
* ncbi blast+ 2.2.30
* mcl 14-137
* bedtools 2.20.1
* bedtools 2.20.1 2.26.0
* prank 130410
* GNU parallel 20130922, 20141022, 20150122
6 changes: 4 additions & 2 deletions dist.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name = Bio-Roary
version = 3.6.5
version = 3.6.6
author = Andrew J. Page <[email protected]>
license = GPL_3
copyright_holder = Wellcome Trust Sanger Institute
Expand All @@ -12,7 +12,9 @@ repository.web = http://sanger-pathogens.github.io/Roary/
repository.url = https://github.com/sanger-pathogens/Roary.git
repository.type = git

[@Starter]
[@Basic]
[PruneCruft]
[ExtraTests]
[AutoPrereqs]
[PodWeaver]
[PkgVersion]
Expand Down
2 changes: 1 addition & 1 deletion install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ PARALLEL_VERSION=${PARALLEL_VERSION:-"20150522"}
PARALLEL_DOWNLOAD_FILENAME="parallel-${PARALLEL_VERSION}.tar.bz2"
PARALLEL_URL="http://ftp.gnu.org/gnu/parallel/${PARALLEL_DOWNLOAD_FILENAME}"

BEDTOOLS_VERSION="2.24.0"
BEDTOOLS_VERSION="2.26.0"
BEDTOOLS_DOWNLOAD_FILENAME="bedtools-${BEDTOOLS_VERSION}.tar.gz"
BEDTOOLS_URL="https://github.com/arq5x/bedtools2/releases/download/v${BEDTOOLS_VERSION}/${BEDTOOLS_DOWNLOAD_FILENAME}"

Expand Down
31 changes: 30 additions & 1 deletion lib/Bio/Roary/Output/GroupsMultifastaNucleotide.pm
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ use Moose;
use Bio::SeqIO;
use File::Path qw(make_path);
use File::Basename;
use File::Copy;
use File::Temp qw/ tempfile /;
use Bio::Roary::Exceptions;
use Bio::Roary::AnalyseGroups;
use Bio::Tools::GFF;
Expand Down Expand Up @@ -154,9 +156,36 @@ sub _extract_nucleotide_regions {
return $self->_extracted_nucleotide_fasta_file_from_bed_filename;
}

sub _cleanup_fasta {
my ($self,$infile) = @_;

my($fh, $outfile) = tempfile();
return unless ( -e $infile );

open( my $in, '<', $infile );
open( my $out, '>', $outfile );
while ( my $line = <$in> ) {
chomp $line;
$line =~ s/"//g if ( $line =~ /^>/ );

if($line =~ /^(>[^:]+)/)
{
$line = $1;
}
print $out "$line\n";
}
close $in;
close $out;

move( $outfile, $infile);
return $infile;
}


sub _build_fasta_file {
my ($self) = @_;
return $self->_extract_nucleotide_regions;
my $fasta_filename = $self->_extract_nucleotide_regions;
return $self->_cleanup_fasta($fasta_filename);
}

no Moose;
Expand Down

0 comments on commit 84f713f

Please sign in to comment.