How to use the kipoiseq.transforms.functional.rc_dna function in kipoiseq

To help you get started, we’ve selected a few kipoiseq examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kipoi / kipoiseq / tests / test_5_protein_dl.py View on Github external
def prepare_seq(self, seq, strand):
        if strand == '-':
            # optionally reverse complement
            seq = rc_dna(seq)
        seq = cut_seq(seq)
        return seq
github kipoi / kipoiseq / kipoiseq / extractors / protein.py View on Github external
def _prepare_seq(seqs: List[str], strand: str, tag: str):
        """
        Prepare the dna sequence in the final variant, which should be
        translated in amino acid sequence
        :param seqs: current dna sequence
        :param strand: dna strand, where the gene is located
        :param tag: tags, which contain information about ambiguous start/end
        :return: prepared dna sequence ready for translation into amino acid
        sequence
        """
        seq = "".join(seqs)
        if strand == '-':
            # optionally reverse complement
            seq = rc_dna(seq)
        seq = cut_transcript_seq(seq, tag)
        return seq
github kipoi / kipoiseq / kipoiseq / extractors / multi_interval.py View on Github external
intervals: List[Interval],
            reverse_complement: Union[str, bool],
            # *args,
            # **kwargs
    ) -> str:
        """
        Prepare the dna sequence in the final variant, which should be translated in amino acid sequence

        :param seqs: current dna sequence
        :param intervals: the list of intervals corresponding to the sequence snippets
        :param reverse_complement: should the dna be reverse-complemented?
        """
        seq = "".join(seqs)
        if reverse_complement is True or reverse_complement == "-":
            # optionally reverse complement
            seq = rc_dna(seq)
        return seq