Harigami
ログイン
anonymous タイトルなし
No License Python
コピー
class Protein:
    def __init__(self, protein_name, sequence):
        self.protein_name = protein_name
        self.sequence = sequence

class Peptide(Protein):
    def __init__(self, protein_name, sequence, start, end):
        super().__init__(protein_name, sequence)
        self.peptide_name = ''
        self.start = start
        self.end = end
    def set_peptide_name(self):
        self.peptide_name = self.protein_name + '[' + str(self.start) + '-' + str(self.end) + ']'

peptides = []

for pro in proteins:
    for start, end in itertools.combinations(range(len(pro.sequence)+1), 2):
        print(pro.protein_name)
        print(pro.sequence[start:end])
        peptides.append(Peptide(pro.protein_name, pro.sequence[start:end], start+1, end))

for pep in peptides:
    pep.set_peptide_name()

class modPeptide
class Protein:
    def __init__(self, protein_name, sequence):
        self.protein_name = protein_name
        self.sequence = sequence

class Peptide(Protein):
    def __init__(self, protein_name, sequence, start, end):
        super().__init__(protein_name, sequence)
        self.peptide_name = ''
        self.start = start
        self.end = end
    def set_peptide_name(self):
        self.peptide_name = self.protein_name + '[' + str(self.start) + '-' + str(self.end) + ']'

peptides = []

for pro in proteins:
    for start, end in itertools.combinations(range(len(pro.sequence)+1), 2):
        print(pro.protein_name)
        print(pro.sequence[start:end])
        peptides.append(Peptide(pro.protein_name, pro.sequence[start:end], start+1, end))

for pep in peptides:
    pep.set_peptide_name()

class modPeptide
コンソール
現在、コメントはありません。
最初のコメンターになりませんか?