Skip to content

Conversation

@Alisa411
Copy link
Owner

No description provided.

Alisa411 and others added 30 commits October 8, 2023 15:26
Copy link

@nvaulin nvaulin left a comment

Choose a reason for hiding this comment

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

Привет!

  1. README, хороший, но кажется не обновлен:)
  2. Названия коммитов не забывай делать с загавной буквы) В остальном оу
  3. По поводу FASTQ-модуля. Ты добавила чтение и запись, но таким образом что этим вообще невозможно воспользоваться. Кажется все части у тебя написаны правильно, поэтому ставлю 1/2, но к сожалению их надо еще соединить как надо.
  4. Не нашел остальных функций. Если ты их и не писала - то ок. Если что сможешь потом сдать на половину баллов.
  5. Обидные ошибки с импортами из-за который весь код падает с ошибкой:)

Баллы

  • Добработка FASTQ-модуля: 1/2 балла
  • convert_multiline_fasta_to_oneline: 0/4 балла
  • select_genes_from_gbk_to_fasta: 0/4 балла

Итого: 1 балл
image

main_script.py Outdated
Comment on lines 1 to 6
from data_processing_scripts.dna_rna_tools import transcribe, reverse, complement, reverse_complement
from data_processing_scripts.das_protein_tools import get_pI, calculate_aa_freq, translate_protein_rna, convert_to_3L_code, protein_mass
from data_processing_scripts.fastq_script import main_fastq_tools, parse_file, save_filtered_fastq
import data_processing_scripts.dna_rna_dict as drd
import data_processing_scripts.protein_dict as prd
import os
Copy link

Choose a reason for hiding this comment

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

Suggested change
from data_processing_scripts.dna_rna_tools import transcribe, reverse, complement, reverse_complement
from data_processing_scripts.das_protein_tools import get_pI, calculate_aa_freq, translate_protein_rna, convert_to_3L_code, protein_mass
from data_processing_scripts.fastq_script import main_fastq_tools, parse_file, save_filtered_fastq
import data_processing_scripts.dna_rna_dict as drd
import data_processing_scripts.protein_dict as prd
import os
import os
import data_processing_scripts.dna_rna_dict as drd
import data_processing_scripts.protein_dict as prd
from data_processing_scripts.dna_rna_tools import transcribe, reverse, complement, reverse_complement
from data_processing_scripts.das_protein_tools import get_pI, calculate_aa_freq, translate_protein_rna, convert_to_3L_code, protein_mass
from data_processing_scripts.fastq_script import main_fastq_tools, parse_file, save_filtered_fastq

main_script.py Outdated
import os


def main_dna_rna_tools(*args: str):
Copy link

Choose a reason for hiding this comment

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

  1. Функции должны называться глаголами
  2. Ну че ж тут как то как будто мы студенты:))
Suggested change
def main_dna_rna_tools(*args: str):
def run_dna_rna_tools(*args: str):

main_script.py Outdated
return results if len(results) > 1 else results[0]


def main_protein_tools(*args: str):
Copy link

Choose a reason for hiding this comment

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

Suggested change
def main_protein_tools(*args: str):
def run_protein_tools(*args: str):

action = args[-1]
sequences = args[:-1]
action_list = {
"get_pI": get_pI,
Copy link

Choose a reason for hiding this comment

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

В питоне названия функций - только в нижнем регистре:)

main_script.py Outdated

return result

def main_fastq(input_path: str, output_filename: str = None):
Copy link

Choose a reason for hiding this comment

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

Suggested change
def main_fastq(input_path: str, output_filename: str = None):
def run_fastq_filter(input_path: str, output_filename: str = None):

или

Suggested change
def main_fastq(input_path: str, output_filename: str = None):
def filter_fastqinput_path: str, output_filename: str = None):

Тем не менее, тут большая ключевая ошибка. Надо было в исходной функции заменить прием словаря на прием пути. Ты добавила по сути "функцию-обертку" снаружи (и это в цело ок), но которая не принимает никаких аргументов для фильтрации... Как я могу воспользоваться фильтром? В этой функции я не могу задать условия для фильтра, в функции из дз 5 я не могу передать файл.

# Here should be a python script


def parse_file(filename):
Copy link

Choose a reason for hiding this comment

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

Ну тут же не просто файл:)

Suggested change
def parse_file(filename):
def read_fastq(path):


def parse_file(filename):
with open(filename, 'r') as f:
lines = f.read().split('\n')
Copy link

Choose a reason for hiding this comment

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

По сути ты сделала f.readlines, но в два притопа:)

В целом ок, но было бы круче написать это не читая весь файл за раз

Comment on lines +115 to +116
# print(len(lines))
# print(*lines, sep="\nx\n")
Copy link

Choose a reason for hiding this comment

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

Ну тут в продакшене такие отладки не надо оставлять

line = lines[i].strip()
# Parse 4 lines per 1 sequence
# The first line should contain '@' sign
if line.startswith('@'):
Copy link

Choose a reason for hiding this comment

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

Все равно получается привязываешься к какому то содержанию. Тут оно нам не шибко в помощь, нельзя полагаться на то что нам не гарантировано в общем случае. Лучше просто по 4 читать независимо от символов.

Comment on lines +149 to +150
for sequence_id, (sequence, quality) in filtered_data.items():
f.write(f"{sequence_id}\n{sequence}\n+\n{quality}\n")
Copy link

Choose a reason for hiding this comment

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

В целом гуд, +- так и ожидалось. Но тут большая проблемка есть:)
Ты не стала читать строку с комментарием вместо неё тут записала "+". Ты получается услугу 2 по цене 1 тут продаешь:) Мы вам не только ваши данные отфильтруем, так еще и почистим от всяких комментариев которые вам могут быть нужны!

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

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