1 / 11

Basic Python Review

Basic Python Review. BCHB524 2009 Lecture 5. Outline. Revision of data-structures Class exercises Exercises. Python Data-Structures. Mutable and changeable storage of many items Lists - Access by index or iteration Dictionaries - Access by key or iteration

kitty
Télécharger la présentation

Basic Python Review

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Basic Python Review BCHB5242009Lecture 5 BCHB524 - 2009 - Edwards

  2. Outline • Revision of data-structures • Class exercises • Exercises BCHB524 - 2009 - Edwards

  3. Python Data-Structures • Mutable and changeable storage of many items • Lists - Access by index or iteration • Dictionaries - Access by key or iteration • Sets - Access by iteration, membership test • Files - Access by iteration, as string • Lists of numbers (range) • Strings → List (split), List → String (join) • Reading sequences, parsing codon table. BCHB524 - 2009 - Edwards

  4. Class Review Exercises • DNA sequence length • Are all DNA symbols valid? • DNA sequence composition • Read chunk format sequence from file • Parse and print NCBI taxonomy names • Compute codon usage BCHB524 - 2009 - Edwards

  5. DNA Sequence Length • Write a program to determine the length of a DNA sequence provided in a file. BCHB524 - 2009 - Edwards

  6. Valid DNA Symbols • Write a program to determine if a DNA sequence provided in a file contains any invalid symbols. BCHB524 - 2009 - Edwards

  7. DNA Composition • Write a program to count the proportion of each symbol in a DNA sequence, provided in a file. BCHB524 - 2009 - Edwards

  8. Chunk format sequence • Write a program to count the proportion of each symbol in a DNA sequence, provided in a file in "chunk" format. • Download these files from the data-directory • SwissProt_Format_Ns.seq • SwissProt_Format.seq • Check that your program correctly reads these sequences BCHB524 - 2009 - Edwards

  9. Codon usage • Write a program to compute the codon usage of gene whose DNA sequence provided in a file. • Assume translation starts with the first symbol of the provided gene sequence. BCHB524 - 2009 - Edwards

  10. Taxonomy names • Write a program to lists all the scientific names from a NCBI taxonomy file. • Download the names.dmp file from the data-directory • Look at the file and figure out how to parse it • Read the file, line by line, and print out only those names that represent scientific names of species. BCHB524 - 2009 - Edwards

  11. Lab Exercises • Modify your DNA translation program to translate in each forward frame (1,2,3) • Modify your translation program to translate in each reverse translation frame. • Modify your translation program to handle 'N' symbols in the DNA sequence • If all possible codons translate to the same amino-aicd, then output that amino-acid. • If the possible codons translate to different amino-acids, the output 'X'. BCHB524 - 2009 - Edwards

More Related