Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Parsing a file

by citromatik (Curate)
on Apr 16, 2009 at 06:40 UTC ( [id://757858]=note: print w/replies, xml ) Need Help??


in reply to Parsing a file

I don't know exactly what are you trying to accomplish, but if you only want to extract the "Sbjct" lines you could simply try something like:

while (<$fh>) { print if (/Sbjct/){ }

As a side note, I'm not a fan of bioperl at all, but maybe it would be useful for you. You can try This tutorial to see how to parse Blast reports.

Also, it is always better to run blast with the option -m 8 and get the results in tabular format if your intention is to parse the results with a custom made script

Hope this helps

Update: The code has been updated to meet the poster output sample included

citromatik

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://757858]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-04-19 20:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found