-
Notifications
You must be signed in to change notification settings - Fork 0
Hw6 files #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
nvaulin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Привет!
- README, хороший, но кажется не обновлен:)
- Названия коммитов не забывай делать с загавной буквы) В остальном оу
- По поводу FASTQ-модуля. Ты добавила чтение и запись, но таким образом что этим вообще невозможно воспользоваться. Кажется все части у тебя написаны правильно, поэтому ставлю 1/2, но к сожалению их надо еще соединить как надо.
- Не нашел остальных функций. Если ты их и не писала - то ок. Если что сможешь потом сдать на половину баллов.
- Обидные ошибки с импортами из-за который весь код падает с ошибкой:)
Баллы
- Добработка FASTQ-модуля: 1/2 балла
- convert_multiline_fasta_to_oneline: 0/4 балла
- select_genes_from_gbk_to_fasta: 0/4 балла
main_script.py
Outdated
| 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Функции должны называться глаголами
- Ну че ж тут как то как будто мы студенты:))
| 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): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| def main_protein_tools(*args: str): | |
| def run_protein_tools(*args: str): |
| action = args[-1] | ||
| sequences = args[:-1] | ||
| action_list = { | ||
| "get_pI": get_pI, |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| def main_fastq(input_path: str, output_filename: str = None): | |
| def run_fastq_filter(input_path: str, output_filename: str = None): |
или
| 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): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ну тут же не просто файл:)
| def parse_file(filename): | |
| def read_fastq(path): |
|
|
||
| def parse_file(filename): | ||
| with open(filename, 'r') as f: | ||
| lines = f.read().split('\n') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
По сути ты сделала f.readlines, но в два притопа:)
В целом ок, но было бы круче написать это не читая весь файл за раз
| # print(len(lines)) | ||
| # print(*lines, sep="\nx\n") |
There was a problem hiding this comment.
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('@'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Все равно получается привязываешься к какому то содержанию. Тут оно нам не шибко в помощь, нельзя полагаться на то что нам не гарантировано в общем случае. Лучше просто по 4 читать независимо от символов.
| for sequence_id, (sequence, quality) in filtered_data.items(): | ||
| f.write(f"{sequence_id}\n{sequence}\n+\n{quality}\n") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В целом гуд, +- так и ожидалось. Но тут большая проблемка есть:)
Ты не стала читать строку с комментарием вместо неё тут записала "+". Ты получается услугу 2 по цене 1 тут продаешь:) Мы вам не только ваши данные отфильтруем, так еще и почистим от всяких комментариев которые вам могут быть нужны!
Не, коммент тут очень важно оставить как есть, не надо ничего делать из того что человек не просил (да и у вас нигде вроде не заявлено, ни в док стрингах ни в ридми, мол а еще вам в подарок удаляем треть информции)

No description provided.