Python Final代写,Python Final Project代写
PROJECT TOPICS
A) Scrabble
In the Scrabble board game, you are given 7 random letters. Using those random letters, you create a word. Each letter in the English alphabet is given a specific value depending on how common that letter occurs in words. The following code is scrabble.py (will be on Hands_On15):
englishscore = {"a": 1, "c": 3, "b": 3, "e": 1, "d": 2, "g": 2,"f": 4, "i": 1, "h": 4, "k": 5, "j": 8, "m": 3, "l": 1, "o": 1, "n": 1, "q": 10, "p": 3, "s": 1, "r": 1, "u": 1, "t": 1, "w": 4, "v": 4, "y": 4, "x": 8, "z": 10}
def scrabble_score(word): """Function computes the English scrabble score of a word""" tot_score = 0 lowercase_word = word.lower() for letter in lowercase_word:
tot_score = tot_score + englishscore[letter] return str(tot_score)
print ("Zebra is worth " + scrabble_score('Zebra') + " points") For example, you are given these 7 letters: ZYBEWAR. If you create the word ZEBRA, you will get 10 points for using the letter Z, 1 point for the letter E, 3 points for the letter B, 1 point for the letter R, and 1 point for the letter A. In total, your score would be 16.
Modify scrabble.py so that the computer gives you 7 randomly chosen letters (from A to Z). You can generate random numbers using the random module (https://docs.python.org/3.8/library/random.html). To use the random module, you have to type import random in the first line of your Python program. You should use random.randint() to generate random numbers. Then, you can assign specific numbers to the letters in the alphabet. Doing so should allow your program to generate random letters. You will then make up a word you believe has a big score and enter it. Your program will then report the score of your word (using “englishscore”).
CS 22A Spring 2020
B) Big Board Battleship
Extend the battleship program you wrote in HW 4 to allow a 25 x 25 ocean and battleships of size three (3x1 or 1x3 battleships). In essence, you are to implement battleship_3.py with a bigger ocean and bigger ships. We are going to assume that hitting only one of the three units of the battleship is enough to sink it. Name your program big_battleship.py.
C) Analyzing Genes
In this project, you are to choose a gene and perform a thorough analysis. As part of the written part of the project, make sure to include:
1) The reason for which you chose that particular gene
2) The diseases (or possible consequences) produced as a result of
mutations of that gene.
3) Anything else you would like to add about the gene.
Next, write a program, gene_analysis.py, to perform the analysis, which
should include:
-
4) The percentage of each base in the gene
-
5) The count of all dinucleotides (16 possible dinucleotides)
-
6) The count of all trinucleotides (64 possible trinucleotides)
-
7) The AT content of the gene
-
8) Any other feature you might want to compute which might include
repeats of size 6
D) Playing with the Amino Acids
This project consists of writing one big program, that you name genetic_code.py, that consists of three functions, enumerated from 1 to 3 below. The genetic code is the central theme of the program. You will then add code in the main program to test every function.
-
1) Write a function, that you name function_1(), that takes a given codon and returns a list of all amino acids that may result from any single mutation in the codon.
-
2) Write a function, that you name function_2(), that takes a given amino acid and randomly changes it to one of the amino acids calculated in part 1 above.
-
3) Write a function, that you name function_3(), that takes 3 arguments in that order: an amino acid; a position 1, 2, or 3; and one of the 4 bases. The function then finds all codons that can be translated to the
CS 22A Spring 2020
given amino acids. Note that there may be one to six such codons. The function then mutates the codon at the specified position (given by the second argument of function_3(), by the base specified in the third argument of the function. The function returns the amino acids that are encoded by the mutated codons.
[From Beginning Perl for Bioinformatics, page 181]
E) Musical Proteins Project Description
This is a challenging problem that will require you to do some very interesting reading and understanding, especially if you are new to music. Over the years, researchers have acknowledged the fact that there are significant similarities between the structures of proteins and music. Both structures are composed of phrases organized into themes [1].
Write a program that converts amino acid sequences to music. By mapping amino acids to musical notes, one can play and listen to proteins. A quick search on the internet will yield a few mappings that have been introduced in the past. One challenge discovered by researchers is generating pleasant music while preserving relationships between amino acids properties. Test your program on short protein sequences, such as the beta globin protein:
MVHLTPEEKSAVTALWGKVNVDEVGGEALGRLLVVYPWTQRFFESFGDLSTPDAVM GNPKVKAHGKKVLGAFSDGLAHLDNLKGTFATLSELHCDKLHVDPENFRLLGNVLVC VLAHHFGKEFTPPVQAAYQKVVAGVAN ALAHKYH
[1] Dunn J. Clark M.A. (1999) Life Music: Sonification of Proteins. Leonardo V.32: 25-32.
F) Turtle Graphics Design
Turtle graphics is a Python module that comes with Python when you downloaded Python for the first time. Turtle allows you to draw by running Python code. Here is the link to look at some methods in this module that you can use to create designs: https://docs.python.org/3.3/library/turtle.html?highlight=turtle
If you choose this project, come up with a design that you want to make, and send the design to me to get my approval. Your code should include functions and loops that we have covered in this course thus far.
