Exemple #1
0
from mgipython.util import error_template
from mgipython.domain.gxdindex_domains import IndexRecordDomain, IndexStageDomain
from mgipython.model import MGIUser, VocTerm
from mgipython.service.gxdindex_service import GxdIndexService
from mgipython.service_schema.search import Paginator, SearchQuery
from pwi import app

# API Classes
api = Namespace('gxdindex', description='GXD_Index related operations')


# Define how fields should be parsed for incoming requests
#   This should match the domain objects used

indexstage_model = api.model('IndexStage', {
    '_indexassay_key': fields.Integer,
    '_stageid_key': fields.Integer
})

gxdindex_model = api.model('GxdIndexRecord', {
    '_index_key': fields.Integer,
    '_refs_key': fields.Integer,
    '_marker_key': fields.Integer,
    '_priority_key': fields.Integer,
    '_conditionalmutants_key': fields.Integer,
    'comments': fields.String,
    
    'indexstages': fields.List(fields.Nested(indexstage_model)),
    
    # readonly fields
    'is_coded': fields.Boolean,
    'jnumid': fields.String,
Exemple #2
0
gxdhtexperiment_parser.add_argument("modification_date", type=str)
gxdhtexperiment_parser.add_argument("evaluated_date", type=str)
gxdhtexperiment_parser.add_argument("curated_date", type=str)
gxdhtexperiment_parser.add_argument("lastupdate_date", type=str)
gxdhtexperiment_parser.add_argument("_evaluationstate_key", type=int)
gxdhtexperiment_parser.add_argument("_experiment_key", type=int)
gxdhtexperiment_parser.add_argument("notetext", type=str, help="Description for Notes")

gxdhtexperiment_model = api.model(
    "GxdHTExperiment",
    {
        "_experiment_key": fields.Integer,
        "name": fields.String(description="This is the name"),
        "description": fields.String(description="This is the description"),
        "release_date": fields.Date,
        "creation_date": fields.Date,
        "modification_date": fields.Date,
        "evaluated_date": fields.Date,
        "curated_date": fields.Date,
        "lastupdate_date": fields.Date,
        "_evaluationstate_key": fields.Integer,
        "notetext": fields.String,
    },
)


@api.route("/", endpoint="gxdhtexperiment-create-resource")
class GxdHTExperimentCreateResource(Resource):

    gxdhtexperiment_service = GxdHTExperimentService()

    @api.expect(gxdhtexperiment_model)
Exemple #3
0
from mgipython.error import *
from mgipython.service_schema import *
from mgipython.service import *
from pwi import app
import re

api = Namespace('gxdgenotype', description='GXD Genotype API operations')

gxdgenotype_parser = reqparse.RequestParser()
gxdgenotype_parser.add_argument('_genotype_key', type=int, help="Genotype Key")
gxdgenotype_parser.add_argument('_strain_key', type=int, help="Strain Key")
gxdgenotype_parser.add_argument('mgiid', type=str, help="Accession Id for Genotype")

gxdgenotype_model = api.model('Genotype', {
    '_genotype_key': fields.Integer,
    '_strain_key': fields.Integer,
    'mgiid': fields.String(description="MGI Accession Id to search for")
})

@api.route('/search', endpoint='gxdgenotype-search-resource')
class GxdGenotypeSearchResource(Resource):

    genotype_service = GxdGenotypeService()

    @api.doc(description='Implementation Notes Text Field')
    @api.expect(gxdgenotype_parser)
    @as_json
    def get(self):
        """
        Get Genotypes by Parameters
        """