Scroll to navigation

Bio::Tools::Analysis::Protein::Sopma(3pm) User Contributed Perl Documentation Bio::Tools::Analysis::Protein::Sopma(3pm)


Bio::Tools::Analysis::Protein::Sopma - a wrapper around the Sopma protein secondary structure prediction server


  use Bio::Tools::Analysis::Protein::Sopma;
  #get a Bio::Seq or Bio::PrimarySeq
  my $seq;
  my $sopma = Bio::Tools::Analysis::Protein::Sopma->new
      (-seq=>$seq, states=>4);
  print $sopma->result;# #raw text to standard error


A module to remotely retrieve predictions of protein secondary structure. Each residue in the protein receives a score representing the likelihood of existing in each of four different states (helix, coil, turn or sheet), e.g.,

  my $analysis_object = Bio::Tools::SimpleAnalysis::Protein::Sopma->new
      ( -seq          => $seq,
        -states       => 4,
        -window_width => 15,

creates a new object. Compulsory argument -seq. Optional arguments -states, -window_width,-similarity_threshold. These arguments can also be set by direct methods , e.g.,


submits the query to the server and obtains raw text output. Given an amino acid sequence the results can be obtained in 4 formats, determined by the argument to the result method:

The raw text of the program output.

  my $rawdata = $analysis_object->result;
A reference to an array of hashes of scores for each state and the assigned state.

  my $data_ref = $analysis_object->result('parsed');
  print "score for helix at residue 2 is $data_ref->[1]{'helix'}\n";
  print "predicted struc  at residue 2 is $data_ref->[1]{'struc}\n";

Hash keys are 'helix', 'struc', 'sheet', 'coil', 'turn'.

An array of Bio::SeqFeature::Generic objects where each feature is a predicted unit of secondary structure. Only stretches of helix/sheet predictions for longer than 4 residues are defined as helices/sheets.

  my @fts = $analysis_object->result(Bio::SeqFeatureI);
  for my $ft (@fts) {
      print " From ",  $ft->start, " to  ",$ft->end, " struc: " ,
             ($ft->each_tag_value('type'))[0]  ,"\n";
A Bio::Seq::Meta::Array implementing sequence.

This is a Bio::Seq object that can also hold data about each residue in the sequence. In this case, the sequence can be associated with a arrays of Sopma prediction scores. e.g.,

  my $meta_sequence = $analysis_object->result('meta');
  print "scores from residues 10 -20 are ",
      $meta_sequence->named_submeta_text("Sopma_helix",10,20), "\n";

Meta sequence names are : Sopma_helix, Sopma_sheet, Sopma_turn, Sopma_coil, Sopma_struc, representing the scores for each residue.

Many methods common to all analyses are inherited from Bio::Tools::Analysis::SimpleAnalysisBase.


Bio::SimpleAnalysisI, Bio::Tools::Analysis::SimpleAnalysisBase Bio::Seq::Meta::Array, Bio::WebAgent


Mailing Lists

User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to one of the Bioperl mailing lists. Your participation is much appreciated.                  - General discussion  - About the mailing lists


Please direct usage questions or support issues to the mailing list:

rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible.

Reporting Bugs

Report bugs to the Bioperl bug tracking system to help us keep track the bugs and their resolution. Bug reports can be submitted via the web:


Richard Adams,,



  Useage  : $job->similarity_threshold(...)
  Returns : The  similarity threshold used in the analysis
  Args    : None (retrieves value) or  an integer (default = 8) 
            that sets the similarity threshold .

This method gets/sets the similarity threshold for the prediction.


  Usage    : $job->window_width(...)
  Returns  : The window width used in the analysis
  Args     : None (retrieves value) or  an integer (default = 17)
             that sets the window width.

This method gets/sets the window width for the prediction, . If attempted to set longer than the sequence, warns of error.


  Usage    : $job->states(...)
  Returns  : The number of secondary structure prediction states
  Args     : None (retrieves value) or either '3' or '4' to set
             prior to running analysis.

This method gets/sets the number of states for the prediction, either 3 or 4 (includes turns).


  Usage   : $job->result (...)
  Returns : a result created by running an analysis
  Args    : various

The method returns a result of an executed job. If the job was terminated by an error the result may contain an error message instead of the real data.

This implementation returns differently processed data depending on argument:

Returns the raw ASCII data stream but without HTML tags
The argument string defines the type of bioperl objects returned in an array. The objects are Bio::SeqFeature::Generic. Feature primary tag is "2ary". Feature tags are "type" (which can be helix, sheet coil, or turn if 4 state prediction requested) "method" (Sopma)
Array of hash references of scores/structure assignations { helix => , sheet => , coil => , struc=>}.
A Bio::Seq::Meta::Array object. Scores can be accessed using methods from this class. Meta sequence names are Sopma_helix, Sopma_sheet, Sopma_coil, Sopma_turn (if defined), and Sopma_struc.
2018-10-27 perl v5.26.2