Class: Bio::PlasmoAP
- Inherits:
-
Object
- Object
- Bio::PlasmoAP
- Defined in:
- lib/bio/appl/plasmoap.rb
Overview
PlasmoAP is a program for predicting apicoplast targetting sequences in Plasmodium falciparum (the most fatal causative agent of malaria). This algorithm was designed based on what was outlined in the PlasmoAP journal article
Dissecting apicoplast targeting in the malaria parasite Plasmodium falciparum. Foth BJ, Ralph SA, Tonkin CJ, Struck NS, Fraunholz M, Roos DS, Cowman AF, McFadden GI. Science. 2003 Jan 31;299(5607):705-8. PMID: 12560551
Instance Method Summary collapse
-
#calculate_score(sequence, has_signal_sequence = nil, signalp_cleaved_sequence = nil) ⇒ Object
Calculate the PlasmoAP score for a sequence (a string of amino acids) sequence - the amino acids to test on has_signal_sequence - Define if it has a signal sequence or not.
Instance Method Details
#calculate_score(sequence, has_signal_sequence = nil, signalp_cleaved_sequence = nil) ⇒ Object
Calculate the PlasmoAP score for a sequence (a string of amino acids) sequence - the amino acids to test on has_signal_sequence - Define if it has a signal sequence or not. The default nil specifies that it should be worked out by SignalP.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/bio/appl/plasmoap.rb', line 21 def calculate_score(sequence, has_signal_sequence = nil, signalp_cleaved_sequence = nil) # Only calculate signal sequence if it isn't already set by the parameter if has_signal_sequence.nil? # to_s means the sequence can be amino acid string or proper Bio::Sequence::AA object signalp = Bio::SignalP::Wrapper.new.calculate(sequence.to_s) has_signal_sequence = signalp.classical_signal_sequence? signalp_cleaved_sequence = signalp.cleave(sequence) elsif signalp_cleaved_sequence.nil? raise ArgumentError, "if the has_signal_sequence parameter is defined, then so must the signalp_cleaved_sequence be as well" end return PlasmoAPResult.new(0) if !has_signal_sequence #Both set of rules need a signal peptide cleaved = Bio::Sequence::AA.new(signalp_cleaved_sequence) set1 = set1?(cleaved) set2 = set2?(cleaved) additional = additional?(cleaved) points = 0 points += 2 if set1 points += 2 if set2 points += 1 if additional return PlasmoAPResult.new(points) end |