Show how to perform a protein search as an ajax call

Assignment Help Programming Languages
Reference no: EM132257473

- These 3 codes are to show how to perform a protein search as an AJAX call that returned and parsed )50N formatted results and display them on the browser. - Read documantation for )Query on the autocomplete function
- After that, please show how to modify these codes to add auto-complete functionality to the search box
- The source of data is the Genbank file
- do not hard-code a list of terms in a )avascript array
- limit the number of rows returned to S so that the large lists are not returned.

1- test.cgi

#!/usr/local/bin/python3

import cgi,json
import os
import mysql.connector

def main()
print("Content-Type:text/html\n\ni print("It worked\n")
if__name--emain__':
main()

2- search.cgi
#!/usr/local/bin/python3
import cgi, json
import os
import mysql.connecting
def main():
print ("Content-Type: application/json\n\n")
form -cgi.FieldStorage()
term -form.getvalue('search_term')
conn - mysql.connector.connect(user - 'any', password-'anything' , host-'host', database -sbiotese) cursor - conn.cursor()
SELECT locus_id, product
FROM genes
WHERE product LIKE %s
cursor.excute(qry, ('%' + term + '%',))
results = {'match_count1:0, 'matches' : list()}
for (locus_id, product) in cursor:
resultsrmatchesl.append({'locus_idl:locus_id, 'product': product}) resultsrmatch_count1+-1
conn.close()
print(json.dumps(results)) if name fls' __main __ . '.
__ __
main()

3- search.html

<!DOCTYPE html>
<html lang =leen"). <head>
<meta charset="utf-8"/>
<title>A3AX demo</title>
<!--[if IE]>
<script src-"https://xxxxxx/xxxx/html5.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="css/search_product.css"/>
<script type-"text/javascript" src-"https://ajax.googleapis.com/ajax/jquery/xxxxxx"></script> <script type="text/javascript" src="js/search.js"></script>
</head>
<body id="main">
<h1>E.coli search </hl>
<form name-"search" id-"search" action-"">
<input name="search_term" type="search value="" autofocus="autofocus" placeholder="Enter a search term"/> </form>
<section id=eresults1>
<p>
<span id='match_countl>0</span> match (es) found.
</p>
<table>
<thead> <tr>
<td>Locus tag</td>
<td>Product</td>
</tr>
</thead> <tbody>
<!--this will be filled in by javascript when there are results -->
</tbody> </section>
</body>
</html>

Attachment:- Programming.rar

Reference no: EM132257473

Questions Cloud

Explain the relationship between credibility and credit : Explain the relationship between credibility and credit. Why is the 1974 passage of ERISA described as “landmark”?
How might the driver have been bitten by the spider : As you visualize the employee's environment, how might this driver have been bitten by the spider? Explain the normal habitat for the Brown Recluse Spider.
Caterpillar experience best illustrates : The firm is a leading supplier of heavy equipment and engines utilized in this sector. Caterpillar's experience best illustrates:
Why korean immigrants came to be the most entrepreneurial : How and why Korean immigrants came to be the most entrepreneurial ethnicity? Include the debate over the sources of Korean American entrepreneurship.
Show how to perform a protein search as an ajax call : Show how to perform a protein search as an AJAX call that returned and parsed )50N formatted results and display them on the browser
Article about employment discrimination : Locate a current article about employment discrimination (within the last 2 years) from a professional journal
How are these concepts used in the analysis of social change : Define and briefly discuss the following basic concepts: Tradition, Modernity, Postmodernity, Globalization, Neoliberalism.
Evaluate at least three current approaches or trends : Evaluate at least three current approaches or trends related to training (in organizations), including pros and cons of each. Justify a training best practice.
Advantages associated with taking the pension payouts : What are the advantages associated with taking the pension payouts in the from of an annuity what are the disadvantages.

Reviews

inf2257473

9/14/2019 3:29:49 AM

You need to work on the assignments which can be occurred at any stage such as invalid syntax for this line when i run the .html file Need to modify search.cgi file and test.cgi and search.mtml file that go along with the search file and this are why errors are coming I need the best exp[ert who can resolve this issue when I run the test.cgi and search.mtml files

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd