| 1 | package NCBIx::Geo; | ||||||||||||||||||||||||||||
| 2 | 1 | ▶ | use base qw(NCBIx::Geo::Base); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use NCBIx::Geo::Sample; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use NCBIx::Geo::Item; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use LWP::Simple; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use XML::Simple; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | 1 | ▶ | use Carp; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 1 | ▶ | use version; our $VERSION = qv('1.0.0'); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | 1 | ▶ | use constant UTILS_URL => 'http://www.ncbi.nlm.nih.gov/entrez/eutils/'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | 1 | our $accn_types = { GDS => 1, GPL => 1, GSE => 1, GSM => 1 }; | |||||||||||||||||||||||||||
| 17 | 1 | our $db = 'gds'; | |||||||||||||||||||||||||||
| 18 | 1 | our $default_dir = '/tmp/geo/'; | |||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | { | ||||||||||||||||||||||||||||
| 21 | 1 | my %query_of :ATTR( :get<query> :set<query> :default<''> :init_arg<query> ); | |||||||||||||||||||||||||||
| 22 | 1 | my %query_type_of :ATTR( :get<query_type> :set<query_type> :default<''> :init_arg<query_type> ); | |||||||||||||||||||||||||||
| 23 | 1 | my %geo_item_of :ATTR( :get<geo_item> :set<geo_item> :default<''> :init_arg<geo_item> ); | |||||||||||||||||||||||||||
| 24 | 1 | my %data_dir_of :ATTR( :get<data_dir> :set<data_dir> :default<''> :init_arg<data_dir> ); | |||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 1 | my %platforms_of :ATTR( :get<platforms> :set<platforms> :default<[]> :init_arg<platforms> ); | |||||||||||||||||||||||||||
| 27 | 1 | my %data_sets_of :ATTR( :get<data_sets> :set<data_sets> :default<[]> :init_arg<data_sets> ); | |||||||||||||||||||||||||||
| 28 | 1 | my %series_of :ATTR( :get<series> :set<series> :default<[]> :init_arg<series> ); | |||||||||||||||||||||||||||
| 29 | 1 | my %samples_of :ATTR( :get<samples> :set<samples> :default<[]> :init_arg<samples> ); | |||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | 1 | my %platforms_count_of :ATTR( :get<platforms_count> :set<platforms_count> :default<''> :init_arg<platforms_count> ); | |||||||||||||||||||||||||||
| 32 | 1 | my %data_sets_count_of :ATTR( :get<data_sets_count> :set<data_sets_count> :default<''> :init_arg<data_sets_count> ); | |||||||||||||||||||||||||||
| 33 | 1 | my %series_count_of :ATTR( :get<series_count> :set<series_count> :default<''> :init_arg<series_count> ); | |||||||||||||||||||||||||||
| 34 | 1 | my %samples_count_of :ATTR( :get<samples_count> :set<samples_count> :default<''> :init_arg<samples_count> ); | |||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | 0 | ▶ | sub START { | ||||||||||||||||||||||||||
|
Subroutine
START: not called CC=7 SCAR=40.3
Pod
undocumented
| |||||||||||||||||||||||||||||
| 37 | 0 | my ($self, $ident, $arg_ref) = @_; | |||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | # Check for valid data_dir | ||||||||||||||||||||||||||||
| 40 | 0 | ▶ | if ( $self->get_data_dir() eq '' ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 41 | # Set default data_dir | ||||||||||||||||||||||||||||
| 42 | 0 | $self->set_data_dir( $default_dir ); | |||||||||||||||||||||||||||
| 43 | } else { | ||||||||||||||||||||||||||||
| 44 | # Check for ending slash | ||||||||||||||||||||||||||||
| 45 | 0 | my $data_dir = $self->get_data_dir(); | |||||||||||||||||||||||||||
| 46 | 0 | ▶ | if (! $data_dir =~ m#/$# ) { $self->set_data_dir( $data_dir . '/' ); } | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | # Make data_dir if it doesn't already exist | ||||||||||||||||||||||||||||
| 50 | 0 | ▶ | if (! -s $self->get_data_dir() ) { mkdir( $self->get_data_dir() ); } | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | # Load data if accn submitted | ||||||||||||||||||||||||||||
| 53 | 0 | ▶ | if ( defined $arg_ref->{accn} ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 54 | # Get meta data | ||||||||||||||||||||||||||||
| 55 | 0 | $self->meta( $arg_ref ); | |||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | # Check if sample data requested immediately | ||||||||||||||||||||||||||||
| 58 | 0 | ▶ | if ( defined $arg_ref->{data} ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 59 | 0 | ▶ | if ( $arg_ref->{data} == 1 ) { $self->data(); } | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||
| 63 | 0 | return; | |||||||||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||
| 66 | 0 | ▶ | sub desc { | ||||||||||||||||||||||||||
|
Subroutine
desc: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 67 | 0 | my ( $self ) = @_; | |||||||||||||||||||||||||||
| 68 | 0 | my $accn_type = $self->get_query_type(); | |||||||||||||||||||||||||||
| 69 | 0 | my $desc; | |||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||
| 71 | 0 | ▶ | if ( $accn_type eq 'GPL' ) { $desc = $self->_describe_platform(); } | ||||||||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||||||||
| 72 | 0 | elsif ( $accn_type eq 'GDS' ) { $desc = $self->_describe_data_set(); } | |||||||||||||||||||||||||||
| 73 | 0 | elsif ( $accn_type eq 'GSE' ) { $desc = $self->_describe_series(); } | |||||||||||||||||||||||||||
| 74 | 0 | elsif ( $accn_type eq 'GSM' ) { $desc = $self->_describe_sample(); } | |||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||
| 76 | 0 | return $desc; | |||||||||||||||||||||||||||
| 77 | } | ||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||
| 79 | 0 | ▶ | sub sample { my ( $self, $arg_ref ) = @_; $arg_ref->{data_dir} = $self->get_data_dir(); $arg_ref->{debug} = $self->debug(); return NCBIx::Geo::Sample->new( $arg_ref ); } | ||||||||||||||||||||||||||
|
Subroutine
sample: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||
| 81 | 0 | ▶ | sub meta { | ||||||||||||||||||||||||||
|
Subroutine
meta: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 82 | 0 | my ( $self, $arg_ref ) = @_; | |||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||
| 84 | 0 | ▶ | my $accn = defined $arg_ref->{accn} ? $arg_ref->{accn} : ''; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 85 | 0 | $self->set_query( $accn ); | |||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||
| 87 | 0 | my $accn_type = $self->get_accn_type( $arg_ref ); | |||||||||||||||||||||||||||
| 88 | 0 | $self->set_query_type( $accn_type ); | |||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||
| 90 | 0 | my $file = $self->get_doc({ accn => $accn }); | |||||||||||||||||||||||||||
| 91 | 0 | $self->parse_doc({ file => $file }); | |||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||
| 93 | 0 | return $self; | |||||||||||||||||||||||||||
| 94 | } | ||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||
| 96 | 0 | ▶ | sub data { | ||||||||||||||||||||||||||
|
Subroutine
data: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 97 | 0 | my ( $self ) = @_; | |||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||
| 99 | # Limit to one data_set | ||||||||||||||||||||||||||||
| 100 | 0 | ▶ | if ( $self->get_data_sets_count() == 1 ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 101 | # Foreach series | ||||||||||||||||||||||||||||
| 102 | 0 | my $series_list = $self->get_series(); | |||||||||||||||||||||||||||
| 103 | 0 | foreach my $series ( @$series_list ) { | |||||||||||||||||||||||||||
| 104 | # Get the file types | ||||||||||||||||||||||||||||
| 105 | 0 | my @file_exts = split( /\s/, $series->get_supp_file() ); | |||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||
| 107 | # Get sample list | ||||||||||||||||||||||||||||
| 108 | 0 | my @sample_accns = split( /;/, $series->get_sample_ids() ); | |||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||
| 110 | # Process each sample accn | ||||||||||||||||||||||||||||
| 111 | 0 | foreach my $sample_accn ( @sample_accns ) { | |||||||||||||||||||||||||||
| 112 | 0 | $self->get_sample_data({ accn => $sample_accn, exts => \@file_exts }); | |||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||
| 114 | } | ||||||||||||||||||||||||||||
| 115 | } else { | ||||||||||||||||||||||||||||
| 116 | 0 | my $data_sets_count = $self->get_data_sets_count() ; | |||||||||||||||||||||||||||
| 117 | 0 | $self->_debug( "\nNote: Too many data_sets found ($data_sets_count); no samples downloaded.\n Use a GDS, GSE, or GSM accession to download data." ); | |||||||||||||||||||||||||||
| 118 | } | ||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||
| 120 | 0 | return; | |||||||||||||||||||||||||||
| 121 | } | ||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||
| 123 | 0 | ▶ | sub diff { | ||||||||||||||||||||||||||
|
Subroutine
diff: not called CC=8 SCAR=42.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 124 | 0 | my ( $self, $arg_ref ) = @_; | |||||||||||||||||||||||||||
| 125 | 0 | ▶ | my @list = defined $arg_ref->{list} ? @{ $arg_ref->{list} } : (); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 126 | 0 | $self->_debug( "DIFF: " . join( ', ', @list ) ); | |||||||||||||||||||||||||||
| 127 | 0 | my $left_accn = shift( @list ); | |||||||||||||||||||||||||||
| 128 | 0 | my $left_sample = $self->sample({ accn => $left_accn }); | |||||||||||||||||||||||||||
| 129 | 0 | my $left_transcripts = $left_sample->get_transcripts(); | |||||||||||||||||||||||||||
| 130 | 0 | my @ids = split( ';', $left_sample->transcript_ids() ); | |||||||||||||||||||||||||||
| 131 | 0 | my $results; | |||||||||||||||||||||||||||
| 132 | |||||||||||||||||||||||||||||
| 133 | 0 | foreach my $right_accn ( @list ) { | |||||||||||||||||||||||||||
| 134 | 0 | my ( @left_present, @right_present ); | |||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||
| 136 | # Get the right transcripts | ||||||||||||||||||||||||||||
| 137 | 0 | my $right_sample = $self->sample({ accn => $right_accn }); | |||||||||||||||||||||||||||
| 138 | 0 | my $right_transcripts = $right_sample->get_transcripts(); | |||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||
| 140 | # Compare each transcript_id | ||||||||||||||||||||||||||||
| 141 | 0 | foreach my $transcript_id ( @ids ) { | |||||||||||||||||||||||||||
| 142 | 0 | my $ltran = $left_transcripts->{$transcript_id}->{call}; | |||||||||||||||||||||||||||
| 143 | 0 | my $rtran = $right_transcripts->{$transcript_id}->{call}; | |||||||||||||||||||||||||||
| 144 | |||||||||||||||||||||||||||||
| 145 | 0 | ▶ | if ( $ltran eq 'P' && $rtran eq 'A' ) { push @left_present, $transcript_id; } | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$ltran eq "P" and $rtran eq "A"
MC/DC0%0/2
$ltran eq "P" and $rtran eq "A"
$ltran eq "P"
$rtran eq "A"
Truth table0%0/3
A and B
A= $ltran eq "P"B= $rtran eq "A"
| |||||||||||||||||||||||||||||
| 146 | 0 | ▶ | if ( $ltran eq 'A' && $rtran eq 'P' ) { push @right_present, $transcript_id; } | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$ltran eq "A" and $rtran eq "P"
MC/DC0%0/2
$ltran eq "A" and $rtran eq "P"
$ltran eq "A"
$rtran eq "P"
Truth table0%0/3
A and B
A= $ltran eq "A"B= $rtran eq "P"
| |||||||||||||||||||||||||||||
| 147 | } | ||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||
| 149 | # Build diff results | ||||||||||||||||||||||||||||
| 150 | 0 | $results .= "<<$left_accn\n"; | |||||||||||||||||||||||||||
| 151 | 0 | $results .= join( ';', @left_present ) . "\n"; | |||||||||||||||||||||||||||
| 152 | 0 | $results .= ">>$right_accn\n"; | |||||||||||||||||||||||||||
| 153 | 0 | $results .= join( ';', @right_present ) . "\n"; | |||||||||||||||||||||||||||
| 154 | } | ||||||||||||||||||||||||||||
| 155 | |||||||||||||||||||||||||||||
| 156 | 0 | return $results; | |||||||||||||||||||||||||||
| 157 | } | ||||||||||||||||||||||||||||
| 158 | |||||||||||||||||||||||||||||
| 159 | 0 | ▶ | sub get_doc { | ||||||||||||||||||||||||||
|
Subroutine
get_doc: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 160 | 0 | my ( $self, $arg_ref ) = @_; | |||||||||||||||||||||||||||
| 161 | 0 | ▶ | my $accn = defined $arg_ref->{accn} ? $arg_ref->{accn} : ''; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 162 | 0 | my $file = $self->get_data_dir() . $accn . '.xml'; | |||||||||||||||||||||||||||
| 163 | |||||||||||||||||||||||||||||
| 164 | # Download XML file if it doesn't exist | ||||||||||||||||||||||||||||
| 165 | 0 | ▶ | if (! -s $file ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 166 | 0 | my $query = $accn . '[ACCN]'; | |||||||||||||||||||||||||||
| 167 | 0 | my $esearch = UTILS_URL . 'esearch.fcgi?'; | |||||||||||||||||||||||||||
| 168 | 0 | $esearch .= "db=$db&retmax=1&usehistory=y&term="; | |||||||||||||||||||||||||||
| 169 | 0 | my $result = get($esearch . $query); | |||||||||||||||||||||||||||
| 170 | |||||||||||||||||||||||||||||
| 171 | 0 | my ( $Count, $QueryKey, $WebEnv ) = $result =~ m|<Count>(\d+)</Count>.*<QueryKey>(\d+)</QueryKey>.*<WebEnv>(\S+)</WebEnv>|s; | |||||||||||||||||||||||||||
| 172 | |||||||||||||||||||||||||||||
| 173 | 0 | $self->_debug( "FOUND: $Count, $QueryKey, $WebEnv" ); | |||||||||||||||||||||||||||
| 174 | 0 | my $esummary = UTILS_URL . 'esummary.fcgi?'; | |||||||||||||||||||||||||||
| 175 | 0 | $esummary .= "db=$db&query_key=$QueryKey&WebEnv=$WebEnv"; | |||||||||||||||||||||||||||
| 176 | 0 | $result = get($esummary); | |||||||||||||||||||||||||||
| 177 | |||||||||||||||||||||||||||||
| 178 | 0 | open( OUTFILE, '>', $file ); | |||||||||||||||||||||||||||
| 179 | 0 | print OUTFILE $result; | |||||||||||||||||||||||||||
| 180 | 0 | close( OUTFILE ); | |||||||||||||||||||||||||||
| 181 | } | ||||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||
| 183 | 0 | return $file; | |||||||||||||||||||||||||||
| 184 | } | ||||||||||||||||||||||||||||
| 185 | |||||||||||||||||||||||||||||
| 186 | 0 | ▶ | sub parse_doc { | ||||||||||||||||||||||||||
|
Subroutine
parse_doc: not called CC=7 SCAR=40.3
Pod
undocumented
| |||||||||||||||||||||||||||||
| 187 | 0 | my ( $self, $arg_ref ) = @_; | |||||||||||||||||||||||||||
| 188 | 0 | ▶ | my $file = defined $arg_ref->{file} ? $arg_ref->{file} : ''; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 189 | 0 | $self->_debug( "PARSE EXISTING FILE: $file" ); | |||||||||||||||||||||||||||
| 190 | 0 | my $doc = XMLin( $file ); | |||||||||||||||||||||||||||
| 191 | 0 | my @items; | |||||||||||||||||||||||||||
| 192 | |||||||||||||||||||||||||||||
| 193 | 0 | my $triggers = { SeriesTitle => \&__parse_SeriesTitle, | |||||||||||||||||||||||||||
| 194 | n_samples => \&__parse_n_samples, | ||||||||||||||||||||||||||||
| 195 | gdsType => \&__parse_gdsType, | ||||||||||||||||||||||||||||
| 196 | ptechType => \&__parse_ptechType, | ||||||||||||||||||||||||||||
| 197 | Samples => \&__parse_Samples, | ||||||||||||||||||||||||||||
| 198 | Projects => \&__parse_Projects, | ||||||||||||||||||||||||||||
| 199 | GSE => \&__parse_GSE, | ||||||||||||||||||||||||||||
| 200 | summary => \&__parse_summary, | ||||||||||||||||||||||||||||
| 201 | GSM_titles_L => \&__parse_GSM_titles_L, | ||||||||||||||||||||||||||||
| 202 | PubMedIds => \&__parse_PubMedIds, | ||||||||||||||||||||||||||||
| 203 | Relations => \&__parse_Relations, | ||||||||||||||||||||||||||||
| 204 | GPL => \&__parse_GPL, | ||||||||||||||||||||||||||||
| 205 | SSInfo => \&__parse_SSInfo, | ||||||||||||||||||||||||||||
| 206 | suppFile => \&__parse_suppFile, | ||||||||||||||||||||||||||||
| 207 | taxon => \&__parse_taxon, | ||||||||||||||||||||||||||||
| 208 | GSM_L => \&__parse_GSM_L, | ||||||||||||||||||||||||||||
| 209 | entryType => \&__parse_entryType, | ||||||||||||||||||||||||||||
| 210 | valType => \&__parse_valType, | ||||||||||||||||||||||||||||
| 211 | PDAT => \&__parse_PDAT, | ||||||||||||||||||||||||||||
| 212 | PlatformTaxa => \&__parse_PlatformTaxa, | ||||||||||||||||||||||||||||
| 213 | SamplesTaxa => \&__parse_SamplesTaxa, | ||||||||||||||||||||||||||||
| 214 | GDS => \&__parse_GDS, | ||||||||||||||||||||||||||||
| 215 | subsetInfo => \&__parse_subsetInfo, | ||||||||||||||||||||||||||||
| 216 | title => \&__parse_title, | ||||||||||||||||||||||||||||
| 217 | PlatformTitle => \&__parse_PlatformTitle }; | ||||||||||||||||||||||||||||
| 218 | |||||||||||||||||||||||||||||
| 219 | 0 | my $item_list = $doc->{DocSum}; | |||||||||||||||||||||||||||
| 220 | 0 | my $count = @$item_list; $self->_debug( "Found $count items." ); | |||||||||||||||||||||||||||
| 221 | |||||||||||||||||||||||||||||
| 222 | 0 | foreach my $item ( @$item_list ) { | |||||||||||||||||||||||||||
| 223 | 0 | my $item_obj = NCBIx::Geo::Item->new(); | |||||||||||||||||||||||||||
| 224 | 0 | my $attr_list = $item->{Item}; | |||||||||||||||||||||||||||
| 225 | 0 | foreach my $attr ( @$attr_list ) { | |||||||||||||||||||||||||||
| 226 | 0 | &{ $triggers->{ $attr->{Name} } }( $item_obj, $attr ); | |||||||||||||||||||||||||||
| 227 | } | ||||||||||||||||||||||||||||
| 228 | |||||||||||||||||||||||||||||
| 229 | 0 | my $item_type = $item_obj->get_entry_type(); | |||||||||||||||||||||||||||
| 230 | 0 | my $item_id; | |||||||||||||||||||||||||||
| 231 | 0 | ▶ | if ( $item_type eq 'GPL' ) { $item_id = $item_obj->get_gpl(); } | ||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||
| 232 | 0 | elsif ( $item_type eq 'GDS' ) { $item_id = $item_obj->get_gds(); } | |||||||||||||||||||||||||||
| 233 | 0 | elsif ( $item_type eq 'GSE' ) { $item_id = $item_obj->get_gse(); } | |||||||||||||||||||||||||||
| 234 | 0 | $self->_debug( "PARSE ITEM: $item_type$item_id" ); | |||||||||||||||||||||||||||
| 235 | |||||||||||||||||||||||||||||
| 236 | 0 | my $test = $item_obj->check_sample_count(); | |||||||||||||||||||||||||||
| 237 | |||||||||||||||||||||||||||||
| 238 | # Add the item | ||||||||||||||||||||||||||||
| 239 | 0 | my $accn_type = $item_obj->get_entry_type(); | |||||||||||||||||||||||||||
| 240 | 0 | $self->add_item({ $accn_type => $item_obj }); | |||||||||||||||||||||||||||
| 241 | |||||||||||||||||||||||||||||
| 242 | 0 | push @items, $item_obj; | |||||||||||||||||||||||||||
| 243 | } | ||||||||||||||||||||||||||||
| 244 | |||||||||||||||||||||||||||||
| 245 | 0 | return @items; | |||||||||||||||||||||||||||
| 246 | #return $self; | ||||||||||||||||||||||||||||
| 247 | } | ||||||||||||||||||||||||||||
| 248 | |||||||||||||||||||||||||||||
| 249 | 0 | ▶ | sub add_item { | ||||||||||||||||||||||||||
|
Subroutine
add_item: not called CC=13 SCAR=52.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 250 | 0 | my ( $self, $arg_ref ) = @_; | |||||||||||||||||||||||||||
| 251 | 0 | my ( $item, @items ); | |||||||||||||||||||||||||||
| 252 | |||||||||||||||||||||||||||||
| 253 | 0 | ▶ | my $gpl = defined $arg_ref->{GPL} ? $arg_ref->{GPL} : ''; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 254 | 0 | ▶ | my $gds = defined $arg_ref->{GDS} ? $arg_ref->{GDS} : ''; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 255 | 0 | ▶ | my $gse = defined $arg_ref->{GSE} ? $arg_ref->{GSE} : ''; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 256 | 0 | ▶ | my $gsm = defined $arg_ref->{GSM} ? $arg_ref->{GSM} : ''; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 257 | |||||||||||||||||||||||||||||
| 258 | 0 | @items = (); | |||||||||||||||||||||||||||
| 259 | |||||||||||||||||||||||||||||
| 260 | 0 | ▶ | if ( $gpl ) { $item = $arg_ref->{GPL}; @items = @{ $self->get_platforms() }; } | ||||||||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||||||||
| 261 | 0 | elsif ( $gds ) { $item = $arg_ref->{GDS}; @items = @{ $self->get_data_sets() }; } | |||||||||||||||||||||||||||
| 262 | 0 | elsif ( $gse ) { $item = $arg_ref->{GSE}; @items = @{ $self->get_series() }; } | |||||||||||||||||||||||||||
| 263 | 0 | elsif ( $gsm ) { $item = $arg_ref->{GSM}; @items = @{ $self->get_samples() }; } | |||||||||||||||||||||||||||
| 264 | |||||||||||||||||||||||||||||
| 265 | 0 | push @items, $item; | |||||||||||||||||||||||||||
| 266 | |||||||||||||||||||||||||||||
| 267 | 0 | ▶ | if ( $gpl ) { $self->set_platforms( \@items ); $self->set_platforms_count( scalar( @items ) ); } | ||||||||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||||||||
| 268 | 0 | elsif ( $gds ) { $self->set_data_sets( \@items ); $self->set_data_sets_count( scalar( @items ) ); } | |||||||||||||||||||||||||||
| 269 | 0 | elsif ( $gse ) { $self->set_series( \@items ); $self->set_series_count( scalar( @items ) ); } | |||||||||||||||||||||||||||
| 270 | 0 | elsif ( $gsm ) { $self->set_samples( \@items ); $self->set_samples_count( scalar( @items ) ); } | |||||||||||||||||||||||||||
| 271 | |||||||||||||||||||||||||||||
| 272 | 0 | return $self; | |||||||||||||||||||||||||||
| 273 | } | ||||||||||||||||||||||||||||
| 274 | |||||||||||||||||||||||||||||
| 275 | 0 | ▶ | sub _describe_platform() { | ||||||||||||||||||||||||||
|
Subroutine
_describe_platform: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||
| 276 | 0 | my ( $self ) = @_; | |||||||||||||||||||||||||||
| 277 | 0 | my $accn = $self->get_query(); | |||||||||||||||||||||||||||
| 278 | 0 | my $accn_id = $accn; | |||||||||||||||||||||||||||
| 279 | 0 | $accn_id =~ s/^.{3}//; | |||||||||||||||||||||||||||
| 280 | 0 | my $desc; | |||||||||||||||||||||||||||
| 281 | |||||||||||||||||||||||||||||
| 282 | 0 | my $platforms = $self->get_platforms(); | |||||||||||||||||||||||||||
| 283 | 0 | foreach my $platform ( @$platforms ) { | |||||||||||||||||||||||||||
| 284 | 0 | ▶ | if ( $platform->get_gpl() eq $accn_id ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 285 | 0 | my $title = $platform->get_title(); | |||||||||||||||||||||||||||
| 286 | 0 | my $summary = $platform->get_summary(); | |||||||||||||||||||||||||||
| 287 | 0 | my $taxon = $platform->get_taxon(); | |||||||||||||||||||||||||||
| 288 | 0 | my $ptech_type = $platform->get_ptech_type(); | |||||||||||||||||||||||||||
| 289 | |||||||||||||||||||||||||||||
| 290 | 0 | my @gds = split( ';', $platform->get_gds() ); | |||||||||||||||||||||||||||
| 291 | 0 | my $data_set_count = scalar( @gds ); | |||||||||||||||||||||||||||
| 292 | |||||||||||||||||||||||||||||
| 293 | 0 | my @gse = split( ';', $platform->get_gse() ); | |||||||||||||||||||||||||||
| 294 | 0 | my $series_count = scalar( @gse ); | |||||||||||||||||||||||||||
| 295 | |||||||||||||||||||||||||||||
| 296 | 0 | $desc = " Platform: $accn \n"; | |||||||||||||||||||||||||||
| 297 | 0 | $desc .= " Title: $title \n"; | |||||||||||||||||||||||||||
| 298 | 0 | $desc .= "Tech Type: $ptech_type \n"; | |||||||||||||||||||||||||||
| 299 | 0 | $desc .= " Taxon: $taxon \n"; | |||||||||||||||||||||||||||
| 300 | 0 | $desc .= " Datasets: $data_set_count \n"; | |||||||||||||||||||||||||||
| 301 | 0 | $desc .= " Series: $series_count \n"; | |||||||||||||||||||||||||||
| 302 | 0 | $desc .= " Summary: $summary \n"; | |||||||||||||||||||||||||||
| 303 | |||||||||||||||||||||||||||||
| 304 | 0 | last; | |||||||||||||||||||||||||||
| 305 | } | ||||||||||||||||||||||||||||
| 306 | } | ||||||||||||||||||||||||||||
| 307 | 0 | return "\n$desc\n"; | |||||||||||||||||||||||||||
| 308 | } | ||||||||||||||||||||||||||||
| 309 | |||||||||||||||||||||||||||||
| 310 | 0 | ▶ | sub _describe_data_set() { | ||||||||||||||||||||||||||
|
Subroutine
_describe_data_set: not called CC=6 SCAR=37.4
| |||||||||||||||||||||||||||||
| 311 | 0 | my ( $self ) = @_; | |||||||||||||||||||||||||||
| 312 | 0 | my $accn = $self->get_query(); | |||||||||||||||||||||||||||
| 313 | 0 | my $accn_id = $accn; | |||||||||||||||||||||||||||
| 314 | 0 | $accn_id =~ s/^.{3}//; | |||||||||||||||||||||||||||
| 315 | 0 | my $desc; | |||||||||||||||||||||||||||
| 316 | |||||||||||||||||||||||||||||
| 317 | 0 | my $data_sets = $self->get_data_sets(); | |||||||||||||||||||||||||||
| 318 | 0 | foreach my $data_set ( @$data_sets ) { | |||||||||||||||||||||||||||
| 319 | 0 | ▶ | if ( $data_set->get_gds() eq $accn_id ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 320 | 0 | my $title = $data_set->get_title(); | |||||||||||||||||||||||||||
| 321 | 0 | my $summary = $data_set->get_summary(); | |||||||||||||||||||||||||||
| 322 | 0 | my $taxon = $data_set->get_taxon(); | |||||||||||||||||||||||||||
| 323 | |||||||||||||||||||||||||||||
| 324 | 0 | my @gse = split( ';', $data_set->get_gse() ); | |||||||||||||||||||||||||||
| 325 | 0 | my $series_count = scalar( @gse ); | |||||||||||||||||||||||||||
| 326 | |||||||||||||||||||||||||||||
| 327 | 0 | my @gsm_ids = split( ';', $data_set->get_gsm_l() ); | |||||||||||||||||||||||||||
| 328 | 0 | my @gsm_titles = split( ';', $data_set->get_gsm_titles_l() ); | |||||||||||||||||||||||||||
| 329 | 0 | my $samples_count = scalar( @gsm_ids ); | |||||||||||||||||||||||||||
| 330 | |||||||||||||||||||||||||||||
| 331 | 0 | my @gpl = split( ';', $data_set->get_gpl() ); | |||||||||||||||||||||||||||
| 332 | 0 | my $platform_count = scalar( @gpl ); | |||||||||||||||||||||||||||
| 333 | 0 | my ( $gpl_accn, $gpl_title ); | |||||||||||||||||||||||||||
| 334 | 0 | ▶ | if ( $platform_count == 1 ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 335 | 0 | $gpl_accn = 'GPL' . $self->get_platforms()->[0]->get_gpl(); | |||||||||||||||||||||||||||
| 336 | 0 | $gpl_title = $self->get_platforms()->[0]->get_title(); | |||||||||||||||||||||||||||
| 337 | } | ||||||||||||||||||||||||||||
| 338 | |||||||||||||||||||||||||||||
| 339 | 0 | $desc = " Data Set: $accn $title \n"; | |||||||||||||||||||||||||||
| 340 | 0 | $desc .= " Taxon: $taxon \n"; | |||||||||||||||||||||||||||
| 341 | 0 | ▶ | if ( $gpl_accn ) { $desc .= " Platform: $gpl_accn $gpl_title \n"; } | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 342 | 0 | $desc .= "GSE Count: $series_count \n"; | |||||||||||||||||||||||||||
| 343 | 0 | $desc .= "GSM Count: $samples_count \n"; | |||||||||||||||||||||||||||
| 344 | 0 | $desc .= " Summary: $summary \n"; | |||||||||||||||||||||||||||
| 345 | |||||||||||||||||||||||||||||
| 346 | # Show samples | ||||||||||||||||||||||||||||
| 347 | 0 | my @samples; | |||||||||||||||||||||||||||
| 348 | 0 | ▶ | foreach ( my $i = 0; $i < @gsm_ids; $i++ ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 349 | 0 | push @samples, "GSM$gsm_ids[$i] $gsm_titles[$i]"; | |||||||||||||||||||||||||||
| 350 | } | ||||||||||||||||||||||||||||
| 351 | 0 | $desc .= "\n Samples: " . join( "\n ", @samples ) . "\n"; | |||||||||||||||||||||||||||
| 352 | |||||||||||||||||||||||||||||
| 353 | 0 | last; | |||||||||||||||||||||||||||
| 354 | } | ||||||||||||||||||||||||||||
| 355 | } | ||||||||||||||||||||||||||||
| 356 | 0 | return "\n$desc\n"; | |||||||||||||||||||||||||||
| 357 | } | ||||||||||||||||||||||||||||
| 358 | |||||||||||||||||||||||||||||
| 359 | 0 | ▶ | sub _describe_series() { | ||||||||||||||||||||||||||
|
Subroutine
_describe_series: not called CC=8 SCAR=42.8
| |||||||||||||||||||||||||||||
| 360 | 0 | my ( $self ) = @_; | |||||||||||||||||||||||||||
| 361 | 0 | my $accn = $self->get_query(); | |||||||||||||||||||||||||||
| 362 | 0 | my $accn_id = $accn; | |||||||||||||||||||||||||||
| 363 | 0 | $accn_id =~ s/^.{3}//; | |||||||||||||||||||||||||||
| 364 | 0 | my $desc; | |||||||||||||||||||||||||||
| 365 | |||||||||||||||||||||||||||||
| 366 | 0 | my $series_list = $self->get_series(); | |||||||||||||||||||||||||||
| 367 | 0 | foreach my $series ( @$series_list ) { | |||||||||||||||||||||||||||
| 368 | 0 | ▶ | if ( $series->get_gse() eq $accn_id ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 369 | 0 | my $title = $series->get_title(); | |||||||||||||||||||||||||||
| 370 | 0 | my $summary = $series->get_summary(); | |||||||||||||||||||||||||||
| 371 | 0 | my $taxon = $series->get_taxon(); | |||||||||||||||||||||||||||
| 372 | |||||||||||||||||||||||||||||
| 373 | 0 | my @gpl = split( ';', $series->get_gpl() ); | |||||||||||||||||||||||||||
| 374 | 0 | my $platform_count = scalar( @gpl ); | |||||||||||||||||||||||||||
| 375 | 0 | my ( $gpl_accn, $gpl_title ); | |||||||||||||||||||||||||||
| 376 | 0 | ▶ | if ( $platform_count == 1 ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 377 | 0 | $gpl_accn = 'GPL' . $self->get_platforms()->[0]->get_gpl(); | |||||||||||||||||||||||||||
| 378 | 0 | $gpl_title = $self->get_platforms()->[0]->get_title(); | |||||||||||||||||||||||||||
| 379 | } | ||||||||||||||||||||||||||||
| 380 | |||||||||||||||||||||||||||||
| 381 | 0 | my @gds = split( ';', $series->get_gds() ); | |||||||||||||||||||||||||||
| 382 | 0 | my $data_set_count = scalar( @gds ); | |||||||||||||||||||||||||||
| 383 | 0 | my ( $gds_accn, $gds_title ); | |||||||||||||||||||||||||||
| 384 | 0 | ▶ | if ( $data_set_count == 1 ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 385 | 0 | $gds_accn = 'GDS' . $self->get_data_sets()->[0]->get_gds(); | |||||||||||||||||||||||||||
| 386 | 0 | $gds_title = $self->get_data_sets()->[0]->get_title(); | |||||||||||||||||||||||||||
| 387 | } | ||||||||||||||||||||||||||||
| 388 | |||||||||||||||||||||||||||||
| 389 | 0 | my @gsm_ids = split( ';', $series->get_gsm_l() ); | |||||||||||||||||||||||||||
| 390 | 0 | my @gsm_titles = split( ';', $series->get_gsm_titles_l() ); | |||||||||||||||||||||||||||
| 391 | 0 | my $samples_count = scalar( @gsm_ids ); | |||||||||||||||||||||||||||
| 392 | |||||||||||||||||||||||||||||
| 393 | 0 | $desc = " Series: $accn $title \n"; | |||||||||||||||||||||||||||
| 394 | 0 | $desc .= " Taxon: $taxon \n"; | |||||||||||||||||||||||||||
| 395 | 0 | ▶ | if ( $gpl_accn ) { $desc .= " Platform: $gpl_accn $gpl_title \n"; } | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 396 | 0 | ▶ | if ( $gds_accn ) { $desc .= " Data Set: $gds_accn $gds_title \n"; } | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 397 | 0 | $desc .= "GDS Count: $data_set_count \n"; | |||||||||||||||||||||||||||
| 398 | 0 | $desc .= "GSM Count: $samples_count \n"; | |||||||||||||||||||||||||||
| 399 | 0 | $desc .= " Summary: $summary \n"; | |||||||||||||||||||||||||||
| 400 | |||||||||||||||||||||||||||||
| 401 | # Show samples | ||||||||||||||||||||||||||||
| 402 | 0 | my @samples; | |||||||||||||||||||||||||||
| 403 | 0 | ▶ | foreach ( my $i = 0; $i < @gsm_ids; $i++ ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 404 | 0 | push @samples, "GSM$gsm_ids[$i] $gsm_titles[$i]"; | |||||||||||||||||||||||||||
| 405 | } | ||||||||||||||||||||||||||||
| 406 | 0 | $desc .= "\n Samples: " . join( "\n ", @samples ) . "\n"; | |||||||||||||||||||||||||||
| 407 | |||||||||||||||||||||||||||||
| 408 | 0 | last; | |||||||||||||||||||||||||||
| 409 | } | ||||||||||||||||||||||||||||
| 410 | } | ||||||||||||||||||||||||||||
| 411 | 0 | return "\n$desc\n"; | |||||||||||||||||||||||||||
| 412 | } | ||||||||||||||||||||||||||||
| 413 | |||||||||||||||||||||||||||||
| 414 | 0 | ▶ | sub _describe_sample() { | ||||||||||||||||||||||||||
|
Subroutine
_describe_sample: not called CC=5 SCAR=34.0
| |||||||||||||||||||||||||||||
| 415 | 0 | my ( $self ) = @_; | |||||||||||||||||||||||||||
| 416 | 0 | my $gsm_accn = $self->get_query(); | |||||||||||||||||||||||||||
| 417 | 0 | my $accn_id = $gsm_accn; | |||||||||||||||||||||||||||
| 418 | 0 | $accn_id =~ s/^.{3}//; | |||||||||||||||||||||||||||
| 419 | 0 | my $desc; | |||||||||||||||||||||||||||
| 420 | |||||||||||||||||||||||||||||
| 421 | 0 | my $series_list = $self->get_series(); | |||||||||||||||||||||||||||
| 422 | 0 | foreach my $series ( @$series_list ) { | |||||||||||||||||||||||||||
| 423 | 0 | ▶ | if ( $series->get_gsm_l() =~ $accn_id ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 424 | 0 | my @gsm_ids = split( ';', $series->get_gsm_l() ); | |||||||||||||||||||||||||||
| 425 | 0 | my @gsm_titles = split( ';', $series->get_gsm_titles_l() ); | |||||||||||||||||||||||||||
| 426 | |||||||||||||||||||||||||||||
| 427 | 0 | my $gsm_title; | |||||||||||||||||||||||||||
| 428 | 0 | ▶ | for ( my $i = 0; $i < @gsm_ids; $i++ ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 429 | 0 | ▶ | if ( $gsm_ids[$i] eq $accn_id ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 430 | 0 | $gsm_title = $gsm_titles[$i]; | |||||||||||||||||||||||||||
| 431 | } | ||||||||||||||||||||||||||||
| 432 | } | ||||||||||||||||||||||||||||
| 433 | |||||||||||||||||||||||||||||
| 434 | 0 | my $gse_title = $series->get_title(); | |||||||||||||||||||||||||||
| 435 | 0 | my $gse_accn = 'GSE' . $series->get_gse(); | |||||||||||||||||||||||||||
| 436 | 0 | my $summary = $series->get_summary(); | |||||||||||||||||||||||||||
| 437 | 0 | my $taxon = $series->get_taxon(); | |||||||||||||||||||||||||||
| 438 | |||||||||||||||||||||||||||||
| 439 | 0 | my $gpl_accn = 'GPL' . $self->get_platforms()->[0]->get_gpl(); | |||||||||||||||||||||||||||
| 440 | 0 | my $gpl_title = $self->get_platforms()->[0]->get_title(); | |||||||||||||||||||||||||||
| 441 | 0 | my $gds_accn = 'GDS' . $self->get_data_sets()->[0]->get_gds(); | |||||||||||||||||||||||||||
| 442 | 0 | my $gds_title = $self->get_data_sets()->[0]->get_title(); | |||||||||||||||||||||||||||
| 443 | |||||||||||||||||||||||||||||
| 444 | 0 | $desc = " Sample: $gsm_accn $gsm_title \n"; | |||||||||||||||||||||||||||
| 445 | 0 | $desc .= " Taxon: $taxon \n"; | |||||||||||||||||||||||||||
| 446 | 0 | $desc .= " Platform: $gpl_accn $gpl_title \n"; | |||||||||||||||||||||||||||
| 447 | 0 | $desc .= " Data Set: $gds_accn $gds_title \n"; | |||||||||||||||||||||||||||
| 448 | 0 | $desc .= " Series: $gse_accn $gse_title \n"; | |||||||||||||||||||||||||||
| 449 | 0 | $desc .= " Summary: $summary \n"; | |||||||||||||||||||||||||||
| 450 | |||||||||||||||||||||||||||||
| 451 | 0 | last; | |||||||||||||||||||||||||||
| 452 | } | ||||||||||||||||||||||||||||
| 453 | } | ||||||||||||||||||||||||||||
| 454 | 0 | return "\n$desc\n"; | |||||||||||||||||||||||||||
| 455 | } | ||||||||||||||||||||||||||||
| 456 | |||||||||||||||||||||||||||||
| 457 | 0 | ▶ | sub __parse_SeriesTitle { | ||||||||||||||||||||||||||
|
Subroutine
__parse_SeriesTitle: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 458 | 0 | my ( $item_obj, $data ) = @_; | |||||||||||||||||||||||||||
| 459 | 0 | $item_obj->set_series_title( __parse_string( $data ) ); | |||||||||||||||||||||||||||
| 460 | } | ||||||||||||||||||||||||||||
| 461 | |||||||||||||||||||||||||||||
| 462 | 0 | ▶ | sub __parse_n_samples { | ||||||||||||||||||||||||||
|
Subroutine
__parse_n_samples: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 463 | 0 | my ( $item_obj, $data ) = @_; | |||||||||||||||||||||||||||
| 464 | 0 | $item_obj->set_n_samples( __parse_integer( $data ) ); | |||||||||||||||||||||||||||
| 465 | } | ||||||||||||||||||||||||||||
| 466 | |||||||||||||||||||||||||||||
| 467 | 0 | ▶ | sub __parse_gdsType { | ||||||||||||||||||||||||||
|
Subroutine
__parse_gdsType: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 468 | 0 | my ( $item_obj, $data ) = @_; | |||||||||||||||||||||||||||
| 469 | 0 | $item_obj->set_gds_type( __parse_string( $data ) ); | |||||||||||||||||||||||||||
| 470 | } | ||||||||||||||||||||||||||||
| 471 | |||||||||||||||||||||||||||||
| 472 | 0 | ▶ | sub __parse_ptechType { | ||||||||||||||||||||||||||
|
Subroutine
__parse_ptechType: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 473 | 0 | my ( $item_obj, $data ) = @_; | |||||||||||||||||||||||||||
| 474 | 0 | $item_obj->set_ptech_type( __parse_string( $data ) ); | |||||||||||||||||||||||||||
| 475 | } | ||||||||||||||||||||||||||||
| 476 | |||||||||||||||||||||||||||||
| 477 | 0 | ▶ | sub __parse_Samples { | ||||||||||||||||||||||||||
|
Subroutine
__parse_Samples: not called CC=6 SCAR=37.4
| |||||||||||||||||||||||||||||
| 478 | 0 | my ( $item_obj, $data ) = @_; | |||||||||||||||||||||||||||
| 479 | 0 | my @values; | |||||||||||||||||||||||||||
| 480 | 0 | ▶ | if ( defined $data->{Item} ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 481 | 0 | ▶ | if ( $data->{Item} =~ m/ARRAY/ ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 482 | 0 | foreach my $item ( @{ $data->{Item} } ) { | |||||||||||||||||||||||||||
| 483 | 0 | ▶ | if ( $item->{Type} =~ m/Structure/ ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 484 | 0 | my $attr_list = $item->{Item}; | |||||||||||||||||||||||||||
| 485 | 0 | my %attr; | |||||||||||||||||||||||||||
| 486 | 0 | foreach my $attr ( @$attr_list ) { | |||||||||||||||||||||||||||
| 487 | 0 | my $key = $attr->{Name}; | |||||||||||||||||||||||||||
| 488 | 0 | my $value = $attr->{content}; | |||||||||||||||||||||||||||
| 489 | 0 | $attr{$key} = $value; | |||||||||||||||||||||||||||
| 490 | } | ||||||||||||||||||||||||||||
| 491 | 0 | push @values, { Accession => $attr{Accession}, Title => $attr{Title} }; | |||||||||||||||||||||||||||
| 492 | } else { | ||||||||||||||||||||||||||||
| 493 | 0 | __exception( $data ); | |||||||||||||||||||||||||||
| 494 | } | ||||||||||||||||||||||||||||
| 495 | } | ||||||||||||||||||||||||||||
| 496 | } else { | ||||||||||||||||||||||||||||
| 497 | 0 | __exception( $data ); | |||||||||||||||||||||||||||
| 498 | } | ||||||||||||||||||||||||||||
| 499 | } | ||||||||||||||||||||||||||||
| 500 | 0 | $item_obj->set_samples_count( scalar(@values) ); | |||||||||||||||||||||||||||
| 501 | 0 | $item_obj->set_samples( \@values ); | |||||||||||||||||||||||||||
| 502 | } | ||||||||||||||||||||||||||||
| 503 | |||||||||||||||||||||||||||||
| 504 | 0 | ▶ | sub __parse_Projects { | ||||||||||||||||||||||||||
|
Subroutine
__parse_Projects: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 505 | 0 | my ( $item_obj, $data ) = @_; | |||||||||||||||||||||||||||
| 506 | 0 | $item_obj->set_projects( '' ); # Have yet to see an example with data | |||||||||||||||||||||||||||
| 507 | } | ||||||||||||||||||||||||||||
| 508 | |||||||||||||||||||||||||||||
| 509 | 0 | ▶ | sub __parse_GSE { | ||||||||||||||||||||||||||
|
Subroutine
__parse_GSE: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 510 | 0 | my ( $item_obj, $data ) = @_; | |||||||||||||||||||||||||||
| 511 | 0 | $item_obj->set_gse( __parse_string( $data ) ); | |||||||||||||||||||||||||||
| 512 | } | ||||||||||||||||||||||||||||
| 513 | |||||||||||||||||||||||||||||
| 514 | 0 | ▶ | sub __parse_summary { | ||||||||||||||||||||||||||
|
Subroutine
__parse_summary: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 515 | 0 | my ( $item_obj, $data ) = @_; | |||||||||||||||||||||||||||
| 516 | 0 | $item_obj->set_summary( __parse_string( $data ) ); | |||||||||||||||||||||||||||
| 517 | } | ||||||||||||||||||||||||||||
| 518 | |||||||||||||||||||||||||||||
| 519 | 0 | ▶ | sub __parse_GSM_titles_L { | ||||||||||||||||||||||||||
|
Subroutine
__parse_GSM_titles_L: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 520 | 0 | my ( $item_obj, $data ) = @_; | |||||||||||||||||||||||||||
| 521 | 0 | $item_obj->set_gsm_titles_l( __parse_string( $data ) ); | |||||||||||||||||||||||||||
| 522 | } | ||||||||||||||||||||||||||||
| 523 | |||||||||||||||||||||||||||||
| 524 | 0 | ▶ | sub __parse_PubMedIds { | ||||||||||||||||||||||||||
|
Subroutine
__parse_PubMedIds: not called CC=7 SCAR=40.3
| |||||||||||||||||||||||||||||
| 525 | 0 | my ( $item_obj, $data ) = @_; | |||||||||||||||||||||||||||
| 526 | 0 | my @values; | |||||||||||||||||||||||||||
| 527 | 0 | ▶ | if ( defined $data->{Item} ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 528 | 0 | ▶ | if ( $data->{Item} =~ m/ARRAY/ ) { | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 529 | 0 | foreach my $item ( @{ $data->{Item} } ) { | |||||||||||||||||||||||||||
| 530 | 0 | ▶ | if ( defined $item->{content} ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 531 | 0 | push @values, $item->{content}; | |||||||||||||||||||||||||||
| 532 | } | ||||||||||||||||||||||||||||
| 533 | } | ||||||||||||||||||||||||||||
| 534 | } elsif ( $data->{Item} =~ m/HASH/ ) { | ||||||||||||||||||||||||||||
| 535 | 0 | my $item = $data->{Item}; | |||||||||||||||||||||||||||
| 536 | 0 | ▶ | if ( defined $item->{content} ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 537 | 0 | push @values, $item->{content}; | |||||||||||||||||||||||||||
| 538 | } | ||||||||||||||||||||||||||||
| 539 | } else { | ||||||||||||||||||||||||||||
| 540 | 0 | __exception( $data ); | |||||||||||||||||||||||||||
| 541 | } | ||||||||||||||||||||||||||||
| 542 | } | ||||||||||||||||||||||||||||
| 543 | 0 | $item_obj->set_pubmed_ids( join( ';', @values ) ); | |||||||||||||||||||||||||||
| 544 | } | ||||||||||||||||||||||||||||
| 545 | |||||||||||||||||||||||||||||
| 546 | 0 | ▶ | sub __parse_Relations { | ||||||||||||||||||||||||||
|
Subroutine
__parse_Relations: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 547 | 0 | my ( $item_obj, $data ) = @_; | |||||||||||||||||||||||||||
| 548 | 0 | $item_obj->set_relations( '' ); # Have yet to see an example with data | |||||||||||||||||||||||||||
| 549 | } | ||||||||||||||||||||||||||||
| 550 | |||||||||||||||||||||||||||||
| 551 | 0 | ▶ | sub __parse_GPL { | ||||||||||||||||||||||||||
|
Subroutine
__parse_GPL: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 552 | 0 | my ( $item_obj, $data ) = @_; | |||||||||||||||||||||||||||
| 553 | 0 | $item_obj->set_gpl( __parse_string( $data ) ); | |||||||||||||||||||||||||||
| 554 | } | ||||||||||||||||||||||||||||
| 555 | |||||||||||||||||||||||||||||
| 556 | 0 | ▶ | sub __parse_SSInfo { | ||||||||||||||||||||||||||
|
Subroutine
__parse_SSInfo: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 557 | 0 | my ( $item_obj, $data ) = @_; | |||||||||||||||||||||||||||
| 558 | 0 | $item_obj->set_ss_info( __parse_string( $data ) ); | |||||||||||||||||||||||||||
| 559 | } | ||||||||||||||||||||||||||||
| 560 | |||||||||||||||||||||||||||||
| 561 | 0 | ▶ | sub __parse_suppFile { | ||||||||||||||||||||||||||
|
Subroutine
__parse_suppFile: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 562 | 0 | my ( $item_obj, $data ) = @_; | |||||||||||||||||||||||||||
| 563 | 0 | $item_obj->set_supp_file( __parse_string( $data ) ); | |||||||||||||||||||||||||||
| 564 | } | ||||||||||||||||||||||||||||
| 565 | |||||||||||||||||||||||||||||
| 566 | 0 | ▶ | sub __parse_taxon { | ||||||||||||||||||||||||||
|
Subroutine
__parse_taxon: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 567 | 0 | my ( $item_obj, $data ) = @_; | |||||||||||||||||||||||||||
| 568 | 0 | $item_obj->set_taxon( __parse_string( $data ) ); | |||||||||||||||||||||||||||
| 569 | } | ||||||||||||||||||||||||||||
| 570 | |||||||||||||||||||||||||||||
| 571 | 0 | ▶ | sub __parse_GSM_L { | ||||||||||||||||||||||||||
|
Subroutine
__parse_GSM_L: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 572 | 0 | my ( $item_obj, $data ) = @_; | |||||||||||||||||||||||||||
| 573 | 0 | $item_obj->set_gsm_l( __parse_string( $data ) ); | |||||||||||||||||||||||||||
| 574 | } | ||||||||||||||||||||||||||||
| 575 | |||||||||||||||||||||||||||||
| 576 | 0 | ▶ | sub __parse_entryType { | ||||||||||||||||||||||||||
|
Subroutine
__parse_entryType: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 577 | 0 | my ( $item_obj, $data ) = @_; | |||||||||||||||||||||||||||
| 578 | 0 | $item_obj->set_entry_type( __parse_string( $data ) ); | |||||||||||||||||||||||||||
| 579 | } | ||||||||||||||||||||||||||||
| 580 | |||||||||||||||||||||||||||||
| 581 | 0 | ▶ | sub __parse_valType { | ||||||||||||||||||||||||||
|
Subroutine
__parse_valType: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 582 | 0 | my ( $item_obj, $data ) = @_; | |||||||||||||||||||||||||||
| 583 | 0 | $item_obj->set_val_type( __parse_string( $data ) ); | |||||||||||||||||||||||||||
| 584 | } | ||||||||||||||||||||||||||||
| 585 | |||||||||||||||||||||||||||||
| 586 | 0 | ▶ | sub __parse_PDAT { | ||||||||||||||||||||||||||
|
Subroutine
__parse_PDAT: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 587 | 0 | my ( $item_obj, $data ) = @_; | |||||||||||||||||||||||||||
| 588 | 0 | $item_obj->set_pdat( __parse_string( $data ) ); | |||||||||||||||||||||||||||
| 589 | } | ||||||||||||||||||||||||||||
| 590 | |||||||||||||||||||||||||||||
| 591 | 0 | ▶ | sub __parse_PlatformTaxa { | ||||||||||||||||||||||||||
|
Subroutine
__parse_PlatformTaxa: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 592 | 0 | my ( $item_obj, $data ) = @_; | |||||||||||||||||||||||||||
| 593 | 0 | $item_obj->set_platform_taxa( __parse_string( $data ) ); | |||||||||||||||||||||||||||
| 594 | } | ||||||||||||||||||||||||||||
| 595 | |||||||||||||||||||||||||||||
| 596 | 0 | ▶ | sub __parse_SamplesTaxa { | ||||||||||||||||||||||||||
|
Subroutine
__parse_SamplesTaxa: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 597 | 0 | my ( $item_obj, $data ) = @_; | |||||||||||||||||||||||||||
| 598 | 0 | $item_obj->set_samples_taxa( __parse_string( $data ) ); | |||||||||||||||||||||||||||
| 599 | } | ||||||||||||||||||||||||||||
| 600 | |||||||||||||||||||||||||||||
| 601 | 0 | ▶ | sub __parse_GDS { | ||||||||||||||||||||||||||
|
Subroutine
__parse_GDS: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 602 | 0 | my ( $item_obj, $data ) = @_; | |||||||||||||||||||||||||||
| 603 | 0 | $item_obj->set_gds( __parse_string( $data ) ); | |||||||||||||||||||||||||||
| 604 | } | ||||||||||||||||||||||||||||
| 605 | |||||||||||||||||||||||||||||
| 606 | 0 | ▶ | sub __parse_subsetInfo { | ||||||||||||||||||||||||||
|
Subroutine
__parse_subsetInfo: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 607 | 0 | my ( $item_obj, $data ) = @_; | |||||||||||||||||||||||||||
| 608 | 0 | $item_obj->set_subset_info( __parse_string( $data ) ); | |||||||||||||||||||||||||||
| 609 | } | ||||||||||||||||||||||||||||
| 610 | |||||||||||||||||||||||||||||
| 611 | 0 | ▶ | sub __parse_title { | ||||||||||||||||||||||||||
|
Subroutine
__parse_title: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 612 | 0 | my ( $item_obj, $data ) = @_; | |||||||||||||||||||||||||||
| 613 | 0 | $item_obj->set_title( __parse_string( $data ) ); | |||||||||||||||||||||||||||
| 614 | } | ||||||||||||||||||||||||||||
| 615 | |||||||||||||||||||||||||||||
| 616 | 0 | ▶ | sub __parse_PlatformTitle { | ||||||||||||||||||||||||||
|
Subroutine
__parse_PlatformTitle: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 617 | 0 | my ( $item_obj, $data ) = @_; | |||||||||||||||||||||||||||
| 618 | 0 | $item_obj->set_platform_title( __parse_string( $data ) ); | |||||||||||||||||||||||||||
| 619 | } | ||||||||||||||||||||||||||||
| 620 | |||||||||||||||||||||||||||||
| 621 | 0 | ▶ | sub __parse_string { | ||||||||||||||||||||||||||
|
Subroutine
__parse_string: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||
| 622 | 0 | my ( $data ) = @_; | |||||||||||||||||||||||||||
| 623 | 0 | my $value = ''; | |||||||||||||||||||||||||||
| 624 | 0 | ▶ | if ( $data->{Type} =~ m/String/ ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 625 | 0 | ▶ | if ( defined $data->{content} ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 626 | 0 | $value = $data->{content}; | |||||||||||||||||||||||||||
| 627 | } | ||||||||||||||||||||||||||||
| 628 | } else { | ||||||||||||||||||||||||||||
| 629 | 0 | __exception( $data ); | |||||||||||||||||||||||||||
| 630 | } | ||||||||||||||||||||||||||||
| 631 | 0 | return $value; | |||||||||||||||||||||||||||
| 632 | } | ||||||||||||||||||||||||||||
| 633 | |||||||||||||||||||||||||||||
| 634 | 0 | ▶ | sub __parse_integer { | ||||||||||||||||||||||||||
|
Subroutine
__parse_integer: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||
| 635 | 0 | my ( $data ) = @_; | |||||||||||||||||||||||||||
| 636 | 0 | my $value = ''; | |||||||||||||||||||||||||||
| 637 | 0 | ▶ | if ( $data->{Type} =~ m/Integer/ ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 638 | 0 | ▶ | if ( defined $data->{content} ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 639 | 0 | $value = $data->{content}; | |||||||||||||||||||||||||||
| 640 | } | ||||||||||||||||||||||||||||
| 641 | } else { | ||||||||||||||||||||||||||||
| 642 | 0 | __exception( $data ); | |||||||||||||||||||||||||||
| 643 | } | ||||||||||||||||||||||||||||
| 644 | 0 | return $value; | |||||||||||||||||||||||||||
| 645 | } | ||||||||||||||||||||||||||||
| 646 | |||||||||||||||||||||||||||||
| 647 | } | ||||||||||||||||||||||||||||
| 648 | |||||||||||||||||||||||||||||
| 649 | 1 | 1; # Magic true value required at end of module | |||||||||||||||||||||||||||
| 650 | __END__ | ||||||||||||||||||||||||||||