Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
Teacher ask different version of this code please provide that
'''
Problem A DNA: CG Pairs
Purpose:This function will take as an argument a string containing a dna strand
Parameter(s):dna
Return Value: fraction of dinucleotides
'''
def cg_pairs(dna):
dna_simple = 'AGCTTTCATTCTGAC'
dna= dna.lower()
for i in range (0,len(dna)):
if(dna[i]=='a'or dna[i]=='c'or dna[i]=='g' or dna[i]=='t' ):
continue
else:
print("Error in DNA strand ")
return 0.0
count = 0
for i in range(0,len(dna)-1):
var = dna[i:i + 2]
if(var=="cg"):
count+=1
else:
continue
return (float(count/(len(dna)-1)
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Pythonarrow_forwardPlease use PYTHON def count_scrabble_points(user_input): """ The function ... """ tile_dict = { 'A': 1, 'B': 3, 'C': 3, 'D': 2, 'E': 1, 'F': 4, 'G': 2, 'H': 4, 'I': 1, 'J': 8, 'K': 5, 'L': 1, 'M': 3, 'N': 1, 'O': 1, 'P': 3, 'Q': 10, 'R': 1, 'S': 1, 'T': 1, 'U': 1, 'V': 4, 'W': 4, 'X': 8, 'Y': 4, 'Z': 10 } if __name__ == "__main__": ''' Type your code here. ''' Thank you!arrow_forwardInside this module, import random and blackout_utils, and define the following global variable, which you should use whenever appropriate: OPERATIONS = ['^', 'x', '/', '+', '-']For full marks, all the following functions must be part of this module: calculate(tokens): Takes one list of tokens as input corresponding to a mathematical equation. The function will evaluate both sides of the equality and return a list of three tokens: the result of the left-hand side (integer), the equals sign (string), and the result of the right-hand side (integer). The equation may contain any of the operations in the OPERATIONS list, as well as opening and closing parentheses. Your function should evaluate both sides of the equation while respecting order of operations (that is, parentheses, followed by exponentiation, then multiplication and division, and then addition and subtraction). Equations may have multiple sets of parentheses and nested parentheses. The contents of the inner-most nested…arrow_forward
- Q# Describe what a data structure is for a char**? (e.g. char** argv) Group of answer choices A. It is a pointer to a single c-string. B. It is an array of c-strings C. It is the syntax for dereferencing a c-string and returning the value.arrow_forwardA C-string variable is an array, so we can use index operator [ ] to access individual character. True or false?arrow_forwardAlert: Don't submit AI generated answer and please submit a step by step solution and detail explanation for each steps. Write a python program using functionsarrow_forward
- Match the std::string constructor on right to its function on left. Source: https://cplusplus.com/reference/string/string/string/ E string() string (const string& str) string (const char* s) string (size_t n, char c) [Choose] [Choose ] constructs a copy of str. constructs an empty string, with a length of zero characters. copies the null-terminated character sequence (C-string) pointed by s. fills the string with n consecutive copies of character c. [Choose ]arrow_forwardPrompt: In Python language, write a function that applies the logistic sigmoid function to all elements of a NumPy array. Code: import numpy as np import math import matplotlib.pyplot as plt import pandas as pd def sigmoid(inputArray): modifiedArray = np.zeros(len(inputArray)) #YOUR CODE HERE: return(modifiedArray) def test(): inputs = np.arange(-100, 100, 0.5) outputs = sigmoid(inputs) plt.figure(1) plt.plot(inputs) plt.title('Input') plt.xlabel('Index') plt.ylabel('Value') plt.show() plt.figure(2) plt.plot(outputs,'Black') plt.title('Output') plt.xlabel('Index') plt.ylabel('Value') plt.show() test()arrow_forwardWhich of the following are true? O The C-library has many functions that are useful in manipulating strings. V If a and b are two different C-string variables, the value in a can be assigned the value in b with the following C-statement: a = b; %3D O The length of the char array holding the string must be at least one character longer than the string itself. O An array identifier cannot be used as a pointer. V The identifier, name, of a C-string is also a pointer to a char data type. The ending character in a C-string must be the newline character, '\n'. O The name of a 1-D array is a pointer to the data type of the array, while the name of a 2-D array is a pointer to a 1-D array of the data type.arrow_forward
- def ppv(tp, fp): # TODO 1 return def TEST_ppv(): ppv_score = ppv(tp=100, fp=3) todo_check([ (np.isclose(ppv_score,0.9708, rtol=.01),"ppv_score is incorrect") ]) TEST_ppv() garbage_collect(['TEST_ppv'])arrow_forwardIn C++ Assume that a 5 element array of type string named boroughs has been declared and initialized. Write the code necessary to switch (exchange) the values of the first and last elements of the array.arrow_forwardPlease help in C++arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education