Skip to content

Feedback hw6#4

Open
1799mrd wants to merge 8 commits intomainfrom
feedbackHW6
Open

Feedback hw6#4
1799mrd wants to merge 8 commits intomainfrom
feedbackHW6

Conversation

@1799mrd
Copy link
Copy Markdown
Owner

@1799mrd 1799mrd commented Oct 17, 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.

В целом неплохо!
Насчет всяких скриптов. Такое лучше бы было разнести по папкам. Например, в папку examples поместить все example файлы. В папку scripts -- скрипты итд

Насчет readlines. В целом это может работать, но если файл очень большой, то мы можем упасть с ошибкой типа MemoryError.
Так что всё-таки надежнее читать файлы (особенно биоинформатические) построчно ))

Comment thread all_functions/myfile.txt
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 all_functions/script.py
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 oneline_fasta_script.py
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 my_change.fasta
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 +19 to +21
if line.startswith('@'):
seq_id = line
id_seq.append(seq_id)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

У тебя так может начинаться и 4 строка с качеством

Comment on lines +22 to +23
elif line.startswith('+'):
pass
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 +40 to +50
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.

Не оч понимаю, а почему у тебя 2 функции filter_fastq_sequences (тут и в bioinf_script.py)?
Причем к тому же и по-разному написанные ))

Comment thread bio_files_processor.py

def change_fasta_start_pos(input_fasta, shift, output_fasta):
with open(input_fasta, 'r') as input_file:
lines = input_file.readlines()
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
sequences = []
index=[]
with open(input_file, 'r') as file:
lines = file.readlines()
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Не оч хорошо, т.к. если файл очень большой, то можем упасть с ошибкой ))
Лучше делать итерацию по строкам

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