示例#1
0
 def getVariantSets(self, pageSize=100):
     """
     Returns an iterator over the variantSets, abstracting away the details
     of the pageSize.
     """
     request = protocol.GASearchVariantSetsRequest()
     return self.resultIterator(
         request, pageSize, self._backend.searchVariantSets,
         protocol.GASearchVariantSetsResponse, "variantSets")
示例#2
0
    def testVariantSetsSearch(self):
        # TODO: Set up the test backend API to return these values rather than
        # hard-coding them here.
        expectedIds = ['example_1', 'example_2', 'example_3', 'example_4']
        request = protocol.GASearchVariantSetsRequest()
        request.pageSize = len(expectedIds)
        response = self.sendJSONPostRequest('/variantsets/search',
                                            request.toJsonString())

        self.assertEqual(200, response.status_code)

        responseData = protocol.GASearchVariantSetsResponse.fromJsonString(
            response.data)
        self.assertTrue(protocol.GASearchVariantSetsResponse.validate(
            responseData.toJsonDict()))

        self.assertIsNone(responseData.nextPageToken)
        self.assertEqual(len(expectedIds), len(responseData.variantSets))
        for variantSet in responseData.variantSets:
            self.assertTrue(variantSet.id in expectedIds)
示例#3
0
文件: cli.py 项目: tymiles003/server
 def __init__(self, args):
     super(VariantSetSearchRunner, self).__init__(args)
     request = protocol.GASearchVariantSetsRequest()
     setCommaSeparatedAttribute(request, args, 'datasetIds')
     self.setHttpClient(request, args)
示例#4
0
import ga4gh.client as client

import auth

application = app = Flask(__name__)
app.config['SECRET_KEY'] = open(
    'secret_key', 'rb').read()  # head -c 24 /dev/urandom > secret_key

__OP = json.loads(open('op_config.json').read())

VARIANTS_URL = sys.argv[1] if len(
    sys.argv) > 1 else "http://*****:*****@app.route('/')
@auth.require_session(redirect_handler='login')
def index():
    return render_template('index_rp.html',
                           variant_sets=variant_sets,
                           user=session['id'])


@app.route('/query', methods=['POST'])
@auth.require_session(redirect_handler='login')
示例#5
0
 def __init__(self, args):
     svsr = protocol.GASearchVariantSetsRequest()
     svsr.pageSize = args.pageSize
     self._request = svsr
     self._verbosity = args.verbose
     self._httpClient = client.HTTPClient(args.baseUrl, args.verbose)