Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions vgraph/bed.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
from operator import attrgetter
from itertools import groupby

import pysam

from .smartfile import smartfile


Expand Down Expand Up @@ -50,12 +52,12 @@ def from_line(line):

n = len(fields)

name = fields[3] or None if n >= 4 else None
score = fields[4] or None if n >= 5 else None
strand = fields[5] or None if n >= 6 else None
thick_start = fields[6] or None if n >= 7 else None
thick_end = fields[7] or None if n >= 8 else None
item_rgb = fields[8] or None if n >= 9 else None
name = fields[3] or None
score = fields[4] or None
strand = fields[5] or None
thick_start = fields[6] or None
thick_end = fields[7] or None
item_rgb = fields[8] or None

return BedRecord(contig, start, stop, name, score, strand, thick_start, thick_end, item_rgb)

Expand Down Expand Up @@ -92,7 +94,6 @@ def tabix(self):
if self._tabix:
return self._tabix

import pysam
self._tabix = pysam.Tabixfile(self.filename)

return self._tabix
Expand Down