Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need to write a python code. These are the instructions: Write a module, complement.py , with a function, complement, that returns the complement of

I need to write a python code. These are the instructions: "Write a module, complement.py, with a function, complement, that returns the complement of a DNA string. Also provide a function, revComplement that takes a DNA sequence as string input and returns the reverse complement of the sequence as a string. Recall that the valid alphabet is {A, C, T, G} and that A-T and G-C are complements. A reverse complement is found by reversing the input string and replacing every nucleotide with its complement. This means that your revComplement method should use your complement method internally rather than duplicating code. Your methods should do appropriate error checking and return an error message as appropriate. Test your functions with input from the user. For example, if your input is ACTG, your complement should be TGAC and your reverse complement should be CAGT." This is what I have so far but my understanding of functions is severely limited and this is not including the reverse complement function yet bc I was trying to just get the complement one done first: def complement(dna): complement_dna ={'A':'T','C':'G','G':'C','T':'A'} #convert to uppercase dna = dna.upper() bases = list(dna) letters ='' for x in bases: if x in complement_dna: letters = letters + dna[x] return ''.join(letters) dna = str(input("Enter the DNA string: ")) print("The complement is",complement(dna),".") Of course, my code can be completely ignored if it is not on the right track what so ever. Any help would be appreciated!!You should not be using any built in modules that calculate variance/standard deviation
for you, you need to code this on your own.
In order to make your program as modular as possible, however, you should define your
own functions to carry out the computation. These functions should be:
sorted_list - takes a list of integers as input and returns them in sorted order
compute_mean - takes a list of integers as input and returns the mean (average)
of the list
compute_variance - takes a list of integers as input and returns the variance of
the list. (Note that this method can call the computeMean method.)
compute_standard_dev - takes the variance as input and returns the standard
deviation (just the square root of variance).
Due Date
This assignment is due at 11:59pm on 1-22-2021. Submit via Canvas; create a zip file with
all your files in it. It should be labeled lastNameFirstInitial_A3. Please make sure to include
all the required files (README, source files).
Grading
Assignments will be graded on correctness according to the prompt, adherence to style,
and the inclusion of meaningful comments.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Next Generation Databases NoSQLand Big Data

Authors: Guy Harrison

1st Edition

1484213300, 978-1484213308

More Books

Students also viewed these Databases questions