Hey Monks,
I have a
page, which has the following format:
It is a list with (biological) "candidates".
For each candidate, a bunch of information is given, like protein name (in square brackets), a R-score and a GO-score.
For each candidate, I'm interested in it's R-score and protein name. The tricky part is the variable number of occurences of the protein name.
The information can have one of the following formats.
1) R-score and protein name.
2) R-score and more than one protein name.
3) R-score and no protein name.
The code I wrote fetches the R-scores, but I can't come up with a code that matches all possible cases of the protein name.
use strict;
use warnings;
use LWP;
my $R_score = ();
my @protein = ();
my @R_score_protein = ();
$browser = LWP::UserAgent->new();
my $resp = $browser->get(http://www.bork.embl-heidelberg.de
+/g2d/list_hits_disease.pl?U57042:Inflammatory_bowel_disease_7);
my $content_all = $resp->content();
while ( $content_all =~ m{R\-score<\/A>\s=\s(\d\.\d+)\;}g ) {
$R_score = $1;
push( @R_score_protein, $R_score );
Update:To improve readability, I've removed the relevant HTML snipets, and placed them on my
BioGeek's scratchpad.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.