Menu

(Solved) : Write Python3 Script Takes Single Stranded Dna Sequence User Prints Gc Content Molecular W Q37167864 . . .

Please use Python3 to complete this.Write a Python3 script which takes in a single stranded DNA sequence from the user and prints out the GC content and molecu6. Calculate percent of Gs and Cs in the string and report GC content of DNA sequence is: percentage and round the percentWrite a Python3 script which takes in a single stranded DNA sequence from the user and prints out the ‘GC’ content and molecular weight of the single stranded circular DNA molecule. DNA is made up of four nucleotides, thymine (T), cytosine (C), adenine (A), or guanine (G). These are represented as strings of only A, C, G and T characters of either upper or lower case), The program should prompt the user for a DNA sequence. If the provided string is not a nucleotide sequence (i.e. contains any non A, C, G, T characters of either case), print an Homework 2 CMPS 5P Spring 19 error message and prompt the user for another DNA sequence. NOTE: the program needs to handle any mixture of upper and lower cases for the DNA sequence! Once a valid DNA sequence is entered by the user, then calculate the ‘GC content the fraction of G and C nucleotides in the sequence. For example, if the user entered ‘ATGC the ‘GC’ content would be 50% because the sequence contains 2 G or C nucleotides and 4 characters in total. Next calculate the total molecular weight of the DNA sequence in Daltons. The given nu- cleotide weights for each nucleotide is shown below in Table 1. For example, if the user entered ATGC the molecular weight of the single stranded DNA sequence would be 1235.80 In detail the following steps should be followed: 1. Prompt user for single stranded DNA sequence with the message “Input DNA Sequence: ” 2. Check if input contains any characters not in {-т”, “A”, iG”, “С. “t”, te”, “g”, “c”) 3. If the user entered an incorrect string, report error: “ERROR: Not a DNA sequence: user-input-seq” where user-input-seg is the input sequence, then prompt the user again. 4. Calculate the molecular weight of the single stranded DNA using Table 1. 5. Output the result with DNA sequence weighs: weight Da” and round the weight to the second decimal position 6. Calculate percent of G’s and C’s in the string and report “GC content of DNA sequence is: percentage and round the percentage to the second decimal position. “Analyze another DNA Sequence (y/n)?: n, then ask again. 7. Ask the user if they want to analyze another sequence with the message 8. If the user inputs ‘y’ then go through the loop again. If ‘n’, then exit, if neither y nor CMPS 5P HomeworK 2 Spring 19 Table 1: DNA nucleotides’ molecular weights DNA Nucleotide Moleculár weight (Da) 304.20 289.18 313.21 329.21 Cytosine Adenine Guanine Example Runs EXAMPLE 1 Input DNA Sequence: ATGC DNA sequence weighs: 1235.80 Da GC content of DNA sequence is: 50.00 Analyze another DNA Sequence (y/n)?: y Input DNA Sequence: atgc DNA sequence veighs: 1235.80 Da Show transcribed image text Write a Python3 script which takes in a single stranded DNA sequence from the user and prints out the ‘GC’ content and molecular weight of the single stranded circular DNA molecule. DNA is made up of four nucleotides, thymine (T), cytosine (C), adenine (A), or guanine (G). These are represented as strings of only A, C, G and T characters of either upper or lower case), The program should prompt the user for a DNA sequence. If the provided string is not a nucleotide sequence (i.e. contains any non A, C, G, T characters of either case), print an Homework 2 CMPS 5P Spring 19 error message and prompt the user for another DNA sequence. NOTE: the program needs to handle any mixture of upper and lower cases for the DNA sequence! Once a valid DNA sequence is entered by the user, then calculate the ‘GC content the fraction of G and C nucleotides in the sequence. For example, if the user entered ‘ATGC the ‘GC’ content would be 50% because the sequence contains 2 G or C nucleotides and 4 characters in total. Next calculate the total molecular weight of the DNA sequence in Daltons. The given nu- cleotide weights for each nucleotide is shown below in Table 1. For example, if the user entered ATGC the molecular weight of the single stranded DNA sequence would be 1235.80 In detail the following steps should be followed: 1. Prompt user for single stranded DNA sequence with the message “Input DNA Sequence: ” 2. Check if input contains any characters not in {-т”, “A”, iG”, “С. “t”, te”, “g”, “c”) 3. If the user entered an incorrect string, report error: “ERROR: Not a DNA sequence: user-input-seq” where user-input-seg is the input sequence, then prompt the user again. 4. Calculate the molecular weight of the single stranded DNA using Table 1. 5. Output the result with DNA sequence weighs: weight Da” and round the weight to the second decimal position
6. Calculate percent of G’s and C’s in the string and report “GC content of DNA sequence is: percentage and round the percentage to the second decimal position. “Analyze another DNA Sequence (y/n)?: n, then ask again. 7. Ask the user if they want to analyze another sequence with the message 8. If the user inputs ‘y’ then go through the loop again. If ‘n’, then exit, if neither y nor CMPS 5P HomeworK 2 Spring 19 Table 1: DNA nucleotides’ molecular weights DNA Nucleotide Moleculár weight (Da) 304.20 289.18 313.21 329.21 Cytosine Adenine Guanine Example Runs EXAMPLE 1 Input DNA Sequence: ATGC DNA sequence weighs: 1235.80 Da GC content of DNA sequence is: 50.00 Analyze another DNA Sequence (y/n)?: y Input DNA Sequence: atgc DNA sequence veighs: 1235.80 Da

Expert Answer


Answer to Write a Python3 script which takes in a single stranded DNA sequence from the user and prints out the ‘GC’ content and m…

OR