-
Notifications
You must be signed in to change notification settings - Fork 1
/
micro.html
133 lines (124 loc) · 4.8 KB
/
micro.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
% if ($micro_program_new) {
% $micro_program = $micro_program_new;
% }
<form name="micro" id="micro" action="micro.html" enctype="multipart/form-data" method="POST">
<script type='text/javascript'>
function micro_selection() {
document.forms["micro"].elements["micro_program_new"].options["<% $micro_program_new %>"].selected = true;
}
window.onload = micro_selection;
</script>
<script type='text/javascript'>
micro_selection;
</script>
<input type="hidden" name="species" value="<% $species %>">
<input type="hidden" name="accession" value="<% $accession %>">
<input type="hidden" name="start" value="<% $start %>">
<input type="hidden" name="micro_program" value="<% $micro_program %>">
% my $mfe_cutoff_new = $mfe_cutoff + $mfe_cutoff_change;
<p>The current program is: <% $micro_program %>, change it to:
<select name="micro_program_new" id="micro_program_new" onchange="this.form.submit(); return true;">
<option name="rnahybrid" value="rnahybrid">rnahybrid</option>
<option name="miranda" value="miranda">miranda</option>
</select>
<br>
The current mfe cutoff is: <% $mfe_cutoff_new %> and change is <% $mfe_cutoff_change %> <br>
Change the mfe cutoff value by
<select name="mfe_cutoff_change" onchange="this.form.submit()">
<option name="0.0" value="0.0">0 kcal/mol</option>
<option name="-1.0" value="-1.0">-1 kcal/mol</option>
<option name="-2.0" value="-2.0">-2 kcal/mol</option>
<option name="-5.0" value="-5.0">-5 kcal/mol</option>
<option name="-10.0" value="-10.0">-10 kcal/mol</option>
<option name="-20.0" value="-20.0">-20 kcal/mol</option>
<option name="1.0" value="1.0">1 kcal/mol</option>
<option name="2.0" value="2.0">2 kcal/mol</option>
<option name="5.0" value="5.0">5 kcal/mol</option>
<option name="10.0" value="10.0">10 kcal/mol</option>
<option name="20.0" value="20.0">20 kcal/mol</option>
</select>
<input type="hidden" name="mfe_cutoff" value="<% $mfe_cutoff_new %>">
</form>
<br>
Attempting to match <% $accession %>, <% $start %> against homo_sapiens miRNA sequences using <% $micro_program %>.<br>
% my $table = qq"mfe_${species}";
% my $sequence = $db->MySelect(type => 'single', statement => qq"SELECT sequence from $table WHERE accession = ? AND start = ?", vars => [$accession, $start]);
% use MicroRNA;
% my $micro = new MicroRNA(energy_cutoff => $mfe_cutoff_new);
% my $output;
% if ($micro_program eq 'rnahybrid') {
% $output = $micro->RNAHybrid($accession, $start);
% } else {
% $output = $micro->Miranda($accession, $start);
% }
% my $mi_counter = 0;
% OUTER: foreach my $mir (sort keys %{$output}) {
% INNER: foreach my $pos (sort keys %{$output->{$mir}}) {
% next INNER if $output->{$mir}->{$pos}->{mfe} > $mfe_cutoff_new;
% $mi_counter++;
%
% my $target_lead_chars = $output->{$mir}->{$pos}->{target_mismatch};
% $target_lead_chars =~ s/^.*5\' //g;
% $target_lead_chars =~ s/^(\w+)\s+.*/$1/g;
% my $target_lead_count;
% if ($target_lead_chars =~ /^\s/) {
% $target_lead_count = 0;
% } else {
% $target_lead_count = $target_lead_chars =~ tr/AGCU//;
% }
% my $mi_lead_chars = $output->{$mir}->{$pos}->{miRNA_mismatch};
% $mi_lead_chars =~ s/^.*3\' //g;
% $mi_lead_chars =~ s/^(\w+)\s+.*/$1/g;
% my $mi_lead_count;
% if ($mi_lead_chars =~ /^\s/) {
% $mi_lead_count = 0;
% } else {
% $mi_lead_count = $mi_lead_chars =~ tr/AGCU//;
% }
% my $char_dif = $mi_lead_count - $target_lead_count;
% my $spacer_modify = 0;
% if ($char_dif == -1) {
% $spacer_modify = 2;
% } elsif ($char_dif == 4) {
% $spacer_modify = -1;
% } elsif ($char_dif == 2) {
% $spacer_modify = 1;
% } elsif ($char_dif == 0) {
% $spacer_modify = 2;
% } elsif ($char_dif == 5) {
% $spacer_modify = -2;
% } elsif ($char_dif == 6) {
% $spacer_modify = -3;
% } elsif ($char_dif == 7) {
% $spacer_modify = -4;
% }
% my $target_mis_spacer = ' ' x ($pos - 6);
% my $spacer = ' ' x ($pos - $spacer_modify);
% my $mi_mis_spacer = ' ' x ($pos - 7);
<p>miRNA: <% $mir %>, position: <% $pos %> <br>
MFE: <% $output->{$mir}->{$pos}->{mfe} %><br>
<pre>
5' <% $sequence %> 3'
<% $target_mis_spacer %><% $output->{$mir}->{$pos}->{target_mismatch} %>
<% $spacer %><% $output->{$mir}->{$pos}->{target_match} %>
% if ($output->{$mir}->{$pos}->{align_string}) {
<% $spacer %><% $output->{$mir}->{$pos}->{align_string} %>
% }
<b><% $spacer %><% $output->{$mir}->{$pos}->{miRNA_match} %></b>
<% $mi_mis_spacer %><% $output->{$mir}->{$pos}->{miRNA_mismatch} %>
</pre>
%#Mir match: <% $output->{$mir}->{$pos}->{miRNA_match} %><br>
%#Mir mismatch: <% $output->{$mir}->{$pos}->{miRNA_mismatch} %><br>
% }
% }
</p>
<p>There are <% $mi_counter %> hits.</p>
<%args>
$micro_program => 'rnahybrid';
$micro_program_new => undef;
$accession => undef;
$start => undef;
$species => 'homo_sapiens';
$mfe_cutoff => '-22.0';
$mfe_cutoff_change => '0.0';
</%args>