allpy
changeset 105:6e2152b2f286
broken: lib:Sequence new argument order in constructor
Sequence::from_fasta planned
author | boris (netbook) <bnagaev@gmail.com> |
---|---|
date | Fri, 22 Oct 2010 17:07:21 +0400 |
parents | 16cb30a3b387 |
children | 166db97ba7a8 |
files | lib/project.py lib/sequence.py |
diffstat | 2 files changed, 8 insertions(+), 5 deletions(-) [+] |
line diff
1.1 --- a/lib/project.py Thu Oct 21 01:00:18 2010 +0400 1.2 +++ b/lib/project.py Fri Oct 22 17:07:21 2010 +0400 1.3 @@ -129,9 +129,9 @@ 1.4 else: 1.5 alignment_list.append(None) 1.6 if "description" in vars():#if there's no description 1.7 - sequences.append(sequence.Sequence(name,monomers,description)) 1.8 + sequences.append(sequence.Sequence(monomers,name,description)) 1.9 else: 1.10 - sequences.append(sequence.Sequence(name,monomers)) 1.11 + sequences.append(sequence.Sequence(monomers,name)) 1.12 alignment[sequences[-1]]=alignment_list 1.13 return sequences,alignment 1.14
2.1 --- a/lib/sequence.py Thu Oct 21 01:00:18 2010 +0400 2.2 +++ b/lib/sequence.py Fri Oct 22 17:07:21 2010 +0400 2.3 @@ -1,5 +1,5 @@ 2.4 #!/usr/bin/python 2.5 -import monomer 2.6 +from monomer import AminoAcidType 2.7 from Bio.PDB import PDBParser, CaPPBuilder 2.8 from Bio.Seq import Seq 2.9 from allpy_pdb import Pdb 2.10 @@ -12,12 +12,12 @@ 2.11 * name -- str with the name of sequence 2.12 * description -- str with description of the sequence 2.13 * monomers -- list of monomer objects (aminoacids or nucleotides) 2.14 - * pdb_chain -- list of Bio.PDB.Chain's 2.15 + * pdb_chains -- list of Bio.PDB.Chain's 2.16 2.17 TODO: class Protein: container of multiple Sequences, 2.18 class ProteinMononer: container of multiple Monomers 2.19 """ 2.20 - def __init__(self, name, monomers, description=""): 2.21 + def __init__(self, monomers, name='', description=""): 2.22 self.name = name 2.23 self.description = description 2.24 self.monomers = monomers 2.25 @@ -47,6 +47,9 @@ 2.26 print sequence 2.27 # FIXME: align and map 2.28 2.29 + @staticmethod 2.30 + def from_fasta(self, fasta_str, name='', description='', type=AminoAcidType): 2.31 + seq = Sequence([]) 2.32 2.33 2.34