GeneValidatorApp API

This is a very simple, easy-to-use API for GeneValidator. It allows you to validates genes within your own Web Applications or Javascript-supporting programs.

  See Source  

  1. Add the GeneValidatorApp-API script to your HTML
  2. <script type="text/javascript" src="genevalidatorapp-API.min.js"></script>

  3. Run the GV.sendToGeneValidator() function as follows:
  4. GV.sendToGeneValidator(genevalidatorAppUrl, sequence, database, validations, outputType)

    The GV.sendToGeneValidator() function has the following arguments:

    • genevalidatorAppUrl
      This the url link to the GeneValidatorApp
      Example: "http://genevalidator.sbcs.qmul.ac.uk"

    • sequence
      This is the sequence(s) that are to be analysed by GeneValidator.
      Sequences should be in a single line with no new line characters within the sequence ('\n'). If an sequence id is present, the id should start with a forward arrow character ('>') and there must be a new line character between the id and sequence. Muliple Sequences are allowed - there should a new line character between sequences ('\n').
      Example: ">seqid1\nTTCTACTCCCCCAAAACACGGCGGGACGTTGAGCAGCCTCTAGTGAACGGTCCCCTGCAT\n>seqid2\nGAGCGGGGTTTCTTCTACTCCCCCAAAACACGGCGGGACGTTGAGCAGCCTCTAGTGAACGGTCCCC"

    • database
      This is the name of the chosen database that you wish GeneValidator to use. Possible options can be seen under 'Advanced Parameters' on the GeneValidatorApp.
      Example:"SwissProt"

    • validations (Optional)
      This is an string of all the validations that you want to run. Each validation must be separated by a comma. Example: "length_cluster, length_rank, duplication, gene_merge, multiple_alignment, blast_reading_frame, open_reading_frame"

    • outputType (Optional)
      It is also possible to specify the output type:

      • open_link (default): This opens the GV results in a new tab. Note: when running the GV.sendToGeneValidator() function asynchronously, the new opened tab will be blocked by the browser. In such a case use results_url instead and manually open the link outside the asynchronous code.
      • results_url*: This return a promise with a link to the GV results.
      • json_url*: This return a promise with a link to the GV results in JSON format.

      • Note: Since the results_url and the json_url arguments return a promise, it is necessary to update your scripts as follows:

      function send() { var loadingUrl = genevalidatorAppUrl + '/GeneValidator/loading.html' var resultsPage = window.open(loadingUrl, '_blank'); ... var gvRun = GV.sendToGeneValidator(genevalidatorAppUrl, sequence, database, validations, outputType) gvRun.then( function(url) { resultsPage.location.href = url }) }

One could create a wrapper function from which the GV.sendToGeneValidator() function is called:

//simple wrapper function for the GV.sendToGeneValidator() function function send(){ var genevalidatorAppUrl = "http://genevalidator.sbcs.qmul.ac.uk"; var sequence = ">gi|514746961|ref|XM_005019748.1| PREDICTED: Anas platyrhynchos insulin (INS), mRNA\nATGGCTCTCTGGATCCGGTCGCTGCCTCTCCTGGCCCTTCTTGCTCTTTCTGGCCCTGGGATCAGCCACGCAGCTGCCAACCAGCACCTCTGTGGCTCCCACTTGGTTGAGGCTCTCTACCTGGTGTGTGGGGAGCGGGGTTTCTTCTACTCCCCCAAAACACGGCGGGACGTTGAGCAGCCTCTAGTGAACGGTCCCCTGCATGGCGAGGTGGGAGAGCTGCCGTTCCAGCATGAGGAATACCAGAAAGTCAAGCGAGGCATCGTTGAGCAATGCTGTGAAAACCCGTGCTCCCTCTACCAACTGGAAAACTACTGCAACTAG\n>gi|514746961|ref|XM_005019748.1|dup PREDICTED: Anas platyrhynchos insulin (INS), mRNA - Contains a duplication\nATGGCTCTCTGGATCCGGTCGCTGCCTCTCCTGGCCCTTCTTGCTCTTTCTGGCCCTGGGATCAGCCACGCAGCTGCCAACCAGCACCTCTGTGGCTCCCACTTGGTTGAGGCTCTCTACCTGGTGTGTGGGGAGCGGGGTTTCTTCTACTCCCCCAAAACACGGCGGGACGTTGAGCAGCCTCTAGTGAACGGTCCCCTGCATGGCGAGGTGGGAGAGCTGCCGTTCCAGCATGAGGAATACCAGACAGCACCTCTGTGGCTCCCACTTGGTTGAGGCTCTCTACCTGGTGTGTGGGGAGCGGGGTTTCTTCTACTCCCCCAAAACACGGCGGGACGTTGAGCAGCCTCTAGTGAACGGTCCCCTGCATGGCGAGGTGGGAGAGCTGCCGTTCCAGCATGAGGAATACCAGAAAGTCAAGCGAGGCATCGTTGAGCAATGCTGTGAAAACCCGTGCTCCCTCTACCAACTGGAAAACTACTGCAACTAG"; var database = "SwissProt;" var validations = "length_cluster, length_rank, duplication, gene_merge, multiple_alignment, blast_reading_frame, open_reading_frame"; var outputType = 'open_link' // Other options include: 'results_url' or 'json_url' var GvRun = GV.sendToGeneValidator(genevalidatorAppUrl, sequence, database, validations, outputType); // // when outputType is equal to 'results_url' or 'json_url' // // var loadingUrl = genevalidatorAppUrl + '/GeneValidator/loading.html' // var resultsPage = window.open(loadingUrl, '_blank'); // // GvRun.then( function(url) { // resultsPage.location.href = url // }) }

One could then call this send() function in the HTML:

<button type="button" onclick="send()" class="btn btn-primary">Click here to send</button>


Try the button below...