sub sprotseq {
   my ($filehandle, $accnr) = @_;

   while ( my $line = <$filehandle> ) {
      # First we are only interested in the AC line which contains the
      # given accession number.
      next unless ( $line =~ /^AC.*\b$accnr;/ );
      
      # If we end up here we have found the correct protein entry.  We
      # now scan until we find the SQ line which preceeds the actual
      # sequence
      while ( my $line = <$filehandle> ) {
         if ( $line =~ /^SQ/ ) {

            # The following lines contains the sequence.
            # When we hit the // line the sequence is complete.
            my $seq = "";
            while ( my $line = <$filehandle> ) {
               last if ( $line =~ /^\/\// );
               $seq .= $line;
            }
            # Note that we can return already here
            return $seq;
         }
      }
   }
}
