-
Notifications
You must be signed in to change notification settings - Fork 0
Hw14 oop #3
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
…nd data_processing_scripts folder
| from Bio.SeqUtils import gc_fraction | ||
|
|
||
|
|
||
| def filter_fastq(input_path: str, output_filename: str = None, gc_bounds=(0, 100), length_bounds=(0, 2 ** 32), quality_threshold=0): |
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.
отлично:)
| output_path = output_filename | ||
| SeqIO.write(filtered_seqs, output_path, "fastq") | ||
|
|
||
| class BiologicalSequence(ABC): |
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.
тут все методы должны были быть абстрактными, в этом и смысл абстрактного класса, он ничего не делает, просто задает структуру, (-2)
| def __init__(self, sequence): | ||
| super().__init__(sequence) | ||
|
|
||
| def transcribe(self): |
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.
тут же уже RNASequence должен возвращаться
| ALPHABET = set("AUGCaugc") | ||
|
|
||
|
|
||
| class AminoAcidSequence(BiologicalSequence): |
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.
По идее тут все ок, ошибка из твоего ноутбука у меня не воспроизвелась. Напиши мне, плиз, давай разберемся)
Вообще ошибка связана с тем, что где-то ты пыталась создать экземпляр абстрактного класса BiologicalSequence. Но не можешь, и это правильно, так не должно быть, если ты запустишь
class SomeAbstractClass(ABC):
def __init__():
pass
@abstractclass
def some_abs_method():
pass
SomeAbstractClass()
то оно упадет с такой же ошибкой. Как я вижу по коду, ты обращаешься только через super().__init__(sequence), но так как раз ты можешь обойти. В общем, напиши, давай попробуем воспроизвести и разберемся:)
No description provided.