Created
September 9, 2015 22:12
-
-
Save 23jodys/52ea19fae7ba5343abf7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from verum.common import ITestRecord, IValidationRecord, getPass | |
logger = logging.getLogger(__name__) | |
class VariantTestRecord(ITestRecord): | |
def __init__(self, variant, success=False): | |
self.variant = variant | |
self.success = success | |
self.ident = "{}:{}".format(variant.CHROM, variant.POS) | |
class VariantMatch(VariantTestRecord): | |
def __init__(self, expected_variant, expected_filename, matched_variant, matched_filename, agi, consensus, success=True): | |
super(VariantMatch, self).__init__(expected_variant, success=success) | |
def getSummary(self): | |
message = ("{passed}: {expected_ident} in {e_filename} to {working_ident} in {w_filename}" | |
.format(passed=getPass(self.success), | |
expected_ident=self.ident, | |
e_filename=self.filename, | |
working_ident="{}:{}".format(self.matched_variant.CHROM, | |
self.matched_variant.POS), | |
"PASS: chr5:345987 in blahblah.vcf to chr5:345987 in summary.vcf" | |
"FAIL: chr5:345987 in blahblah.vcf to chr5:345987 in summary.vcf" | |
class VariantWorkingOrphan(VariantTestRecord): | |
pass | |
class VariantExpectedOrphan(VariantTestRecord): | |
def __init__(self, variant, success=False, filename, amplicon_group_id, consensus): | |
super(VariantExpectedOrphan, self).__init__(variant, sucess) | |
self.filename = filename | |
self.amplicon_group_id = amplicon_group_id | |
self.consensus = consensus | |
self.ident = "{}:{}, {}".format(self.variant.CHROM, self.variant.POS, self.amplicon_group_id[:9]) | |
class VariantSNPMismatch(VariantTestRecord): | |
pass | |
class VariantIndelMismatch(VariantTestRecord): | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment