[Bioperl-l] Extract field from Medline
Andrej Kastrin
andrej.kastrin at siol.net
Wed Dec 7 09:57:26 EST 2005
Barry Moore wrote:
>Andrej-
>
>Doesn't really sound like you need Bioperl for this one - just some
>loops and regular expressions. Can't offer too much help without seeing
>your file formats, but a boiler plate might look like this:
>
>#!/usr/bin/perl
>
>use strict;
>use warnings;
>
>my $file_terms = shift;
>my $file_medline = shift;
>open (TERM, $file_term) or die "Can't open TERM";
>open (MEDL, $file_medline) or die "Can't open MEDL";
>
>my @terms = <TERM>;
>
>while (my ($pmid, $ti, $ab) = split <MEDL>) {
> for my $term (@terms) {
> if (/$term/ for ($pmid, $ti, $ab)) {
> print "$pmid\t$ti\t$ab";
> }
> }
>}
>
>-----Original Message-----
>From: bioperl-l-bounces at portal.open-bio.org
>[mailto:bioperl-l-bounces at portal.open-bio.org] On Behalf Of Andrej
>Kastrin
>Sent: Wednesday, December 07, 2005 5:40 AM
>To: bioperl-l at portal.open-bio.org
>Subject: [Bioperl-l] Extract field from Medline
>
>Hello all,
>
>big problem for me, small for you (while I'm noob in perl). I have a
>list of terms (i.e. genes, gene products) in row data format. Now I have
>
>to parse Medline (standard Medline format) and extract PMID, TI and AB
>(ID number, Title and Abstract) fields which involve any term in my term
>
>list. I already transform Medline "multiline" format to "single" line,
>so there is only one line per each field.
>
>How to start? Thanks for any suggesstion.
>Best, Andrej
>
>_______________________________________________
>Bioperl-l mailing list
>Bioperl-l at portal.open-bio.org
>http://portal.open-bio.org/mailman/listinfo/bioperl-l
>
>_______________________________________________
>Bioperl-l mailing list
>Bioperl-l at portal.open-bio.org
>http://portal.open-bio.org/mailman/listinfo/bioperl-l
>
>
>
>
Hi,
I try this but something wrong, due to compilation problem (lines 15
and 19); and also, how to include input files?
More information about the Bioperl-l
mailing list