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 advantages of external css and internal css

Write down the advantages of external CSS compared to internal CSS? Describe conditions in which each is suitable type.

  Write a program to allow user to create a binary search tree

Write a program to allow user to create a binary search tree. Your program should display in BFT and DFT (in order) format.

  Compute service charge customer owes for writing bad check

Create the output and sketch the flowchart or write pseudocode for program which computes service charge a customer owes for writing bad check.

  Design an employee class

Design an Employee class that has fields for the following pieces of information: Employee Name and Employee Number

  Explain the contents of the text box

Describe the contents of the text box after the button is clicked

  Write a program that prints the balance of an account

Write a program that prints the balance of an account after each of a number of years y, given an initial balance b and a yearly interest i, specified as a percentage (e.g., 5%). The values of y, b and i are all user-specified.

  Calculate the minimum salary for all employees.

Calculate the minimum salaries for exempt and non-exempt employees.

  Identity some suitable static analysis tools for a language

Identity some suitable static analysis tools for a language that you know. Determine the cost, availability, and ease of use of these tools.

  Compute tax percentage using nested if

On Home Sales Data worksheet, in column E, compute Tax Percentage. Using nested IF calculate the following (Hint: do not use the function AND because if the house does not have 1 bedroom

  The process of identifying the classes or functions

How the two programs were selected and The process of identifying the classes or functions for replacement

  Design a gui program to find weighted average of four test

Design a GUI program to find the weighted average of four test scores. The four test scores and their respective weights are given in the following format.

  Display each word together with its associated line numbers

In addition to the words in a section of text, a concordance usually stores the numbers of selected pages on which there is a significant use of the word.

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