Question: # - - - - - - - - - - - - - - - - - - - - - - - -
#
#PYTHON LAB : LISTS
#
print
########## PART ##########
#PART Append substrings to a list
# Use a or loop to iterate through a sequence.
# Divide the sequence into sections of DNA bases with NO OVERLAP.
# Append the base codons to a list.
#NOTE: If a group is not bases long, do not include it in the list.
# Print the final list.
# PART
#seq"AUGGGAAGC" #This should print AUG"GGA","AGC"
seq"AUGGGAAGCGCGG" #This should print AUG"GGA","AGC","GCG
#Here is a little snippet of code that should help.
#It uses a for loop to 'break up a string into groups of characters
# like with codons. Question how do you then append then to a list?
seq"AUGGGAAGC"
for i in rangelenseq:
codonseqi:i
printcodon
#
print
########## PART ##########
#PART Change the length of the substrings
# Exactly the same as part EXCEPT instead of characters
# it can be of length x where x is an integer.
# For example if x then if seq'AAAAGGGGCCCC' the loop would print
# AAAAGGGGCCCC
# Feel free to copy past and modify the loop from part
# PART
#Try it out with two different values of x and two different sequences
x
#x
seq"AAAAGGGGCCCC"
#seq"AUGUAUGUCUGUCUGAUC"
#
print
########## PART ##########
#PART Use random.shuffle to randomize student names and write them to a file
# Open a file for writing called "selectstudents.txt
# Use a for loop and range function to loop times.
# Each time shuffle the names of the students and write the
## shuffled names to a file.
studentsJane 'Klaus','Julia','Moon Unit', 'Frantz', 'Seamus'
#to convert students to a string for writing use the str function.
#
print
########## PART ##########
#PART Iterate through a list of strings, calculate value, write to file
# Iterate through the list of sequences
# Count Gs and Cs for each sequence nmer in a list.
# Calculate the GC Percentage for the sequence nmer.
# Write the sequence and its GC percentage separated by a "Tab"
# to a file named:
# gcoutput.txt
###A counting shortcut for string data:
seq"AGGT"
gcountseq.countG
printgcount
#For example if given the following sequence list
#seqlistAAUG"AGCG","GCUA"
#The loop would write the following to the file gcoutput.txt
#AAUG
#AGCG
#GCUA
# PART
seqlistAAUG"AGCG","GCUA"
#seqlistAAUGGAGACU"AGCGCCCC","GCUAAAAAAU"
Dont use chatgpt please!
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
