-
Notifications
You must be signed in to change notification settings - Fork 0
Nechaeva #1
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
SidorinAnton
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.
Красиво!
| if (set(seq).issubset(DNA_ALPHABET)) or (set(seq).issubset(RNA_ALPHABET)): | ||
| if ('u' in seq) or ('U' in seq): |
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.
Многовато скобок )))
| 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: |
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.
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) |
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.
Почему .get вместо []? ))
| 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} |
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.
Не оч хорошо, что возвращается словарь с разными ключами. Ты же скорее всего эту функцию будешь вызывать не только для отображения. Соответственно, в другой функции тебе нужно будет доставать значение по ключу
| 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} |
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.
Та же история и тут, что ключи различаются
| import additional_modules.for_filter_read as ffr | ||
| import additional_modules.dna_rna_tools as drt | ||
| import additional_modules.run_aminoacid_seq as amino |
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.
можно не переназывать ))
|
|
||
| filter_seqs = {} | ||
|
|
||
| if type(gc_bounds) != tuple: |
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.
isinstance
|
|
||
| if type(gc_bounds) != tuple: | ||
| gc_bounds = (0, gc_bounds) | ||
| if type(length_bounds) != tuple: |
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.
isinstance
| 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: |
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.
Это все можно было бы сделать в одном ифе через and ))
No description provided.