[Bio] / SeedViewer / MetagenomeAnalysis.pm Repository:
ViewVC logotype

Diff of /SeedViewer/MetagenomeAnalysis.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.18, Mon Jul 14 22:12:45 2008 UTC revision 1.19, Wed Aug 13 20:50:41 2008 UTC
# Line 593  Line 593 
593    
594  }  }
595    
596    =pod
597    
598    =item * B<get_sequence_subset_genome> (I<genome>)
599    
600    Given a dataset name (db_id), this method returns all sequence ids,
601    the alignment length, the match id and the taxonomy string for all
602    sequences which match the criteria and have their tax_str start with
603    the filter string I<filter>.
604    
605    =cut
606    
607    sub get_sequence_subset_genome {
608      my ($self, $genome) = @_;
609    
610      my $table = $self->dbtable_best_psc;
611      my $dbid  = $self->get_dataset_id("SEED:seed_genome_tax");
612      my $where = $self->get_where_clause();
613      $where = ($where) ? "and $where" : '';
614    
615      my ($tax_id) = $self->dbh->selectrow_array(qq(SELECT tax_str
616                                                    FROM rdp_to_tax
617                                                    WHERE seq_num= ?), undef, $genome);
618    
619      if($tax_id =~ /(\S+)\s/){
620        $tax_id = $1;
621      }
622    
623      my $sth = $self->dbh->prepare(qq(SELECT id1, ali_ln, id2, tax_str
624                                       FROM $table
625                                       WHERE dbid=? $where and tax_str=?));
626    
627    
628      $sth->execute($dbid, $tax_id);
629      my $result = $sth->fetchall_arrayref();
630    
631      return $result;
632    
633    }
634    
635  =pod  =pod
636    

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3