☰ Menu

      Bioinformatics: Command Line/R Prerequisites 2020

Home
Introduction
Intro to the Workshop and Core
Schedule
Resources
Zoom help
Slack help
Software and Links
Cheat Sheets
Intro CLI
Logging in
Introduction to the Command Line part 1
Introduction to the Command Line part 2
The cluster and modules
Introduction to Python
Python Part1, Background
Python Part2, Data Types
Python Part2, Solutions
Python Part3, Flow Control
Python Part3, Solutions
Python Part4, Working with Files
Python Part4, Solutions
Advanced CLI
Advanced Command Line
Advanced Challenge Solutions
A Simple Bioinformatics Workflow
Software Installation
Using make and cmake
Using Conda
Getting set up with AWS
AWS Event Engine
Starting and Stopping your AWS Instance
Introduction to R
Introduction to R
Introduction to tidyverse
Organizing, manipulating, and visualizing data in the tidyverse
Advanced R
Linear models in R
ETC
Closing thoughts
Github page
Biocore website
  1. Create a list of all even values from 0 to 100.
    • What is the length of the list?
    • What is the average of the list?
    • What is the sum of the 13 to the 17th elements in the list?
    • What is the 16th element from the end?
    • Replace the 23rd element with the value 200. Now what is the average?
     my_list = range(0,102,2)
     type(my_list)
     my_list = list(my_list)
     type(my_list)
     len(my_list)
     sum(my_list)/len(my_list)
     sum(my_list[12:17])
     my_list[-16] # note when working backwards the index starts at -1 rather the 0 like when forward
     my_list[22] = 200
     sum(my_list)/len(my_list)
    
  2. Learning to use python it is good to have an experimental mentality to learn more about edge cases
    • What is the empty list in terms of a boolean value?
    • What is an empty dictionary in terms of a boolean value?
    • What about a float value of 0?
     bool([])
     bool({})
     bool(0.0)
    
  3. Create a string in python with some information about yourself (Name, background, etc.)
    • Take the string you created and make a list out of it where each word is an element.
    • Now recreate the string with two spaces where there was originally one space. There are two ways, one using the list and one using the original string. Can you think of both?
     bio = "Hi my name is Keith Mitchell and I am a grad student in genetics/genomics and biostats."
     bio
     bio_list = bio.split()
     bio_list
     new_bio_string = '  '.join(bio_list)
     new_bio_string
     new_bio_string2 = bio.replace(' ', '  ')
     new_bio_string2