#!/usr/local/bin/perl ############################################################################### # Set up all needed modules and objects ############################################################################### use strict; use Getopt::Long; use FindBin; use Data::Dumper; use lib "$FindBin::Bin/../../lib/perl"; use vars qw ($sbeams $sbeamsMOD $q $current_contact_id $current_username $accessible_project_ids $PROG_NAME $USAGE %OPTIONS $QUIET $VERBOSE $DEBUG $DATABASE $TABLE_NAME $CATEGORY $DB_TABLE_NAME @MENU_OPTIONS); use SBEAMS::Connection qw($q $log); use SBEAMS::Connection::Settings; use SBEAMS::Connection::Tables; use SBEAMS::Connection::TabMenu; use SBEAMS::PeptideAtlas; use SBEAMS::PeptideAtlas::Settings; use SBEAMS::PeptideAtlas::Tables; $sbeams = new SBEAMS::Connection; $sbeamsMOD = new SBEAMS::PeptideAtlas; $sbeamsMOD->setSBEAMS($sbeams); $sbeams->setSBEAMS_SUBDIR($SBEAMS_SUBDIR); ############################################################################### # Set program name and usage banner for command line use ############################################################################### $PROG_NAME = $FindBin::Script; $USAGE = <Authenticate() and exit if it fails or continue if it works. ############################################################################### sub main { #### Do the SBEAMS authentication and exit if a username is not returned exit unless ($current_username = $sbeams->Authenticate( #permitted_work_groups_ref=>['PeptideAtlas_user','PeptideAtlas_admin'], # connect_read_only=>1, allow_anonymous_access=>1, )); #### Read in the default input parameters my %parameters; $parameters{uploaded_file_not_saved} = 1; my $n_params_found = $sbeams->parse_input_parameters( q=>$q,parameters_ref=>\%parameters); #$sbeams->printDebuggingInfo($q); #### Process generic "state" parameters before we start $sbeams->processStandardParameters(parameters_ref=>\%parameters); #### Decide what action to take based on information so far if ($parameters{action} eq "???") { # Some action } else { my $project_id = $sbeamsMOD->getProjectID( atlas_build_id => $parameters{atlas_build_id} ); $sbeamsMOD->display_page_header( project_id => $project_id, use_tabbed_panes=> '1', ); handle_request(ref_parameters=>\%parameters); $sbeamsMOD->display_page_footer( use_tabbed_panes=> '1', ); } } # end main ############################################################################### # Handle Request ############################################################################### sub handle_request { my %args = @_; #### Process the arguments list my $ref_parameters = $args{'ref_parameters'} || die "ref_parameters not passed"; my %parameters = %{$ref_parameters}; #### Declare some variables my $file_name; #### Get the HTML to display the tabs my $tabMenu = $sbeamsMOD->getTabMenu( parameters_ref => \%parameters, program_name => $PROG_NAME, ); if ( $sbeams->output_mode() eq 'html' ) { print $tabMenu->asHTML(); print ""; } #### Get the current atlas_build_id based on parameters or session my $atlas_build_id = $sbeamsMOD->getCurrentAtlasBuildID( parameters_ref => \%parameters, ); if (defined($atlas_build_id) && $atlas_build_id < 0) { return; } $parameters{atlas_build_id} = $atlas_build_id; #### Define some generic variables my ($i,$element,$key,$value,$line,$result,$sql); #### Define some variables for a query and resultset my %resultset = (); my $resultset_ref = \%resultset; my (%url_cols,%hidden_cols,%max_widths,$show_sql,$biosequence_name_constraint); #### Read in the standard form values my $apply_action = $parameters{'action'} || $parameters{'apply_action'}; # for some reason, this returns nothing. # Used to return GetProteins instead of GetProteins_beta #### Set some specific settings for this program my $CATEGORY="Get PTM Summary"; my $TABLE_NAME="AT_GetPTMSummary"; my $base_url = "$CGI_BASE_DIR/$SBEAMS_SUBDIR/$PROG_NAME"; #### Get the columns and input types for this table/query my @columns = $sbeamsMOD->returnTableInfo($TABLE_NAME,"ordered_columns"); my %input_types = $sbeamsMOD->returnTableInfo($TABLE_NAME,"input_types"); #### Read the input parameters for each column my $n_params_found = $sbeams->parse_input_parameters( q=>$q,parameters_ref=>\%parameters, columns_ref=>\@columns, input_types_ref=>\%input_types); #$sbeams->printDebuggingInfo($q); #### If the apply action was to recall a previous resultset, do it my %rs_params = $sbeams->parseResultSetParams(q=>$q); if ($apply_action =~ /VIEWRESULTSET|VIEWPLOT/ ) { $sbeams->readResultSet( resultset_file=>$rs_params{set_name}, resultset_ref=>$resultset_ref, query_parameters_ref=>\%parameters ); $n_params_found = 99; } #### Set some reasonable defaults if no parameters supplied unless ($n_params_found) { $parameters{input_form_format} = "minimum_detail"; $parameters{presence_level_constraint} = "1"; } #### Display the user-interaction input form $sbeams->display_input_form( TABLE_NAME=>$TABLE_NAME, CATEGORY=>$CATEGORY, apply_action=>$apply_action, PROGRAM_FILE_NAME=>$PROG_NAME, parameters_ref=>\%parameters, input_types_ref=>\%input_types, mask_user_context=> '1', use_tabbed_panes=> '1', ); #### Display the form action buttons $sbeams->display_form_buttons( TABLE_NAME=>$TABLE_NAME, use_tabbed_panes => 1, ); #### Finish the upper part of the page and go begin the full-width #### data portion of the page $sbeams->display_page_footer( close_tables=>'NO', use_tabbed_panes => 1, separator_bar=>'NO', display_footer=>'NO'); ######################################################################### #### Process all the constraints #### If no atlas_build_id was selected, stop here unless ($parameters{atlas_build_id}) { $sbeams->reportException( state => 'ERROR', type => 'INSUFFICIENT CONSTRAINTS', message => 'You must select at least one Atlas Build', ); return; } #### Build ATLAS_BUILD constraint my $atlas_build_clause = $sbeams->parseConstraint2SQL( constraint_column=>"PTM.atlas_build_id", constraint_type=>"int_list", constraint_name=>"Atlas Build", constraint_value=>$parameters{atlas_build_id} ); return if ($atlas_build_clause eq '-1'); #### Build PTM_Type constraint my $ptm_type_clause = $sbeams->parseConstraint2SQL( constraint_column=>"PTM.ptm_type", constraint_type=>"plain_text", constraint_name=>"PTM Type", constraint_value=>$parameters{ptm_type} ); return if ($ptm_type_clause eq '-1'); #### Build BIOSEQUENCE_NAME constraints my $biosequence_name_clauses = $sbeams->parseConstraint2SQL( constraint_column=>"BS.biosequence_name", constraint_type=>"plain_text", constraint_name=>"BioSequence Name", constraint_value=>$parameters{biosequence_name_constraint} ); return if ($biosequence_name_clauses eq '-1'); #### Build BIOSEQUENCE_GENE_NAME constraints my $biosequence_gene_name_clauses = $sbeams->parseConstraint2SQL( constraint_column=>"BS.biosequence_gene_name", constraint_type=>"plain_text", constraint_name=>"BioSequence Gene Name", constraint_value=>$parameters{biosequence_gene_name_constraint} ); return if ($biosequence_gene_name_clauses eq '-1'); #### Build BIOSEQUENCE_DESC constraints my $biosequence_desc_clauses = $sbeams->parseConstraint2SQL( constraint_column=>"BS.biosequence_desc", constraint_type=>"plain_text", constraint_name=>"BioSequence Description", constraint_value=>$parameters{biosequence_desc_constraint} ); return if ($biosequence_desc_clauses eq '-1'); #### Build PRESENCE_LEVEL constraint my $presence_level_clause = $sbeams->parseConstraint2SQL( constraint_column=>"PPL.protein_presence_level_id", constraint_type=>"int_list", constraint_name=>"Protein Presence Level", constraint_value=>$parameters{presence_level_constraint} ); return if ($presence_level_clause eq '-1'); #### Build BEST_PROBABILITY constraint my $probability_clause = ''; my %probability_selections = (1 => 'PTM.nP95>0', 2 => 'PTM.nP99 >0', 3 => 'PTM.nP100 >0', 4 => 'PTM.noChoice >0', ); if ($parameters{probability_constraint}){ my $or = ''; foreach my $n (split(",", $parameters{probability_constraint})){ $probability_clause .= "$or $probability_selections{$n} "; $or = 'or'; } $probability_clause = "AND ($probability_clause)"; } ## get organism_id to pass on to url_cols my $tsql = qq~ SELECT BS.organism_id FROM $TBAT_BIOSEQUENCE_SET BS JOIN $TBAT_ATLAS_BUILD AB ON (AB.biosequence_set_id = BS.biosequence_set_id) where AB.atlas_build_id ='$parameters{atlas_build_id}' ~; my ($organism_id) = $sbeams->selectOneColumn($tsql) or die "\nERROR: Unable to find the organism_id" . " with $tsql\n\n"; $parameters{organism_id} = $organism_id; ## handle file upload and clause for sql for $parameters{upload_file} my $biosequence_names_clauses; my %protein_hash; if ( $parameters{upload_file} ) { ## upload the file to a file handler my $fh = $q->upload('upload_file'); if (!$fh && $q->cgi_error) { print $q->header(-status=>$q->cgi_error); } elsif (!$fh) { # We get here when, after successfully uploading, we sort by column. #print "Could not create file handle for $parameters{upload_file}!\n" } # if file is a text file and is not too big, upload if ( (-T $fh) && (-s $fh < 1000000)) ##size constraint of 10 MB, restrict $count < 30000 { my $count = 0; my $read_file=0; my $prt; ## protein list while ($prt=<$fh>) { chomp($prt); $prt =~ s/\s+$//; if ($prt) { $protein_hash{$prt} = $prt; $count = $count + 1; } last if ($count > 30000); } } ## join with a commas: my $protein_list = ""; foreach my $pr (keys %protein_hash) { $protein_list = "'$protein_hash{$pr}',$protein_list"; } ## trim off last comma: $protein_list =~ s/(.*)(,)$/$1/; if ($protein_list =~ m/%/) { my @tmp = split("," , $protein_list); $biosequence_names_clauses = " AND ( BS.biosequence_name LIKE $tmp[0] "; for (my $i = 1; $i < scalar(@tmp); $i++ ){ if ( $tmp[$i] ){ $biosequence_names_clauses .= " OR BS.biosequence_name LIKE $tmp[$i] "; } } $biosequence_names_clauses .= " ) --end"; } else { $log->debug(" in unless % ") ; $biosequence_names_clauses =" AND BS.biosequence_name IN ( $protein_list )"; } } # if upload file #### Build ROWCOUNT constraint $parameters{row_limit} = 50000 unless ($parameters{row_limit} > 0 && $parameters{row_limit}<=1000000); $parameters{row_limit} = '' if ($parameters{proteome_component}); my $limit_clause = "TOP $parameters{row_limit}" if ($parameters{row_limit}); my @column_array = ( ["biosequence_name","BS.biosequence_name","Biosequence Name"], ["presence_level","PPL.level_phrase","Presence Level"], ); my $protein_sql = ''; my $show_redundant_prot = $parameters{redundancy_constraint} || ''; if ($show_redundant_prot eq 'on'){ @column_array = ( @column_array, ["relationship_name", "BSRT.relationship_name","Redundancy Relationship"], ["reference_biosequence_name", "BS_REF.biosequence_name", "Redundant With Respect To"], ); $protein_sql = qq~ LEFT JOIN $TBAT_PROTEIN_IDENTIFICATION PID ON (PID.BIOSEQUENCE_ID = PTM.BIOSEQUENCE_ID AND PID.atlas_build_id = $atlas_build_id) LEFT JOIN $TBAT_PROTEIN_PRESENCE_LEVEL PPL ON ( PPL.PROTEIN_PRESENCE_LEVEL_ID = PID.PRESENCE_LEVEL_ID ) LEFT JOIN $TBAT_BIOSEQUENCE_RELATIONSHIP BSR ON ( BSR.RELATED_BIOSEQUENCE_ID = PTM.BIOSEQUENCE_ID and BSR.atlas_build_id = $atlas_build_id) LEFT JOIN $TBAT_BIOSEQUENCE_RELATIONSHIP_TYPE BSRT ON ( BSRT.BIOSEQUENCE_RELATIONSHIP_TYPE_ID = BSR.RELATIONSHIP_TYPE_ID ) LEFT JOIN $TBAT_BIOSEQUENCE BS_REF ON ( BS_REF.biosequence_id = BSR.reference_biosequence_id ) LEFT JOIN $TBAT_BIOSEQUENCE_RELATIONSHIP BSR_REF ON (BSR_REF.related_biosequence_id=BS_REF.biosequence_id ) ~; }else{ $protein_sql = qq~ JOIN $TBAT_PROTEIN_IDENTIFICATION PID ON (PID.BIOSEQUENCE_ID = PTM.BIOSEQUENCE_ID AND PID.atlas_build_id = $atlas_build_id) JOIN $TBAT_PROTEIN_PRESENCE_LEVEL PPL ON ( PPL.PROTEIN_PRESENCE_LEVEL_ID = PID.PRESENCE_LEVEL_ID ) ~; } #### Set flag to display SQL statement if user selected if ( $parameters{display_options} =~ /proteinResidueView/ ) { @column_array = ( @column_array, ["residue","PTM.residue","residue"], ["offset","PTM.offset","offset"], ["ptm_type","PTM.ptm_type","PTM Type"], ["nObs","PTM.nObs","nObs"], ["one_site","PTM.one_site","One_mod"], ["two_sites","PTM.two_sites","Two_mods"], ["over_two_sites","PTM.over_two_sites","Over_two_mods"], ["nP01","PTM.nP01","nP0-.01"], ["nP05","PTM.nP05","nP.01-.05"], ["nP19","PTM.nP19","nP.05-.20"], ["nP81","PTM.nP81","nP.20-.80"], ["nP95","PTM.nP95","nP.80-.95"], ["nP99","PTM.nP99","nP.95-.99"], ["nP100","PTM.nP100","nP.99-1"], ["noChoice","PTM.noChoice","no-choice"], ["isInUniProt","PTM.isInUniProt","InUniprot"], ["isInNeXtProt","PTM.isInNeXtProt","InNextProt"], ["most_observed_ptm_peptide","PTM.most_observed_ptm_peptide","most_observed_ptm_peptide"], ["enrichedNonMod","PTM.enrichedNonMod","enriched-but-non-mod"], ["nonEnriched","PTM.nonEnriched","non-enriched"], ["enrichedWithMod","PTM.enrichedWithMod","enriched-with-mod"], ["biosequence_gene_name","BS.biosequence_gene_name","Biosequence Gene Name"], ["biosequence_desc","CAST(BS.biosequence_desc AS varchar(255))","Biosequence Description"], ); }else{ #### Define some variables needed to build the query @column_array = ( @column_array, ["ptm_type","PTM.ptm_type","PTM Type"], ["ptm_residue_nPover80", "count(distinct PTM.offset)", "N_PTM_Sites nP.8-1"], ["nP95", "sum(PTM.nP95)","nP.80-.95"], ["nP99", "sum(PTM.nP99)","nP.95-.99"], ["nP100", "sum(PTM.nP100)","nP.99-1"], ["noChoice", "sum(PTM.noChoice)","no-choice"], ["biosequence_gene_name","BS.biosequence_gene_name","Biosequence Gene Name"], ["biosequence_desc","CAST(BS.biosequence_desc AS varchar(255))","Biosequence Description"], ); } my %colnameidx = (); my @column_titles = (); my $columns_clause = $sbeams->build_SQL_columns_list( column_array_ref=>\@column_array, colnameidx_ref=>\%colnameidx, column_titles_ref=>\@column_titles ); my $group_by = 'GROUP BY BS.biosequence_name,BS.biosequence_gene_name,'. 'PPL.level_phrase,PTM.ptm_type,CAST(BS.biosequence_desc AS varchar(255))'; if ($show_redundant_prot eq 'on'){ $group_by .= ",BSRT.relationship_name, BS_REF.biosequence_name"; } my $order_by_1 = 'ORDER BY PTM.ptm_type, BS.biosequence_name'; my $order_by_2 = 'ORDER BY PTM.ptm_type, BS.biosequence_name, PTM.offset'; my $sql = qq~ SELECT $limit_clause $columns_clause FROM $TBAT_PTM_SUMMARY PTM JOIN $TBAT_BIOSEQUENCE BS ON (BS.BIOSEQUENCE_ID = PTM.BIOSEQUENCE_ID) $protein_sql WHERE 1=1 AND PTM.nobs > 0 $atlas_build_clause $ptm_type_clause $probability_clause $biosequence_name_clauses $biosequence_gene_name_clauses $biosequence_desc_clauses $presence_level_clause ~; #### Set flag to display SQL statement if user selected if (! $parameters{display_options} || $parameters{display_options} !~ /protein/){ $sql = "$sql\n$group_by\n$order_by_1\n"; } if ( $parameters{display_options} =~ /ShowSQL/ ) { $show_sql = 1; } if ($parameters{display_options} =~ /proteinView/){ $sql = qq~ $sql AND (PTM.nP95>0 or PTM.nP99 >0 or PTM.nP100 >0 or PTM.noChoice > 0) $group_by $order_by_1 ~; } #### Certain types of actions should be passed to links my $pass_action = "QUERY"; $pass_action = $apply_action if ($apply_action =~ /QUERY/i); my %url_cols = ( 'Biosequence Name' => "$CGI_BASE_DIR/PeptideAtlas/GetProtein?atlas_build_id=$atlas_build_id&protein_name=\%$colnameidx{biosequence_name}V&apply_action=$pass_action", 'most_observed_ptm_peptide' => "$CGI_BASE_DIR/PeptideAtlas/GetPeptide?_tab=3&atlas_build_id=$parameters{atlas_build_id}&searchWithinThis=Peptide+Sequence&searchForThis=\%$colnameidx{most_observed_ptm_peptide}V&action=QUERY", ); if ($parameters{display_options} =~ /proteinResidueView/){ $sql = "$sql\n$order_by_2\n"; my $get_ptm_spec_url = "$CGI_BASE_DIR/PeptideAtlas/GetPTMSpectra?". "atlas_build_id=$atlas_build_id&site=\%$colnameidx{offset}V". "&biosequence_name=\%$colnameidx{biosequence_name}V". "&ptm_type=\%$colnameidx{ptm_type}V&residue=\%$colnameidx{residue}V". "&apply_action=QUERY"; $url_cols{'nP.80-.95'} = "$get_ptm_spec_url&min=0.80&max=0.95"; $url_cols{'nP.95-.99'} = "$get_ptm_spec_url&min=0.95&max=0.99"; $url_cols{'nP.99-1'} = "$get_ptm_spec_url&min=0.99"; $url_cols{'no-choice'} = "$get_ptm_spec_url&nochoice=1"; } ######################################################################### #### If QUERY or VIEWRESULTSET was selected, display the data if ($apply_action =~ /QUERY/i || $apply_action =~ /VIEWRESULTSET|VIEWPLOT/ ) { #### If the action contained QUERY, then fetch the results from #### the database if ($apply_action =~ /QUERY/i) { #### Show the SQL that will be or was executed $sbeams->display_sql( sql=>$sql, use_tabbed_panes=> '1', )if ($show_sql); #### Fetch the results from the database server my $use_caching = (defined $parameters{use_caching}) ? $parameters{use_caching} : 1; #### Fetch the results from the database server $sbeams->fetchResultSet( sql_query=>$sql, resultset_ref=>$resultset_ref, query_parameters_ref=>\%parameters, use_caching => $use_caching, ); if ($resultset_ref->{from_cache}){ $log->info( "Skipping post-processing with cached RS" ); }else{ #### Post process the resultset postProcessResultset( rs_params_ref=>\%rs_params, resultset_ref=>$resultset_ref, query_parameters_ref=>\%parameters, column_titles_ref=>\@column_titles, show_redundant_prot=> $show_redundant_prot, ); } #### Store the resultset and parameters to disk resultset cache $rs_params{set_name} = "SETME"; my %write_params = ( rs_table => $TBAT_ATLAS_BUILD, key_field => 'atlas_build_id', key_value => $parameters{atlas_build_id} ); $sbeams->writeResultSet( resultset_file_ref=>\$rs_params{set_name}, resultset_ref=>$resultset_ref, query_parameters_ref=>\%parameters, resultset_params_ref=>\%rs_params, query_name=>"$SBEAMS_SUBDIR/$PROG_NAME", column_titles_ref=>\@column_titles, %write_params ); } my $obs_help = $sbeamsMOD->get_table_help(column_titles_ref=>\@column_titles); #### Display the resultset $sbeams->displayResultSet( resultset_ref=>$resultset_ref, query_parameters_ref=>\%parameters, rs_params_ref=>\%rs_params, url_cols_ref=>\%url_cols, hidden_cols_ref=>\%hidden_cols, max_widths=>\%max_widths, use_tabbed_panes => 1, column_titles_ref=>\@column_titles, column_help=>$obs_help, base_url=>$base_url, ); #### Display the resultset controls $sbeams->displayResultSetControls( resultset_ref=>$resultset_ref, query_parameters_ref=>\%parameters, rs_params_ref=>\%rs_params, base_url=>$base_url, use_tabbed_panes=>'1', ); #### Display a plot of data from the resultset $sbeams->displayResultSetPlot_plotly( rs_params_ref=>\%rs_params, resultset_ref=>$resultset_ref, query_parameters_ref=>\%parameters, column_titles_ref=>\@column_titles, use_tabbed_panes => 1, mouseover_column => 'peptide_sequence', mouseover_url => $url_cols{'Peptide Sequence'}, mouseover_tag => '%1V', base_url=>$base_url, ); #### If QUERY was not selected, then tell the user to enter some parameters } else { if ($sbeams->invocation_mode() eq 'http') { print "

Select parameters above and press QUERY

\n"; } else { print "You need to supply some parameters to constrain the query\n"; } } } # end handle_request ############################################################################### # evalSQL # # Callback for translating Perl variables into their values, # especially the global table variables to table names ############################################################################### sub evalSQL { my $sql = shift; return eval "\"$sql\""; } # end evalSQL ####################################################################### sub getOrganismFullName { my %args = @_; my $organism_id = $args{organism_id}; my $sql = qq~ SELECT full_name FROM $TB_ORGANISM WHERE organism_id = '$organism_id' AND record_status != 'D' ~; my ($full_name) = $sbeams->selectOneColumn($sql); ## replace spaces with _ $full_name =~ s/ /\_/g; return $full_name; } ############################################################################### # postProcessResultset # # Perform some additional processing on the resultset that would otherwise # be very awkward to do in SQL. ############################################################################### sub postProcessResultset { my %args = @_; my ($i,$element,$key,$value,$line,$result,$sql); #### Process the arguments list my $resultset_ref = $args{'resultset_ref'}; my $rs_params_ref = $args{'rs_params_ref'}; my $query_parameters_ref = $args{'query_parameters_ref'}; my $column_titles_ref = $args{'column_titles_ref'}; my $show_redundant_prot = $args{'show_redundant_prot'}; my %rs_params = %{$rs_params_ref}; my %parameters = %{$query_parameters_ref}; my $n_rows = scalar(@{$resultset_ref->{data_ref}}); my $cols = $resultset_ref->{column_hash_ref}; my $proteome_component = $parameters{proteome_component} || ''; $proteome_component =~ /^(.*),(.*)$/; my $source_type = $1; my @patterns = split(/;/, $2); my @data=(); if ($parameters{display_options} =~ /proteinResidueView/){ for (my $i=0; $i<$n_rows; $i++) { my $val1= 5; my $val2 = 22; if ($show_redundant_prot eq 'on'){ $val1 = 7; $val2 = 24; } for my $j ($val1..$val2){ next if($j >= $val1+12 && $j <= $val1+14); if ($resultset_ref->{data_ref}->[$i]->[$j] == 0){ delete $resultset_ref->{data_ref}->[$i]->[$j]; } } if ($proteome_component ne ''){ my $biosequence_name = $resultset_ref->{data_ref}->[$i]->[$cols->{biosequence_name}]; my $biosequence_desc = $resultset_ref->{data_ref}->[$i]->[$cols->{biosequence_desc}]; my $matched = $sbeamsMOD->match_proteome_component(pattern=>\@patterns, source_type => $source_type, biosequence_name => $biosequence_name, biosequence_desc => $biosequence_desc); next if ( $resultset_ref->{data_ref}->[$i]->[$cols->{relationship_name}] eq 'identical'); next if (! $matched); } push @data, $resultset_ref->{data_ref}->[$i]; } }elsif($parameters{display_options} =~ /proteinView/){ return if ($proteome_component eq ''); for (my $i=0; $i<$n_rows; $i++) { my $biosequence_name = $resultset_ref->{data_ref}->[$i]->[$cols->{biosequence_name}]; my $biosequence_desc = $resultset_ref->{data_ref}->[$i]->[$cols->{biosequence_desc}]; my $matched = $sbeamsMOD->match_proteome_component(pattern=>\@patterns, source_type => $source_type, biosequence_name => $biosequence_name, biosequence_desc => $biosequence_desc); next if (! $matched); push @data, $resultset_ref->{data_ref}->[$i]; } } $resultset_ref->{data_ref} = \@data; return 1; } # end postProcessResult