Skip to content

Lukina hw6#2

Open
MariaLuk wants to merge 12 commits intomainfrom
lukina_hw6
Open

Lukina hw6#2
MariaLuk wants to merge 12 commits intomainfrom
lukina_hw6

Conversation

@MariaLuk
Copy link
Copy Markdown
Owner

No description provided.

Copy link
Copy Markdown

@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-файлов в фильтраторе кажется все написано правильно, но че-то к сожалению привел ввод который выдал мне пустой вывод. Не знаю что именно не так.
  4. В целом работа хорошая, но вот везде какие-то мелкие косяки которые все портят)) В конвертере какой-то небольшой мусор влезает, тоже обрати внимание. В сдвиге позиции у тебя возвращается только первая буква правильного ответа)) В общем не забывай сама все это дело еще проверять перед отправкой, и тогда совсем хорошо будет.

Баллы

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

-0.5 за то что есть неправильные названия аргументов (не так как заявлено в ТЗ)

Итого: 4.3 баллов + 2 доп. балла (они будут стоять в отдельной колонке)

В любом случае, ты молодец! Нужно чуть больше внимательности и так понимаю больше времени, и тогда совсем все супер будет.

Comment thread README.md
Comment on lines +2 to +4
This package consists of 2 mini-tools
`tools_for_bioinformatics` designed to work with nucleotide and amino acid sequences and FASTQ files
`bio_files_processor` provides opportunity to manipulate with FASTA files
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
This package consists of 2 mini-tools
`tools_for_bioinformatics` designed to work with nucleotide and amino acid sequences and FASTQ files
`bio_files_processor` provides opportunity to manipulate with FASTA files
This package consists of 2 mini-tools
`tools_for_bioinformatics` designed to work with nucleotide and amino acid sequences and FASTQ files
`bio_files_processor` provides opportunity to manipulate with FASTA files

Returns:
(str): oligo- and polynucleotide sequence
"""
return complement(seq)[::-1]
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
return complement(seq)[::-1]
return reverse(complement(seq))

Comment on lines +1 to +6
from typing import Union
import os
import modules.nucleic_acids_functions as na
import modules.fastq_filters as ff
import modules.amino_acids_functions as aa
NUCLEOTIDES = {'U', 'A', 'g', 't', 'G', 'T', 'a', 'c', 'C', 'u'}
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
from typing import Union
import os
import modules.nucleic_acids_functions as na
import modules.fastq_filters as ff
import modules.amino_acids_functions as aa
NUCLEOTIDES = {'U', 'A', 'g', 't', 'G', 'T', 'a', 'c', 'C', 'u'}
import os
from typing import Union
import modules.nucleic_acids_functions as na
import modules.fastq_filters as ff
import modules.amino_acids_functions as aa
NUCLEOTIDES = {'U', 'A', 'g', 't', 'G', 'T', 'a', 'c', 'C', 'u'}

С импортами тоже куча своих конвенций. Например тут:

  1. Отделяем от дальнейшего кода 2 строками
  2. Сперва внешние, потом твои
  3. Сперва import, потом from ... import

Ну и там далее еще куча разных, можно про это в PEP-8 прочитать

return answer


def fastq_filtration(input_fastq, gc_bounds=(0, 100), length_bounds=(0, 2 ** 32), quality_treshold=0, output_fastq=''):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

  1. Функции глаголами
  2. Пропущенные значения по умолчанию - None
Suggested change
def fastq_filtration(input_fastq, gc_bounds=(0, 100), length_bounds=(0, 2 ** 32), quality_treshold=0, output_fastq=''):
def run_fastq_filtration(input_fastq, gc_bounds=(0, 100), length_bounds=(0, 2 ** 32), quality_treshold=0, output_fastq=None):

или

Suggested change
def fastq_filtration(input_fastq, gc_bounds=(0, 100), length_bounds=(0, 2 ** 32), quality_treshold=0, output_fastq=''):
def filter_fastq(input_fastq, gc_bounds=(0, 100), length_bounds=(0, 2 ** 32), quality_treshold=0, output_fastq=None):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

А еще в ТЗ первый аргумент это input_path, ну и + в слове treshold опечатка (quality_threshold) :)

"""
if not os.path.isdir('fastq_filtrator_resuls'):
os.mkdir('fastq_filtrator_resuls')
if output_fastq == '':
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
if output_fastq == '':
if not output_fastq:

Ну а вообще с учетом прошло комментария:

Suggested change
if output_fastq == '':
if output_fastq is None:

Comment thread modules/fastq_filters.py
return seqs


def write_dict_file_to_fastq(seqs, output_fastq):
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
def write_dict_file_to_fastq(seqs, output_fastq):
def write_fastq(seqs, output_fastq):

Comment thread modules/fastq_filters.py
Comment on lines +94 to +99
with open(output_fastq, 'w') as output_file:
for key, params in seqs.items():
output_file.write(key + '\n')
output_file.write(params[0] + '\n')
output_file.write(params[1] + '\n')
output_file.write(params[2] + '\n')
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 bio_files_processor.py
output_fasta = os.path.join('multiple_to_online_results', os.path.basename(input_fasta))
else:
output_fasta = os.path.join('multiple_to_online_results', output_fasta + ".fasta")
with open(input_fasta) as input_file, open(output_fasta, 'w') as output_file:
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 bio_files_processor.py
Comment on lines +19 to +37
current = []
output_file.write(input_file.readline())
while True:
line = input_file.readline()
current.append(line.strip())
if line.startswith('>'):
output_file.write(''.join(current) + '\n')
output_file.write(line)
current = []
break

for line in input_file:
if line.startswith('>'):
output_file.write(''.join(current) + '\n')
output_file.write(line)
current = []
else:
current.append(line.strip())
output_file.write(''.join(current) + '\n')
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Вроде конечно все выглядит ок и хорошо. И вообще здорово что ты так все в одном решила написать. Но...
У меня тут при тестировании какой-то небольшой мусор в первой записи выводится:)
image

Comment thread bio_files_processor.py
new_fasta = s1 +s2
with open(output_fasta, 'w') as output_file:
output_file.write(name +'\n')
output_file.write(new_fasta[0] + '\n')
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Вот всё тут супер, но этот [0] оставляет лишь первую букву)))

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