Skip to content

Hw14 oop#3

Open
Alisa411 wants to merge 72 commits intomainfrom
HW14_OOP
Open

Hw14 oop#3
Alisa411 wants to merge 72 commits intomainfrom
HW14_OOP

Conversation

@Alisa411
Copy link
Copy Markdown
Owner

No description provided.

Alisa411 and others added 30 commits October 8, 2023 15:26
Comment thread HW14_main.py
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):
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 HW14_main.py
output_path = output_filename
SeqIO.write(filtered_seqs, output_path, "fastq")

class BiologicalSequence(ABC):
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)

Comment thread HW14_main.py
def __init__(self, sequence):
super().__init__(sequence)

def transcribe(self):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

тут же уже RNASequence должен возвращаться

Comment thread HW14_main.py
ALPHABET = set("AUGCaugc")


class AminoAcidSequence(BiologicalSequence):
Copy link
Copy Markdown

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), но так как раз ты можешь обойти. В общем, напиши, давай попробуем воспроизвести и разберемся:)

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