Skip to content

Conversation

@Alisa411
Copy link
Owner

No description provided.

Alisa411 and others added 30 commits October 8, 2023 15:26
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):

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):

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):

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):

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