logo       

Sponsor
FREE Network Mapping Tool for Microsoft® Office Visio® Professional 2007
Don't map your network by hand - let LANsurveyor Exx press for Microsoft Visio Professional 2007 automatically create network diagrams for you!

Re: How do you add a consensus to AlignIO?: msg#00220

lang.perl.bio.general

Subject: Re: How do you add a consensus to AlignIO?

Brian Osborne wrote:
Wes,

I'm puzzled. I'm looking at SimpleAlign::_consensus_aa and it certainly
looks like this method should ignore the $gapchar when it calculates the
consensus at any given position. Does your method look like this:

Hi Brian,

Thanks for responding. No, my SimpleAlign.pm does not look like this.
I am using bioperl-1.2.2. You must be using bioperl-live from CVS.
I added the two "gapchar" changes to my bioper-1.2.2 code and it works
like a charm. Thanks!



sub _consensus_aa {
my $self = shift;
my $point = shift;
my $threshold_percent = shift || -1 ;
my ($seq,%hash,$count,$letter,$key);
my $gapchar = $self->gap_char;
foreach $seq ( $self->each_seq() ) {
$letter = substr($seq->seq,$point,1);
$self->throw("--$point-----------") if $letter eq '';
($letter eq $gapchar || $letter =~ /\./) && next;
# print "Looking at $letter\n";
$hash{$letter}++;
}
my $number_of_sequences = $self->no_sequences();
my $threshold = $number_of_sequences * $threshold_percent / 100. ;
$count = -1;
$letter = '?';

foreach $key ( sort keys %hash ) {
# print "Now at $key $hash{$key}\n";
if( $hash{$key} > $count && $hash{$key} >= $threshold) {
$letter = $key;
$count = $hash{$key};
}
}
return $letter;
}

?

Brian O.

-----Original Message-----
From: bioperl-l-bounces@xxxxxxxxxxxxxxxxxxx
[mailto:bioperl-l-bounces@xxxxxxxxxxxxxxxxxxx]On Behalf Of Wes Barris
Sent: Wednesday, August 27, 2003 10:56 PM
To: Bioperl Mailing List
Subject: Re: [Bioperl-l] How do you add a consensus to AlignIO?

Jason Stajich wrote:


Try:
my $consensus = new Bio::LocatableSeq(-seq=>$aln->consensus_string(),
-id=>'btcn1000');


Thanks. That did the trick almost (I had to add -start and -end to the
argument list). However, it is not producing the consensus in the way
that I want. Here is a portion of the resulting msf file:

AU278862 ---------- ---------C TCTACAGAAT CTGTGTTTAT TTTGTTTCAG
AU278567 ---------- ---------- ---ACAGAAT CTGTGTTTAT TTTGTTTCAG
AU277959 -------AGA TTTTGACATC TCTACAGAAT CTGTGTTTAT TTTGTTTCAG
AU278008 CCTTCTTANA TTTTGACATC TCTACAGAAT CTGNGTTTAT TTTGTTTCAG
AU278623 -------AAA TTTTGACATC TCTACANAA- CTGTGTTTAT TTTGTTTCAN
AU278682 -------AAA TTTTGACATC TCTACANAAT CTGTGTTTAT TTTGTTTCAN
BM031781 ---------- ---------- ---------- ---------- ----------
consensus -------A-A TTTTGACATC TCTACAGAAT CTGTGTTTAT TTTGTTTCAG

I need the consensus to span the entire alignment length like this:

consensus CCTTCTTAAA TTTTGACATC TCTACAGAAT CTGTGTTTAT TTTGTTTCAG

i.e. I need it to ignore where the aligned sequences do not exist. Is there
a way to make it do that?

--
Wes Barris
E-Mail: Wes.Barris@xxxxxxxx

_______________________________________________
Bioperl-l mailing list
Bioperl-l@xxxxxxxxxxxxxxxxxxx
http://portal.open-bio.org/mailman/listinfo/bioperl-l



--
Wes Barris
E-Mail: Wes.Barris@xxxxxxxx





Only community members can participate in forum threads. You must Register or log in to contribute.

<Prev in Thread] Current Thread [Next in Thread>
Sponsor
FREE Network Mapping Tool for Microsoft® OfficeVisio Professional 2007
Don't map your network by hand - let LANsurveyor Express for Microsoft Visio Professional 2007
automatically create network diagrams for you!
Google Custom Search

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation

Home | sitemap | advertise | OSDir is an inevitable website. super tiny logo