aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pepseq/__init__.py4
-rw-r--r--pepseq/amino_acid.py23
-rw-r--r--pepseq/fragment.py6
-rw-r--r--pepseq/peptide.py6
-rw-r--r--pepseq/test_fragment.py14
-rw-r--r--pepseq/test_peptide.py11
6 files changed, 24 insertions, 40 deletions
diff --git a/pepseq/__init__.py b/pepseq/__init__.py
index b6d92ae..67db17e 100644
--- a/pepseq/__init__.py
+++ b/pepseq/__init__.py
@@ -3,7 +3,5 @@
__version__ = '0.0.0'
from amino_acid import *
-from peptide import *
-from fragment import *
-__all__ = ['amino_acid', 'peptide', 'fragment']
+__all__ = ['amino_acid']
diff --git a/pepseq/amino_acid.py b/pepseq/amino_acid.py
index b0badb6..429c089 100644
--- a/pepseq/amino_acid.py
+++ b/pepseq/amino_acid.py
@@ -36,3 +36,26 @@ class AminoAcid(object):
def __str__(self):
return "%s (%s, %s) MW: %.2f" % (
self.name, self.triple, self.letter, self.weight)
+
+if __name__ == '__main__':
+
+ import itertools
+
+ fragment = (
+ ((AminoAcid('a'), AminoAcid('t'), AminoAcid('k'))),
+ ((AminoAcid('r'), AminoAcid('q'), AminoAcid('h'))),
+ ((AminoAcid('r'), AminoAcid('q'), AminoAcid('h'))),
+ ((AminoAcid('r'), AminoAcid('q'), AminoAcid('h'))),
+ ((AminoAcid('r'), AminoAcid('q'), AminoAcid('h'))),
+ )
+
+ sequences = list(itertools.product(*fragment))
+ for sequence in sequences:
+ weight = 0
+ string = ""
+ for amino_acid in sequence:
+ weight += amino_acid.weight
+ string += ('%s' % (amino_acid.letter))
+ if amino_acid is not sequence[-1]:
+ string += ','
+ print "%d: %s" % (weight, string)
diff --git a/pepseq/fragment.py b/pepseq/fragment.py
deleted file mode 100644
index 02e676b..0000000
--- a/pepseq/fragment.py
+++ /dev/null
@@ -1,6 +0,0 @@
-# -*- coding: utf-8 -*-
-
-
-class Fragment(object):
- """ A sequence of peptides. """
- pass
diff --git a/pepseq/peptide.py b/pepseq/peptide.py
deleted file mode 100644
index 4bde63d..0000000
--- a/pepseq/peptide.py
+++ /dev/null
@@ -1,6 +0,0 @@
-# -*- coding: utf-8 -*-
-
-
-class Peptide(object):
- """ Peptides are short polymers of amino acids linked by peptide bonds. """
- pass
diff --git a/pepseq/test_fragment.py b/pepseq/test_fragment.py
deleted file mode 100644
index 4a857a2..0000000
--- a/pepseq/test_fragment.py
+++ /dev/null
@@ -1,14 +0,0 @@
-# -*- coding: utf-8 -*-
-
-import unittest
-
-
-class FragmentTestCase(unittest.TestCase):
- pass
-
-def suite():
- suite = unittest.TestLoader().loadTestsFromTestCase(FragmentTestCase)
- return suite
-
-if __name__ == '__main__':
- unittest.TextTestRunner().run(suite())
diff --git a/pepseq/test_peptide.py b/pepseq/test_peptide.py
deleted file mode 100644
index 9a87b57..0000000
--- a/pepseq/test_peptide.py
+++ /dev/null
@@ -1,11 +0,0 @@
-# -*- coding: utf-8 -*-
-
-import unittest
-
-
-class PeptideTestCase(unittest.TestCase):
- pass
-
-if __name__ == '__main__':
- suite = unittest.TestLoader().loadTestsFromTestCase(PeptideTestCase)
- unittest.TextTestRunner(verbosity=2).run(suite)