Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

PEP8

  • Loading branch information...
commit 2b854972e940d1f857157bf36deea5ff86eca2f9 1 parent 6d38025
James Casbon authored
Showing with 7 additions and 9 deletions.
  1. +7 −9 vcf/model.py
View
16 vcf/model.py
@@ -1,11 +1,11 @@
import collections
-
+import sys
class _Call(object):
+ """ A genotype call, a cell entry in a VCF file"""
__slots__ = ['site', 'sample', 'data', 'gt_nums', 'called']
- """ A genotype call, a cell entry in a VCF file"""
def __init__(self, site, sample, data):
#: The ``_Record`` for this ``_Call``
self.site = site
@@ -22,11 +22,9 @@ def __init__(self, site, sample, data):
# FIXME how do we know if a non GT call is called?
self.called = None
-
def __repr__(self):
return "Call(sample=%s, %s)" % (self.sample, str(self.data))
-
def __eq__(self, other):
""" Two _Calls are equal if their _Records are equal
and the samples and ``gt_type``s are the same
@@ -364,14 +362,14 @@ def var_subtype(self):
return "ts"
elif len(self.ALT) == 1:
return "tv"
- else: # multiple ALT alleles. unclear
+ else: # multiple ALT alleles. unclear
return "unknown"
elif self.is_indel:
if self.is_deletion:
return "del"
elif len(self.ALT) == 1:
return "ins"
- else: # multiple ALT alleles. unclear
+ else: # multiple ALT alleles. unclear
return "unknown"
elif self.is_sv:
if self.INFO['SVTYPE'] == "BND":
@@ -519,7 +517,7 @@ def __repr__(self):
def make_calldata_tuple(fields):
- """ Return a namedtuple for a given sample format """
+ """ Return a namedtuple for a given call format """
class CallData(collections.namedtuple('calldata', fields)):
__slots__ = ()
@@ -528,8 +526,8 @@ class CallData(collections.namedtuple('calldata', fields)):
_nums = []
def __str__(self):
- dat = ", ".join(["%s=%s" % (x,y)
- for (x,y) in zip(self._fields, self)])
+ dat = ", ".join(["%s=%s" % (x, y)
+ for (x, y) in zip(self._fields, self)])
return "CallData(" + dat + ')'
return CallData
Please sign in to comment.
Something went wrong with that request. Please try again.