- my ($query, @seqs) = @_;
-
- croak "JPRED: Not a Sequence::File" if grep { not isa $_, 'Sequence::File' } $query;
- croak "JPRED: Not PSISEQ" if grep { not isa $_, 'PSISEQ' } @seqs;
-
- # Get the query sequence
- my $q_query = $query->get_entry(0);
-
- # Get the query sequence from the PSIBLAST alignment
- my $a_query = shift @seqs;
-
- # The gap size required to expand the alignment
- my ($start_gap_length, $end_gap_length);
- {
- # Make handling the sequence easier
- my $q_seq = join "", @{[ $q_query->seq ]};
- my $a_seq = join "", @{ $a_query->align };
-
- $q_seq =~ s/-//g;
- $a_seq =~ s/-//g;
-
- ($q_seq, $a_seq) = map { uc $_ } $q_seq, $a_seq;
-
- $start_gap_length = index($q_seq, $a_seq);
- croak "JPRED: query sequence from alignment not found in original query sequence" if $start_gap_length == -1;
-
- $end_gap_length = length($q_seq) - length($a_seq) - $start_gap_length;
- }
-
- # Add the gaps to the end of the alignments
- for (@seqs) {
- $_->align([
- ($GAP) x $start_gap_length,
- @{ $_->align },
- ($GAP) x $end_gap_length
- ]);
- }
-
- # Put the query sequence back
- unshift @seqs, PSISEQ->new(
- id => $a_query->id,
- align => [
- ($start_gap_length ? @{ $q_query->seq }[ 0..($start_gap_length-1) ] : ()),
- @{ $a_query->align },
- ($end_gap_length ? @{ $q_query->seq }[ -$end_gap_length .. -1 ] : ()),
- ]
- );
-
- return @seqs;
+ my ( $query, @seqs ) = @_;
+
+ croak "JPRED: Not a Sequence::File" if grep { not isa $_, 'Sequence::File' } $query;
+ croak "JPRED: Not PSISEQ" if grep { not isa $_, 'PSISEQ' } @seqs;
+
+ # Get the query sequence
+ my $q_query = $query->get_entry(0);
+
+ # Get the query sequence from the PSIBLAST alignment
+ my $a_query = shift @seqs;
+
+ # The gap size required to expand the alignment
+ my ( $start_gap_length, $end_gap_length );
+ {
+
+ # Make handling the sequence easier
+ my $q_seq = join "", @{ [ $q_query->seq ] };
+ my $a_seq = join "", @{ $a_query->align };
+
+ $q_seq =~ s/-//g;
+ $a_seq =~ s/-//g;
+
+ ( $q_seq, $a_seq ) = map { uc $_ } $q_seq, $a_seq;
+
+ $start_gap_length = index( $q_seq, $a_seq );
+ croak "JPRED: query sequence from alignment not found in original query sequence" if $start_gap_length == -1;
+
+ $end_gap_length = length($q_seq) - length($a_seq) - $start_gap_length;
+ }
+
+ # Add the gaps to the end of the alignments
+ for (@seqs) {
+ $_->align( [ ($GAP) x $start_gap_length, @{ $_->align }, ($GAP) x $end_gap_length ] );
+ }
+
+ # Put the query sequence back
+ unshift @seqs,
+ PSISEQ->new(
+ id => $a_query->id,
+ align => [
+ ( $start_gap_length ? @{ $q_query->seq }[ 0 .. ( $start_gap_length - 1 ) ] : () ),
+ @{ $a_query->align },
+ ( $end_gap_length ? @{ $q_query->seq }[ -$end_gap_length .. -1 ] : () ),
+ ]
+ );
+
+ return @seqs;