4 sbfinder.pl - a web script that displays potential seedbacs given a marker of the F2-2000 map
8 sbfinder.pl will query the physical database bac_marker_matches materialized view for information about BAC - genetic map associations. There are three association types: overgo (experimentally determined associations), computational (associations determined by blast) and manual associations. (the materialized view is created from data of other tables in the physical and sgn databases using the script add_bac_marker_matches_view.pl (found in sgn-tools/stable/physical_tools/bin/ ). See perldoc of that script for more information.
10 Note: As of 6/2006, the overgo analysis has only been performed on the HindIII library. The computational analysis was done on the HindIII, EcoRI, and MboI library, based on BAC end sequence data (a small part of the normally not known full BAC sequence). Manual annotations are made based on publications and other experimental data.
14 Lukas Mueller (lam87@cornell.edu)
22 use CXGN
::DB
::Connection
;
24 my $sbf = seedbac_finder
-> new
();
26 if (!$sbf -> has_data
()) {
30 $sbf -> display_results
();
35 package seedbac_finder
;
42 my $self = bless $args, $class;
43 our $page = CXGN
::Page
->new();
44 $self->{page
} = $page;
45 $self->{dbh
} = CXGN
::DB
::Connection
->new();
51 if ($self->get_marker()) {
61 $self->{marker
} = shift;
66 return $self->{marker
};
71 $self->{page
}->header();
75 $self->{page
}->footer();
81 my $marker = $self->get_marker();
84 <h3>Seedbac finder</h3>
85 This tool will suggest a seed bac given a marker name from the tomato F2-2000 map. Experimental (overgo), computational (blast) and manual (curated from experimental evidence) associations are reported.<br /><br />
86 <form action=\"sbfinder.pl\">
87 Marker name: <input name="marker" value="$marker" />
88 <input type="submit" value="Submit" />
98 my ($marker) = $self->{page
}->get_arguments("marker");
99 $self->set_marker($marker);
103 sub display_results
{
106 (@
{$bacs{overgo
}}) = $self->get_bacs("overgo");
107 (@
{$bacs{computational
}}) = $self->get_bacs("computational");
108 (@
{$bacs{manual
}}) = $self ->get_bacs("manual");
110 $self->{page
}->header();
114 print "<br /><h3>Suggested Seedbacs for marker ".$self->get_marker()."</h3>";
116 print qq { <table cellspacing
="10"> };
117 print "<tr><td>BAC name</td><td>estimated length</td><td>contig name</td><td>contig size</td><td>top pick</td></tr>";
118 foreach my $a_type ("overgo", "computational", "manual") {
119 print qq { <tr
><td colspan
="4"><b
>$a_type associations
</b></td
></tr
> };
120 if (!@
{$bacs{$a_type}}) {
121 print qq { <tr
><td colspan
="4">None found
.</td></tr
> };
123 foreach my $b (@
{$bacs{$a_type}}) {
125 my ($bac_id, $bac, $len, $name, $contigs) = split /\t/, $b;
126 my $toppick="<td> </td>";
128 if ($name =~ /ctg(\d+)/) { $contig_id = $1; }
130 if ($len>120000 && $contigs > 0) { $toppick="<td bgcolor=00FF00> </td>"; }
131 print qq{ <tr
><td
><B
><a href
="/maps/physical/clone_info.pl?id=$bac_id">$bac</a
></B></td
><td
>$len</td><td><a href="http://www.genome.arizona.edu//WebAGCoL/WebFPC
/WebFPC_Direct_v2.1.cgi?name=tomato&contig=$contig_id">$name</a><td
>$contigs</td>$toppick</tr
> };
135 $self->{page
}->footer();
142 my $marker_name = $self->get_marker();
143 my $association_type = shift;
145 # my $physical = $self->{dbh}->qualify_schema('physical');
147 # my $query = "SELECT cornell_clone_name, estimated_length, contig_name, number_of_contigs, number_of_markers FROM $physical.bac_marker_matches WHERE marker_name=? GROUP BY bac_id, cornell_clone_name, estimated_length, contig_name, number_of_contigs, number_of_markers ORDER BY estimated_length desc, number_of_contigs";
148 my $query = "SELECT distinct bac_id, arizona_clone_name, estimated_length, contig_name, number_of_bacs, lg.lg_order, bmm.position, alias, marker_id FROM physical.bac_marker_matches AS bmm inner join linkage_group as lg using(lg_id) WHERE alias ilike ? AND association_type=? ORDER BY lg.lg_order, bmm.position, alias, estimated_length desc, number_of_bacs desc, arizona_clone_name, contig_name desc";
150 my $sth = $self->{dbh
}->prepare($query);
151 $sth->execute($marker_name, $association_type);
154 while (my @line = $sth -> fetchrow_array
()) {
156 my $line = join ("\t", @line);
166 # $self->{dbh}->disconnect();