6 /markers/cosii_orthologs.mas - a Mason component displaying information about cos ortholog markers
16 $marker - a CXGN::Marker object.
22 Lukas Mueller <lam87@cornell.edu>
34 use CXGN::Unigene::Tools;
36 my $marker_name = $marker->get_name();
37 return '' unless $marker->is_in_collection('COSII');
39 my $cosii_data_files = cosii_data_files($marker, $c);
40 my @unigenes = $marker->cosii_unigenes();
42 my $table_headings = [ 'Species', 'Copies', 'Sequence ID', 'CDS/Edited sequence', 'Peptide sequence', 'Predicted introns' ];
45 for my $unigene (@unigenes) {
47 $unigene->{copies} = {
50 }->{ $unigene->{copies} } || 'No copy data found';
52 $unigene->{sequence_name} ||= CXGN::Marker::Tools::cosii_to_arab_name( $marker_name );
54 $unigene->{organism} ||= $unigene->{database_name};
56 if( $unigene->{unigene_id} ) {
58 if( $unigene->{organism}=~/Coffee/i ) {
60 my $new_sgn_id = CXGN::Unigene::Tools::cgn_id_to_sgn_id( $marker->{dbh}, $unigene->{unigene_id} );
61 my $old_coffee_id = $unigene->{unigene_id};
62 $unigene->{unigene_id} = qq|<a href="/search/unigene.pl?unigene_id=$new_sgn_id">$new_sgn_id (SGN)</a><br /><span class="ghosted">$old_coffee_id (CGN)</span>|;
65 $unigene->{unigene_id} = qq|<a href="/search/unigene.pl?unigene_id=$unigene->{unigene_id}">SGN-U$unigene->{unigene_id}</a>|;
69 $unigene->{unigene_id} = 'Not available';
72 my $organism_name_for_uri = URI::Escape::uri_escape( $unigene->{organism} );
73 my( $ed_desc, $pep_desc, $int_desc ) = ( 'Edited', 'Peptide', 'Introns' );
77 push @row_data, $unigene->{organism};
78 push @row_data, $unigene->{copies};
80 if( $unigene->{organism}=~/Arabidopsis/i ) {
81 push @row_data, CXGN::Marker::Tools::tair_gene_search_link($unigene->{sequence_name});
82 $ed_desc = 'CDS from TAIR';
83 $pep_desc = 'Peptide from TAIR';
84 $int_desc = 'Introns from TAIR';
87 push @row_data, $unigene->{unigene_id};
90 if ($cosii_data_files->{edited_seq_files}->[0]) {
91 for my $file (@{$cosii_data_files->{edited_seq_files}}) {
92 push @row_data, qq|<a href="$file">$ed_desc</a>|;
99 if ( $cosii_data_files->{peptide_seq_files}->[0] ) {
100 for my $file( @{$cosii_data_files->{peptide_seq_files}} ) {
101 push @row_data, qq|<a href="$file">$pep_desc</a>|;
108 if( $cosii_data_files->{intron_seq_files}->[0] ) {
109 for my $file( @{$cosii_data_files->{intron_seq_files}} ) {
110 push @row_data, qq|<a href="$file">$int_desc</a>|;
117 push @$table_data, \@row_data;
120 sub cosii_data_files {
121 my ($marker, $conf) = @_;
123 unless($marker->is_in_collection('COSII')){return;}
124 my $cosii_data_files={};
125 my $seq_file_search_string=CXGN::Marker::Tools::cosii_name_to_seq_file_search_string($marker->name_that_marker());
126 my $data_shared_website_path=$conf->{'static_datasets_path'};
127 my $additional_data_files_string=`find $data_shared_website_path/cosii -type f -iregex ".*$seq_file_search_string.*"`;
128 my @files=split("\n",$additional_data_files_string);
129 my @edited_seq_files;
130 my @peptide_seq_files;
131 my @intron_seq_files;
132 my @all_other_data_files;
133 for my $file(@files) {
134 my $data_shared_url=$conf->{'static_datasets_url'};
135 $file=~s/$data_shared_website_path/$data_shared_url/;
136 if($file=~/\.cds\.txt\.modify$/) {
137 push(@edited_seq_files,$file);
139 elsif($file=~/\.pep\.txt$/) {
140 push(@peptide_seq_files,$file);
142 elsif($file=~/\.intron.txt$/) {
143 push(@intron_seq_files,$file);
146 push(@all_other_data_files,$file);
149 $cosii_data_files->{edited_seq_files}=\@edited_seq_files;
150 $cosii_data_files->{peptide_seq_files}=\@peptide_seq_files;
151 $cosii_data_files->{intron_seq_files}=\@intron_seq_files;
152 $cosii_data_files->{all_other_data_files}=\@all_other_data_files;
153 $cosii_data_files->{all_files}=\@files;
154 return $cosii_data_files;
159 <&| /page/info_section.mas, title=>"Orthologs in this COSII group" &>
160 <& /page/columnar_table.mas, headings => $table_headings, data => $table_data, __align => 'llcccc' &>