Promoteriwise is an alignment algorithm that relaxes the constraint
that local alignments have to be co-linear. Otherwise it provides a
similar model to DBA, which is designed for promoter sequence
alignments. Promoterwise is written by Ewan Birney. It is part of
the wise2 package available at
ftp://ftp.ebi.ac.uk/pub/software/unix/wise2/This module is the parser for the Promoterwise output in tab format.
sub _parse
{ my ($self) = @_;
my (%hash,@fp);
while (defined($_ = $self->_readline()) ) {
chomp;
my @array = split;
push @{$hash{$array[-1]}},\@ array;
}
foreach my $key(keys %hash){
my $sf1 = Bio::SeqFeature::Generic->new(-primary=>"conserved_element",
-source_tag=>"promoterwise");
$sf1->attach_seq($self->query1_seq) if $self->query1_seq;
my $sf2 = Bio::SeqFeature::Generic->new(-primary=>"conserved_element",
-source_tag=>"promoterwise");
$sf2->attach_seq($self->query2_seq) if $self->query2_seq;
foreach my $info(@{$hash{$key}}){
my ($score,$id1,$start_1,$end_1, $strand_1,$s1_len,
$id2,$start_2,$end_2,$strand_2,$s2_len, $group);
if( @{$info} == 12 ) {
($score,$id1,$start_1,$end_1, $strand_1,$s1_len,
$id2,$start_2,$end_2,$strand_2,$s2_len, $group) = @{$info};
} elsif( @{$info} == 10 ) {
($score,$id1,$start_1,$end_1, $strand_1,
$id2,$start_2,$end_2,$s2_len, $group) = @{$info};
} else {
$self->throw("unknown promoterwise output, ", scalar @{$info},
" columns, expected 10 or 12\n");
}
if(!$sf1->strand && !$sf2->strand){
$sf1->strand($strand_1);
$sf2->strand($strand_2);
$sf1->seq_id($id1);
$sf2->seq_id($id2);
$sf1->score($score);
$sf2->score($score);
}
my $sub1 = Bio::SeqFeature::Generic->new(-start=>$start_1,
-seq_id=>$id1,
-end =>$end_1,
-strand=>$strand_1,
-primary=>"conserved_element",
-source_tag=>"promoterwise",
-score=>$score);
$sub1->attach_seq($self->query1_seq) if $self->query1_seq;
my $sub2 = Bio::SeqFeature::Generic->new(-start=>$start_2,
-seq_id=>$id2,
-end =>$end_2,
-strand=>$strand_2,
-primary=>"conserved_element",
-source_tag=>"promoterwise",
-score=>$score);
$sub2->attach_seq($self->query2_seq) if $self->query2_seq;
$sf1->add_SeqFeature($sub1,'EXPAND');
$sf2->add_SeqFeature($sub2,'EXPAND');
}
my $fp = Bio::SeqFeature::FeaturePair->new(-feature1=>$sf1,
-feature2=>$sf2);
push @fp, $fp;
}
$self->_feature_pairs(\@fp);
$self->_parsed(1);
return;} |
The rest of the documentation details each of the object methods.
Internal methods are usually preceded with a _