Skip to content

Commit

Permalink
Made _AltRecord into ABC.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lenna Peterson committed Jul 1, 2012
1 parent 2b85497 commit cc894c5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion vcf/model.py
@@ -1,3 +1,4 @@
from abc import ABCMeta, abstractmethod
import collections import collections
import sys import sys


Expand Down Expand Up @@ -408,13 +409,15 @@ def is_monomorphic(self):


class _AltRecord(object): class _AltRecord(object):
'''An alternative allele record: either replacement string, SV placeholder, or breakend''' '''An alternative allele record: either replacement string, SV placeholder, or breakend'''
__metaclass__ = ABCMeta


def __init__(self, type): def __init__(self, type):
#: String to describe the type of variant, by default "SNV" or "MNV", but can be extended to any of the types described in the ALT lines of the header (e.g. "DUP", "DEL", "INS"...) #: String to describe the type of variant, by default "SNV" or "MNV", but can be extended to any of the types described in the ALT lines of the header (e.g. "DUP", "DEL", "INS"...)
self.type = type self.type = type


@abstractmethod
def __str__(self): def __str__(self):
assert False, "_AltRecord is an abstract class, you should be using a subclass instead" raise NotImplementedError


def __eq__(self, other): def __eq__(self, other):
return self.type == other.type return self.type == other.type
Expand Down

0 comments on commit cc894c5

Please sign in to comment.