| 1 | package Bio::ConnectDots::ConnectorSet::gse_sample; | ||
| 2 | use strict; | ||
| 3 | use vars qw(@ISA); | ||
| 4 | use Bio::ConnectDots::ConnectorSet; | ||
| 5 | @ISA = qw(Bio::ConnectDots::ConnectorSet); | ||
| 6 | |||
| 7 | |||
| 8 | sub parse_entry { | ||
| 9 | my ($self) = @_; | ||
| 10 | my $input_fh=$self->input_fh; | ||
| 11 | while (<$input_fh>) { | ||
| 12 | chomp; | ||
| 13 | s/[\r\n]//; | ||
| 14 | s/\t/\s/; | ||
| 15 | chomp; | ||
| 16 | if (/^\^sample\s*=\s*(GSM\d+)/) { | ||
| 17 | my $sample = $1; | ||
| 18 | $self->put_dot("SampleID","$sample") if $sample; | ||
| 19 | } | ||
| 20 | if (/^\!Sample_status\s*=\s*(.*)/) { | ||
| 21 | my $status = $1; | ||
| 22 | $self->put_dot("Status","$status") if $status; | ||
| 23 | } | ||
| 24 | if (/^\!Sample_title\s*=\s*(.*)/) { | ||
| 25 | my $title = $1; | ||
| 26 | $self->put_dot("Title","$title") if $title; | ||
| 27 | } | ||
| 28 | if (/^\!Sample_type\s*=\s*(.*)/) { | ||
| 29 | my $type = $1; | ||
| 30 | $self->put_dot("Type","$type") if $type; | ||
| 31 | } | ||
| 32 | if (/^\!Sample_pubmed_id\s*=\s*(\d+)/) { | ||
| 33 | my $pubmed = $1; | ||
| 34 | $self->put_dot("PubMedID","$pubmed") if $pubmed; | ||
| 35 | } | ||
| 36 | if (/^\!Sample_web_link\s*=\s*(.*)/) { | ||
| 37 | my $link = $1; | ||
| 38 | $self->put_dot("Link","$link") if $link; | ||
| 39 | } | ||
| 40 | if (/^\!Sample_description\s*=\s*(.*)/) { | ||
| 41 | my $desc = $1; | ||
| 42 | ## removed b/c was causing copy error | ||
| 43 | #$self->put_dot("Description","$desc") if $desc; | ||
| 44 | } | ||
| 45 | if (/^\!Sample_keyword\s*=\s*(.*)/) { | ||
| 46 | my $key = $1; | ||
| 47 | $self->put_dot("Keyword","$key") if $key; | ||
| 48 | } | ||
| 49 | if (/^\!Sample_organism\s*=\s*(.*)/) { | ||
| 50 | my $org = $1; | ||
| 51 | $self->put_dot("Organism","$org") if $org; | ||
| 52 | } | ||
| 53 | if (/^\!Sample_lot_batch\s*=\s*(.*)/) { | ||
| 54 | my $lot = $1; | ||
| 55 | $self->put_dot("Lot","$lot") if $lot; | ||
| 56 | } | ||
| 57 | if (/^\!Sample_platform_id\s*=\s*(GPL\d+)/) { | ||
| 58 | my $gpl = $1; | ||
| 59 | $self->put_dot("PlatformID","$gpl") if $gpl; | ||
| 60 | } | ||
| 61 | if (/^\!Sample_target_source\s*=\s*(.*)/) { | ||
| 62 | my $source = $1; | ||
| 63 | $self->put_dot("TargetSource","$source") if $source; | ||
| 64 | } | ||
| 65 | if (/^\!Sample_geo_accession\s*=\s*(GSM\d+)/) { | ||
| 66 | return $self->have_dots; | ||
| 67 | } | ||
| 68 | } | ||
| 69 | close GSE; | ||
| 70 | } |