1.	#!/usr/bin/perl -w
2.	use strict;
3.	
4.	use ANNOserver;
5.	use Data::Dumper;
6.	
7.	# Reads FASTA protein sequences from STDIN. 
8.	# Produces sequence ID, role, genome set name, confidence
9.	# If "-blast" is specified, uses BLAST option.
10.	
11.	my $annoObject = ANNOserver->new();
12.	my $blastOption = ($ARGV[0] && $ARGV[0] =~ /^-blast/i ? 1 : 0);
13.	
14.	my $results = $annoObject->assign_function_to_prot(-input => \*STDIN,
15.	                                                   -kmer => 8,
16.	                                                   -scoreThreshold => 3,
17.	                                                   -assignToAll => $blastOption);
18.	while (my $data = $results->get_next()) {
19.	    my ($id, $role, $genomeSet, undef, $hits) = @$data;
20.	    # Only proceed if a role was found.
21.	    if ($role) {
22.	        $genomeSet = '' if ! defined $genomeSet;
23.	        print join("\t", $id, $role, $genomeSet, $hits) . "\n";
24.	    }
25.	}