Skip to content

Conversation

@JuliGen
Copy link
Owner

@JuliGen JuliGen commented Oct 7, 2023

No description provided.

Copy link

@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.

Красиво!

Comment on lines +15 to +16
if (set(seq).issubset(DNA_ALPHABET)) or (set(seq).issubset(RNA_ALPHABET)):
if ('u' in seq) or ('U' in seq):

Choose a reason for hiding this comment

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

Многовато скобок )))

return sum(quality_phred_33) / len(quality_phred_33)


def create_report_about_filt(seqs: dict[str, tuple[str, str]], filter_seq: dict[str, tuple[str, str]]) -> str:

Choose a reason for hiding this comment

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

filt? 0_0
create_filtration_report можно, например

:return: int
"""
sequence_upper = sequence.upper()
molecular_weight = sum(AMINO_ACID_WEIGHTS.get(aa, 0) for aa in sequence_upper)

Choose a reason for hiding this comment

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

Почему .get вместо []? ))

Comment on lines +100 to +110
if percent:
result_dict = {"Percentage of positively charged amino acids":
(round((amount_positive * 100) / len(amino_seq))),
"Percentage of neutrally charged amino acids":
(round((amount_neutral * 100) / len(amino_seq))),
"Percentage of negatively charged amino acids":
(round((amount_negative * 100) / len(amino_seq)))}
else:
result_dict = {"Number of positively charged amino acids": amount_positive,
"Number of neutrally charged amino acids": amount_neutral,
"Number of negatively charged amino acids": amount_negative}

Choose a reason for hiding this comment

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

Не оч хорошо, что возвращается словарь с разными ключами. Ты же скорее всего эту функцию будешь вызывать не только для отображения. Соответственно, в другой функции тебе нужно будет доставать значение по ключу

Comment on lines +135 to +142
if percent:
result_dict = {'Percentage of hydrophilic amino acids':
(round((amount_hydrophilic * 100) / len(amino_seq), 2)),
'Percentage of hydrophobic amino acids':
(round((amount_hydrophobic * 100) / len(amino_seq), 2))}
else:
result_dict = {'Number of hydrophilic amino acids': amount_hydrophilic,
'Number of hydrophobic amino acids': amount_hydrophobic}

Choose a reason for hiding this comment

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

Та же история и тут, что ключи различаются

Comment on lines +2 to +4
import additional_modules.for_filter_read as ffr
import additional_modules.dna_rna_tools as drt
import additional_modules.run_aminoacid_seq as amino

Choose a reason for hiding this comment

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

можно не переназывать ))


filter_seqs = {}

if type(gc_bounds) != tuple:

Choose a reason for hiding this comment

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

isinstance


if type(gc_bounds) != tuple:
gc_bounds = (0, gc_bounds)
if type(length_bounds) != tuple:

Choose a reason for hiding this comment

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

isinstance

Comment on lines +98 to +100
if gc_bounds[0] <= ffr.determine_gc_content(read) <= gc_bounds[1]:
if length_bounds[0] <= ffr.determine_lenght(read) <= length_bounds[1]:
if ffr.determine_quality(quality) > quality_threshold:

Choose a reason for hiding this comment

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

Это все можно было бы сделать в одном ифе через and ))

@JuliGen JuliGen closed this Feb 23, 2024
@JuliGen JuliGen reopened this Feb 23, 2024
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