in reply to processing data from an array reference
the value of $tag is one of: CDS, exons, genes, mRNAs, misc_RNAs, primer_binds, repeat_regions, or sources?my $tag = $f->primary_tag;
If that's what is happening, all you need to do is place a condition on the following "push" -- only do the push if the value of $tag is one that you want:
Or, if you prefer, you can create a hash whose keys are the desired set of feature names, and then the condition can check for the hash key, instead of doing a regex match:push @{$sorted_features{$tag}}, $f if ($tag =~ /CDS|genes|primer_b +inds|sources/);
my %sorted_features; my %want = map { $_ => 1 } qw/CDS genes primer_binds sources/; for my $f ( @features ) { my $tag = $f->primary_tag; push @{$sorted_features{$tag}}, $f if( $want{$tag} ); }
|
|---|