Skip to content

Hw14#3

Open
BeskrovnaiaM wants to merge 8 commits into
mainfrom
HW14
Open

Hw14#3
BeskrovnaiaM wants to merge 8 commits into
mainfrom
HW14

Conversation

@BeskrovnaiaM

Copy link
Copy Markdown
Owner

No description provided.

Comment thread README.md

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Кажется ридми стал немного outdated :))

Comment thread modules/dna_rna_tools.py

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это стоит удалить уже (как и остальные эти модули)

Comment thread main_script_HW14.py

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Этот код тоже по идее должен был бы быть в biotools.py

Comment thread main_script_HW14.py
Comment on lines +29 to +34
def __getitem__(self, slc) -> str:
if isinstance(slc, int):
return self.seq.__getitem__(slc - 1)
elif isinstance(slc, slice):
new_slice = slice(slc.start - 1, slc.stop, slc.step)
return self.seq.__getitem__(new_slice)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ты это специально решила перекодировать? Просто мы кажется этот пример на лекции не разбирали. Если ты сама разобралась - то респект

Comment thread main_script_HW14.py
Comment on lines +42 to +44
def check_alphabet(self) -> bool:
unique_char_seq = set(self.seq)
return all(nuc in self.complement_dict for nuc in unique_char_seq)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Функционально одно и то же конечно, но кажется все таки не совсем логично использовать complement_dict для проверки алфавита))

Comment thread main_script_HW14.py
return self.__class__(''.join(comp_seq))

def gc_content(self) -> float:
gc_count = sum(1 for base in self.seq if base.upper() in ['G', 'C'])

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Оригинальный подход! Можно наверное вообще как нибудь типа:

Suggested change
gc_count = sum(1 for base in self.seq if base.upper() in ['G', 'C'])
gc_count = sum(base.upper() in ['G', 'C'] for base in self.seq)

Comment thread main_script_HW14.py


class DNASequence(NucleicAcidSequence):
complement_dict = {'A': 'T', 'T': 'A', 'G': 'C', 'C': 'G', 'a': 't', 't': 'a', 'g': 'c', 'c': 'g'}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ну это кажется линтерами должно разбиваться на несколько строк

Comment thread main_script_HW14.py
Comment on lines +99 to +101
def to_rna(self):
result = ''.join(self.rna_dict[base] for base in self.seq)
return RNASequence(result)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment thread biotools.py

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут все эти штуки тоже по сути должны быть удалены. Ну и вижу что код не был отрефакторен на основе ревью из прошлого семестра:))
Эта штука, convert_fasta_to_dic, я ее помню 😂

Comment thread main_script_HW14.py

def check_alphabet(self) -> bool:
unique_amino_acids = set(self.seq)
return unique_amino_acids <= self.amino_acids

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

воо, тут же ты не какими нибудь словарями пользуешься, а множеством аминокислот

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants