Concept explainers
Below this question is a generated text representing a DNA sequence. The first line starts with '>' and is a comment, and the lines after that hold the sequence. The sequence has letters 'A', 'C', 'T', and 'G'. In your program (written in python) for this question, read the sequence using the statements:
f = open('kdpF.txt') # opens a file for reading line = f.readline() # reads a single line print(line)
seq = ''
for line in f : # reading the rest of the lines
seq = seq + line
seq = seq.replace('\n', '') # removing the newline characters seq = seq.upper()
print(seq)
def gcContent(sequence) :
# You do the rest
pass
Also write a function gcContent(sequence), which returns the percent of the sequence which is either 'G' or 'C'. Use your function on the input sequence and print the results.
generated text DNA sequence:
>200 bp region of the chromosome of E. coli, containing gene kdpF, shortest gene
ttgcagccagaattctacccttccggtatcacttttaggccattggaggtgcactat
gagtgcaggcgtgataaccggcgtattgctggtgtttttattactgggttatctggt
ttatgccctgatcaatgcggaggcgttctgatggctgcgcaagggttcttactgatc
gccacgtttttactggtgttaatggtgc
Step by stepSolved in 4 steps with 2 images
- The fields below repeat for each customer: o Customer name (String)o Customer ID (numeric integer) o Bill balance (numeric)o EmailAddress (String)o Tax liability (numeric or String) The customers served by the office supply store are of two types: tax-exempt or non-tax- exempt. For a tax-exempt customer, the tax liability field on the file is the reason for the tax exemptions: education, non-profit, government, other (String). For a non-tax exempt customer, the tax liability field is the percent of tax that the customer will pay (numeric) based on the state where the customer’s business resides. Program requirements: From the information provided, write a solution that includes the following: A suitable inheritance hierarchy which represents the customers serviced by the office supply company. It is up to you how to design the inheritance hierarchy. I suggest a Customer class and appropriate subclasses.. For all classes include the following: o Instance variables o…arrow_forwardUsing Java PrintWriter, write a program that prompts the user for information and saves it to a text file File name is musicians.txt Use this information below: George,Thoroughgood,54321 Ludwig,Van Beethoven,90111 Edward,Van Halen,12345arrow_forwardProblem A straight line can be defined by a pair of points p1(x1, yı) and p2(x2, y2). The slope m of a line is defined as follow: У2 — У1 m = X2 - X1 Your program reads the points from a text file called 'points.txt’ which contains the coordinates of unknown number of pairs of points as shown in Figure 1. Each line contains four values x1, y1, x2, y2, where x1, yl are the coordinates of the first point and x2, y2 are the coordinates of the second point. 10 -2 7.5 -3.2 4 15.5 -4.6 21 -2 Зр 12.5 6. 2 5 -3 -6 10 3 10 15 Figure 1. Input file contains unknown number of point pairs Use Spider, to create the following files: (i) The input file 'points.txt' shown in Figure 1. Your Python program that reads from the input file 'points.txt', the coordinates of unknown number of pairs of points, computes the corresponding slopes then prints the results on the screen as shown in Figure 2. (ii) Line # X1 Y1 X2 Y2 slope 1 10.00 -2.00 7.50 -3.20 0.48 2 4.00 15.50 -4.60 21.00 -0.64 3 0.00 0.00 0.00…arrow_forward
- In Python Write a program that consists of (at least) two function: A function that creates and saves data in a file. The saved data represents exam grades. In the function, you will create n random numbers in the range [0,100], where n is the number of students. The function can be called as follows: createFile(filename, n) Main function, in which the user inputs the file name and the number of students, then the main calls function createFile. The main should perform validation for n (should be > 0), and the filename (should end with .txt). I will explain how to validate strings in the coming lecture. Hint: a good developer will write four functions to solve the problem.arrow_forwardplease help on this python problem, produce new codarrow_forwardreads in a file of student academic credit data. Each line of the input filewill contain the student name (a single String with no spaces), the number of semester hours earned (an integer),the total quality points earned (a double).Here is the students.dat data file:students.dat Smith 27 83.7Jones 21 28.35Walker 96 182.4Doe 60 150Wood 100 400Street 33 57.4Taylor 83 190Davis 110 198Smart 75 292.5Bird 84 168Summers 52 83.2 My question is how can I create the <<students.dat>> I already have the code but I just need help to create the students.datarrow_forward
- 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