Ejemplo n.º 1
0
 def testHashVariantAnnotation(self):
     annotation = protocol.VariantAnnotation()
     variant = protocol.Variant()
     expected = 'bec63dc7c876bb3c7b71422203b101d1'
     hashed = self._variantAnnotationSet.hashVariantAnnotation(
         variant, annotation)
     self.assertEqual(hashed, expected)
Ejemplo n.º 2
0
 def testHashVariantAnnotation(self):
     annotation = protocol.VariantAnnotation()
     variant = protocol.Variant()
     expected = hashlib.md5('\t()\t[]\t').hexdigest()
     hashed = self._variantAnnotationSet.hashVariantAnnotation(
         variant, annotation)
     self.assertEqual(hashed, expected)
Ejemplo n.º 3
0
 def _createGaVariant(self):
     """
     Convenience method to set the common fields in a GA Variant
     object from this variant set.
     """
     ret = protocol.Variant()
     ret.created = self._creationTime
     ret.updated = self._updatedTime
     ret.variantSetId = self.getId()
     return ret
Ejemplo n.º 4
0
 def testMaxBufferSizeOverridesPageSize(self):
     responseClass = protocol.SearchVariantsResponse
     typicalValue = protocol.Variant()
     # We have to put some values in here or it will have zero length.
     typicalValue.start = 1
     typicalValue.end = 2
     typicalValue.reference_bases = "AAAAAAAA"
     typicalValueLength = typicalValue.ByteSize()
     for numValues in range(1, 10):
         maxBufferSize = numValues * typicalValueLength
         builder = protocol.SearchResponseBuilder(responseClass, 1000,
                                                  maxBufferSize)
         self.assertEqual(maxBufferSize, builder.getMaxBufferSize())
         while not builder.isFull():
             builder.addValue(typicalValue)
         instance = protocol.fromJson(builder.getSerializedResponse(),
                                      responseClass)
         valueList = getattr(instance, getValueListName(responseClass))
         self.assertEqual(len(valueList), numValues)
Ejemplo n.º 5
0
 def setUp(self):
     self.variant = protocol.Variant()
     self.variant.start = 4
     self.variant.end = 6
     self.intervalIterator = backend.VariantsIntervalIterator
Ejemplo n.º 6
0
def generateVariant():
    variant = protocol.Variant()
    return variant