Commit 8b92e569 authored by Nicolas  MAILLET's avatar Nicolas MAILLET
Browse files

change miss-cleavage to miscleavage

parent c201c0a3
......@@ -35,7 +35,7 @@ class ResultOneDigestion:
:param enzyme_name: name of the enzyme used
:param peptides: all resulting peptides after digestion
:param nb_cleavage: number of cleavage that occurs
:param pos_miss_cleavage: position of miss-cleavage that occurs
:param pos_miss_cleavage: position of miscleavage that occurs
:type enzyme_name: str
:type peptides: list(:py:class:`~rpg.sequence.Peptide`)
:type nb_cleavage: int
......@@ -55,10 +55,10 @@ class ResultOneDigestion:
# self representation for print
def __repr__(self):
return "Number of cleavage: " + str(self.nb_cleavage) + \
"\nNumber of miss-cleavage: " + \
"\nNumber of miscleavage: " + \
str(len(self.pos_miss_cleavage)) + \
"\nPositions of miss-cleavage: " + str(self.pos_miss_cleavage)\
+ "\nRatio of miss-cleavage: " + \
"\nPositions of miscleavage: " + str(self.pos_miss_cleavage)\
+ "\nRatio of miscleavage: " + \
str(self.get_ratio_miss_cleavage()) + \
"\nPeptides: " + str(self.peptides) + "\n"
......@@ -102,26 +102,26 @@ class ResultOneDigestion:
self.nb_cleavage += 1
def get_nb_miss_cleavage(self):
"""Get the number of miss-cleavages that occurs
"""Get the number of miscleavages that occurs
on this digestion.
:return: number of miss-cleavage
:return: number of miscleavage
:rtype: int
"""
return len(self.pos_miss_cleavage)
def add_miss_cleavage(self, new_pos_miss_cleavage):
"""Add a miss-cleavage to :attr:`self.pos_miss_cleavage`.
"""Add a miscleavage to :attr:`self.pos_miss_cleavage`.
:param new_pos_miss_cleavage: position of miss-cleavage
:param new_pos_miss_cleavage: position of miscleavage
:type new_pos_miss_cleavage: int
"""
self.pos_miss_cleavage.append(new_pos_miss_cleavage)
def get_ratio_miss_cleavage(self):
"""Get ratio of miss-cleavage.
"""Get ratio of miscleavage.
:return: ratio of miss-cleavage
:return: ratio of miscleavage
:rtype: float
"""
ret = 0
......@@ -132,9 +132,9 @@ class ResultOneDigestion:
return ret
def get_miss_cleavage_pos(self):
"""Get positions of miss-cleavage as a string.
"""Get positions of miscleavage as a string.
:return: positions of miss-cleavage
:return: positions of miscleavage
:rtype: str
"""
ret = ""
......@@ -186,7 +186,7 @@ class ResultOneDigestion:
def get_more_info(self):
"""Return informations and statistics about this digestion,
*i.e.* number of (miss)-cleavages and positions, miss-cleavage
*i.e.* number of (miss)-cleavages and positions, miscleavage
ratio, size of the smallest peptide and first and last peptide.
:return: informations and statistics ready to be printed
......@@ -195,10 +195,10 @@ class ResultOneDigestion:
ret = ""
ret += "\nNumber of cleavage: " + str(self.nb_cleavage) + "\n"
ret += "Cleavage position: " + self.get_cleavage_pos() + "\n"
ret += "Number of miss-cleavage: " + str(self.get_nb_miss_cleavage())\
ret += "Number of miscleavage: " + str(self.get_nb_miss_cleavage())\
+ "\n"
ret += "Miss-cleavage position: " + self.get_miss_cleavage_pos() + "\n"
ret += "Miss-cleavage ratio: %.2f%%\n" % self.get_ratio_miss_cleavage()
ret += "miscleavage position: " + self.get_miss_cleavage_pos() + "\n"
ret += "miscleavage ratio: %.2f%%\n" % self.get_ratio_miss_cleavage()
ret += "Smallest peptide size: " + \
str(self.get_smallest_peptide().size) + "\n"
ret += "N terminal peptide: " + self.peptides[0].sequence + "\n"
......@@ -250,9 +250,9 @@ def one_digest(pep, enz):
for rul in enz.rules:
# Apply the rule: if we need to cut
if rule.handle_rule(pep.sequence, pos, rul, cut):
# Random to handle miss-cleavage
# Random to handle miscleavage
tmp_rand = random.random() * 100
# Rand > ratio_miss_cleavage, no miss-cleavage occurs
# Rand > ratio_miss_cleavage, no miscleavage occurs
if tmp_rand > enz.ratio_miss_cleavage:
# Test, this should NEVER be used
if rul.pos == -1:
......@@ -283,7 +283,7 @@ def one_digest(pep, enz):
a_cut_occurs = True
# A cleavage occur
ret.inc_nb_cleavage()
# A miss-cleavage occurs
# A miscleavage occurs
else:
ret.add_miss_cleavage(pos)
# End of the peptide
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment