How to use the kipoiseq.Interval 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 gtf_row2interval(row):
    """Note: GTF is 1-based
    """
    return Interval(str(row.Chromosome),
                    int(row.Start) - 1,
                    int(row.End),
                    strand=str(row.Strand))
github kipoi / kipoiseq / tests / test_5_protein_dl.py View on Github external
def strand_default(self, intervals):
        return [Interval(interval.chrom, interval.start, interval.end, interval.name, interval.score, strand=".") for interval in intervals]    
github kipoi / kipoiseq / kipoiseq / extractors / gtf.py View on Github external
def gtf_row2interval(row, interval_attrs: Union[str, List[str]] = None):
    """
    Convert gtf row object into interval class.
    """
    if interval_attrs:
        # check type
        if not isinstance(interval_attrs, list):
            interval_attrs = [interval_attrs]

        interval_attrs = {i: row[i] for i in interval_attrs if i in row}

    return Interval(str(row.Chromosome),
                    int(row.Start),
                    int(row.End),
                    strand=str(row.Strand),
                    attrs=interval_attrs)