Skip to content

Conversation

@grishchenkoira
Copy link
Owner

This pull request adds a utility Bio_Seq_Analysis_Tool.py with 3 main functions, a folder with 3 modules required for Bio_Seq_Analysis_Tool and README.md file

Copy link

@albidgy albidgy left a comment

Choose a reason for hiding this comment

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

Плюсы:

  • Молодец, что добавила в README примеры, что вернется если подать такую-то последовательность.
  • Код, который ты пишешь, работает правильно.
  • Докстринги и typing сделаны правильно и подробно. Здорово!

Замечания:

  • Не забывай ставить пробелы.
  • Не включила границы в fastq_analysis.
  • Не нужно системные файлы добавлять на GitHub, это плохая практика. Ты добавила директорию .ipynb_checkpoints.
  • Вот совсем непонятно, что было сделано за тот или иной коммит. Хочется более конкретных комментариев, что было добавлено/сделано.
Снимок экрана 2023-10-16 в 12 12 48 - У тебя достаточно тяжело воспринимаемый код получается. Это сейчас не страшно, но над этим нужно работать. У меня есть 2 предложения:
  1. Когда ты написала какую-то функцию, пробуй придумать, как можно убрать повторяющиеся части кода (если они есть).
  2. Можно, думаю, смотреть прошлые домашние задания одногруппников. Мы там указываем на преимущества и недостатки. Анализируй код, почему он тебе нравится или не нравится.

Баллы:

  • 3 фильтрации FASTQ 3/3
  • Главная функция 0.9/1 (границы значений не включены)
  • README 2/2
  • Структура репозитория и качество кода 2/3 (-0.5 за системные файлы, -0.3 за комментарии к коммитам, -0.2 Отсутствие пробелов).
    Улучшение кода ДНК/РНК и белковых тулов 0.8/1.

Итого: 8.7 баллов

:rtype: str
:return: complement sequence
"""
complement_dict = {'A': 'T', 'C': 'G',
Copy link

Choose a reason for hiding this comment

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

Про словарь я тебе писала, что его лучше сделать константой и вынести за пределы функции.

complement_dict = {'A': 'T', 'C': 'G',
'G': 'C', 'T': 'A', 'U': 'A', 'a': 't',
'c': 'g', 'g': 'c', 't': 'a', 'u': 'a'}
complement_seq = []
Copy link

Choose a reason for hiding this comment

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

За это спасибо!

:return: GC-contentn percent
"""
length = len(seq)
gc_content = 0.0
Copy link

Choose a reason for hiding this comment

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

Можно не создавать переменную, она сама создастся на лету в строке 78

length = len(seq)
gc_content = 0.0
seq_up = seq.upper()
c = seq_up.count("C")
Copy link

Choose a reason for hiding this comment

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

Раньше было лучше название - c_nucl

seq_up = seq.upper()
c = seq_up.count("C")
g = seq_up.count("G")
gc_content = round(((c+g)/length*100),2)
Copy link

Choose a reason for hiding this comment

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

Не забывай про пробелы. + одна пара скобок тут лишняя.

Suggested change
gc_content = round(((c+g)/length*100),2)
gc_content = round((c+g) / length * 100 , 2)

if len(sep_seq[0]) == 1:
encode_seq.append(RESIDUES_NAMES_THREE[residue])
for residue, reg in zip(encode_seq, save_register(seq)):
if (reg == 1):
Copy link

Choose a reason for hiding this comment

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

Скобки не нужны

encode_seq.append(RESIDUES_NAMES_THREE[residue])
for residue, reg in zip(encode_seq, save_register(seq)):
if (reg == 1):
encode_seq_registered += residue.upper()
Copy link

Choose a reason for hiding this comment

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

Лучше использовать append()

fin_seq.append(residue)
if ((i+1) % 3 == 0):
fin_seq.append(' ')
return ' '.join(fin_seq)
Copy link

Choose a reason for hiding this comment

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

Suggested change
return ' '.join(fin_seq)
return ''.join(fin_seq)

Лучше убрать пробел, а то запись странная получается.
Снимок экрана 2023-10-16 в 12 02 14

Код работает правильно, но в нем много повторений. Если тебе будет интересно, как это можно сделать короче, напиши мне, я напишу альтернативную версию.

Comment on lines +176 to +178
residue_count[[tl_code for tl_code in RESIDUES_NAMES if RESIDUES_NAMES[tl_code] == residue][0]] = 0
for residue in seq:
residue_count[[tl_code for tl_code in RESIDUES_NAMES if RESIDUES_NAMES[tl_code] == residue][0]] += 1
Copy link

Choose a reason for hiding this comment

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

Вот эту часть можно было переписать. 2 словаря у тебя теперь есть, поэтому достаточно легко сделать это более аккуратно. Замечание не исправлено.
Снимок экрана 2023-10-16 в 12 04 41

site_full_position.append(f'{site_start_position[counter]}:{site_end_position[counter]}')
return f'Site entry in sequence = {site_count}. Site residues can be found at positions: {site_full_position}'
else:
return f'{site} site is not in sequence!'
Copy link

Choose a reason for hiding this comment

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

Замечание не исправлено.
Снимок экрана 2023-10-16 в 12 07 41

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