Skip to content

Commit

Permalink
Add GFF output
Browse files Browse the repository at this point in the history
  • Loading branch information
Nolan Woods committed Jan 17, 2019
1 parent 94edd28 commit c81c1c6
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions Dimob.pl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ =head1 AUTHORS
=head1 LAST MAINTAINED
December 16th, 2016
January 16th, 2019
=cut

Expand Down Expand Up @@ -138,12 +138,28 @@ =head1 LAST MAINTAINED

my $i = 1;
open my $fhgd, '>', $outputfile or die "Cannot open output.txt: $!";
foreach my $island (@islands) {
my $start = $island->[0];
my $end = $island->[1];
print $fhgd "GI_$i\t$start\t$end\n";
$i++;

if ($outputfile =~ /\.txt$/) {
#legacy output
$logger->info("Warning: txt output is now depreciated. Support has been added to output GFF3 formatted documents. Use (any) other extension to enable GFF output. See: https://github.com/brinkmanlab/islandpath/issues/7");
foreach my $island (@islands) {
my $start = $island->[0];
my $end = $island->[1];
print $fhgd "GI_$i\t$start\t$end\n";
$i++;
}
} else {
#GFF output
print $fhgd "##gff-version 3\n";
foreach my $island (@islands) {
my $start = $island->[0];
my $end = $island->[1];
#TODO use proper chromosome sequence id
print $fhgd "GI_$i\tislandpath\tgenomic_island\t$start\t$end\t.\t.\t.\tID=GI_$i\n";
$i++;
}
}

close $fhgd;

$logger->info("Removing tmp files");
Expand Down

1 comment on commit c81c1c6

@innovate-invent
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit addresses #7

Please sign in to comment.