Hw4 petrikov#17
Conversation
…_point, 'rename': transform_to_three_letters,
'lengths': sequence_length, 'weights': calc_protein_mass}
FUNC_DICT_FOR_PAIR_RETURN = {'heavy': heaviest_protein, 'light': lightest_protei
Edit Readme
SidorinAnton
left a comment
There was a problem hiding this comment.
В целом неплохо!
Мне кажется, немного перемудрили с функциями для подсчета массы ... но а вообще молодцы ))
| * Muradova Gulgaz | ||
| * Yury Popov | ||
|
|
||
|  |
There was a problem hiding this comment.
Не оч понял, а кто 4-ый девелопер )))
Причем судя по его гитхабу, он вроде как пишет на Го )))
| """ | ||
| Perform some simple operations on amino acids sequences. | ||
| """ |
There was a problem hiding this comment.
Раз это главная функция (в какой-то степени точка входа), тут бы побольше описания дать...
| 'light': find_lightest_proteins} | ||
|
|
||
|
|
||
| def process_seqs(option: str, seqs: list): |
There was a problem hiding this comment.
def process_seqs(option: str, seqs: List[str]):| if isinstance(seqs, str): | ||
| seq_tmp = seqs | ||
| seqs = [seq_tmp] |
There was a problem hiding this comment.
Ну вот по идее такого никогда не должно быть, т.к. вы явно сказали, что seqs -- лист )))
Непонятно, зачем проверять её на строчку...
| return f'{proteins} - {min_weight}' | ||
|
|
||
|
|
||
| def check_sequences(seqs: list): |
There was a problem hiding this comment.
def check_sequences(seqs: List[str]):| def find_heaviest_proteins(sequence: list): | ||
| """ | ||
| Return the sequence of the heaviest protein from list | ||
| """ | ||
| protein_mass = {} | ||
| list_of_protein = sequence | ||
| for i in list_of_protein: | ||
| protein_mass[i] = calc_protein_mass(i) | ||
| return count_uniq_max_mass(protein_mass) |
There was a problem hiding this comment.
Все те же самые комменты, что и для функции find_lightest_proteins ))
| Calculate protein molecular weight using the average | ||
| molecular weight of amino acid - 110 Da | ||
| """ | ||
| return len(seq) * 110 |
There was a problem hiding this comment.
У вас же есть функция sequence_length... почему не использовали её?
return sequence_length(seq) * 110| sequence to 3-letter symbols separated by | ||
| hyphens. | ||
| """ | ||
| new_name = '' |
There was a problem hiding this comment.
кажется, не оч удачное название ))
мб хотя бы three_letter_seq
| return round(ph_iso_point, 1) | ||
|
|
||
|
|
||
| def transform_to_three_letters(seq: str) -> str: |
There was a problem hiding this comment.
Имхо, лучше было бы разделитель как раз задать параметром по умолчанию
| charged_amino_ac_numbers = [] | ||
| for amino_ac in ("C", "D", "E", "Y", "H", "K", "R"): | ||
| charged_amino_ac_numbers.append(seq.count(amino_ac)) |
There was a problem hiding this comment.
Тут не оч хорошо использовать список. Лучше бы сделать тут вот так:
charged_amino_ac_numbers = {
"C": 0, "D": 0, "E": 0, "Y": 0, "H": 0, "K": 0, "R": 0
}
for amino_ac in seq:
if amino_ac in charged_amino_ac_numbers:
charged_amino_ac_numbers[amino_ac] += 1
No description provided.