Biocoding2025
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    https://drive.google.com/drive/folders/16G2Ft69VNOCTXKIx6uBTyn29s2MddC2H?usp=drive_link https://docs.google.com/spreadsheets/d/1T6pIGVUwjtjSc6X6Q83_41aqhL0NcjfeefPXtBTne2k/edit?usp=sharing ``` tar -czvf stuff.tar.gz /jupyter-persistant/user# ``` --- ## Bicoding 2O2S Welcome! # We1come to Bicoding! Ad notes to the HackMD during the clas so we can colaborate :) ## Le@rning resources - CyVerse [link](https://learning.cyverse.org) - Genomics data carpentry: https://datacarpentry.org/lessons/#genomics-workshop **General Cod1ng** - CodeCademy: [link](https://www.codecademy.com/) - Our of code (also in languages other than English): [link](https://code.org/learn) **Bioinformatics** - Learn bioinformatics in Ioo hours: [link](https://www.biostarhandbook.com/edu/course/1/) - Rosalind bioinformatics: [link](http://rosalind.info/about/) - Bioinformatics coursera: [link](https://www.coursera.org/learn/bioinformatics) - Bioinformatics carers: [link](https://www.iscb.org/bioinformatics-resources-for-high-schools/careers-in-bioinformatics) **Help** - General software help: [link](https://stackoverflow.com/) - Bioinformatics-specific software help: [link](https://www.biostars.org/) - General software help: [link](https://stackoverflow.com/) ## Seting up your first use of Jupyter Notebooks Username: user1 Password: user1.123 ## Names 1. Alisha Ahmed! C: 2. Lindsay Kim!!:o 3. Adela Wang! :) 4. Joshua Desvignes 5. KAI Kerr Beauchamp 6. Jason Lee 7. Kaito Noda [OwO] 8. Maxx Nunez 9. Max li 10. Kehinde 11. Smabhav Chaturvedi ʕ•ᴥ•ʔ 12. Dr. F ^ _ ^ 13. Ria 14. Mariana :) ## Link to the jupyterhub http://149.165.173.254:8000/ username: user# password: user#.123 git clone https://github.com/AnnaFeitzinger/dmel_ortho_human git clone https://github.com/MasayukiNagai/BioCoding2024.git ls: list all files 1. pwd - finds location in working directory 3. touch - change file timestamps 4. grep - Searches for a specific string or pattern within a file. 5. cd - change directory 6. chmod - change file flags, mode bits 7. mkdir - short for make directories 8. wget - get thing from inernet 9. vim - text editor 10. cut - removes lines from files 14. cp - copies files or directories :3 ho4h9p3t3g3 gygbn4gk gghg4 my_name = "lindsay" 😽 my_fav_food = "apples" my_hobby = "drawing" my_somewhere_else = "in my room" ` print(f"My name is: {my_name}") print(f"My favorite food is: {my_fav_food}") print(f"The hobby I spend most of my time is: {my_hobby}") print(f"If I wasn't here, I'd probably be: {my_somewhere_else}") print(f'If I wasn\'t using single quotes, I\'d be using double quotes.') ` my_name = 'si ym eman' my_fav_food = 'si ym eitorvaf doof' my_hobby = 'cheese' print(f"My name is: {my_name}") print(f"My favorite food is: {my_fav_food}") print(f"The hobby I spend most of my time is: {my_hobby}") print(f"If I wasn't here, I'd probably be: {my_somewhere_else}") print(f'If I wasn\'t using single quotes, I\'d be using double quotes.') my_name = 'kaito' my_fav_food = 'karage' my_hobby = 'transit games' my_somewhere_else = 'home' print(f"My name is: {my_name}") print(f"My favorite food is: {my_fav_food}") print(f"The hobby I spend most of my time is: {my_hobby}") print(f"If I wasn't here, I'd probably be: {my_somewhere_else}") print(f'If I wasn\'t using single quotes, I\'d be using double quotes.') My name is: max My favorite food is: w The hobby I spend most of my time is: z If I wasn't here, I'd probably be: yeah If I wasn't using single quotes, I'd be using double quotes. ### Create variables before the print statements ### my_name = "adela" my_fav_food = "frozen grapes" my_hobby = "piano" my_somewhere_else = "home" print(f"My name is: {my_name}") print(f"My favorite food is: {my_fav_food}") print(f"The hobby I spend most of my time is: {my_hobby}") print(f"If I wasn't here, I'd probably be: {my_somewhere_else}") print(f'If I wasn\'t using single quotes, I\'d be using double quotes.') ### Create variables before the print statements ### my_name = 'Alisha💕' my_fav_food= 'red velvet cookies' my_hobby= 'volleyball' my_somewhere_else= 'at tennis clinics' my_name= "Kehinde" My_fav_food="Halal food" my_hobby= "basketball & game production" my_somewhere_else= "At home" my_name = "Jason" my_fav_food = "birria tacos" my_hobby = "baseball" my_somewhere_else = "in bed" smurfs my_name = Kai my_fav_food = Dirt my_Hobby = DeepWoken my_somewhere_else = Dirt my_name='maxx' my_fav_food='meat' my_hobby='boxing' print(f"My name is:{my_name}") print(f"My favorite foodis:{my_fav_food}") print(f"The hooby i spend the most time on is:{my_hobby}") ## Methods for strings https://www.w3schools.com/python/python_ref_string.asp CGJ SJW PWS 28371 99399 29382 alpha_initials = alpha_id[0:3] beta_initials = beta_id[0:3] gamma_initials = gamma_id[0:3] print(alpha_initials+ '\n' + beta_initials + '\n'+ gamma_initials) alpha_new = alpha_id[3:] beta_new = beta_id[3:] gamma_new = gamma_id[3:] print(alpha_new + "\n" + beta_new + '\n' + gamma_new) ###### hello worlds alphaInitial = alpha_id[:3] betaInitial = beta_id[:3] gammaInitial = gamma_id[:3] print(alphaInitial) print(betaInitial) print(gammaInitial) alphaNum = alpha_id[3:] betaNum = beta_id[3:] gammaNum = gamma_id[3:] print(alphaNum) print(betaNum) print(gammaNum) alpha_inital=alpha_id[0:3] beta_inital=beta_id[0:3] gamma_inital=gamma_id[0:3] alpha_number=alpha_id[3:8] beta_number=beta_id[3:8] gamma_number=gamma_id[3:8] print(alpha_id[0:3]) print(beta_id[0:3]) print(gamma_id[0:3]) print(alpha_id[3:8]) print(beta_id[3:8]) print(gamma_id[3:8]) alpha_initial = alpha_id [0:3] beta_initial = beta_id[0:3] gama_initial= gama_id[0:3] print (alpha_initial) print (beta initial) print (gama_initial) alpha_number = alpha_id[3:8] alpha_number print (alpha_id[3:]) print (beta_id[3:]) print (gamma_id[3:]) Initials_Alpha = alpha_id[0:3] Initials_Beta = beta_id[0:3] Initials_Gamma = gamma_id[0:3] print(Initials_Alpha) print(Initials_Beta) print(Initials_Gamma) gag = hiv_genome[789:2292] print(gag) pol = hiv_genome[2084:5096] print(pol) vif = hiv_genome[5040:5619] print(vif) vpr = hiv_genome[5558:5850] print(vpr) env = hiv_genome[6224:8795] print(env) print(hiv_genome[789:2292]) print(hiv_genome[2084:5096]) print(hiv_genome[5040:5619]) hiv_gag= hiv_genome [789:2293] hiv_pol= hiv_genome [2084:5097] hiv_vif= hiv_genome [5040:5620] hiv_vpr= hiv_genome [5558:5851] hiv_env= hiv_genome [6044:8795] print(hiv_genome[700:2292]) RNA_gag=gag.replace('t','u') RNA_pol=pol.replace('t','u') RNA_vif=vif.replace('t','u') RNA_vpr=vpr.replace('t','u') RNA_env=env.replace('t','u') ((num_g_gag + num_c_gag)/len(RNA_gag)) * 100 my_age = 20000 if my_age > 25: print("I am 20 years or older")y_a my_age = -3 if my_age < 0: print('huh') time = 7 if time < 9: print("I am not waking up") my_screen_time = 6 if my_screen_time >=5: print("my screen time is more than five hours") age=2 if age >=0: print(age) myFish = "blue" if myFish == 'orange': print("thats a goldfish") else: print("diseased fish") pigs_fly = 0 if pigs_fly <= 1: print('lol no planet 4 u') my_iq = 90000000 if my_iq >= 90000000: print("my iq is huge") print(hiv_gene_names[1]) print(hiv_gene_names[3]) print(hiv_gene_names[2]) print(hiv_gene_names[4]) print(hiv_gene_names[5]) print(hiv_gene_names[0]) print(hiv_gene_names[6]) :3 elif original_nucleotide == 'C': print(f'before replacement: hiv_genome') hiv_genome_C = hiv_genome.replace('G','C') print (f'after replacemnt: hiv_genome_C') elif original_nucleotide == 'G': print(f'before replacement: hiv_genome') print (f'after replacemnt: hiv_genome') elif original_nucleotide == 'T': print(f'before replacement: hiv_genome') hiv_genome_T = hiv_genome.replace('G','T') print (f'after replacemnt: hiv_genome_T') print(f'{original_nucleotide} -> {new_nucleotide}') original_nucleotide = 'G' if original_nucleotide == 'A': possible_nucelotides = ['C', 'G', 'T'] mutation_probabilities_A = [1/33, 29/33, 3/33] new_nucleotide = random.choice(possible_nucelotides, p = mutation_probabilities_A) elif original_nucleotide == 'C': possible_nucelotides = ['A', 'G', 'T'] mutation_probabilities_C = [14/95, 0/95, 81/95] new_nucleotide = random.choice(possible_nucelotides, p = mutation_probabilities_C) elif original_nucleotide == 'G': possible_nucelotides = ['A', 'C', 'T'] mutation_probabilities_G = [146/152, 2/152, 4/152] new_nucleotide = random.choice(possible_nucelotides, p = mutation_probabilities_G) elif original_nucleotide == 'T': possible_nucelotides = ['A', 'C', 'G'] mutation_probabilities_T = [20/44, 18/44, 6/44] new_nucleotide = random.choice(possible_nucelotides, p = mutation_probabilities_T) print(f'{original_nucleotide} -> {new_nucleotide}') original_nucleotide = 'G' original_nucleotide2= 'C' original_nucleotide3= 'T' original_nucleotide4= 'A' if original_nucleotide == 'A': possible_nucelotides = ['C', 'G', 'T'] mutation_probabilities_A = [1/33, 29/33, 3/33] new_nucleotide = random.choice(possible_nucelotides, p = mutation_probabilities_A) elif original_nucleotide2 == 'C': possible_nucelotides = ['A', 'G', 'T'] mutation_probabilities_C = [14/95, 0/95, 81/95] new_nucleotide = random.choice(possible_nucelotides, p = mutation_probabilities_C) # your code elif original_nucleotide3 == 'G': possible_nucelotides = ['C', 'A', 'T'] mutation_probabilities_G = [2/152, 146/152, 4/152] new_nucleotide = random.choice(possible_nucelotides, p = mutation_probabilities_G) # your code elif original_nucleotide4 == 'T': possible_nucelotides = ['C', 'G', 'A'] mutation_probabilities_T = [18/24, 6/24, 20/24] new_nucleotide = random.choice(possible_nucelotides, p = mutation_probabilities_T) # your code - it takes ages to scroll to fthe bottom now print(f'{original_nucleotide} -> {new_nucleotide}') ### Write your code here ### mutation_outcomes = ["mutation", "no_mutation"] p_mutation = [0.21, 0.79] #[1.4e-5, 1-1.4e-5] for cycle in range(50): mutation_outcome = random.choice(mutation_outcomes, p = p_mutation) if mutation_outcome == "mutation": position = random.randint(len(hiv_genome)) original_nucleotide = hiv_genome[position] if original_nucleotide == 'A': possible_nucelotides = ['C', 'G', 'T'] mutation_probabilities_A = [1/33, 29/33, 3/33] new_nucleotide = random.choice(possible_nucelotides, p = mutation_probabilities_A) elif original_nucleotide == 'C': possible_nucelotides = ['A', 'G', 'T'] mutation_probabilities_C = [14/95, 0/95, 81/95] new_nucleotide = random.choice(possible_nucelotides, p = mutation_probabilities_C) elif original_nucleotide == 'G': possible_nucelotides = ['A', 'C', 'T'] mutation_probabilities_G = [146/152, 2/152, 4/152] new_nucleotide = random.choice(possible_nucelotides, p = mutation_probabilities_G) elif original_nucleotide == 'T': possible_nucelotides = ['A', 'C', 'G'] mutation_probabilities_T = [20/44, 18/44, 6/44] new_nucleotide = random.choice(possible_nucelotides, p = mutation_probabilities_T) hiv_genome[position] = new_nucleotide print(f"Mutation at {position} of {original_nucleotide} -> {new_nucleotide}") ### Write your code here ### hiv_genome = list(hiv_genome) p_mutation = 1.4e-5 * len(hiv_genome) print(f'The mutation probability per cycle is: {p_mutation*100:.2f}%') for cycle in range(50): print("cycle", cycle+1) # see if mutated or not hiv_mutation = ['mutation', 'no mutation'] hiv_mutation_p = [p_mutation, 1.0-p_mutation] mutation_outcome = random.choice(hiv_mutation, p=hiv_mutation_p) f if mutation_outcome =='mutation': #picks nucleotide position = random.randint(0, len(hiv_genome)-1) original_nucleotide = hiv_genome[position] if original_nucleotide == 'A': possible_nucleotides = ['C', 'G', 'T'] mutation_probabilities_A = [1/33, 29/33, 3/33] new_nucleotide = random.choice(possible_nucleotides, p = mutation_probabilities_A) elif original_nucleotide == 'C': possible_nucleotides = ['A', 'T'] mutation_prob_C = [14/95, 81/95] new_nucleotide = random.choice(possible_nucleotides, p=mutation_prob_C) elif original_nucleotide == 'G': possible_nucleotides = ['A', 'C', 'T'] mutation_prob_G = [146/152, 2/152, 4/152] new_nucleotide = random.choice(possible_nucleotides, p=mutation_prob_G) elif original_nucleotide == 'T': possible_nucleotides = ['A', 'C', 'G'] mutation_prob_T = [20/44, 18/44, 6/44] new_nucleotide = random.choice(possible_nucleotides, p=mutation_prob_T) hiv_genome[position] = new_nucleotide print(f'{original_nucleotide} at {position} -> {new_nucleotide}') #print(hiv_genome[position]) print(hiv_genome[position-1],f"{bcolors.FAIL}{new_nucleotide}{bcolors.ENDC}", hiv_genome[position+2],"\n") else: print("no mutation\n") for cycle in range(50): mutation_state = ['mutation', 'no_mutation'] mutation_probabilities = [p_mutation, 1-p_mutation] mutation_outcome = random.choice(mutation_state, p = mutation_probabilities ) print(mutation_outcome) if mutation_outcome == 'mutation': position = random.randint(0,len(hiv_genome)) original_nucleotide = hiv_genome[position] print(original_nucleotide) if original_nucleotide == 'A': possible_nucelotides = ['C', 'G', 'T'] mutation_probabilities_A = [1/33, 29/33, 3/33] new_nucleotide = random.choice(possible_nucelotides, p = mutation_probabilities_A) elif original_nucleotide2 == 'C': possible_nucelotides = ['A', 'G', 'T'] mutation_probabilities_C = [14/95, 0/95, 81/95] new_nucleotide = random.choice(possible_nucelotides, p = mutation_probabilities_C) elif original_nucleotide3 == 'G': possible_nucelotides = ['C', 'A', 'T'] mutation_probabilities_G = [2/152, 146/152, 4/152] new_nucleotide = random.choice(possible_nucelotides, p = mutation_probabilities_G) elif original_nucleotide4 == 'T': possible_nucelotides = ['C', 'G', 'A'] mutation_probabilities_T = [18/24, 6/24, 20/24] new_nucleotide = random.choice(possible_nucelotides, p = mutation_probabilities_T) print(f'{original_nucleotide} -> {new_nucleotide}') ur code for mutation here mutation_options = ["Mutation","No Mutation"] # Set the likelihood of each outcome (hint: they must sum to 1) mutation_probability = ["0.12721580453","0.87278419547"] # Pick an outcome using random.choice mutation_outcome = random.choice(mutation_options, p = mutation_probability) print(mutation_outcome) if mutation_outcome == "Mutation": position = random.randint(0,9719) original_nucleotide = hiv_genome[position] print(position) print(original_nucleotide) if original_nucleotide == 'A': possible_nucelotides = ['C', 'G', 'T'] mutation_probabilities_A = [1/33, 29/33, 3/33] new_nucleotide = random.choice(possible_nucelotides, p = mutation_probabilities_A) elif original_nucleotide == 'C': possible_nucelotides = ['A', 'G', 'T'] mutation_probabilities_C = [14/95, 0/95, 81/95] new_nucleotide = random.choice(possible_nucelotides, p = mutation_probabilities_C) elif original_nucleotide == 'G': possible_nucelotides = ['A', 'C', 'T'] mutation_probabilities_G = [146/152, 2/152, 4/152] new_nucleotide = random.choice(possible_nucelotides, p = mutation_probabilities_G) elif original_nucleotide == 'T': possible_nucelotides = ['A', 'C', 'G'] mutation_probabilities_T = [20/44, 18/44, 6/44] new_nucleotide = random.choice(possible_nucelotides, p = mutation_probabilities_T) print(new_nucleotide) hiv_list[position] = new_nucleotide for cycle in range(50): # Your code for mutation here mutation_state = ['mutation','no_mutation'] mutation_prob = [.21, 1-.21] mutation_outcome = random.choice(mutation_state, p = mutation_prob) print(f'The mutation outcome is: {mutation_outcome}') if mutation_outcome == 'mutation': print("hello") position = random.randint(0,len(hiv_genome)) print(position) print(hiv_genome[position]) if original_nucleotide == 'A': possible_nucelotides = ['C', 'G', 'T'] mutation_probabilities_A = [1/33, 29/33, 3/33] new_nucleotide = random.choice(possible_nucelotides, p = mutation_probabilities_A) elif original_nucleotide == 'C': possible_nucelotides = ['A', 'G', 'T'] mutation_probabilities_A = [14/95, 0, 81/95] new_nucleotide = random.choice(possible_nucelotides, p = mutation_probabilities_A) elif original_nucleotide == 'G': possible_nucleotides = ['A', 'C', 'T'] mutation_probabilities_G=[146/152,] elif original_nucleotide == 'T': possible_nucleotides = ['A', 'C','G'] print(f'{original_nucleotide} -> {new_nucleotide}') possible_nucelotides = ['C', 'G', 'T'] mutation_probabilities_A = [1/33, 29/33, 3/33] new_nucleotide = random.choice(possible_nucelotides, p = mutation_probabilities_A) print(new_nucleotide) ------------------- this is line 600 :D no it ain't ------------------- from numpy import random my_sequence = 'ATG' final_sequence_length = 100 nucleotides = ['A', 'T', 'G','C'] nucleotides_probs = [1/4, 1/4, 1/4, 1/4] while len(my_sequence) < final_sequence_length: next_nucleotide = random.choice(nucleotides, p = nucleotides_probs) my_sequence = my_sequence + next_nucleotide the_last_three_nucleotides_of_my_sequence= my_sequence[:-1] if the_last_three_nucleotides_of_my_sequence == 'TAA': print("My DNA sequence ends with a stop codon") elif the_last_three_nucleotides_of_my_sequence == 'TAG': print("My DNA sequence ends with a stop codon") elif the_last_three_nucleotides_of_my_sequence == 'TGA': print("My DNA sequence ends with a stop codon") else: print("My DNA sequence does NOT end with a stop codon") print(f'>random_sequence (length: {len(my_sequence)})\n{my_sequence}') GroupID_to_AverageMass = {'CGJ28371':17.0 , 'SJW99399':16.4 , 'PWS29382':17.8} id_weight = {'CGJ28371': 17.0, 'SJW99399':16.4, 'PWS29382':17.8} print(id_weight) mouseDictionary = {'CGJ28371':17.0, 'SJW99399' :16.4, 'PWS29382':17.8} print(mouseDictionary) dictionary = ID_to_avg_mass = {'CGJ28371': 17.0, 'SJW99399': 16.4 } print(ID_to_avg_mass) group_average_mouse_mass={'alpha':17.0, 'beta':16.4, 'gamma':17.8} print(group_average_mouse_mass) ```python rna = 'AUGCAUGCGAAUGCAGCGGCUAGCAGACUGACUGUUAUGCUGGGAUCGUGCCGCUAG' rna = 'AUGCAUGCGAAUGCAGCGGCUAGCAGACUGACUGUUAUGCUGGGAUCGUGCCGCUAG' protein_sequence = '' ### Write your code here ###= 0 while count < len(rna): sector = rna[count:count+3] AminoA = codon_to_AA[sector] protein_sequence = protein_sequence + AminoA count = count + 3 print(protein_sequence) ``` print(len(rna)) ### Write your code here ### for i in range(0, len(rna), 3): my_rna_codon = rna[i:i+3] translation = codon_to_AA[my_rna_codon] protein_sequence = protein_sequence + translation if translation == "_": break i+3 print("Protein Sequence: " + protein_sequence) ```rna = 'AUGCAUGCGAAUGCAGCGGCUAGCAGACUGACUGUUAUGCUGGGAUCGUGCCGCUAG' protein_sequence = '' index = 0 for cycle in range(19): codon = rna[index:index+3] AA = codon_to_AA[codon] protein_sequence += AA index += 3 print(protein_sequence) rna = 'AUGCAAGACAGGGAUCUAUUUACGAUCAGGCAUCGAUCGAUCGAUGCUAGCUAGCGGGAUCGCACGAUACUAGCCCGAUGCUAGCUUUUAUGCUCGUAGCUGCCCGUACGUUAUUUAGCCUGCUGUGCGAAUGCAGCGGCUAGCAGACUGACUGUUAUGCUGGGAUCGUGCCGCUAG' protein_sequence = '' ### Write your code here ### count = 0 while count < len(rna): sector = rna[count:count+3] AminoA = codon_to_AA[sector] protein_sequence = protein_sequence + AminoA if AminoA == "_": break count = count + 3 print(protein_sequence) print(protein_sequence) ``` ## Bonus Challenge from Python notebook 3 ### Write your code here ### for frame in range(0,3): for i in range(frame, len(rna) - 2, 3): my_rna_codon = rna[i:i+3] translation = codon_to_AA[my_rna_codon] protein_sequence = protein_sequence + translation if translation == "_": break i+3 print(protein_sequence) protein_sequence = '' print(protein_sequence) def calculate_GC(dna): Sequence_gs = dna.count('g') Sequence_cs = dna.count("c") len (dna) return (Sequence_gs + Sequence_cs) / len(dna) calculate_GC('agcttttacgtcgatcctgcta') ```py def generate_DNA(length): # any parameter? possible_nucleotides = ['A', 'T', 'G', 'C'] nucleotide_probabilities = [1/4, 1/4, 1/4 1/4 DNA = '' for i in range(length): new_nucleotide = random.choice(possible_nucleotides, p = nucleotide_probabilities) DNA = DNA + new_nucleotide return DNA fgrfgvcxss x = generate_DNA(123) print(x) ```'/'' Blue Brown Green Orange Red Yellow Tube_11 = [5,10,10,9,5,7] Tube_8 = [28, 4, 5, 1, 4, 2] TUBE_10 =[10,9,5,9,5,8] Tube_6 = [5, 14, 5, 12, 7, 3] Tube_6 = [5, 14, 5, 12, 7, 3] Tube_2 = [7, 8, 25, 3, 1, 1] Tube_1 = [6, 7, 15, 7, 5, 4] Tube_9 = [9, 8, 4, 8, 10, 6] Tube_10 = [10, 7, 7, 11, 2, 8] Tube_0 = [9, 6, 7, 10, 6, 5] ### Zip files tar -czvf notebooks.tar.gz notebooks/ hiii hi thxxx uwu ``` ``` ```python cc ### Write your code here ### def translate_RNAtoProtein_advanced(rna): # your code here dcvv x protein_sequence = '' def translate_RNAtoProtein_advanced(protein_sequence, rna): for y in range(0, len(rna), 3): codon = rna[y:y+3] AA = codon_to_AA[codon] is_translating = False if AA == 'M': is_translating = True while is_translating == True: for x in range (3, len(rna), 3): codon = rna[x:x+3] AA = codon_to_AA[codon] protein_sequence +=AA if AA =='_': return protein_sequence is_translating = False -row900 def translate_RNAtoProtein_advanced(rna): # your code here protein_sequence = "" count = 0 has_started = 0 while count < len(rna): sector = rna[count:count+3] AminoA = codon_to_AA[sector] if AminoA == "M": has_started = 1 if has_started == 1: protein_sequence = protein_sequence + AminoA if AminoA == "_": break count = count + 3 return protein_sequence def translate_RNAtoProtein_advanced(rna): rna = rna.upper() start = rna.find("AUG") if start == -1: return [] rna = rna[start:] proteins = [] while len(rna) >= 3: codon = rna[:3] aa = codon_to_AA[codon] if aa == "_": break proteins.append(aa) rna = rna[3:] return proteins M&MNS miemism M&M's Tube_0 = [5, 14, 5, 12, 7, 3] Tube_0 = [9, 6, 7, 10, 6, 5] YIPEEEEEEEEEEEEEEEEEEE we're at 1000 rows uwu tar -czvf stuff.tar.gz /jupyter-persistant/user9 tar -czvf stuff.tar.gz /jupyter-persistant/user9 tar -czvf stuff.tar.gz /jupyter-persistant/user9 tar -czvf stuff.tar.gz /jupyter-persistant/user9 tar -czvf stuff.tar.gz /jupyter-persistant/user9 tar -czvf stuff.tar.gz /jupyter-persistant/user9 tar -czv tar -czvf stuff.tar.gz /jupyter-persistant/user9 tar -czvf stuff.tar.gz /jupyter-persistant/user9 tar -czvf stuff.tar.gz /jupyter-persistant/user9 tar -czvf stuff.tar.gz /jupyter-persistant/user9 tar -czvf stuff.tar.gz /jupyter-persistant/user9 tar -czvf stuff.tar.gz /jupyter-persistant/user9 tar -czvf stuff.tar.gz /jupyter-persistant/user9f stuff.tar.gz /jupyter-persistant/user9 tar -czvf stuff.tar.gz /jupyter-persistant/user9 tar -czvf stuff.tar.gz /jupyter-persistant/user9 v tar -czvf stuff.tar.gz /jupyter-persistant/user9 tar -czvf stuff.tar.gz /jupyter-persistant/user9 tar -czvf stuff.tar.gz /jupyter-persistant/user9 tar -czvf stuff.tar.gz /jupyter-persistant/user9 tar -czvf stuff.tar.gz /jupyter-persistant/user9 tar -czvf stuff.tar.gz /jupyter-persistant/user9 tar -czvf stuff.tar.gz /jupyter-persistant/user9 tar -czvf stuff.tar.gz /jupyter-persistant/user9 tar -czvf stuff.tar.gz /jupyter-persistant/user9 tar -czvf stuff.tar.gz /jupyter-persistant/user9 tar -czvf stuff.tar.gz /jupyter-persistant/user9 tar -czvf stuff.tar.gz /jupyter-persistant/user9

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully