-
Notifications
You must be signed in to change notification settings - Fork 1
/
search_blast.html
100 lines (96 loc) · 4.27 KB
/
search_blast.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<%perl>
my $local_info;
my $blast = new PRFBlast(config=>$config);
if (!defined($search_string)) {
if (defined($start) and defined($accession)) {
my $sp = $db->MySelect(statement => "SELECT species FROM genome WHERE accession = ?", type => 'single', vars => [$accession]);
my $mt = "mfe_$sp";
$search_string = $db->MySelect(statement => "SELECT sequence FROM $mt WHERE accession = ? AND start = ? LIMIT 1", vars => [$accession, $start], type => 'single');
} elsif (defined($accession)) {
$search_string = $db->MySelect(statement => "SELECT mrna_seq FROM genome WHERE accession = ? LIMIT 1", vars => [$accession], type => 'single');
}
$search_string =~ tr/Uu/Tt/;
$search_string =~ s/\s//g;
$local_info = $blast->Search($search_string, $location);
} elsif ($blast_type eq 'blastn') {
$search_string =~ tr/Uu/Tt/;
$search_string =~ s/\s//g;
$local_info = $blast->Search($search_string, $location);
} elsif ($blast_type eq 'tblastn') {
$local_info = $blast->Search($search_string, $location, $blast_type);
} else {
$local_info = $blast->Search($search_string, $location, 'blastn');
}
</%perl>
</p>
% if (!defined($local_info)) {
<p>There was an error in your blast search, the most likely cause is that the query sequence was not long enough.
Please remind me to sort out the potential errors so I can report them more fully</p>
% } else {
<p>Searching the <% $location %> BLAST database, the query sequence has <% $local_info->{query_length} %> bases.<br>
% my (%hit_names, %accessions, %lengths, %descriptions, %scores, %significances, %bitses);
% my (%hsps_evalue, %hsps_expect, %hsps_gaps, %hsps_querystring, %hsps_homostring, %hsps_hitstring, %hsps_numid, %hsps_numcon, %hsps_length, %hsps_score);
% if (!defined($local_info->{hits})) {
<p>There were no hits in the blast database.<br></p>
% }
% my @hits = @{$local_info->{hits}};
% foreach my $c (0 .. $#hits) {
<p>Hit Number: <% $c %><br>
Name: <% $local_info->{hits}->[$c]->{hit_name} %><br>
% if ($location eq 'local') {
Accession: <a href="/search.html?short=1&accession=<% $local_info->{hits}->[$c]->{accession} %>">
% } else {
Accession: <a href="http://www.ncbi.nlm.nih.gov/nuccore/<% $accession %>" rel="external" target="_blank" title="Link to the NCBI entry."><% $accession %></a>, or Import <a href="/import.html?accession=<% $local_info->{hits}->[$c]->{accession} %>" title="Import <% $local_info->{hits}->[$c]->{accession} %> into the PRFdb">
% }
% my @description_array = split(/ /, $local_info->{hits}->[$c]->{description});
<% $local_info->{hits}->[$c]->{accession} %></a><br>
Length: <% $local_info->{hits}->[$c]->{length} %><br>
Description:
% foreach my $word (@description_array) {
<a href="/search.html?search_species_limit=all&query=<% $word %>"><% $word %></a>
% }
<br>
Score: <% $local_info->{hits}->[$c]->{score} %>
Significance: <% $local_info->{hits}->[$c]->{significance} %>
Bits: <% $local_info->{hits}->[$c]->{bits} %><br>
% my @hsps = ();
% if (defined(@{$local_info->{hits}->[$c]->{hsps}})) {
% @hsps = @{$local_info->{hits}->[$c]->{hsps}};
% }
% foreach my $d (0 .. $#hsps) {
HSP: <% $d %><br>
Evalue: <% $local_info->{hits}->[$c]->{hsps}->[$d]->{evalue} %>
Gaps: <% $local_info->{hits}->[$c]->{hsps}->[$d]->{gaps} %>
Number Identical: <% $local_info->{hits}->[$c]->{hsps}->[$d]->{num_identical} %>
Score: <% $local_info->{hits}->[$c]->{hsps}->[$d]->{score} %>
% my @query_array = split(//, $local_info->{hits}->[$c]->{hsps}->[$d]->{query_string});
% my @homo_array = split(//, $local_info->{hits}->[$c]->{hsps}->[$d]->{homology_string});
% my @hit_array = split(//, $local_info->{hits}->[$c]->{hsps}->[$d]->{hit_string});
% my ($query_string, $homo_string, $hit_string);
% while (scalar(@query_array) > 90 or scalar(@query_array) > 0) {
% foreach my $c (0 .. 89) {
% $query_string .= shift(@query_array) if (defined($query_array[0]));
% $homo_string .= shift(@homo_array) if (defined($homo_array[0]));
% $hit_string .= shift(@hit_array) if (defined($hit_array[0]));
% }
<pre>
<% $query_string %>
<% $homo_string %>
<% $hit_string %>
</pre>
% $query_string = '';
% $homo_string = '';
% $hit_string = '';
% }
% }
<hr>
<br>
% }
% }
<%args>
$start => undef
$accession => undef
$search_string => undef
$location => undef
$blast_type => 'blastn'
</%args>