Podcast
Questions and Answers
Which of the following is required to run a Python program?
Which of the following is required to run a Python program?
Python programs can only use English language keywords.
Python programs can only use English language keywords.
True
What command is used to output 'Hello world!' in a Python program?
What command is used to output 'Hello world!' in a Python program?
print('Hello world!')
In Python, a _____ is used to represent a collection of key-value pairs.
In Python, a _____ is used to represent a collection of key-value pairs.
Signup and view all the answers
Match the following Python built-in types with their examples:
Match the following Python built-in types with their examples:
Signup and view all the answers
Which operator is used in Python to calculate the modulus?
Which operator is used in Python to calculate the modulus?
Signup and view all the answers
The flow control structure in Python includes if/elif/else statements.
The flow control structure in Python includes if/elif/else statements.
Signup and view all the answers
What is the purpose of the break statement in Python?
What is the purpose of the break statement in Python?
Signup and view all the answers
What is the primary organism referenced in the sequence?
What is the primary organism referenced in the sequence?
Signup and view all the answers
The Bio.SeqIO module is designed for input and output of various sequence file formats.
The Bio.SeqIO module is designed for input and output of various sequence file formats.
Signup and view all the answers
What is the goal of using the Basic Local Alignment Search Tool (BLAST)?
What is the goal of using the Basic Local Alignment Search Tool (BLAST)?
Signup and view all the answers
BioPython allows users to convert DNA sequences among different __________.
BioPython allows users to convert DNA sequences among different __________.
Signup and view all the answers
Match the following BioPython modules to their main function:
Match the following BioPython modules to their main function:
Signup and view all the answers
What does the FASTQ format primarily include along with DNA base calls?
What does the FASTQ format primarily include along with DNA base calls?
Signup and view all the answers
Multiple FASTA records can be combined in a single file.
Multiple FASTA records can be combined in a single file.
Signup and view all the answers
What is the first line of a FASTQ entry always start with?
What is the first line of a FASTQ entry always start with?
Signup and view all the answers
A FASTA record should not mix _____ and _____ records in the same file.
A FASTA record should not mix _____ and _____ records in the same file.
Signup and view all the answers
Match the following sequence formats with their characteristics:
Match the following sequence formats with their characteristics:
Signup and view all the answers
Which of the following is NOT a component of a FASTQ entry?
Which of the following is NOT a component of a FASTQ entry?
Signup and view all the answers
The third line of a FASTQ entry is represented by a plus symbol (‘+’).
The third line of a FASTQ entry is represented by a plus symbol (‘+’).
Signup and view all the answers
What type of information does the Phred score represent?
What type of information does the Phred score represent?
Signup and view all the answers
In Genbank format, the LOCUS line provides information about the sequence's _____ and _____ type.
In Genbank format, the LOCUS line provides information about the sequence's _____ and _____ type.
Signup and view all the answers
Which line of a FASTQ entry contains the actual DNA base calls?
Which line of a FASTQ entry contains the actual DNA base calls?
Signup and view all the answers
What is the source organism of the accession AY069118?
What is the source organism of the accession AY069118?
Signup and view all the answers
Internal priming is a known artifact associated with cDNA clone generation.
Internal priming is a known artifact associated with cDNA clone generation.
Signup and view all the answers
What may contaminants during cDNA generation lead to?
What may contaminants during cDNA generation lead to?
Signup and view all the answers
The accession number of this cDNA clone is ______.
The accession number of this cDNA clone is ______.
Signup and view all the answers
Match the following attributes related to cDNA generation with their corresponding descriptions:
Match the following attributes related to cDNA generation with their corresponding descriptions:
Signup and view all the answers
Which of the following is a potential artifact from reverse transcription of precursor RNAs?
Which of the following is a potential artifact from reverse transcription of precursor RNAs?
Signup and view all the answers
The information about the sequence can be found on a web page or via email.
The information about the sequence can be found on a web page or via email.
Signup and view all the answers
What does cDNA stand for?
What does cDNA stand for?
Signup and view all the answers
The genetic material of fruit flies belongs to the kingdom ______.
The genetic material of fruit flies belongs to the kingdom ______.
Signup and view all the answers
Which domain of life does Drosophila melanogaster belong to?
Which domain of life does Drosophila melanogaster belong to?
Signup and view all the answers
Study Notes
Course Details
- Course Title: BIOTECH4BI3 - BIOINFORMATICS
- Lecture 1: Python review and introduction to BioPython
Python Installation
- Use Anaconda: www.anaconda.com/products/individual
- Download Python 3.12 version suitable for your platform (Windows, Mac, Linux)
- Install the appropriate installer (different versions for Windows, Mac, and Linux). Windows has a 64-bit Graphical Installer (912.3M), Mac has a 64-bit (Apple silicon) Graphical Installer (704.7M), and Linux has a 64-bit (x86) Installer (1007.9M).
Python Fundamentals
- Extensive standard library
- Promotes easy addition of new functionality
- Code structure is crucial
- Proper use of English language keywords is essential (e.g., capitalization matters)
- "Clever" coding is not considered a positive attribute
Hello World! Example
- Each Python program typically starts with a declaration specifying the Python interpreter's location (often omitted on Windows)
- Use
\n
for newline characters - Strings for text need quotation marks
- Save the program with a
.py
extension - Execute the program using the
python
command
Data Types
- Python has built-in data types, including numbers (integers and floats) and strings
- Variables store data (e.g.,
myNumber = 1
,mySentence = "You will love my class"
) - Operators for data manipulation (e.g.,
+
,-
,*
,/
,%
,**
,<=
,>=
,!=
,<
,>
).
Built-in Python Types
- Integers (
int(x)
) - Floats (
float(x)
) - Lists (e.g.,
myList=[1,2,3,'four']
) - Ranges (e.g.,
myRange=range(0,10,2)
) - Strings (e.g.,
myString="biotech"
) - Dictionaries (e.g.,
myHash={'Joe':123,'John':456}
)
Flow Control
- Python uses familiar constructs (e.g.,
if/elif/else
,for
statements,while
statements,break
,continue
) for program flow control.
If/elif/else
- Conditional statements provide choices to actions
- If condition is true, execute operation 1
- If condition is false but
elif
condition is true , execute operation 2 - If neither condition is true, execute operation 3
For Loop Examples
- Used for looping through a defined or specified range
- Avoid infinite loops (ensure your loop counter changes value).
- Use indentation to structure your code within the loop
While Loop Examples
- Used for looping an indeterminate number of times
- The
while
loop continues executing as long as the logical value isTrue
. Make a condition that changes from True to False to end the loop.
Lists
- List is a data structure for storing objects sequentially
- Create a list (e.g.,
myList = []
) - Add elements (
myList.append(element)
) - Add lists to lists (
myList.extend(listToAppend)
) - Insert elements (
myList.insert(index, element)
) - Delete elements (
del myList[index]
,myList.pop(index)
)
Dictionaries
- A data structure for key-value pairs
- Create an empty dictionary (
myBook = {}
) - Add key-value pairs (
myBook["one"] = 1
) - Delete key-value pairs (
del myBook["one"]
,myBook.pop("one")
) - Accessing keys, values, and key-value pairs (
myKeys=myBook.keys()
,myValues=myBook.values()
,for key, value in myBook.items()
)
Files
- Python has an easy way to access text files
- Use
FILEHANDLE = open(FILE, mode='r')
to open the file for reading -
FILEHANDLE = open(FILE, mode='w')
to open to write, andFILEHANDLE = open(FILE, mode='a')
for appending - Reading a line from the file (
myLine = myFile.readline()
) - Writing to a file (
myFile.write(“This is a text”)
) - Closing the file (
myFile.close()
)
Miscellaneous Commands
-
str.rstrip()
: Removes whitespace from the end of a string (by default). Can also remove newlines (\n
) usingstr.rstrip('\n')
-
''.join(list)
: Joins the strings in a list into a single string. -
str.split()
: Splits a string into a list of strings. -
str.find()
: Finds the position of a substring within a string. -
str.replace(old,new)
: Replaces occurrences of 'old' with 'new' in a string - Replacing characters at specified positions (
stringList[index]=newCharacter
)
Error Handling
- A
try...except
block handles potential errors gracefully -
try
block: Code that might raise an error. - The
except
block: Handles the specific error type. -
finally
block: Always executes regardless of errors, often for cleanup operations.
Command-line Arguments
- Pass information to a Python program at execution
-
sys.argv
stores the arguments -
programName = sys.argv[0]
access file name -
arg1=sys.argv[1]
access the first external argument input
Python Functions
- Reusable code blocks
-
def FUNCTION_NAME(PARAMETERS):
to define a function -
RETURN_VALUE
to return data or execute an action
BioPython
- A collection of Python classes designed to handle bioinformatics tasks
- Facilitates processing BLAST reports and other bioinformatics data
- Useful for working with DNA sequences and converting between different formats (e.g., Genbank, FASTA, FASTQ
FASTA Format
- Standard format for DNA data exchange in bioinformatics.
- Each record starts with a ">" followed by a descriptive title.
- DNA data starts on the next line.
FASTQ Format
- Used for high-throughput DNA sequencing data.
- Contains base calls and quality scores.
- Each record has four lines:
- The first line begins with an "@" symbol; provides identifying information.
- The second line contains the DNA base sequence.
- The third line begins with a "+" character.
- The fourth line shows quality scores for corresponding bases.
Genbank Format
- Widely used format for nucleotide data in bioinformatics.
- Contains various metadata about the sequence including location, accession numbers, and references.
Bio.SeqIO
- A module in BioPython for parsing and writing sequence files in different formats.
- Often used for processing FASTA, GenBank, and other formats.
Bio.SearchIO
- Used to search a sequence against a database of sequences, specifically through programs like BLAST.
- Converts and processes results from BLAST reports.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Related Documents
Description
Test your knowledge of Python programming and its applications in bioinformatics. This quiz covers essential Python concepts along with specific BioPython modules and file formats used in biological data analysis. Perfect for learners who want to assess their understanding of these two critical areas.