8 $genefamily_id => undef
13 <& /page/page_title.mas, title=>'Gene family search' &>
20 my $DIR = $c->get_conf('genefamily_dir'); # '/home/mueller/dutch_tomato_assembly/tomato_ara_rice_comparison/';
21 if (!$action) { $action = "input"; }
22 if ($genefamily_id eq '') { $genefamily_id=0; }
24 if ($action eq 'detail') {
25 my $gf = SGN::Genefamily->new(
26 name => "ORTHOMCL$genefamily_id",
37 my $align_link_disabled = "";
38 my $fasta_link_disabled = "";
39 my $tree_link_disabled = "";
40 my $exp_link_disabled = "";
45 $seq_data = $gf->get_alignment();
48 $errors .= "Alignment data not available. ";
50 $align_link_disabled="disabled";
53 $fasta_data = $gf->get_fasta();
57 $errors .= "Sequence data not available. ";
59 $fasta_link_disabled = "disabled";
62 $tree_data = $gf->get_tree();
65 $errors .= "Tree data not available. ";
66 $tree_link_disabled = "disabled"
69 $annot_data = $gf->get_annotation();
72 $errors .= "Annotation data not available. ";
73 $annot_data = "(No annotation data available)";
76 $errors .= "Expression data not available. ";
77 $exp_data = $gf->get_expression();
80 $exp_link_disabled = "disabled";
83 if ($big_errors > 0) {
84 $errors = "This family does not seem to exist!\n";
89 <h1>Family detail for family <% $genefamily_id %></h1>
90 <table><tr><td>Family: <b><% $genefamily_id %></b></td><td><% $annot_data %></td></tr>
91 <tr><td colspan="2">Note: <% $errors %></td></tr>
97 <form name="alignment_viewer_form" method="POST" action="/tools/align_viewer/index.pl">
98 <input type="hidden" name="seq_data" value="<% $seq_data %>" />
99 <input type="submit" value="Alignment" <% $align_link_disabled %> />
100 <input type="hidden" name="format" value="fasta" />
105 <form name="tree_browser_form" method="post" action="/tools/tree_browser/index.pl">
106 <input type="hidden" name="" value="<% $tree_data %>" />
107 <input type="submit" value="Tree" <% $tree_link_disabled %> />
117 Sequences in fasta:</td><td>
118 <form name="tree_browser_unaligned" method="post" action="/tools/align_viewer/index.pl">
119 <input type="hidden" name="seq_data" value="<% $fasta_data %>" />
120 <input type="hidden" name="format" value="fasta_unaligned" />
121 <input type="submit" value="Align" />
126 <pre><% $fasta_data %></pre>
132 if ($action eq 'search' && $member_id) {
133 die 'must provide dataset' unless $dataset;
134 my $member_file = catfile($DIR,$dataset,'genefamily_defs.txt');
135 open (my $F, "<", $member_file) || die "can't open family file $member_file";
140 if ($_=~/\b$member_id\b/i) {
151 <form name="genefamily_display_form">
152 In dataset <b><% $dataset %></b>, sequence <% $member_id %> is in family <% $family_nr %>.
153 <input type="hidden" name="genefamily_id" value="<% $family_nr %>" />
154 <input type="hidden" name="dataset" value="<% $dataset %>" />
155 <input type="hidden" name="action" value="detail" />
156 <input type="submit" name="view_family" value="view family <% $family_nr %>" />
161 <% $member_id %> was not found in any family.
167 my @datasets = SGN::Genefamily->get_available_datasets($DIR);
169 my $select = '<select name="dataset">';
171 foreach my $d (@datasets) {
172 if ($d eq $dataset) { $selected="selected=\"selected\" "; }
173 else { $selected= ""; }
174 $select .= qq | <option value="$d" $selected>$d</option> |;
176 $select .= "</select>";
178 if ($action eq 'input') {
183 <tr><td colspan="2">If you know the ID of your gene family, enter it below.</td></tr>
184 <tr><td>Genefamily id</td><td>
185 <form name="genefamily_detail_form">
186 <input name="genefamily_id" size="10" />(a number)
187 <input type="hidden" name="action" value="detail" />
189 <input type="submit" value="Details" />
192 <tr><td colspan="2"><b>-OR-</b></td></tr>
193 <tr><td colspan="2">if you know a member ID, search for the corresponding family:</td></tr>
194 <tr><td>Member id</td><td>
195 <form name="member_search_form">
196 <input name="member_id" size="10" /> (e.g. At1g01060)
197 <input type="hidden" name="action" value="search" />
199 <input type="submit" />
208 use File::Spec::Functions;