Conversation
sme229
reviewed
May 3, 2024
Comment on lines
+88
to
+89
| return sum(amino_acid_weights.get(aa, 0) for aa in self._sequence) | ||
|
|
There was a problem hiding this comment.
Код не учитывает потерю воды при образовании аминокислотной цепи. Например,
water_mw = 18
for aa in list_input_seq:
total_mw = sum(aa_weight_dict[a] for a in list_input_seq)
mw_water_removed = (total_mw - (water_mw * (len(list_input_seq)-1)))
return mw_water_removed
Member
Author
Comment on lines
+45
to
+46
| gc_count = sum(base in {'G', 'C'} for base in self._sequence) | ||
| return gc_count / len(self._sequence) |
There was a problem hiding this comment.
Поскольку это абстрактный класс, то методов здесь не должно быть
| raise ValueError("Invalid sequence for the given type.") | ||
| self._sequence = sequence | ||
|
|
||
| @abstractmethod |
There was a problem hiding this comment.
Насколько я понимаю, декоратор @abstract должен быть перед def init
Member
Author
There was a problem hiding this comment.
Да, тут вообще все методы должны быть абстрактными
Comment on lines
+76
to
+78
| valid_amino_acids = {'A', 'R', 'N', 'D', 'C', 'Q', 'E', 'G', 'H', 'I', | ||
| 'L', 'K', 'M', 'F', 'P', 'S', 'T', 'W', 'Y', 'V'} | ||
| return all(amino_acid in valid_amino_acids for amino_acid in sequence) |
There was a problem hiding this comment.
Можно было добавить ситуацию когда подаются не заглавные буквы, например c помощью set:
unique_chars = set(seq)
single_letter = set('GALMFWKQESPVICYHRNDTgalmfwkqespvicyhrndt')
Comment on lines
+51
to
+52
| def is_valid(self, sequence: str) -> bool: | ||
| return all(nucleotide in {'A', 'C', 'G', 'T'} for nucleotide in sequence) |
There was a problem hiding this comment.
То же самое про заглавные и строчные буквы, можно добавить такую проверку:
nucleotides_dna = set('ATGCatgc')
nucleotides_rna = set('AUGCaugc')
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Review MRPS7