Skip to content

Develop#3

Open
1799mrd wants to merge 7 commits intofeedbackfrom
develop
Open

Develop#3
1799mrd wants to merge 7 commits intofeedbackfrom
develop

Conversation

@1799mrd
Copy link
Copy Markdown
Owner

@1799mrd 1799mrd commented Oct 13, 2023

No description provided.

Copy link
Copy Markdown

@SidorinAnton SidorinAnton left a comment

Choose a reason for hiding this comment

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

В целом неплохо, но есть странности ))

  • нет типизации
  • не везде есть докстринги
  • очень странно с функцией filter_fastq_sequences, которая реализована в 2х местах (причем в файле bioinf_script.py она не работает и явно хуже той, что в файле all_functions/fastq_filtration_tools.py)

А так молодец! Продолжай в том же духе ))

Comment on lines +51 to +54
weight_amino = [71.08, 156.2, 114.1, 115.1, 103.1, 129.1, 128.1, 57.05, 137.1, 113.2, 113.2, 128.2, 131.2, 147.2, 97.12, 87.08,
101.1, 186.2, 163.2, 99.13, 168.05, 255.3,
71.08, 156.2, 114.1, 115.1, 103.1, 129.1, 128.1, 57.05, 137.1, 113.2, 113.2, 128.2, 131.2, 147.2, 97.12, 87.08,
101.1, 186.2, 163.2, 99.13, 168.05, 255.3]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Тут лучше словарь, где в качестве ключей идут аминоксилоты

71.08, 156.2, 114.1, 115.1, 103.1, 129.1, 128.1, 57.05, 137.1, 113.2, 113.2, 128.2, 131.2, 147.2, 97.12, 87.08,
101.1, 186.2, 163.2, 99.13, 168.05, 255.3]

import random
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

это нужно в самый верх файла

d_names = dict(zip(short_code, long_code))
recording = sequence.maketrans(d_names)
return sequence.translate(recording)
else:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Тут else не нужен

recording = sequence.maketrans(d_names)
return sequence.translate(recording)
else:
len = int(input("введите желаемую длину: "))
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 on lines +72 to +78
else:
len = int(input("введите желаемую длину: "))
bases = list(amino_acid)
amino_sequencqe = ''.join(random.choice(bases) for i in range(len))
d_names = dict(zip(short_code, long_code))
recording = amino_sequencqe.maketrans(d_names)
return "рандомная последовательнсть", amino_sequencqe, amino_sequencqe.translate(recording)
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)

Comment thread bioinf_script.py
Comment on lines +3 to +5
from all_functions.fastq_filtration_tools import filter_fastq_sequences

def filter_fastq_sequences(seqs, gc_bounds=(0, 100), length_bounds=(0, 2**32), quality_threshold=0):
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_0 )))
У тебя же уже есть эта функция (вот ты её выше импортируешь). Зачем еще одна, которая к тому же написана хуже

Comment on lines +16 to +27
def filter_fastq_sequences(seqs, gc_bounds=(0, 100), length_bounds=(0, 2**32), quality_threshold=0):
filtered_seqs = {}

for name, (sequence, quality) in seqs.items():
gc_content = calculate_gc_content(sequence)
seq_length = len(sequence)
avg_quality = calculate_avg_quality(quality)

if is_within_bounds(gc_content, gc_bounds) and is_within_bounds(seq_length, length_bounds) and avg_quality >= quality_threshold:
filtered_seqs[name] = (sequence, quality)

return filtered_seqs
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

А почему это не в файле bioinf_script.py?

Comment thread bioinf_script.py

for seq_name, (sequence, quality) in seqs.items():
# Фильтрация по GC составу
gc_content = calculate_gc_content(sequence)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Ты же не импортируешь calculate_gc_content 0_0

Comment thread bioinf_script.py
continue

# Фильтрация по качеству
average_quality = calculate_average_quality(quality)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Ты же не импортируешь calculate_average_quality 0_0

Comment on lines +1 to +7
amino_acid = 'ARNDCEQGHILKMFPSTWYVUOarndceqghilkmfpstwyvuo'
short_code = list(amino_acid)
long_code = ['Ala', 'Arg', 'Asn', 'Asp', 'Cys', 'Glu', 'Gln', 'Gly', 'His', 'Ile', 'Leu', 'Lys', 'Met', 'Phe', 'Pro',
'Ser', 'Thr', 'Trp', 'Tyr', 'Val', 'Sec', 'Pyl',
'Ala', 'Arg', 'Asn', 'Asp', 'Cys', 'Glu', 'Gln', 'Gly', 'His', 'Ile', 'Leu', 'Lys', 'Met', 'Phe', 'Pro',
'Ser', 'Thr', 'Trp', 'Tyr', 'Val', 'Sec', 'Pyl']
codon_table = {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Это все константы, поэтому нужно капсом:
AMINO_ACIDS, SHORT_CODE...

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