[Bioperl-l] Need help in needle parser

Chris Fields cjfields at uiuc.edu
Tue Jul 11 16:04:49 UTC 2006


Okay, I take that back.  Bio::AlignIO::emboss does parse EMBOSS v3 needle
output!  The fact that it doesn't parse your alignment is b/c there are no
sequence descriptors in the file for the sequences (your FASTA files didn't
have them either).  Modifying the file to contain descriptions for both the
alignment and the 'Aligned_sequences:'  section gets your test alignment to
work.   I consider this a feature and not a bug; how would others be able to
distinguish between numerous sequences in an alignment w/o identifiers of
some sort?  It shouldn't just toss this out without a warning however; I'll
try to add a little exception handling.

 

BTW, one line is incorrect in your script; it should be 

 

print "Number of sequences:".$align->no_sequences()."\n";

 

you have   

 

print "Number of sequences:".$align->no_sequence()."\n";

 

Chris

 

  _____  

From: Khoiwal Tara [mailto:khoiwal_tara at yahoo.co.in] 
Sent: Tuesday, July 11, 2006 8:26 AM
To: Chris Fields
Subject: Re: [Bioperl-l] Need help in needle parser

 

I am sending my testing data to you. I have two fasta files
"GenomicSeq.fasta" and "TranscriptSeq.fasta". I ran needle on these files as
follows:

 

$ needle GenomicSeq.fasta TranscriptSeq.fasta outfile.needle

 

So the out put of the needle will get stored in outfile.needle. I am
attaching the output file also. Please check it and tell me if it has any
problem.

Is my output file is correct?

 

Thanks and Regards,

Tara.

Chris Fields <cjfields at uiuc.edu> wrote:

perldoc Bio::AlignIO
perldoc Bio::AlignIO::needle

http://www.bioperl.org/wiki/FAQ
http://www.bioperl.org/wiki/HOWTO:Beginners
http://www.bioperl.org/wiki/Bptutorial.pl
http://www.catb.org/~esr/faqs/smart-questions.html

Google is your friend!

If it isn't entering the while loop, there are two possibilities:

1) Something is wrong with the file
2) The parser isn't reading the file correctly

In order to know which, we will need to see the alignment itself.

Chris

On Jul 11, 2006, at 7:19 AM, Khoiwal Tara wrote:

> Hi,
> I want to parse the output of needle.I tried but didn't able to 
> get expected output.
>
> My code is as follows:
>
> #!/usr/local/bin/perl
>
> use strict;
> use warnings;
> use Bio::AlignIO;
> my $needleReport = $ARGV[0];
>
> my $in = new Bio::AlignIO(-format => 'emboss',-file =>$needleReport);
>
> while(my $align = $in->next_aln()){
> print "Alignment Length:".$align->length()."\n";
> print "Percentage Identity:".$align->percentage_identity()."\n";
> print "Consensus string:".$align->consensus_string()."\n";
> print "Number of sequences:".$align->no_sequence()."\n";
> print "Number of residues:".$align->no_residues()."\n";
> }
>
> But it doesn't go inside the while loop.
> Pls help me.
> How to find the alignment position for the query sequence on the 
> target sequence from the needle output?
> Where can i find the good documentation on needle parser and its 
> usage?
> Good document on bioperl for beginners.
>
> Regards,
> Tara Khoiwal.
>
> 
> ---------------------------------
> Sneak preview the all-new Yahoo.com. It's not radically different. 
> Just radically better.
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l

Christopher Fields
Postdoctoral Researcher
Lab of Dr. Robert Switzer
Dept of Biochemistry
University of Illinois Urbana-Champaign




 

  

  _____  

Do you Yahoo!?
Next-gen email? Have it all with the all-new
<http://us.rd.yahoo.com/evt=42241/*http:/advision.webevents.yahoo.com/handra
isers>  Yahoo! Mail Beta.




More information about the Bioperl-l mailing list