1 / 64100%
SEQUENCE ALIGNMENT AND SCORING IN DNA
SEQUENCING ANALYSIS
ADVANCED SEQUENCE ALIGNMENT AND SCORING
Problem 1. Consider a local alignment of two DNA sequences using the Smith-Waterman
algorithm with the following scoring scheme:
Match: +2
Mismatch: -1
Gap: -2
The sequences are: S1=ACGTACGTACGT
S2=ACGTACGTTCGT
Calculate the optimal local alignment score and provide the aligned sequences.
Solution 1. We’ll use dynamic programming to fill the scoring matrix.
Step 1: Initialize the matrix (Showing only part of the matrix due to space constraints)
A C G T A
0 0 0 0 0 0
A 0 2 0 0 0 2
C 0 0 4 2 0 0
G 0 0 2 6 4 2
T 0 0 0 4 8 6
A 0 2 0 2 6 10
Step 2: Fill the entire matrix (not shown due to space)
Step 3: Find the maximum score and trace back Maximum score: 24
Aligned sequences: S1:ACGTACGT-CGT
S2:ACGTACGTTCGT
Therefore, the optimal local alignment score is 24, and the aligned sequences are shown above.
Problem 2. In a DNA sequencing experiment, a read of length 100 bp is aligned to a
reference genome of length 3 billion bp using the Burrows-Wheeler Transform (BWT) and FM-
index. The average time to process one base pair during alignment is 10 nanoseconds.
a) Calculate the expected time to align this read.
b) If we have 1 million such reads, how long would it take to align all of them using a single
processor?
c) How many processors would we need to align all reads in under 1 hour?
Solution 2. a) Expected time to align one read: Time = Read length × Time per base pair
Time = 100 bp × 10 ns/bp = 1,000 ns = 1 μs
b) Time to align 1 million reads on a single processor: Total time = Number of reads × Time
per read Total time = 1,000,000 × 1 μs = 1,000,000 μs = 1 s
c) Number of processors needed for alignment under 1 hour: 1 hour = 3,600 s 1 s is already
fast enough, so we only need 1 processor.
If we want to be more precise: Processors needed = Ceiling(1 s / 3,600 s) = 1
Therefore: a) It takes 1 μs to align one read. b) It takes 1 s to align all 1 million reads on a
single processor. c) We need 1 processor to align all reads in under 1 hour.
1 ERROR CORRECTION AND QUALITY SCORES
Problem 3. In a DNA sequencing run, quality scores are provided in Phred+33 format. A
particular base has an ASCII value of 73.
a) What is the corresponding Phred quality score?
b) What is the probability of an error for this base call?
c) If we have a sequence of 1000 bases with this quality score, what is the expected number of
errors?
d) What is the probability of having exactly 5 errors in this 1000-base sequence?
Solution 3. a) Phred quality score: ASCII value - 33 = Phred score 73 - 33 = 40
b) Probability of an error: P(error) = 10(−Q/10), where Q is the Phred score P(error) =
10(40/10)=104 = 0.0001
c) Expected number of errors in 1000 bases: E(errors) = Number of bases × P(error) E(errors)
= 1000 × 0.0001 = 0.1
d) Probability of exactly 5 errors in 1000 bases: This follows a binomial distribution: B(n, p) n =
1000, p = 0.0001
P(X = 5) = C(1000, 5) × (0.0001)5 × (0.9999)995
C(1000, 5) = 1000! / (5! × 995!) 8.25 × 1012
P(X = 5) 8.25 × 1012 × 1020 × 0.9005 7.43 × 10−8
Therefore: a) The Phred quality score is 40. b) The probability of an error is 0.0001. c) The
expected number of errors in 1000 bases is 0.1. d) The probability of exactly 5 errors in 1000
bases is approximately 7.43 × 10−8.
2 GENOME ASSEMBLY
Problem 4. In a de novo genome assembly project, you have the following information:
Estimated genome size: 100 Mbp
Read length: 150 bp
Desired coverage: 30x
Sequencing machine output: 300 million reads per run
Cost per run: $1000
a) How many reads are needed to achieve the desired coverage?
b) What is the total amount of sequence data needed in base pairs?
c) How many sequencing runs are required?
d) What is the total cost of sequencing?
e) If the assembly algorithm has a time complexity of O(n log n), where n is the number of
reads, estimate the relative time increase if we double the coverage to 60x.
Solution 4. a) Number of reads needed: Coverage = (Number of reads × Read length) /
Genome size 30 = (Number of reads × 150 bp) / (100 × 106 bp) Number of reads = (30 × 100
× 106) / 150 = 20 million reads
b) Total amount of sequence data: Data = Number of reads × Read length Data = 20 million ×
150 bp = 3 billion bp = 3 Gbp
c) Number of sequencing runs: Runs = Ceiling(Reads needed / Reads per run) Runs =
Ceiling(20 million / 300 million) = 1 run
d) Total cost: Cost = Number of runs × Cost per run Cost = 1 × $1000 = $1000
e) Time increase for doubled coverage: Original time: O(n log n), where n = 20 million New
time with 60x coverage: O(2n log(2n))
Relative increase = (2n log(2n)) / (n log n) = 2(log(2n) / log(n)) = 2(log(40 million) / log(20
million)) 2.1
Therefore: a) 20 million reads are needed. b) 3 Gbp of sequence data is needed. c) 1
sequencing run is required. d) The total cost of sequencing is $1000. e) Doubling the coverage
would increase the assembly time by a factor of approximately 2.1.
Consider a local alignment of two DNA sequences using the Smith-Waterman algorithm with the
following scoring scheme:
Match: +2
Mismatch: -1
Gap: -2
The sequences are: S1=ACGTACGTACGT
S2=ACGTACGTTCGT
Calculate the optimal local alignment score and provide the aligned sequences.
Solution 1. We’ll use dynamic programming to fill the scoring matrix.
Step 1: Initialize the matrix (Showing only part of the matrix due to space constraints)
A C G T A
0 0 0 0 0 0
A 0 2 0 0 0 2
C 0 0 4 2 0 0
G 0 0 2 6 4 2
T 0 0 0 4 8 6
A 0 2 0 2 6 10
Step 2: Fill the entire matrix (not shown due to space)
Step 3: Find the maximum score and trace back Maximum score: 24
Aligned sequences: S1:ACGTACGT-CGT
S2:ACGTACGTTCGT
Therefore, the optimal local alignment score is 24, and the aligned sequences are shown above.
Problem 2. In a DNA sequencing experiment, a read of length 100 bp is aligned to a
reference genome of length 3 billion bp using the Burrows-Wheeler Transform (BWT) and FM-
index. The average time to process one base pair during alignment is 10 nanoseconds.
a) Calculate the expected time to align this read.
b) If we have 1 million such reads, how long would it take to align all of them using a single
processor?
c) How many processors would we need to align all reads in under 1 hour?
Solution 2. a) Expected time to align one read: Time = Read length × Time per base pair
Time = 100 bp × 10 ns/bp = 1,000 ns = 1 μs
b) Time to align 1 million reads on a single processor: Total time = Number of reads × Time
per read Total time = 1,000,000 × 1 μs = 1,000,000 μs = 1 s
c) Number of processors needed for alignment under 1 hour: 1 hour = 3,600 s 1 s is already
fast enough, so we only need 1 processor.
If we want to be more precise: Processors needed = Ceiling(1 s / 3,600 s) = 1
Therefore: a) It takes 1 μs to align one read. b) It takes 1 s to align all 1 million reads on a
single processor. c) We need 1 processor to align all reads in under 1 hour.
3 ERROR CORRECTION AND QUALITY SCORES
Problem 3. In a DNA sequencing run, quality scores are provided in Phred+33 format. A
particular base has an ASCII value of 73.
a) What is the corresponding Phred quality score?
b) What is the probability of an error for this base call?
c) If we have a sequence of 1000 bases with this quality score, what is the expected number of
errors?
d) What is the probability of having exactly 5 errors in this 1000-base sequence?
Solution 3. a) Phred quality score: ASCII value - 33 = Phred score 73 - 33 = 40
b) Probability of an error: P(error) = 10(−Q/10), where Q is the Phred score P(error) =
10(40/10)=104 = 0.0001
c) Expected number of errors in 1000 bases: E(errors) = Number of bases × P(error) E(errors)
= 1000 × 0.0001 = 0.1
d) Probability of exactly 5 errors in 1000 bases: This follows a binomial distribution: B(n, p) n =
1000, p = 0.0001
P(X = 5) = C(1000, 5) × (0.0001)5 × (0.9999)995
C(1000, 5) = 1000! / (5! × 995!) 8.25 × 1012
P(X = 5) 8.25 × 1012 × 1020 × 0.9005 7.43 × 10−8
Therefore: a) The Phred quality score is 40. b) The probability of an error is 0.0001. c) The
expected number of errors in 1000 bases is 0.1. d) The probability of exactly 5 errors in 1000
bases is approximately 7.43 × 10−8.
4 GENOME ASSEMBLY
Problem 4. In a de novo genome assembly project, you have the following information:
Estimated genome size: 100 Mbp
Read length: 150 bp
Desired coverage: 30x
Sequencing machine output: 300 million reads per run
Cost per run: $1000
a) How many reads are needed to achieve the desired coverage?
b) What is the total amount of sequence data needed in base pairs?
c) How many sequencing runs are required?
d) What is the total cost of sequencing?
e) If the assembly algorithm has a time complexity of O(n log n), where n is the number of
reads, estimate the relative time increase if we double the coverage to 60x.
Solution 4. a) Number of reads needed: Coverage = (Number of reads × Read length) /
Genome size 30 = (Number of reads × 150 bp) / (100 × 106 bp) Number of reads = (30 × 100
× 106) / 150 = 20 million reads
b) Total amount of sequence data: Data = Number of reads × Read length Data = 20 million ×
150 bp = 3 billion bp = 3 Gbp
c) Number of sequencing runs: Runs = Ceiling(Reads needed / Reads per run) Runs =
Ceiling(20 million / 300 million) = 1 run
d) Total cost: Cost = Number of runs × Cost per run Cost = 1 × $1000 = $1000
e) Time increase for doubled coverage: Original time: O(n log n), where n = 20 million New
time with 60x coverage: O(2n log(2n))
Relative increase = (2n log(2n)) / (n log n) = 2(log(2n) / log(n)) = 2(log(40 million) / log(20
million)) 2.1
Therefore: a) 20 million reads are needed. b) 3 Gbp of sequence data is needed. c) 1
sequencing run is required. d) The total cost of sequencing is $1000. e) Doubling the coverage
would increase the assembly time by a factor of approximately 2.1.
Consider a local alignment of two DNA sequences using the Smith-Waterman algorithm with the
following scoring scheme:
Match: +2
Mismatch: -1
Gap: -2
The sequences are: S1=ACGTACGTACGT
S2=ACGTACGTTCGT
Calculate the optimal local alignment score and provide the aligned sequences.
Solution 1. We’ll use dynamic programming to fill the scoring matrix.
Step 1: Initialize the matrix (Showing only part of the matrix due to space constraints)
A C G T A
0 0 0 0 0 0
A 0 2 0 0 0 2
C 0 0 4 2 0 0
G 0 0 2 6 4 2
T 0 0 0 4 8 6
A 0 2 0 2 6 10
Step 2: Fill the entire matrix (not shown due to space)
Step 3: Find the maximum score and trace back Maximum score: 24
Aligned sequences: S1:ACGTACGT-CGT
S2:ACGTACGTTCGT
Therefore, the optimal local alignment score is 24, and the aligned sequences are shown above.
Problem 2. In a DNA sequencing experiment, a read of length 100 bp is aligned to a
reference genome of length 3 billion bp using the Burrows-Wheeler Transform (BWT) and FM-
index. The average time to process one base pair during alignment is 10 nanoseconds.
a) Calculate the expected time to align this read.
b) If we have 1 million such reads, how long would it take to align all of them using a single
processor?
c) How many processors would we need to align all reads in under 1 hour?
Solution 2. a) Expected time to align one read: Time = Read length × Time per base pair
Time = 100 bp × 10 ns/bp = 1,000 ns = 1 μs
b) Time to align 1 million reads on a single processor: Total time = Number of reads × Time
per read Total time = 1,000,000 × 1 μs = 1,000,000 μs = 1 s
c) Number of processors needed for alignment under 1 hour: 1 hour = 3,600 s 1 s is already
fast enough, so we only need 1 processor.
If we want to be more precise: Processors needed = Ceiling(1 s / 3,600 s) = 1
Therefore: a) It takes 1 μs to align one read. b) It takes 1 s to align all 1 million reads on a
single processor. c) We need 1 processor to align all reads in under 1 hour.
5 ERROR CORRECTION AND QUALITY SCORES
Problem 3. In a DNA sequencing run, quality scores are provided in Phred+33 format. A
particular base has an ASCII value of 73.
a) What is the corresponding Phred quality score?
b) What is the probability of an error for this base call?
c) If we have a sequence of 1000 bases with this quality score, what is the expected number of
errors?
d) What is the probability of having exactly 5 errors in this 1000-base sequence?
Solution 3. a) Phred quality score: ASCII value - 33 = Phred score 73 - 33 = 40
b) Probability of an error: P(error) = 10(−Q/10), where Q is the Phred score P(error) =
10(40/10)=104 = 0.0001
c) Expected number of errors in 1000 bases: E(errors) = Number of bases × P(error) E(errors)
= 1000 × 0.0001 = 0.1
d) Probability of exactly 5 errors in 1000 bases: This follows a binomial distribution: B(n, p) n =
1000, p = 0.0001
P(X = 5) = C(1000, 5) × (0.0001)5 × (0.9999)995
C(1000, 5) = 1000! / (5! × 995!) 8.25 × 1012
P(X = 5) 8.25 × 1012 × 1020 × 0.9005 7.43 × 10−8
Therefore: a) The Phred quality score is 40. b) The probability of an error is 0.0001. c) The
expected number of errors in 1000 bases is 0.1. d) The probability of exactly 5 errors in 1000
bases is approximately 7.43 × 10−8.
6 GENOME ASSEMBLY
Problem 4. In a de novo genome assembly project, you have the following information:
Estimated genome size: 100 Mbp
Read length: 150 bp
Desired coverage: 30x
Sequencing machine output: 300 million reads per run
Cost per run: $1000
a) How many reads are needed to achieve the desired coverage?
b) What is the total amount of sequence data needed in base pairs?
c) How many sequencing runs are required?
d) What is the total cost of sequencing?
e) If the assembly algorithm has a time complexity of O(n log n), where n is the number of
reads, estimate the relative time increase if we double the coverage to 60x.
Solution 4. a) Number of reads needed: Coverage = (Number of reads × Read length) /
Genome size 30 = (Number of reads × 150 bp) / (100 × 106 bp) Number of reads = (30 × 100
× 106) / 150 = 20 million reads
b) Total amount of sequence data: Data = Number of reads × Read length Data = 20 million ×
150 bp = 3 billion bp = 3 Gbp
c) Number of sequencing runs: Runs = Ceiling(Reads needed / Reads per run) Runs =
Ceiling(20 million / 300 million) = 1 run
d) Total cost: Cost = Number of runs × Cost per run Cost = 1 × $1000 = $1000
e) Time increase for doubled coverage: Original time: O(n log n), where n = 20 million New
time with 60x coverage: O(2n log(2n))
Relative increase = (2n log(2n)) / (n log n) = 2(log(2n) / log(n)) = 2(log(40 million) / log(20
million)) 2.1
Therefore: a) 20 million reads are needed. b) 3 Gbp of sequence data is needed. c) 1
sequencing run is required. d) The total cost of sequencing is $1000. e) Doubling the coverage
would increase the assembly time by a factor of approximately 2.1.
Consider a local alignment of two DNA sequences using the Smith-Waterman algorithm with the
following scoring scheme:
Match: +2
Mismatch: -1
Gap: -2
The sequences are: S1=ACGTACGTACGT
S2=ACGTACGTTCGT
Calculate the optimal local alignment score and provide the aligned sequences.
Solution 1. We’ll use dynamic programming to fill the scoring matrix.
Step 1: Initialize the matrix (Showing only part of the matrix due to space constraints)
A C G T A
0 0 0 0 0 0
A 0 2 0 0 0 2
C 0 0 4 2 0 0
G 0 0 2 6 4 2
T 0 0 0 4 8 6
A 0 2 0 2 6 10
Step 2: Fill the entire matrix (not shown due to space)
Step 3: Find the maximum score and trace back Maximum score: 24
Aligned sequences: S1:ACGTACGT-CGT
S2:ACGTACGTTCGT
Therefore, the optimal local alignment score is 24, and the aligned sequences are shown above.
Problem 2. In a DNA sequencing experiment, a read of length 100 bp is aligned to a
reference genome of length 3 billion bp using the Burrows-Wheeler Transform (BWT) and FM-
index. The average time to process one base pair during alignment is 10 nanoseconds.
a) Calculate the expected time to align this read.
b) If we have 1 million such reads, how long would it take to align all of them using a single
processor?
c) How many processors would we need to align all reads in under 1 hour?
Solution 2. a) Expected time to align one read: Time = Read length × Time per base pair
Time = 100 bp × 10 ns/bp = 1,000 ns = 1 μs
b) Time to align 1 million reads on a single processor: Total time = Number of reads × Time
per read Total time = 1,000,000 × 1 μs = 1,000,000 μs = 1 s
c) Number of processors needed for alignment under 1 hour: 1 hour = 3,600 s 1 s is already
fast enough, so we only need 1 processor.
If we want to be more precise: Processors needed = Ceiling(1 s / 3,600 s) = 1
Therefore: a) It takes 1 μs to align one read. b) It takes 1 s to align all 1 million reads on a
single processor. c) We need 1 processor to align all reads in under 1 hour.
7 ERROR CORRECTION AND QUALITY SCORES
Problem 3. In a DNA sequencing run, quality scores are provided in Phred+33 format. A
particular base has an ASCII value of 73.
a) What is the corresponding Phred quality score?
b) What is the probability of an error for this base call?
c) If we have a sequence of 1000 bases with this quality score, what is the expected number of
errors?
d) What is the probability of having exactly 5 errors in this 1000-base sequence?
Solution 3. a) Phred quality score: ASCII value - 33 = Phred score 73 - 33 = 40
b) Probability of an error: P(error) = 10(−Q/10), where Q is the Phred score P(error) =
10(40/10)=104 = 0.0001
c) Expected number of errors in 1000 bases: E(errors) = Number of bases × P(error) E(errors)
= 1000 × 0.0001 = 0.1
d) Probability of exactly 5 errors in 1000 bases: This follows a binomial distribution: B(n, p) n =
1000, p = 0.0001
P(X = 5) = C(1000, 5) × (0.0001)5 × (0.9999)995
C(1000, 5) = 1000! / (5! × 995!) 8.25 × 1012
P(X = 5) 8.25 × 1012 × 1020 × 0.9005 7.43 × 10−8
Therefore: a) The Phred quality score is 40. b) The probability of an error is 0.0001. c) The
expected number of errors in 1000 bases is 0.1. d) The probability of exactly 5 errors in 1000
bases is approximately 7.43 × 10−8.
8 GENOME ASSEMBLY
Problem 4. In a de novo genome assembly project, you have the following information:
Estimated genome size: 100 Mbp
Read length: 150 bp
Desired coverage: 30x
Sequencing machine output: 300 million reads per run
Cost per run: $1000
a) How many reads are needed to achieve the desired coverage?
b) What is the total amount of sequence data needed in base pairs?
c) How many sequencing runs are required?
d) What is the total cost of sequencing?
e) If the assembly algorithm has a time complexity of O(n log n), where n is the number of
reads, estimate the relative time increase if we double the coverage to 60x.
Solution 4. a) Number of reads needed: Coverage = (Number of reads × Read length) /
Genome size 30 = (Number of reads × 150 bp) / (100 × 106 bp) Number of reads = (30 × 100
× 106) / 150 = 20 million reads
b) Total amount of sequence data: Data = Number of reads × Read length Data = 20 million ×
150 bp = 3 billion bp = 3 Gbp
c) Number of sequencing runs: Runs = Ceiling(Reads needed / Reads per run) Runs =
Ceiling(20 million / 300 million) = 1 run
d) Total cost: Cost = Number of runs × Cost per run Cost = 1 × $1000 = $1000
e) Time increase for doubled coverage: Original time: O(n log n), where n = 20 million New
time with 60x coverage: O(2n log(2n))
Relative increase = (2n log(2n)) / (n log n) = 2(log(2n) / log(n)) = 2(log(40 million) / log(20
million)) 2.1
Therefore: a) 20 million reads are needed. b) 3 Gbp of sequence data is needed. c) 1
sequencing run is required. d) The total cost of sequencing is $1000. e) Doubling the coverage
would increase the assembly time by a factor of approximately 2.1.
Consider a local alignment of two DNA sequences using the Smith-Waterman algorithm with the
following scoring scheme:
Match: +2
Mismatch: -1
Gap: -2
The sequences are: S1=ACGTACGTACGT
S2=ACGTACGTTCGT
Calculate the optimal local alignment score and provide the aligned sequences.
Solution 1. We’ll use dynamic programming to fill the scoring matrix.
Step 1: Initialize the matrix (Showing only part of the matrix due to space constraints)
A C G T A
0 0 0 0 0 0
A 0 2 0 0 0 2
C 0 0 4 2 0 0
G 0 0 2 6 4 2
T 0 0 0 4 8 6
A 0 2 0 2 6 10
Step 2: Fill the entire matrix (not shown due to space)
Step 3: Find the maximum score and trace back Maximum score: 24
Aligned sequences: S1:ACGTACGT-CGT
S2:ACGTACGTTCGT
Therefore, the optimal local alignment score is 24, and the aligned sequences are shown above.
Problem 2. In a DNA sequencing experiment, a read of length 100 bp is aligned to a
reference genome of length 3 billion bp using the Burrows-Wheeler Transform (BWT) and FM-
index. The average time to process one base pair during alignment is 10 nanoseconds.
a) Calculate the expected time to align this read.
b) If we have 1 million such reads, how long would it take to align all of them using a single
processor?
c) How many processors would we need to align all reads in under 1 hour?
Solution 2. a) Expected time to align one read: Time = Read length × Time per base pair
Time = 100 bp × 10 ns/bp = 1,000 ns = 1 μs
b) Time to align 1 million reads on a single processor: Total time = Number of reads × Time
per read Total time = 1,000,000 × 1 μs = 1,000,000 μs = 1 s
c) Number of processors needed for alignment under 1 hour: 1 hour = 3,600 s 1 s is already
fast enough, so we only need 1 processor.
If we want to be more precise: Processors needed = Ceiling(1 s / 3,600 s) = 1
Therefore: a) It takes 1 μs to align one read. b) It takes 1 s to align all 1 million reads on a
single processor. c) We need 1 processor to align all reads in under 1 hour.
9 ERROR CORRECTION AND QUALITY SCORES
Problem 3. In a DNA sequencing run, quality scores are provided in Phred+33 format. A
particular base has an ASCII value of 73.
a) What is the corresponding Phred quality score?
b) What is the probability of an error for this base call?
c) If we have a sequence of 1000 bases with this quality score, what is the expected number of
errors?
d) What is the probability of having exactly 5 errors in this 1000-base sequence?
Solution 3. a) Phred quality score: ASCII value - 33 = Phred score 73 - 33 = 40
b) Probability of an error: P(error) = 10(−Q/10), where Q is the Phred score P(error) =
10(40/10)=104 = 0.0001
c) Expected number of errors in 1000 bases: E(errors) = Number of bases × P(error) E(errors)
= 1000 × 0.0001 = 0.1
d) Probability of exactly 5 errors in 1000 bases: This follows a binomial distribution: B(n, p) n =
1000, p = 0.0001
P(X = 5) = C(1000, 5) × (0.0001)5 × (0.9999)995
C(1000, 5) = 1000! / (5! × 995!) 8.25 × 1012
P(X = 5) 8.25 × 1012 × 1020 × 0.9005 7.43 × 10−8
Therefore: a) The Phred quality score is 40. b) The probability of an error is 0.0001. c) The
expected number of errors in 1000 bases is 0.1. d) The probability of exactly 5 errors in 1000
bases is approximately 7.43 × 10−8.
10 GENOME ASSEMBLY
Problem 4. In a de novo genome assembly project, you have the following information:
Estimated genome size: 100 Mbp
Read length: 150 bp
Desired coverage: 30x
Sequencing machine output: 300 million reads per run
Cost per run: $1000
a) How many reads are needed to achieve the desired coverage?
b) What is the total amount of sequence data needed in base pairs?
c) How many sequencing runs are required?
d) What is the total cost of sequencing?
e) If the assembly algorithm has a time complexity of O(n log n), where n is the number of
reads, estimate the relative time increase if we double the coverage to 60x.
Solution 4. a) Number of reads needed: Coverage = (Number of reads × Read length) /
Genome size 30 = (Number of reads × 150 bp) / (100 × 106 bp) Number of reads = (30 × 100
× 106) / 150 = 20 million reads
b) Total amount of sequence data: Data = Number of reads × Read length Data = 20 million ×
150 bp = 3 billion bp = 3 Gbp
c) Number of sequencing runs: Runs = Ceiling(Reads needed / Reads per run) Runs =
Ceiling(20 million / 300 million) = 1 run
d) Total cost: Cost = Number of runs × Cost per run Cost = 1 × $1000 = $1000
e) Time increase for doubled coverage: Original time: O(n log n), where n = 20 million New
time with 60x coverage: O(2n log(2n))
Relative increase = (2n log(2n)) / (n log n) = 2(log(2n) / log(n)) = 2(log(40 million) / log(20
million)) 2.1
Therefore: a) 20 million reads are needed. b) 3 Gbp of sequence data is needed. c) 1
sequencing run is required. d) The total cost of sequencing is $1000. e) Doubling the coverage
would increase the assembly time by a factor of approximately 2.1.
Consider a local alignment of two DNA sequences using the Smith-Waterman algorithm with the
following scoring scheme:
Match: +2
Mismatch: -1
Gap: -2
The sequences are: S1=ACGTACGTACGT
S2=ACGTACGTTCGT
Calculate the optimal local alignment score and provide the aligned sequences.
Solution 1. We’ll use dynamic programming to fill the scoring matrix.
Step 1: Initialize the matrix (Showing only part of the matrix due to space constraints)
A C G T A
0 0 0 0 0 0
A 0 2 0 0 0 2
C 0 0 4 2 0 0
G 0 0 2 6 4 2
T 0 0 0 4 8 6
A 0 2 0 2 6 10
Step 2: Fill the entire matrix (not shown due to space)
Step 3: Find the maximum score and trace back Maximum score: 24
Aligned sequences: S1:ACGTACGT-CGT
S2:ACGTACGTTCGT
Therefore, the optimal local alignment score is 24, and the aligned sequences are shown above.
Problem 2. In a DNA sequencing experiment, a read of length 100 bp is aligned to a
reference genome of length 3 billion bp using the Burrows-Wheeler Transform (BWT) and FM-
index. The average time to process one base pair during alignment is 10 nanoseconds.
a) Calculate the expected time to align this read.
b) If we have 1 million such reads, how long would it take to align all of them using a single
processor?
c) How many processors would we need to align all reads in under 1 hour?
Solution 2. a) Expected time to align one read: Time = Read length × Time per base pair
Time = 100 bp × 10 ns/bp = 1,000 ns = 1 μs
b) Time to align 1 million reads on a single processor: Total time = Number of reads × Time
per read Total time = 1,000,000 × 1 μs = 1,000,000 μs = 1 s
c) Number of processors needed for alignment under 1 hour: 1 hour = 3,600 s 1 s is already
fast enough, so we only need 1 processor.
If we want to be more precise: Processors needed = Ceiling(1 s / 3,600 s) = 1
Therefore: a) It takes 1 μs to align one read. b) It takes 1 s to align all 1 million reads on a
single processor. c) We need 1 processor to align all reads in under 1 hour.
11 ERROR CORRECTION AND QUALITY SCORES
Problem 3. In a DNA sequencing run, quality scores are provided in Phred+33 format. A
particular base has an ASCII value of 73.
a) What is the corresponding Phred quality score?
b) What is the probability of an error for this base call?
c) If we have a sequence of 1000 bases with this quality score, what is the expected number of
errors?
d) What is the probability of having exactly 5 errors in this 1000-base sequence?
Solution 3. a) Phred quality score: ASCII value - 33 = Phred score 73 - 33 = 40
b) Probability of an error: P(error) = 10(−Q/10), where Q is the Phred score P(error) =
10(40/10)=104 = 0.0001
c) Expected number of errors in 1000 bases: E(errors) = Number of bases × P(error) E(errors)
= 1000 × 0.0001 = 0.1
d) Probability of exactly 5 errors in 1000 bases: This follows a binomial distribution: B(n, p) n =
1000, p = 0.0001
P(X = 5) = C(1000, 5) × (0.0001)5 × (0.9999)995
C(1000, 5) = 1000! / (5! × 995!) 8.25 × 1012
P(X = 5) 8.25 × 1012 × 1020 × 0.9005 7.43 × 10−8
Therefore: a) The Phred quality score is 40. b) The probability of an error is 0.0001. c) The
expected number of errors in 1000 bases is 0.1. d) The probability of exactly 5 errors in 1000
bases is approximately 7.43 × 10−8.
12 GENOME ASSEMBLY
Problem 4. In a de novo genome assembly project, you have the following information:
Estimated genome size: 100 Mbp
Read length: 150 bp
Desired coverage: 30x
Sequencing machine output: 300 million reads per run
Cost per run: $1000
a) How many reads are needed to achieve the desired coverage?
b) What is the total amount of sequence data needed in base pairs?
c) How many sequencing runs are required?
d) What is the total cost of sequencing?
e) If the assembly algorithm has a time complexity of O(n log n), where n is the number of
reads, estimate the relative time increase if we double the coverage to 60x.
Solution 4. a) Number of reads needed: Coverage = (Number of reads × Read length) /
Genome size 30 = (Number of reads × 150 bp) / (100 × 106 bp) Number of reads = (30 × 100
× 106) / 150 = 20 million reads
b) Total amount of sequence data: Data = Number of reads × Read length Data = 20 million ×
150 bp = 3 billion bp = 3 Gbp
c) Number of sequencing runs: Runs = Ceiling(Reads needed / Reads per run) Runs =
Ceiling(20 million / 300 million) = 1 run
d) Total cost: Cost = Number of runs × Cost per run Cost = 1 × $1000 = $1000
e) Time increase for doubled coverage: Original time: O(n log n), where n = 20 million New
time with 60x coverage: O(2n log(2n))
Relative increase = (2n log(2n)) / (n log n) = 2(log(2n) / log(n)) = 2(log(40 million) / log(20
million)) 2.1
Therefore: a) 20 million reads are needed. b) 3 Gbp of sequence data is needed. c) 1
sequencing run is required. d) The total cost of sequencing is $1000. e) Doubling the coverage
would increase the assembly time by a factor of approximately 2.1.
Consider a local alignment of two DNA sequences using the Smith-Waterman algorithm with the
following scoring scheme:
Match: +2
Mismatch: -1
Gap: -2
The sequences are: S1=ACGTACGTACGT
S2=ACGTACGTTCGT
Calculate the optimal local alignment score and provide the aligned sequences.
Solution 1. We’ll use dynamic programming to fill the scoring matrix.
Step 1: Initialize the matrix (Showing only part of the matrix due to space constraints)
A C G T A
0 0 0 0 0 0
A 0 2 0 0 0 2
C 0 0 4 2 0 0
G 0 0 2 6 4 2
T 0 0 0 4 8 6
A 0 2 0 2 6 10
Step 2: Fill the entire matrix (not shown due to space)
Step 3: Find the maximum score and trace back Maximum score: 24
Aligned sequences: S1:ACGTACGT-CGT
S2:ACGTACGTTCGT
Therefore, the optimal local alignment score is 24, and the aligned sequences are shown above.
Problem 2. In a DNA sequencing experiment, a read of length 100 bp is aligned to a
reference genome of length 3 billion bp using the Burrows-Wheeler Transform (BWT) and FM-
index. The average time to process one base pair during alignment is 10 nanoseconds.
a) Calculate the expected time to align this read.
b) If we have 1 million such reads, how long would it take to align all of them using a single
processor?
c) How many processors would we need to align all reads in under 1 hour?
Solution 2. a) Expected time to align one read: Time = Read length × Time per base pair
Time = 100 bp × 10 ns/bp = 1,000 ns = 1 μs
b) Time to align 1 million reads on a single processor: Total time = Number of reads × Time
per read Total time = 1,000,000 × 1 μs = 1,000,000 μs = 1 s
c) Number of processors needed for alignment under 1 hour: 1 hour = 3,600 s 1 s is already
fast enough, so we only need 1 processor.
If we want to be more precise: Processors needed = Ceiling(1 s / 3,600 s) = 1
Therefore: a) It takes 1 μs to align one read. b) It takes 1 s to align all 1 million reads on a
single processor. c) We need 1 processor to align all reads in under 1 hour.
13 ERROR CORRECTION AND QUALITY SCORES
Problem 3. In a DNA sequencing run, quality scores are provided in Phred+33 format. A
particular base has an ASCII value of 73.
a) What is the corresponding Phred quality score?
b) What is the probability of an error for this base call?
c) If we have a sequence of 1000 bases with this quality score, what is the expected number of
errors?
d) What is the probability of having exactly 5 errors in this 1000-base sequence?
Solution 3. a) Phred quality score: ASCII value - 33 = Phred score 73 - 33 = 40
b) Probability of an error: P(error) = 10(−Q/10), where Q is the Phred score P(error) =
10(40/10)=104 = 0.0001
c) Expected number of errors in 1000 bases: E(errors) = Number of bases × P(error) E(errors)
= 1000 × 0.0001 = 0.1
d) Probability of exactly 5 errors in 1000 bases: This follows a binomial distribution: B(n, p) n =
1000, p = 0.0001
P(X = 5) = C(1000, 5) × (0.0001)5 × (0.9999)995
C(1000, 5) = 1000! / (5! × 995!) 8.25 × 1012
P(X = 5) 8.25 × 1012 × 1020 × 0.9005 7.43 × 10−8
Therefore: a) The Phred quality score is 40. b) The probability of an error is 0.0001. c) The
expected number of errors in 1000 bases is 0.1. d) The probability of exactly 5 errors in 1000
bases is approximately 7.43 × 10−8.
14 GENOME ASSEMBLY
Problem 4. In a de novo genome assembly project, you have the following information:
Estimated genome size: 100 Mbp
Read length: 150 bp
Desired coverage: 30x
Sequencing machine output: 300 million reads per run
Cost per run: $1000
a) How many reads are needed to achieve the desired coverage?
b) What is the total amount of sequence data needed in base pairs?
c) How many sequencing runs are required?
d) What is the total cost of sequencing?
e) If the assembly algorithm has a time complexity of O(n log n), where n is the number of
reads, estimate the relative time increase if we double the coverage to 60x.
Solution 4. a) Number of reads needed: Coverage = (Number of reads × Read length) /
Genome size 30 = (Number of reads × 150 bp) / (100 × 106 bp) Number of reads = (30 × 100
× 106) / 150 = 20 million reads
b) Total amount of sequence data: Data = Number of reads × Read length Data = 20 million ×
150 bp = 3 billion bp = 3 Gbp
c) Number of sequencing runs: Runs = Ceiling(Reads needed / Reads per run) Runs =
Ceiling(20 million / 300 million) = 1 run
d) Total cost: Cost = Number of runs × Cost per run Cost = 1 × $1000 = $1000
e) Time increase for doubled coverage: Original time: O(n log n), where n = 20 million New
time with 60x coverage: O(2n log(2n))
Relative increase = (2n log(2n)) / (n log n) = 2(log(2n) / log(n)) = 2(log(40 million) / log(20
million)) 2.1
Therefore: a) 20 million reads are needed. b) 3 Gbp of sequence data is needed. c) 1
sequencing run is required. d) The total cost of sequencing is $1000. e) Doubling the coverage
would increase the assembly time by a factor of approximately 2.1.
Consider a local alignment of two DNA sequences using the Smith-Waterman algorithm with the
following scoring scheme:
Match: +2
Mismatch: -1
Gap: -2
The sequences are: S1=ACGTACGTACGT
S2=ACGTACGTTCGT
Calculate the optimal local alignment score and provide the aligned sequences.
Solution 1. We’ll use dynamic programming to fill the scoring matrix.
Step 1: Initialize the matrix (Showing only part of the matrix due to space constraints)
A C G T A
0 0 0 0 0 0
A 0 2 0 0 0 2
C 0 0 4 2 0 0
G 0 0 2 6 4 2
T 0 0 0 4 8 6
A 0 2 0 2 6 10
Step 2: Fill the entire matrix (not shown due to space)
Step 3: Find the maximum score and trace back Maximum score: 24
Aligned sequences: S1:ACGTACGT-CGT
S2:ACGTACGTTCGT
Therefore, the optimal local alignment score is 24, and the aligned sequences are shown above.
Problem 2. In a DNA sequencing experiment, a read of length 100 bp is aligned to a
reference genome of length 3 billion bp using the Burrows-Wheeler Transform (BWT) and FM-
index. The average time to process one base pair during alignment is 10 nanoseconds.
a) Calculate the expected time to align this read.
b) If we have 1 million such reads, how long would it take to align all of them using a single
processor?
c) How many processors would we need to align all reads in under 1 hour?
Solution 2. a) Expected time to align one read: Time = Read length × Time per base pair
Time = 100 bp × 10 ns/bp = 1,000 ns = 1 μs
b) Time to align 1 million reads on a single processor: Total time = Number of reads × Time
per read Total time = 1,000,000 × 1 μs = 1,000,000 μs = 1 s
c) Number of processors needed for alignment under 1 hour: 1 hour = 3,600 s 1 s is already
fast enough, so we only need 1 processor.
If we want to be more precise: Processors needed = Ceiling(1 s / 3,600 s) = 1
Therefore: a) It takes 1 μs to align one read. b) It takes 1 s to align all 1 million reads on a
single processor. c) We need 1 processor to align all reads in under 1 hour.
15 ERROR CORRECTION AND QUALITY SCORES
Problem 3. In a DNA sequencing run, quality scores are provided in Phred+33 format. A
particular base has an ASCII value of 73.
a) What is the corresponding Phred quality score?
b) What is the probability of an error for this base call?
c) If we have a sequence of 1000 bases with this quality score, what is the expected number of
errors?
d) What is the probability of having exactly 5 errors in this 1000-base sequence?
Solution 3. a) Phred quality score: ASCII value - 33 = Phred score 73 - 33 = 40
b) Probability of an error: P(error) = 10(−Q/10), where Q is the Phred score P(error) =
10(40/10)=104 = 0.0001
c) Expected number of errors in 1000 bases: E(errors) = Number of bases × P(error) E(errors)
= 1000 × 0.0001 = 0.1
d) Probability of exactly 5 errors in 1000 bases: This follows a binomial distribution: B(n, p) n =
1000, p = 0.0001
P(X = 5) = C(1000, 5) × (0.0001)5 × (0.9999)995
C(1000, 5) = 1000! / (5! × 995!) 8.25 × 1012
P(X = 5) 8.25 × 1012 × 1020 × 0.9005 7.43 × 10−8
Therefore: a) The Phred quality score is 40. b) The probability of an error is 0.0001. c) The
expected number of errors in 1000 bases is 0.1. d) The probability of exactly 5 errors in 1000
bases is approximately 7.43 × 10−8.
16 GENOME ASSEMBLY
Problem 4. In a de novo genome assembly project, you have the following information:
Estimated genome size: 100 Mbp
Read length: 150 bp
Desired coverage: 30x
Sequencing machine output: 300 million reads per run
Cost per run: $1000
a) How many reads are needed to achieve the desired coverage?
b) What is the total amount of sequence data needed in base pairs?
c) How many sequencing runs are required?
d) What is the total cost of sequencing?
e) If the assembly algorithm has a time complexity of O(n log n), where n is the number of
reads, estimate the relative time increase if we double the coverage to 60x.
Solution 4. a) Number of reads needed: Coverage = (Number of reads × Read length) /
Genome size 30 = (Number of reads × 150 bp) / (100 × 106 bp) Number of reads = (30 × 100
× 106) / 150 = 20 million reads
b) Total amount of sequence data: Data = Number of reads × Read length Data = 20 million ×
150 bp = 3 billion bp = 3 Gbp
c) Number of sequencing runs: Runs = Ceiling(Reads needed / Reads per run) Runs =
Ceiling(20 million / 300 million) = 1 run
d) Total cost: Cost = Number of runs × Cost per run Cost = 1 × $1000 = $1000
e) Time increase for doubled coverage: Original time: O(n log n), where n = 20 million New
time with 60x coverage: O(2n log(2n))
Relative increase = (2n log(2n)) / (n log n) = 2(log(2n) / log(n)) = 2(log(40 million) / log(20
million)) 2.1
Therefore: a) 20 million reads are needed. b) 3 Gbp of sequence data is needed. c) 1
sequencing run is required. d) The total cost of sequencing is $1000. e) Doubling the coverage
would increase the assembly time by a factor of approximately 2.1.
Consider a local alignment of two DNA sequences using the Smith-Waterman algorithm with the
following scoring scheme:
Match: +2
Mismatch: -1
Gap: -2
The sequences are: S1=ACGTACGTACGT
S2=ACGTACGTTCGT
Calculate the optimal local alignment score and provide the aligned sequences.
Solution 1. We’ll use dynamic programming to fill the scoring matrix.
Step 1: Initialize the matrix (Showing only part of the matrix due to space constraints)
A C G T A
0 0 0 0 0 0
A 0 2 0 0 0 2
C 0 0 4 2 0 0
G 0 0 2 6 4 2
T 0 0 0 4 8 6
A 0 2 0 2 6 10
Step 2: Fill the entire matrix (not shown due to space)
Step 3: Find the maximum score and trace back Maximum score: 24
Aligned sequences: S1:ACGTACGT-CGT
S2:ACGTACGTTCGT
Therefore, the optimal local alignment score is 24, and the aligned sequences are shown above.
Problem 2. In a DNA sequencing experiment, a read of length 100 bp is aligned to a
reference genome of length 3 billion bp using the Burrows-Wheeler Transform (BWT) and FM-
index. The average time to process one base pair during alignment is 10 nanoseconds.
a) Calculate the expected time to align this read.
b) If we have 1 million such reads, how long would it take to align all of them using a single
processor?
c) How many processors would we need to align all reads in under 1 hour?
Solution 2. a) Expected time to align one read: Time = Read length × Time per base pair
Time = 100 bp × 10 ns/bp = 1,000 ns = 1 μs
b) Time to align 1 million reads on a single processor: Total time = Number of reads × Time
per read Total time = 1,000,000 × 1 μs = 1,000,000 μs = 1 s
c) Number of processors needed for alignment under 1 hour: 1 hour = 3,600 s 1 s is already
fast enough, so we only need 1 processor.
If we want to be more precise: Processors needed = Ceiling(1 s / 3,600 s) = 1
Therefore: a) It takes 1 μs to align one read. b) It takes 1 s to align all 1 million reads on a
single processor. c) We need 1 processor to align all reads in under 1 hour.
17 ERROR CORRECTION AND QUALITY SCORES
Problem 3. In a DNA sequencing run, quality scores are provided in Phred+33 format. A
particular base has an ASCII value of 73.
a) What is the corresponding Phred quality score?
b) What is the probability of an error for this base call?
c) If we have a sequence of 1000 bases with this quality score, what is the expected number of
errors?
d) What is the probability of having exactly 5 errors in this 1000-base sequence?
Solution 3. a) Phred quality score: ASCII value - 33 = Phred score 73 - 33 = 40
b) Probability of an error: P(error) = 10(−Q/10), where Q is the Phred score P(error) =
10(40/10)=104 = 0.0001
c) Expected number of errors in 1000 bases: E(errors) = Number of bases × P(error) E(errors)
= 1000 × 0.0001 = 0.1
d) Probability of exactly 5 errors in 1000 bases: This follows a binomial distribution: B(n, p) n =
1000, p = 0.0001
P(X = 5) = C(1000, 5) × (0.0001)5 × (0.9999)995
C(1000, 5) = 1000! / (5! × 995!) 8.25 × 1012
P(X = 5) 8.25 × 1012 × 1020 × 0.9005 7.43 × 10−8
Therefore: a) The Phred quality score is 40. b) The probability of an error is 0.0001. c) The
expected number of errors in 1000 bases is 0.1. d) The probability of exactly 5 errors in 1000
bases is approximately 7.43 × 10−8.
18 GENOME ASSEMBLY
Problem 4. In a de novo genome assembly project, you have the following information:
Estimated genome size: 100 Mbp
Read length: 150 bp
Desired coverage: 30x
Sequencing machine output: 300 million reads per run
Cost per run: $1000
a) How many reads are needed to achieve the desired coverage?
b) What is the total amount of sequence data needed in base pairs?
c) How many sequencing runs are required?
d) What is the total cost of sequencing?
e) If the assembly algorithm has a time complexity of O(n log n), where n is the number of
reads, estimate the relative time increase if we double the coverage to 60x.
Solution 4. a) Number of reads needed: Coverage = (Number of reads × Read length) /
Genome size 30 = (Number of reads × 150 bp) / (100 × 106 bp) Number of reads = (30 × 100
× 106) / 150 = 20 million reads
b) Total amount of sequence data: Data = Number of reads × Read length Data = 20 million ×
150 bp = 3 billion bp = 3 Gbp
c) Number of sequencing runs: Runs = Ceiling(Reads needed / Reads per run) Runs =
Ceiling(20 million / 300 million) = 1 run
d) Total cost: Cost = Number of runs × Cost per run Cost = 1 × $1000 = $1000
e) Time increase for doubled coverage: Original time: O(n log n), where n = 20 million New
time with 60x coverage: O(2n log(2n))
Relative increase = (2n log(2n)) / (n log n) = 2(log(2n) / log(n)) = 2(log(40 million) / log(20
million)) 2.1
Therefore: a) 20 million reads are needed. b) 3 Gbp of sequence data is needed. c) 1
sequencing run is required. d) The total cost of sequencing is $1000. e) Doubling the coverage
would increase the assembly time by a factor of approximately 2.1.
Consider a local alignment of two DNA sequences using the Smith-Waterman algorithm with the
following scoring scheme:
Match: +2
Mismatch: -1
Gap: -2
The sequences are: S1=ACGTACGTACGT
S2=ACGTACGTTCGT
Calculate the optimal local alignment score and provide the aligned sequences.
Solution 1. We’ll use dynamic programming to fill the scoring matrix.
Step 1: Initialize the matrix (Showing only part of the matrix due to space constraints)
A C G T A
0 0 0 0 0 0
A 0 2 0 0 0 2
C 0 0 4 2 0 0
G 0 0 2 6 4 2
T 0 0 0 4 8 6
A 0 2 0 2 6 10
Step 2: Fill the entire matrix (not shown due to space)
Step 3: Find the maximum score and trace back Maximum score: 24
Aligned sequences: S1:ACGTACGT-CGT
S2:ACGTACGTTCGT
Therefore, the optimal local alignment score is 24, and the aligned sequences are shown above.
Problem 2. In a DNA sequencing experiment, a read of length 100 bp is aligned to a
reference genome of length 3 billion bp using the Burrows-Wheeler Transform (BWT) and FM-
index. The average time to process one base pair during alignment is 10 nanoseconds.
a) Calculate the expected time to align this read.
b) If we have 1 million such reads, how long would it take to align all of them using a single
processor?
c) How many processors would we need to align all reads in under 1 hour?
Solution 2. a) Expected time to align one read: Time = Read length × Time per base pair
Time = 100 bp × 10 ns/bp = 1,000 ns = 1 μs
b) Time to align 1 million reads on a single processor: Total time = Number of reads × Time
per read Total time = 1,000,000 × 1 μs = 1,000,000 μs = 1 s
c) Number of processors needed for alignment under 1 hour: 1 hour = 3,600 s 1 s is already
fast enough, so we only need 1 processor.
If we want to be more precise: Processors needed = Ceiling(1 s / 3,600 s) = 1
Therefore: a) It takes 1 μs to align one read. b) It takes 1 s to align all 1 million reads on a
single processor. c) We need 1 processor to align all reads in under 1 hour.
19 ERROR CORRECTION AND QUALITY SCORES
Problem 3. In a DNA sequencing run, quality scores are provided in Phred+33 format. A
particular base has an ASCII value of 73.
a) What is the corresponding Phred quality score?
b) What is the probability of an error for this base call?
c) If we have a sequence of 1000 bases with this quality score, what is the expected number of
errors?
d) What is the probability of having exactly 5 errors in this 1000-base sequence?
Solution 3. a) Phred quality score: ASCII value - 33 = Phred score 73 - 33 = 40
b) Probability of an error: P(error) = 10(−Q/10), where Q is the Phred score P(error) =
10(40/10)=104 = 0.0001
c) Expected number of errors in 1000 bases: E(errors) = Number of bases × P(error) E(errors)
= 1000 × 0.0001 = 0.1
d) Probability of exactly 5 errors in 1000 bases: This follows a binomial distribution: B(n, p) n =
1000, p = 0.0001
P(X = 5) = C(1000, 5) × (0.0001)5 × (0.9999)995
C(1000, 5) = 1000! / (5! × 995!) 8.25 × 1012
P(X = 5) 8.25 × 1012 × 1020 × 0.9005 7.43 × 10−8
Therefore: a) The Phred quality score is 40. b) The probability of an error is 0.0001. c) The
expected number of errors in 1000 bases is 0.1. d) The probability of exactly 5 errors in 1000
bases is approximately 7.43 × 10−8.
20 GENOME ASSEMBLY
Problem 4. In a de novo genome assembly project, you have the following information:
Estimated genome size: 100 Mbp
Read length: 150 bp
Desired coverage: 30x
Sequencing machine output: 300 million reads per run
Cost per run: $1000
a) How many reads are needed to achieve the desired coverage?
b) What is the total amount of sequence data needed in base pairs?
c) How many sequencing runs are required?
d) What is the total cost of sequencing?
e) If the assembly algorithm has a time complexity of O(n log n), where n is the number of
reads, estimate the relative time increase if we double the coverage to 60x.
Solution 4. a) Number of reads needed: Coverage = (Number of reads × Read length) /
Genome size 30 = (Number of reads × 150 bp) / (100 × 106 bp) Number of reads = (30 × 100
× 106) / 150 = 20 million reads
b) Total amount of sequence data: Data = Number of reads × Read length Data = 20 million ×
150 bp = 3 billion bp = 3 Gbp
c) Number of sequencing runs: Runs = Ceiling(Reads needed / Reads per run) Runs =
Ceiling(20 million / 300 million) = 1 run
d) Total cost: Cost = Number of runs × Cost per run Cost = 1 × $1000 = $1000
e) Time increase for doubled coverage: Original time: O(n log n), where n = 20 million New
time with 60x coverage: O(2n log(2n))
Relative increase = (2n log(2n)) / (n log n) = 2(log(2n) / log(n)) = 2(log(40 million) / log(20
million)) 2.1
Therefore: a) 20 million reads are needed. b) 3 Gbp of sequence data is needed. c) 1
sequencing run is required. d) The total cost of sequencing is $1000. e) Doubling the coverage
would increase the assembly time by a factor of approximately 2.1.
Consider a local alignment of two DNA sequences using the Smith-Waterman algorithm with the
following scoring scheme:
Match: +2
Mismatch: -1
Gap: -2
The sequences are: S1=ACGTACGTACGT
S2=ACGTACGTTCGT
Calculate the optimal local alignment score and provide the aligned sequences.
Solution 1. We’ll use dynamic programming to fill the scoring matrix.
Step 1: Initialize the matrix (Showing only part of the matrix due to space constraints)
A C G T A
0 0 0 0 0 0
A 0 2 0 0 0 2
C 0 0 4 2 0 0
G 0 0 2 6 4 2
T 0 0 0 4 8 6
A 0 2 0 2 6 10
Step 2: Fill the entire matrix (not shown due to space)
Step 3: Find the maximum score and trace back Maximum score: 24
Aligned sequences: S1:ACGTACGT-CGT
S2:ACGTACGTTCGT
Therefore, the optimal local alignment score is 24, and the aligned sequences are shown above.
Problem 2. In a DNA sequencing experiment, a read of length 100 bp is aligned to a
reference genome of length 3 billion bp using the Burrows-Wheeler Transform (BWT) and FM-
index. The average time to process one base pair during alignment is 10 nanoseconds.
a) Calculate the expected time to align this read.
b) If we have 1 million such reads, how long would it take to align all of them using a single
processor?
c) How many processors would we need to align all reads in under 1 hour?
Solution 2. a) Expected time to align one read: Time = Read length × Time per base pair
Time = 100 bp × 10 ns/bp = 1,000 ns = 1 μs
b) Time to align 1 million reads on a single processor: Total time = Number of reads × Time
per read Total time = 1,000,000 × 1 μs = 1,000,000 μs = 1 s
c) Number of processors needed for alignment under 1 hour: 1 hour = 3,600 s 1 s is already
fast enough, so we only need 1 processor.
If we want to be more precise: Processors needed = Ceiling(1 s / 3,600 s) = 1
Therefore: a) It takes 1 μs to align one read. b) It takes 1 s to align all 1 million reads on a
single processor. c) We need 1 processor to align all reads in under 1 hour.
21 ERROR CORRECTION AND QUALITY SCORES
Problem 3. In a DNA sequencing run, quality scores are provided in Phred+33 format. A
particular base has an ASCII value of 73.
a) What is the corresponding Phred quality score?
b) What is the probability of an error for this base call?
c) If we have a sequence of 1000 bases with this quality score, what is the expected number of
errors?
d) What is the probability of having exactly 5 errors in this 1000-base sequence?
Solution 3. a) Phred quality score: ASCII value - 33 = Phred score 73 - 33 = 40
b) Probability of an error: P(error) = 10(−Q/10), where Q is the Phred score P(error) =
10(40/10)=104 = 0.0001
c) Expected number of errors in 1000 bases: E(errors) = Number of bases × P(error) E(errors)
= 1000 × 0.0001 = 0.1
d) Probability of exactly 5 errors in 1000 bases: This follows a binomial distribution: B(n, p) n =
1000, p = 0.0001
P(X = 5) = C(1000, 5) × (0.0001)5 × (0.9999)995
C(1000, 5) = 1000! / (5! × 995!) 8.25 × 1012
P(X = 5) 8.25 × 1012 × 1020 × 0.9005 7.43 × 10−8
Therefore: a) The Phred quality score is 40. b) The probability of an error is 0.0001. c) The
expected number of errors in 1000 bases is 0.1. d) The probability of exactly 5 errors in 1000
bases is approximately 7.43 × 10−8.
22 GENOME ASSEMBLY
Problem 4. In a de novo genome assembly project, you have the following information:
Estimated genome size: 100 Mbp
Read length: 150 bp
Desired coverage: 30x
Sequencing machine output: 300 million reads per run
Cost per run: $1000
a) How many reads are needed to achieve the desired coverage?
b) What is the total amount of sequence data needed in base pairs?
c) How many sequencing runs are required?
d) What is the total cost of sequencing?
e) If the assembly algorithm has a time complexity of O(n log n), where n is the number of
reads, estimate the relative time increase if we double the coverage to 60x.
Solution 4. a) Number of reads needed: Coverage = (Number of reads × Read length) /
Genome size 30 = (Number of reads × 150 bp) / (100 × 106 bp) Number of reads = (30 × 100
× 106) / 150 = 20 million reads
b) Total amount of sequence data: Data = Number of reads × Read length Data = 20 million ×
150 bp = 3 billion bp = 3 Gbp
c) Number of sequencing runs: Runs = Ceiling(Reads needed / Reads per run) Runs =
Ceiling(20 million / 300 million) = 1 run
d) Total cost: Cost = Number of runs × Cost per run Cost = 1 × $1000 = $1000
e) Time increase for doubled coverage: Original time: O(n log n), where n = 20 million New
time with 60x coverage: O(2n log(2n))
Relative increase = (2n log(2n)) / (n log n) = 2(log(2n) / log(n)) = 2(log(40 million) / log(20
million)) 2.1
Therefore: a) 20 million reads are needed. b) 3 Gbp of sequence data is needed. c) 1
sequencing run is required. d) The total cost of sequencing is $1000. e) Doubling the coverage
would increase the assembly time by a factor of approximately 2.1.
Consider a local alignment of two DNA sequences using the Smith-Waterman algorithm with the
following scoring scheme:
Match: +2
Mismatch: -1
Gap: -2
The sequences are: S1=ACGTACGTACGT
S2=ACGTACGTTCGT
Calculate the optimal local alignment score and provide the aligned sequences.
Solution 1. We’ll use dynamic programming to fill the scoring matrix.
Step 1: Initialize the matrix (Showing only part of the matrix due to space constraints)
A C G T A
0 0 0 0 0 0
A 0 2 0 0 0 2
C 0 0 4 2 0 0
G 0 0 2 6 4 2
T 0 0 0 4 8 6
A 0 2 0 2 6 10
Step 2: Fill the entire matrix (not shown due to space)
Step 3: Find the maximum score and trace back Maximum score: 24
Aligned sequences: S1:ACGTACGT-CGT
S2:ACGTACGTTCGT
Therefore, the optimal local alignment score is 24, and the aligned sequences are shown above.
Problem 2. In a DNA sequencing experiment, a read of length 100 bp is aligned to a
reference genome of length 3 billion bp using the Burrows-Wheeler Transform (BWT) and FM-
index. The average time to process one base pair during alignment is 10 nanoseconds.
a) Calculate the expected time to align this read.
b) If we have 1 million such reads, how long would it take to align all of them using a single
processor?
c) How many processors would we need to align all reads in under 1 hour?
Solution 2. a) Expected time to align one read: Time = Read length × Time per base pair
Time = 100 bp × 10 ns/bp = 1,000 ns = 1 μs
b) Time to align 1 million reads on a single processor: Total time = Number of reads × Time
per read Total time = 1,000,000 × 1 μs = 1,000,000 μs = 1 s
c) Number of processors needed for alignment under 1 hour: 1 hour = 3,600 s 1 s is already
fast enough, so we only need 1 processor.
If we want to be more precise: Processors needed = Ceiling(1 s / 3,600 s) = 1
Therefore: a) It takes 1 μs to align one read. b) It takes 1 s to align all 1 million reads on a
single processor. c) We need 1 processor to align all reads in under 1 hour.
23 ERROR CORRECTION AND QUALITY SCORES
Problem 3. In a DNA sequencing run, quality scores are provided in Phred+33 format. A
particular base has an ASCII value of 73.
a) What is the corresponding Phred quality score?
b) What is the probability of an error for this base call?
c) If we have a sequence of 1000 bases with this quality score, what is the expected number of
errors?
d) What is the probability of having exactly 5 errors in this 1000-base sequence?
Solution 3. a) Phred quality score: ASCII value - 33 = Phred score 73 - 33 = 40
b) Probability of an error: P(error) = 10(−Q/10), where Q is the Phred score P(error) =
10(40/10)=104 = 0.0001
c) Expected number of errors in 1000 bases: E(errors) = Number of bases × P(error) E(errors)
= 1000 × 0.0001 = 0.1
d) Probability of exactly 5 errors in 1000 bases: This follows a binomial distribution: B(n, p) n =
1000, p = 0.0001
P(X = 5) = C(1000, 5) × (0.0001)5 × (0.9999)995
C(1000, 5) = 1000! / (5! × 995!) 8.25 × 1012
P(X = 5) 8.25 × 1012 × 1020 × 0.9005 7.43 × 10−8
Therefore: a) The Phred quality score is 40. b) The probability of an error is 0.0001. c) The
expected number of errors in 1000 bases is 0.1. d) The probability of exactly 5 errors in 1000
bases is approximately 7.43 × 10−8.
24 GENOME ASSEMBLY
Problem 4. In a de novo genome assembly project, you have the following information:
Estimated genome size: 100 Mbp
Read length: 150 bp
Desired coverage: 30x
Sequencing machine output: 300 million reads per run
Cost per run: $1000
a) How many reads are needed to achieve the desired coverage?
b) What is the total amount of sequence data needed in base pairs?
c) How many sequencing runs are required?
d) What is the total cost of sequencing?
e) If the assembly algorithm has a time complexity of O(n log n), where n is the number of
reads, estimate the relative time increase if we double the coverage to 60x.
Solution 4. a) Number of reads needed: Coverage = (Number of reads × Read length) /
Genome size 30 = (Number of reads × 150 bp) / (100 × 106 bp) Number of reads = (30 × 100
× 106) / 150 = 20 million reads
b) Total amount of sequence data: Data = Number of reads × Read length Data = 20 million ×
150 bp = 3 billion bp = 3 Gbp
c) Number of sequencing runs: Runs = Ceiling(Reads needed / Reads per run) Runs =
Ceiling(20 million / 300 million) = 1 run
d) Total cost: Cost = Number of runs × Cost per run Cost = 1 × $1000 = $1000
e) Time increase for doubled coverage: Original time: O(n log n), where n = 20 million New
time with 60x coverage: O(2n log(2n))
Relative increase = (2n log(2n)) / (n log n) = 2(log(2n) / log(n)) = 2(log(40 million) / log(20
million)) 2.1
Therefore: a) 20 million reads are needed. b) 3 Gbp of sequence data is needed. c) 1
sequencing run is required. d) The total cost of sequencing is $1000. e) Doubling the coverage
would increase the assembly time by a factor of approximately 2.1.
Consider a local alignment of two DNA sequences using the Smith-Waterman algorithm with the
following scoring scheme:
Match: +2
Mismatch: -1
Gap: -2
The sequences are: S1=ACGTACGTACGT
S2=ACGTACGTTCGT
Calculate the optimal local alignment score and provide the aligned sequences.
Solution 1. We’ll use dynamic programming to fill the scoring matrix.
Step 1: Initialize the matrix (Showing only part of the matrix due to space constraints)
A C G T A
0 0 0 0 0 0
A 0 2 0 0 0 2
C 0 0 4 2 0 0
G 0 0 2 6 4 2
T 0 0 0 4 8 6
A 0 2 0 2 6 10
Step 2: Fill the entire matrix (not shown due to space)
Step 3: Find the maximum score and trace back Maximum score: 24
Aligned sequences: S1:ACGTACGT-CGT
S2:ACGTACGTTCGT
Therefore, the optimal local alignment score is 24, and the aligned sequences are shown above.
Problem 2. In a DNA sequencing experiment, a read of length 100 bp is aligned to a
reference genome of length 3 billion bp using the Burrows-Wheeler Transform (BWT) and FM-
index. The average time to process one base pair during alignment is 10 nanoseconds.
a) Calculate the expected time to align this read.
b) If we have 1 million such reads, how long would it take to align all of them using a single
processor?
c) How many processors would we need to align all reads in under 1 hour?
Solution 2. a) Expected time to align one read: Time = Read length × Time per base pair
Time = 100 bp × 10 ns/bp = 1,000 ns = 1 μs
b) Time to align 1 million reads on a single processor: Total time = Number of reads × Time
per read Total time = 1,000,000 × 1 μs = 1,000,000 μs = 1 s
c) Number of processors needed for alignment under 1 hour: 1 hour = 3,600 s 1 s is already
fast enough, so we only need 1 processor.
If we want to be more precise: Processors needed = Ceiling(1 s / 3,600 s) = 1
Therefore: a) It takes 1 μs to align one read. b) It takes 1 s to align all 1 million reads on a
single processor. c) We need 1 processor to align all reads in under 1 hour.
25 ERROR CORRECTION AND QUALITY SCORES
Problem 3. In a DNA sequencing run, quality scores are provided in Phred+33 format. A
particular base has an ASCII value of 73.
a) What is the corresponding Phred quality score?
b) What is the probability of an error for this base call?
c) If we have a sequence of 1000 bases with this quality score, what is the expected number of
errors?
d) What is the probability of having exactly 5 errors in this 1000-base sequence?
Solution 3. a) Phred quality score: ASCII value - 33 = Phred score 73 - 33 = 40
b) Probability of an error: P(error) = 10(−Q/10), where Q is the Phred score P(error) =
10(40/10)=104 = 0.0001
c) Expected number of errors in 1000 bases: E(errors) = Number of bases × P(error) E(errors)
= 1000 × 0.0001 = 0.1
d) Probability of exactly 5 errors in 1000 bases: This follows a binomial distribution: B(n, p) n =
1000, p = 0.0001
P(X = 5) = C(1000, 5) × (0.0001)5 × (0.9999)995
C(1000, 5) = 1000! / (5! × 995!) 8.25 × 1012
P(X = 5) 8.25 × 1012 × 1020 × 0.9005 7.43 × 10−8
Therefore: a) The Phred quality score is 40. b) The probability of an error is 0.0001. c) The
expected number of errors in 1000 bases is 0.1. d) The probability of exactly 5 errors in 1000
bases is approximately 7.43 × 10−8.
26 GENOME ASSEMBLY
Problem 4. In a de novo genome assembly project, you have the following information:
Estimated genome size: 100 Mbp
Read length: 150 bp
Desired coverage: 30x
Sequencing machine output: 300 million reads per run
Cost per run: $1000
a) How many reads are needed to achieve the desired coverage?
b) What is the total amount of sequence data needed in base pairs?
c) How many sequencing runs are required?
d) What is the total cost of sequencing?
e) If the assembly algorithm has a time complexity of O(n log n), where n is the number of
reads, estimate the relative time increase if we double the coverage to 60x.
Solution 4. a) Number of reads needed: Coverage = (Number of reads × Read length) /
Genome size 30 = (Number of reads × 150 bp) / (100 × 106 bp) Number of reads = (30 × 100
× 106) / 150 = 20 million reads
b) Total amount of sequence data: Data = Number of reads × Read length Data = 20 million ×
150 bp = 3 billion bp = 3 Gbp
c) Number of sequencing runs: Runs = Ceiling(Reads needed / Reads per run) Runs =
Ceiling(20 million / 300 million) = 1 run
d) Total cost: Cost = Number of runs × Cost per run Cost = 1 × $1000 = $1000
e) Time increase for doubled coverage: Original time: O(n log n), where n = 20 million New
time with 60x coverage: O(2n log(2n))
Relative increase = (2n log(2n)) / (n log n) = 2(log(2n) / log(n)) = 2(log(40 million) / log(20
million)) 2.1
Therefore: a) 20 million reads are needed. b) 3 Gbp of sequence data is needed. c) 1
sequencing run is required. d) The total cost of sequencing is $1000. e) Doubling the coverage
would increase the assembly time by a factor of approximately 2.1.
Consider a local alignment of two DNA sequences using the Smith-Waterman algorithm with the
following scoring scheme:
Match: +2
Mismatch: -1
Gap: -2
The sequences are: S1=ACGTACGTACGT
S2=ACGTACGTTCGT
Calculate the optimal local alignment score and provide the aligned sequences.
Solution 1. We’ll use dynamic programming to fill the scoring matrix.
Step 1: Initialize the matrix (Showing only part of the matrix due to space constraints)
A C G T A
0 0 0 0 0 0
A 0 2 0 0 0 2
C 0 0 4 2 0 0
G 0 0 2 6 4 2
T 0 0 0 4 8 6
A 0 2 0 2 6 10
Step 2: Fill the entire matrix (not shown due to space)
Step 3: Find the maximum score and trace back Maximum score: 24
Aligned sequences: S1:ACGTACGT-CGT
S2:ACGTACGTTCGT
Therefore, the optimal local alignment score is 24, and the aligned sequences are shown above.
Problem 2. In a DNA sequencing experiment, a read of length 100 bp is aligned to a
reference genome of length 3 billion bp using the Burrows-Wheeler Transform (BWT) and FM-
index. The average time to process one base pair during alignment is 10 nanoseconds.
a) Calculate the expected time to align this read.
b) If we have 1 million such reads, how long would it take to align all of them using a single
processor?
c) How many processors would we need to align all reads in under 1 hour?
Solution 2. a) Expected time to align one read: Time = Read length × Time per base pair
Time = 100 bp × 10 ns/bp = 1,000 ns = 1 μs
b) Time to align 1 million reads on a single processor: Total time = Number of reads × Time
per read Total time = 1,000,000 × 1 μs = 1,000,000 μs = 1 s
c) Number of processors needed for alignment under 1 hour: 1 hour = 3,600 s 1 s is already
fast enough, so we only need 1 processor.
If we want to be more precise: Processors needed = Ceiling(1 s / 3,600 s) = 1
Therefore: a) It takes 1 μs to align one read. b) It takes 1 s to align all 1 million reads on a
single processor. c) We need 1 processor to align all reads in under 1 hour.
27 ERROR CORRECTION AND QUALITY SCORES
Problem 3. In a DNA sequencing run, quality scores are provided in Phred+33 format. A
particular base has an ASCII value of 73.
a) What is the corresponding Phred quality score?
b) What is the probability of an error for this base call?
c) If we have a sequence of 1000 bases with this quality score, what is the expected number of
errors?
d) What is the probability of having exactly 5 errors in this 1000-base sequence?
Solution 3. a) Phred quality score: ASCII value - 33 = Phred score 73 - 33 = 40
b) Probability of an error: P(error) = 10(−Q/10), where Q is the Phred score P(error) =
10(40/10)=104 = 0.0001
c) Expected number of errors in 1000 bases: E(errors) = Number of bases × P(error) E(errors)
= 1000 × 0.0001 = 0.1
d) Probability of exactly 5 errors in 1000 bases: This follows a binomial distribution: B(n, p) n =
1000, p = 0.0001
P(X = 5) = C(1000, 5) × (0.0001)5 × (0.9999)995
C(1000, 5) = 1000! / (5! × 995!) 8.25 × 1012
P(X = 5) 8.25 × 1012 × 1020 × 0.9005 7.43 × 10−8
Therefore: a) The Phred quality score is 40. b) The probability of an error is 0.0001. c) The
expected number of errors in 1000 bases is 0.1. d) The probability of exactly 5 errors in 1000
bases is approximately 7.43 × 10−8.
28 GENOME ASSEMBLY
Problem 4. In a de novo genome assembly project, you have the following information:
Estimated genome size: 100 Mbp
Read length: 150 bp
Desired coverage: 30x
Sequencing machine output: 300 million reads per run
Cost per run: $1000
a) How many reads are needed to achieve the desired coverage?
b) What is the total amount of sequence data needed in base pairs?
c) How many sequencing runs are required?
d) What is the total cost of sequencing?
e) If the assembly algorithm has a time complexity of O(n log n), where n is the number of
reads, estimate the relative time increase if we double the coverage to 60x.
Solution 4. a) Number of reads needed: Coverage = (Number of reads × Read length) /
Genome size 30 = (Number of reads × 150 bp) / (100 × 106 bp) Number of reads = (30 × 100
× 106) / 150 = 20 million reads
b) Total amount of sequence data: Data = Number of reads × Read length Data = 20 million ×
150 bp = 3 billion bp = 3 Gbp
c) Number of sequencing runs: Runs = Ceiling(Reads needed / Reads per run) Runs =
Ceiling(20 million / 300 million) = 1 run
d) Total cost: Cost = Number of runs × Cost per run Cost = 1 × $1000 = $1000
e) Time increase for doubled coverage: Original time: O(n log n), where n = 20 million New
time with 60x coverage: O(2n log(2n))
Relative increase = (2n log(2n)) / (n log n) = 2(log(2n) / log(n)) = 2(log(40 million) / log(20
million)) 2.1
Therefore: a) 20 million reads are needed. b) 3 Gbp of sequence data is needed. c) 1
sequencing run is required. d) The total cost of sequencing is $1000. e) Doubling the coverage
would increase the assembly time by a factor of approximately 2.1.
Consider a local alignment of two DNA sequences using the Smith-Waterman algorithm with the
following scoring scheme:
Match: +2
Mismatch: -1
Gap: -2
The sequences are: S1=ACGTACGTACGT
S2=ACGTACGTTCGT
Calculate the optimal local alignment score and provide the aligned sequences.
Solution 1. We’ll use dynamic programming to fill the scoring matrix.
Step 1: Initialize the matrix (Showing only part of the matrix due to space constraints)
A C G T A
0 0 0 0 0 0
A 0 2 0 0 0 2
C 0 0 4 2 0 0
G 0 0 2 6 4 2
T 0 0 0 4 8 6
A 0 2 0 2 6 10
Step 2: Fill the entire matrix (not shown due to space)
Step 3: Find the maximum score and trace back Maximum score: 24
Aligned sequences: S1:ACGTACGT-CGT
S2:ACGTACGTTCGT
Therefore, the optimal local alignment score is 24, and the aligned sequences are shown above.
Problem 2. In a DNA sequencing experiment, a read of length 100 bp is aligned to a
reference genome of length 3 billion bp using the Burrows-Wheeler Transform (BWT) and FM-
index. The average time to process one base pair during alignment is 10 nanoseconds.
a) Calculate the expected time to align this read.
b) If we have 1 million such reads, how long would it take to align all of them using a single
processor?
c) How many processors would we need to align all reads in under 1 hour?
Solution 2. a) Expected time to align one read: Time = Read length × Time per base pair
Time = 100 bp × 10 ns/bp = 1,000 ns = 1 μs
b) Time to align 1 million reads on a single processor: Total time = Number of reads × Time
per read Total time = 1,000,000 × 1 μs = 1,000,000 μs = 1 s
c) Number of processors needed for alignment under 1 hour: 1 hour = 3,600 s 1 s is already
fast enough, so we only need 1 processor.
If we want to be more precise: Processors needed = Ceiling(1 s / 3,600 s) = 1
Therefore: a) It takes 1 μs to align one read. b) It takes 1 s to align all 1 million reads on a
single processor. c) We need 1 processor to align all reads in under 1 hour.
29 ERROR CORRECTION AND QUALITY SCORES
Problem 3. In a DNA sequencing run, quality scores are provided in Phred+33 format. A
particular base has an ASCII value of 73.
a) What is the corresponding Phred quality score?
b) What is the probability of an error for this base call?
c) If we have a sequence of 1000 bases with this quality score, what is the expected number of
errors?
d) What is the probability of having exactly 5 errors in this 1000-base sequence?
Solution 3. a) Phred quality score: ASCII value - 33 = Phred score 73 - 33 = 40
b) Probability of an error: P(error) = 10(−Q/10), where Q is the Phred score P(error) =
10(40/10)=104 = 0.0001
c) Expected number of errors in 1000 bases: E(errors) = Number of bases × P(error) E(errors)
= 1000 × 0.0001 = 0.1
d) Probability of exactly 5 errors in 1000 bases: This follows a binomial distribution: B(n, p) n =
1000, p = 0.0001
P(X = 5) = C(1000, 5) × (0.0001)5 × (0.9999)995
C(1000, 5) = 1000! / (5! × 995!) 8.25 × 1012
P(X = 5) 8.25 × 1012 × 1020 × 0.9005 7.43 × 10−8
Therefore: a) The Phred quality score is 40. b) The probability of an error is 0.0001. c) The
expected number of errors in 1000 bases is 0.1. d) The probability of exactly 5 errors in 1000
bases is approximately 7.43 × 10−8.
30 GENOME ASSEMBLY
Problem 4. In a de novo genome assembly project, you have the following information:
Estimated genome size: 100 Mbp
Read length: 150 bp
Desired coverage: 30x
Sequencing machine output: 300 million reads per run
Cost per run: $1000
a) How many reads are needed to achieve the desired coverage?
b) What is the total amount of sequence data needed in base pairs?
c) How many sequencing runs are required?
d) What is the total cost of sequencing?
e) If the assembly algorithm has a time complexity of O(n log n), where n is the number of
reads, estimate the relative time increase if we double the coverage to 60x.
Solution 4. a) Number of reads needed: Coverage = (Number of reads × Read length) /
Genome size 30 = (Number of reads × 150 bp) / (100 × 106 bp) Number of reads = (30 × 100
× 106) / 150 = 20 million reads
b) Total amount of sequence data: Data = Number of reads × Read length Data = 20 million ×
150 bp = 3 billion bp = 3 Gbp
c) Number of sequencing runs: Runs = Ceiling(Reads needed / Reads per run) Runs =
Ceiling(20 million / 300 million) = 1 run
d) Total cost: Cost = Number of runs × Cost per run Cost = 1 × $1000 = $1000
e) Time increase for doubled coverage: Original time: O(n log n), where n = 20 million New
time with 60x coverage: O(2n log(2n))
Relative increase = (2n log(2n)) / (n log n) = 2(log(2n) / log(n)) = 2(log(40 million) / log(20
million)) 2.1
Therefore: a) 20 million reads are needed. b) 3 Gbp of sequence data is needed. c) 1
sequencing run is required. d) The total cost of sequencing is $1000. e) Doubling the coverage
would increase the assembly time by a factor of approximately 2.1.
Consider a local alignment of two DNA sequences using the Smith-Waterman algorithm with the
following scoring scheme:
Match: +2
Mismatch: -1
Gap: -2
The sequences are: S1=ACGTACGTACGT
S2=ACGTACGTTCGT
Calculate the optimal local alignment score and provide the aligned sequences.
Solution 1. We’ll use dynamic programming to fill the scoring matrix.
Step 1: Initialize the matrix (Showing only part of the matrix due to space constraints)
A C G T A
0 0 0 0 0 0
A 0 2 0 0 0 2
C 0 0 4 2 0 0
G 0 0 2 6 4 2
T 0 0 0 4 8 6
A 0 2 0 2 6 10
Step 2: Fill the entire matrix (not shown due to space)
Step 3: Find the maximum score and trace back Maximum score: 24
Aligned sequences: S1:ACGTACGT-CGT
S2:ACGTACGTTCGT
Therefore, the optimal local alignment score is 24, and the aligned sequences are shown above.
Problem 2. In a DNA sequencing experiment, a read of length 100 bp is aligned to a
reference genome of length 3 billion bp using the Burrows-Wheeler Transform (BWT) and FM-
index. The average time to process one base pair during alignment is 10 nanoseconds.
a) Calculate the expected time to align this read.
b) If we have 1 million such reads, how long would it take to align all of them using a single
processor?
c) How many processors would we need to align all reads in under 1 hour?
Solution 2. a) Expected time to align one read: Time = Read length × Time per base pair
Time = 100 bp × 10 ns/bp = 1,000 ns = 1 μs
b) Time to align 1 million reads on a single processor: Total time = Number of reads × Time
per read Total time = 1,000,000 × 1 μs = 1,000,000 μs = 1 s
c) Number of processors needed for alignment under 1 hour: 1 hour = 3,600 s 1 s is already
fast enough, so we only need 1 processor.
If we want to be more precise: Processors needed = Ceiling(1 s / 3,600 s) = 1
Therefore: a) It takes 1 μs to align one read. b) It takes 1 s to align all 1 million reads on a
single processor. c) We need 1 processor to align all reads in under 1 hour.
31 ERROR CORRECTION AND QUALITY SCORES
Problem 3. In a DNA sequencing run, quality scores are provided in Phred+33 format. A
particular base has an ASCII value of 73.
a) What is the corresponding Phred quality score?
b) What is the probability of an error for this base call?
c) If we have a sequence of 1000 bases with this quality score, what is the expected number of
errors?
d) What is the probability of having exactly 5 errors in this 1000-base sequence?
Solution 3. a) Phred quality score: ASCII value - 33 = Phred score 73 - 33 = 40
b) Probability of an error: P(error) = 10(−Q/10), where Q is the Phred score P(error) =
10(40/10)=104 = 0.0001
c) Expected number of errors in 1000 bases: E(errors) = Number of bases × P(error) E(errors)
= 1000 × 0.0001 = 0.1
d) Probability of exactly 5 errors in 1000 bases: This follows a binomial distribution: B(n, p) n =
1000, p = 0.0001
P(X = 5) = C(1000, 5) × (0.0001)5 × (0.9999)995
C(1000, 5) = 1000! / (5! × 995!) 8.25 × 1012
P(X = 5) 8.25 × 1012 × 1020 × 0.9005 7.43 × 10−8
Therefore: a) The Phred quality score is 40. b) The probability of an error is 0.0001. c) The
expected number of errors in 1000 bases is 0.1. d) The probability of exactly 5 errors in 1000
bases is approximately 7.43 × 10−8.
32 GENOME ASSEMBLY
Problem 4. In a de novo genome assembly project, you have the following information:
Estimated genome size: 100 Mbp
Read length: 150 bp
Desired coverage: 30x
Sequencing machine output: 300 million reads per run
Cost per run: $1000
a) How many reads are needed to achieve the desired coverage?
b) What is the total amount of sequence data needed in base pairs?
c) How many sequencing runs are required?
d) What is the total cost of sequencing?
e) If the assembly algorithm has a time complexity of O(n log n), where n is the number of
reads, estimate the relative time increase if we double the coverage to 60x.
Solution 4. a) Number of reads needed: Coverage = (Number of reads × Read length) /
Genome size 30 = (Number of reads × 150 bp) / (100 × 106 bp) Number of reads = (30 × 100
× 106) / 150 = 20 million reads
b) Total amount of sequence data: Data = Number of reads × Read length Data = 20 million ×
150 bp = 3 billion bp = 3 Gbp
c) Number of sequencing runs: Runs = Ceiling(Reads needed / Reads per run) Runs =
Ceiling(20 million / 300 million) = 1 run
d) Total cost: Cost = Number of runs × Cost per run Cost = 1 × $1000 = $1000
e) Time increase for doubled coverage: Original time: O(n log n), where n = 20 million New
time with 60x coverage: O(2n log(2n))
Relative increase = (2n log(2n)) / (n log n) = 2(log(2n) / log(n)) = 2(log(40 million) / log(20
million)) 2.1
Therefore: a) 20 million reads are needed. b) 3 Gbp of sequence data is needed. c) 1
sequencing run is required. d) The total cost of sequencing is $1000. e) Doubling the coverage
would increase the assembly time by a factor of approximately 2.1.
Consider a local alignment of two DNA sequences using the Smith-Waterman algorithm with the
following scoring scheme:
Match: +2
Mismatch: -1
Gap: -2
The sequences are: S1=ACGTACGTACGT
S2=ACGTACGTTCGT
Calculate the optimal local alignment score and provide the aligned sequences.
Solution 1. We’ll use dynamic programming to fill the scoring matrix.
Step 1: Initialize the matrix (Showing only part of the matrix due to space constraints)
A C G T A
0 0 0 0 0 0
A 0 2 0 0 0 2
C 0 0 4 2 0 0
G 0 0 2 6 4 2
T 0 0 0 4 8 6
A 0 2 0 2 6 10
Step 2: Fill the entire matrix (not shown due to space)
Step 3: Find the maximum score and trace back Maximum score: 24
Aligned sequences: S1:ACGTACGT-CGT
S2:ACGTACGTTCGT
Therefore, the optimal local alignment score is 24, and the aligned sequences are shown above.
Problem 2. In a DNA sequencing experiment, a read of length 100 bp is aligned to a
reference genome of length 3 billion bp using the Burrows-Wheeler Transform (BWT) and FM-
index. The average time to process one base pair during alignment is 10 nanoseconds.
a) Calculate the expected time to align this read.
b) If we have 1 million such reads, how long would it take to align all of them using a single
processor?
c) How many processors would we need to align all reads in under 1 hour?
Solution 2. a) Expected time to align one read: Time = Read length × Time per base pair
Time = 100 bp × 10 ns/bp = 1,000 ns = 1 μs
b) Time to align 1 million reads on a single processor: Total time = Number of reads × Time
per read Total time = 1,000,000 × 1 μs = 1,000,000 μs = 1 s
c) Number of processors needed for alignment under 1 hour: 1 hour = 3,600 s 1 s is already
fast enough, so we only need 1 processor.
If we want to be more precise: Processors needed = Ceiling(1 s / 3,600 s) = 1
Therefore: a) It takes 1 μs to align one read. b) It takes 1 s to align all 1 million reads on a
single processor. c) We need 1 processor to align all reads in under 1 hour.
33 ERROR CORRECTION AND QUALITY SCORES
Problem 3. In a DNA sequencing run, quality scores are provided in Phred+33 format. A
particular base has an ASCII value of 73.
a) What is the corresponding Phred quality score?
b) What is the probability of an error for this base call?
c) If we have a sequence of 1000 bases with this quality score, what is the expected number of
errors?
d) What is the probability of having exactly 5 errors in this 1000-base sequence?
Solution 3. a) Phred quality score: ASCII value - 33 = Phred score 73 - 33 = 40
b) Probability of an error: P(error) = 10(−Q/10), where Q is the Phred score P(error) =
10(40/10)=104 = 0.0001
c) Expected number of errors in 1000 bases: E(errors) = Number of bases × P(error) E(errors)
= 1000 × 0.0001 = 0.1
d) Probability of exactly 5 errors in 1000 bases: This follows a binomial distribution: B(n, p) n =
1000, p = 0.0001
P(X = 5) = C(1000, 5) × (0.0001)5 × (0.9999)995
C(1000, 5) = 1000! / (5! × 995!) 8.25 × 1012
P(X = 5) 8.25 × 1012 × 1020 × 0.9005 7.43 × 10−8
Therefore: a) The Phred quality score is 40. b) The probability of an error is 0.0001. c) The
expected number of errors in 1000 bases is 0.1. d) The probability of exactly 5 errors in 1000
bases is approximately 7.43 × 10−8.
34 GENOME ASSEMBLY
Problem 4. In a de novo genome assembly project, you have the following information:
Estimated genome size: 100 Mbp
Read length: 150 bp
Desired coverage: 30x
Sequencing machine output: 300 million reads per run
Cost per run: $1000
a) How many reads are needed to achieve the desired coverage?
b) What is the total amount of sequence data needed in base pairs?
c) How many sequencing runs are required?
d) What is the total cost of sequencing?
e) If the assembly algorithm has a time complexity of O(n log n), where n is the number of
reads, estimate the relative time increase if we double the coverage to 60x.
Solution 4. a) Number of reads needed: Coverage = (Number of reads × Read length) /
Genome size 30 = (Number of reads × 150 bp) / (100 × 106 bp) Number of reads = (30 × 100
× 106) / 150 = 20 million reads
b) Total amount of sequence data: Data = Number of reads × Read length Data = 20 million ×
150 bp = 3 billion bp = 3 Gbp
c) Number of sequencing runs: Runs = Ceiling(Reads needed / Reads per run) Runs =
Ceiling(20 million / 300 million) = 1 run
d) Total cost: Cost = Number of runs × Cost per run Cost = 1 × $1000 = $1000
e) Time increase for doubled coverage: Original time: O(n log n), where n = 20 million New
time with 60x coverage: O(2n log(2n))
Relative increase = (2n log(2n)) / (n log n) = 2(log(2n) / log(n)) = 2(log(40 million) / log(20
million)) 2.1
Therefore: a) 20 million reads are needed. b) 3 Gbp of sequence data is needed. c) 1
sequencing run is required. d) The total cost of sequencing is $1000. e) Doubling the coverage
would increase the assembly time by a factor of approximately 2.1.
Consider a local alignment of two DNA sequences using the Smith-Waterman algorithm with the
following scoring scheme:
Match: +2
Mismatch: -1
Gap: -2
The sequences are: S1=ACGTACGTACGT
S2=ACGTACGTTCGT
Calculate the optimal local alignment score and provide the aligned sequences.
Solution 1. We’ll use dynamic programming to fill the scoring matrix.
Step 1: Initialize the matrix (Showing only part of the matrix due to space constraints)
A C G T A
0 0 0 0 0 0
A 0 2 0 0 0 2
C 0 0 4 2 0 0
G 0 0 2 6 4 2
T 0 0 0 4 8 6
A 0 2 0 2 6 10
Step 2: Fill the entire matrix (not shown due to space)
Step 3: Find the maximum score and trace back Maximum score: 24
Aligned sequences: S1:ACGTACGT-CGT
S2:ACGTACGTTCGT
Therefore, the optimal local alignment score is 24, and the aligned sequences are shown above.
Problem 2. In a DNA sequencing experiment, a read of length 100 bp is aligned to a
reference genome of length 3 billion bp using the Burrows-Wheeler Transform (BWT) and FM-
index. The average time to process one base pair during alignment is 10 nanoseconds.
a) Calculate the expected time to align this read.
b) If we have 1 million such reads, how long would it take to align all of them using a single
processor?
c) How many processors would we need to align all reads in under 1 hour?
Solution 2. a) Expected time to align one read: Time = Read length × Time per base pair
Time = 100 bp × 10 ns/bp = 1,000 ns = 1 μs
b) Time to align 1 million reads on a single processor: Total time = Number of reads × Time
per read Total time = 1,000,000 × 1 μs = 1,000,000 μs = 1 s
c) Number of processors needed for alignment under 1 hour: 1 hour = 3,600 s 1 s is already
fast enough, so we only need 1 processor.
If we want to be more precise: Processors needed = Ceiling(1 s / 3,600 s) = 1
Therefore: a) It takes 1 μs to align one read. b) It takes 1 s to align all 1 million reads on a
single processor. c) We need 1 processor to align all reads in under 1 hour.
35 ERROR CORRECTION AND QUALITY SCORES
Problem 3. In a DNA sequencing run, quality scores are provided in Phred+33 format. A
particular base has an ASCII value of 73.
a) What is the corresponding Phred quality score?
b) What is the probability of an error for this base call?
c) If we have a sequence of 1000 bases with this quality score, what is the expected number of
errors?
d) What is the probability of having exactly 5 errors in this 1000-base sequence?
Solution 3. a) Phred quality score: ASCII value - 33 = Phred score 73 - 33 = 40
b) Probability of an error: P(error) = 10(−Q/10), where Q is the Phred score P(error) =
10(40/10)=104 = 0.0001
c) Expected number of errors in 1000 bases: E(errors) = Number of bases × P(error) E(errors)
= 1000 × 0.0001 = 0.1
d) Probability of exactly 5 errors in 1000 bases: This follows a binomial distribution: B(n, p) n =
1000, p = 0.0001
P(X = 5) = C(1000, 5) × (0.0001)5 × (0.9999)995
C(1000, 5) = 1000! / (5! × 995!) 8.25 × 1012
P(X = 5) 8.25 × 1012 × 1020 × 0.9005 7.43 × 10−8
Therefore: a) The Phred quality score is 40. b) The probability of an error is 0.0001. c) The
expected number of errors in 1000 bases is 0.1. d) The probability of exactly 5 errors in 1000
bases is approximately 7.43 × 10−8.
36 GENOME ASSEMBLY
Problem 4. In a de novo genome assembly project, you have the following information:
Estimated genome size: 100 Mbp
Read length: 150 bp
Desired coverage: 30x
Sequencing machine output: 300 million reads per run
Cost per run: $1000
a) How many reads are needed to achieve the desired coverage?
b) What is the total amount of sequence data needed in base pairs?
c) How many sequencing runs are required?
d) What is the total cost of sequencing?
e) If the assembly algorithm has a time complexity of O(n log n), where n is the number of
reads, estimate the relative time increase if we double the coverage to 60x.
Solution 4. a) Number of reads needed: Coverage = (Number of reads × Read length) /
Genome size 30 = (Number of reads × 150 bp) / (100 × 106 bp) Number of reads = (30 × 100
× 106) / 150 = 20 million reads
b) Total amount of sequence data: Data = Number of reads × Read length Data = 20 million ×
150 bp = 3 billion bp = 3 Gbp
c) Number of sequencing runs: Runs = Ceiling(Reads needed / Reads per run) Runs =
Ceiling(20 million / 300 million) = 1 run
d) Total cost: Cost = Number of runs × Cost per run Cost = 1 × $1000 = $1000
e) Time increase for doubled coverage: Original time: O(n log n), where n = 20 million New
time with 60x coverage: O(2n log(2n))
Relative increase = (2n log(2n)) / (n log n) = 2(log(2n) / log(n)) = 2(log(40 million) / log(20
million)) 2.1
Therefore: a) 20 million reads are needed. b) 3 Gbp of sequence data is needed. c) 1
sequencing run is required. d) The total cost of sequencing is $1000. e) Doubling the coverage
would increase the assembly time by a factor of approximately 2.1.
Consider a local alignment of two DNA sequences using the Smith-Waterman algorithm with the
following scoring scheme:
Match: +2
Mismatch: -1
Gap: -2
The sequences are: S1=ACGTACGTACGT
S2=ACGTACGTTCGT
Calculate the optimal local alignment score and provide the aligned sequences.
Solution 1. We’ll use dynamic programming to fill the scoring matrix.
Step 1: Initialize the matrix (Showing only part of the matrix due to space constraints)
A C G T A
0 0 0 0 0 0
A 0 2 0 0 0 2
C 0 0 4 2 0 0
G 0 0 2 6 4 2
T 0 0 0 4 8 6
A 0 2 0 2 6 10
Step 2: Fill the entire matrix (not shown due to space)
Step 3: Find the maximum score and trace back Maximum score: 24
Aligned sequences: S1:ACGTACGT-CGT
S2:ACGTACGTTCGT
Therefore, the optimal local alignment score is 24, and the aligned sequences are shown above.
Problem 2. In a DNA sequencing experiment, a read of length 100 bp is aligned to a
reference genome of length 3 billion bp using the Burrows-Wheeler Transform (BWT) and FM-
index. The average time to process one base pair during alignment is 10 nanoseconds.
a) Calculate the expected time to align this read.
b) If we have 1 million such reads, how long would it take to align all of them using a single
processor?
c) How many processors would we need to align all reads in under 1 hour?
Solution 2. a) Expected time to align one read: Time = Read length × Time per base pair
Time = 100 bp × 10 ns/bp = 1,000 ns = 1 μs
b) Time to align 1 million reads on a single processor: Total time = Number of reads × Time
per read Total time = 1,000,000 × 1 μs = 1,000,000 μs = 1 s
c) Number of processors needed for alignment under 1 hour: 1 hour = 3,600 s 1 s is already
fast enough, so we only need 1 processor.
If we want to be more precise: Processors needed = Ceiling(1 s / 3,600 s) = 1
Therefore: a) It takes 1 μs to align one read. b) It takes 1 s to align all 1 million reads on a
single processor. c) We need 1 processor to align all reads in under 1 hour.
37 ERROR CORRECTION AND QUALITY SCORES
Problem 3. In a DNA sequencing run, quality scores are provided in Phred+33 format. A
particular base has an ASCII value of 73.
a) What is the corresponding Phred quality score?
b) What is the probability of an error for this base call?
c) If we have a sequence of 1000 bases with this quality score, what is the expected number of
errors?
d) What is the probability of having exactly 5 errors in this 1000-base sequence?
Solution 3. a) Phred quality score: ASCII value - 33 = Phred score 73 - 33 = 40
b) Probability of an error: P(error) = 10(−Q/10), where Q is the Phred score P(error) =
10(40/10)=104 = 0.0001
c) Expected number of errors in 1000 bases: E(errors) = Number of bases × P(error) E(errors)
= 1000 × 0.0001 = 0.1
d) Probability of exactly 5 errors in 1000 bases: This follows a binomial distribution: B(n, p) n =
1000, p = 0.0001
P(X = 5) = C(1000, 5) × (0.0001)5 × (0.9999)995
C(1000, 5) = 1000! / (5! × 995!) 8.25 × 1012
P(X = 5) 8.25 × 1012 × 1020 × 0.9005 7.43 × 10−8
Therefore: a) The Phred quality score is 40. b) The probability of an error is 0.0001. c) The
expected number of errors in 1000 bases is 0.1. d) The probability of exactly 5 errors in 1000
bases is approximately 7.43 × 10−8.
38 GENOME ASSEMBLY
Problem 4. In a de novo genome assembly project, you have the following information:
Estimated genome size: 100 Mbp
Read length: 150 bp
Desired coverage: 30x
Sequencing machine output: 300 million reads per run
Cost per run: $1000
a) How many reads are needed to achieve the desired coverage?
b) What is the total amount of sequence data needed in base pairs?
c) How many sequencing runs are required?
d) What is the total cost of sequencing?
e) If the assembly algorithm has a time complexity of O(n log n), where n is the number of
reads, estimate the relative time increase if we double the coverage to 60x.
Solution 4. a) Number of reads needed: Coverage = (Number of reads × Read length) /
Genome size 30 = (Number of reads × 150 bp) / (100 × 106 bp) Number of reads = (30 × 100
× 106) / 150 = 20 million reads
b) Total amount of sequence data: Data = Number of reads × Read length Data = 20 million ×
150 bp = 3 billion bp = 3 Gbp
c) Number of sequencing runs: Runs = Ceiling(Reads needed / Reads per run) Runs =
Ceiling(20 million / 300 million) = 1 run
d) Total cost: Cost = Number of runs × Cost per run Cost = 1 × $1000 = $1000
e) Time increase for doubled coverage: Original time: O(n log n), where n = 20 million New
time with 60x coverage: O(2n log(2n))
Relative increase = (2n log(2n)) / (n log n) = 2(log(2n) / log(n)) = 2(log(40 million) / log(20
million)) 2.1
Therefore: a) 20 million reads are needed. b) 3 Gbp of sequence data is needed. c) 1
sequencing run is required. d) The total cost of sequencing is $1000. e) Doubling the coverage
would increase the assembly time by a factor of approximately 2.1.
Consider a local alignment of two DNA sequences using the Smith-Waterman algorithm with the
following scoring scheme:
Match: +2
Mismatch: -1
Gap: -2
The sequences are: S1=ACGTACGTACGT
S2=ACGTACGTTCGT
Calculate the optimal local alignment score and provide the aligned sequences.
Solution 1. We’ll use dynamic programming to fill the scoring matrix.
Step 1: Initialize the matrix (Showing only part of the matrix due to space constraints)
A C G T A
0 0 0 0 0 0
A 0 2 0 0 0 2
C 0 0 4 2 0 0
G 0 0 2 6 4 2
T 0 0 0 4 8 6
A 0 2 0 2 6 10
Step 2: Fill the entire matrix (not shown due to space)
Step 3: Find the maximum score and trace back Maximum score: 24
Aligned sequences: S1:ACGTACGT-CGT
S2:ACGTACGTTCGT
Therefore, the optimal local alignment score is 24, and the aligned sequences are shown above.
Problem 2. In a DNA sequencing experiment, a read of length 100 bp is aligned to a
reference genome of length 3 billion bp using the Burrows-Wheeler Transform (BWT) and FM-
index. The average time to process one base pair during alignment is 10 nanoseconds.
a) Calculate the expected time to align this read.
b) If we have 1 million such reads, how long would it take to align all of them using a single
processor?
c) How many processors would we need to align all reads in under 1 hour?
Solution 2. a) Expected time to align one read: Time = Read length × Time per base pair
Time = 100 bp × 10 ns/bp = 1,000 ns = 1 μs
b) Time to align 1 million reads on a single processor: Total time = Number of reads × Time
per read Total time = 1,000,000 × 1 μs = 1,000,000 μs = 1 s
c) Number of processors needed for alignment under 1 hour: 1 hour = 3,600 s 1 s is already
fast enough, so we only need 1 processor.
If we want to be more precise: Processors needed = Ceiling(1 s / 3,600 s) = 1
Therefore: a) It takes 1 μs to align one read. b) It takes 1 s to align all 1 million reads on a
single processor. c) We need 1 processor to align all reads in under 1 hour.
39 ERROR CORRECTION AND QUALITY SCORES
Problem 3. In a DNA sequencing run, quality scores are provided in Phred+33 format. A
particular base has an ASCII value of 73.
a) What is the corresponding Phred quality score?
b) What is the probability of an error for this base call?
c) If we have a sequence of 1000 bases with this quality score, what is the expected number of
errors?
d) What is the probability of having exactly 5 errors in this 1000-base sequence?
Solution 3. a) Phred quality score: ASCII value - 33 = Phred score 73 - 33 = 40
b) Probability of an error: P(error) = 10(−Q/10), where Q is the Phred score P(error) =
10(40/10)=104 = 0.0001
c) Expected number of errors in 1000 bases: E(errors) = Number of bases × P(error) E(errors)
= 1000 × 0.0001 = 0.1
d) Probability of exactly 5 errors in 1000 bases: This follows a binomial distribution: B(n, p) n =
1000, p = 0.0001
P(X = 5) = C(1000, 5) × (0.0001)5 × (0.9999)995
C(1000, 5) = 1000! / (5! × 995!) 8.25 × 1012
P(X = 5) 8.25 × 1012 × 1020 × 0.9005 7.43 × 10−8
Therefore: a) The Phred quality score is 40. b) The probability of an error is 0.0001. c) The
expected number of errors in 1000 bases is 0.1. d) The probability of exactly 5 errors in 1000
bases is approximately 7.43 × 10−8.
40 GENOME ASSEMBLY
Problem 4. In a de novo genome assembly project, you have the following information:
Estimated genome size: 100 Mbp
Read length: 150 bp
Desired coverage: 30x
Sequencing machine output: 300 million reads per run
Cost per run: $1000
a) How many reads are needed to achieve the desired coverage?
b) What is the total amount of sequence data needed in base pairs?
c) How many sequencing runs are required?
d) What is the total cost of sequencing?
e) If the assembly algorithm has a time complexity of O(n log n), where n is the number of
reads, estimate the relative time increase if we double the coverage to 60x.
Solution 4. a) Number of reads needed: Coverage = (Number of reads × Read length) /
Genome size 30 = (Number of reads × 150 bp) / (100 × 106 bp) Number of reads = (30 × 100
× 106) / 150 = 20 million reads
b) Total amount of sequence data: Data = Number of reads × Read length Data = 20 million ×
150 bp = 3 billion bp = 3 Gbp
c) Number of sequencing runs: Runs = Ceiling(Reads needed / Reads per run) Runs =
Ceiling(20 million / 300 million) = 1 run
d) Total cost: Cost = Number of runs × Cost per run Cost = 1 × $1000 = $1000
e) Time increase for doubled coverage: Original time: O(n log n), where n = 20 million New
time with 60x coverage: O(2n log(2n))
Relative increase = (2n log(2n)) / (n log n) = 2(log(2n) / log(n)) = 2(log(40 million) / log(20
million)) 2.1
Therefore: a) 20 million reads are needed. b) 3 Gbp of sequence data is needed. c) 1
sequencing run is required. d) The total cost of sequencing is $1000. e) Doubling the coverage
would increase the assembly time by a factor of approximately 2.1.
Consider a local alignment of two DNA sequences using the Smith-Waterman algorithm with the
following scoring scheme:
Match: +2
Mismatch: -1
Gap: -2
The sequences are: S1=ACGTACGTACGT
S2=ACGTACGTTCGT
Calculate the optimal local alignment score and provide the aligned sequences.
Solution 1. We’ll use dynamic programming to fill the scoring matrix.
Step 1: Initialize the matrix (Showing only part of the matrix due to space constraints)
A C G T A
0 0 0 0 0 0
A 0 2 0 0 0 2
C 0 0 4 2 0 0
G 0 0 2 6 4 2
T 0 0 0 4 8 6
A 0 2 0 2 6 10
Step 2: Fill the entire matrix (not shown due to space)
Step 3: Find the maximum score and trace back Maximum score: 24
Aligned sequences: S1:ACGTACGT-CGT
S2:ACGTACGTTCGT
Therefore, the optimal local alignment score is 24, and the aligned sequences are shown above.
Problem 2. In a DNA sequencing experiment, a read of length 100 bp is aligned to a
reference genome of length 3 billion bp using the Burrows-Wheeler Transform (BWT) and FM-
index. The average time to process one base pair during alignment is 10 nanoseconds.
a) Calculate the expected time to align this read.
b) If we have 1 million such reads, how long would it take to align all of them using a single
processor?
c) How many processors would we need to align all reads in under 1 hour?
Solution 2. a) Expected time to align one read: Time = Read length × Time per base pair
Time = 100 bp × 10 ns/bp = 1,000 ns = 1 μs
b) Time to align 1 million reads on a single processor: Total time = Number of reads × Time
per read Total time = 1,000,000 × 1 μs = 1,000,000 μs = 1 s
c) Number of processors needed for alignment under 1 hour: 1 hour = 3,600 s 1 s is already
fast enough, so we only need 1 processor.
If we want to be more precise: Processors needed = Ceiling(1 s / 3,600 s) = 1
Therefore: a) It takes 1 μs to align one read. b) It takes 1 s to align all 1 million reads on a
single processor. c) We need 1 processor to align all reads in under 1 hour.
41 ERROR CORRECTION AND QUALITY SCORES
Problem 3. In a DNA sequencing run, quality scores are provided in Phred+33 format. A
particular base has an ASCII value of 73.
a) What is the corresponding Phred quality score?
b) What is the probability of an error for this base call?
c) If we have a sequence of 1000 bases with this quality score, what is the expected number of
errors?
d) What is the probability of having exactly 5 errors in this 1000-base sequence?
Solution 3. a) Phred quality score: ASCII value - 33 = Phred score 73 - 33 = 40
b) Probability of an error: P(error) = 10(−Q/10), where Q is the Phred score P(error) =
10(40/10)=104 = 0.0001
c) Expected number of errors in 1000 bases: E(errors) = Number of bases × P(error) E(errors)
= 1000 × 0.0001 = 0.1
d) Probability of exactly 5 errors in 1000 bases: This follows a binomial distribution: B(n, p) n =
1000, p = 0.0001
P(X = 5) = C(1000, 5) × (0.0001)5 × (0.9999)995
C(1000, 5) = 1000! / (5! × 995!) 8.25 × 1012
P(X = 5) 8.25 × 1012 × 1020 × 0.9005 7.43 × 10−8
Therefore: a) The Phred quality score is 40. b) The probability of an error is 0.0001. c) The
expected number of errors in 1000 bases is 0.1. d) The probability of exactly 5 errors in 1000
bases is approximately 7.43 × 10−8.
42 GENOME ASSEMBLY
Problem 4. In a de novo genome assembly project, you have the following information:
Estimated genome size: 100 Mbp
Read length: 150 bp
Desired coverage: 30x
Sequencing machine output: 300 million reads per run
Cost per run: $1000
a) How many reads are needed to achieve the desired coverage?
b) What is the total amount of sequence data needed in base pairs?
c) How many sequencing runs are required?
d) What is the total cost of sequencing?
e) If the assembly algorithm has a time complexity of O(n log n), where n is the number of
reads, estimate the relative time increase if we double the coverage to 60x.
Solution 4. a) Number of reads needed: Coverage = (Number of reads × Read length) /
Genome size 30 = (Number of reads × 150 bp) / (100 × 106 bp) Number of reads = (30 × 100
× 106) / 150 = 20 million reads
b) Total amount of sequence data: Data = Number of reads × Read length Data = 20 million ×
150 bp = 3 billion bp = 3 Gbp
c) Number of sequencing runs: Runs = Ceiling(Reads needed / Reads per run) Runs =
Ceiling(20 million / 300 million) = 1 run
d) Total cost: Cost = Number of runs × Cost per run Cost = 1 × $1000 = $1000
e) Time increase for doubled coverage: Original time: O(n log n), where n = 20 million New
time with 60x coverage: O(2n log(2n))
Relative increase = (2n log(2n)) / (n log n) = 2(log(2n) / log(n)) = 2(log(40 million) / log(20
million)) 2.1
Therefore: a) 20 million reads are needed. b) 3 Gbp of sequence data is needed. c) 1
sequencing run is required. d) The total cost of sequencing is $1000. e) Doubling the coverage
would increase the assembly time by a factor of approximately 2.1.
Consider a local alignment of two DNA sequences using the Smith-Waterman algorithm with the
following scoring scheme:
Match: +2
Mismatch: -1
Gap: -2
The sequences are: S1=ACGTACGTACGT
S2=ACGTACGTTCGT
Calculate the optimal local alignment score and provide the aligned sequences.
Solution 1. We’ll use dynamic programming to fill the scoring matrix.
Step 1: Initialize the matrix (Showing only part of the matrix due to space constraints)
A C G T A
0 0 0 0 0 0
A 0 2 0 0 0 2
C 0 0 4 2 0 0
G 0 0 2 6 4 2
T 0 0 0 4 8 6
A 0 2 0 2 6 10
Step 2: Fill the entire matrix (not shown due to space)
Step 3: Find the maximum score and trace back Maximum score: 24
Aligned sequences: S1:ACGTACGT-CGT
S2:ACGTACGTTCGT
Therefore, the optimal local alignment score is 24, and the aligned sequences are shown above.
Problem 2. In a DNA sequencing experiment, a read of length 100 bp is aligned to a
reference genome of length 3 billion bp using the Burrows-Wheeler Transform (BWT) and FM-
index. The average time to process one base pair during alignment is 10 nanoseconds.
a) Calculate the expected time to align this read.
b) If we have 1 million such reads, how long would it take to align all of them using a single
processor?
c) How many processors would we need to align all reads in under 1 hour?
Solution 2. a) Expected time to align one read: Time = Read length × Time per base pair
Time = 100 bp × 10 ns/bp = 1,000 ns = 1 μs
b) Time to align 1 million reads on a single processor: Total time = Number of reads × Time
per read Total time = 1,000,000 × 1 μs = 1,000,000 μs = 1 s
c) Number of processors needed for alignment under 1 hour: 1 hour = 3,600 s 1 s is already
fast enough, so we only need 1 processor.
If we want to be more precise: Processors needed = Ceiling(1 s / 3,600 s) = 1
Therefore: a) It takes 1 μs to align one read. b) It takes 1 s to align all 1 million reads on a
single processor. c) We need 1 processor to align all reads in under 1 hour.
43 ERROR CORRECTION AND QUALITY SCORES
Problem 3. In a DNA sequencing run, quality scores are provided in Phred+33 format. A
particular base has an ASCII value of 73.
a) What is the corresponding Phred quality score?
b) What is the probability of an error for this base call?
c) If we have a sequence of 1000 bases with this quality score, what is the expected number of
errors?
d) What is the probability of having exactly 5 errors in this 1000-base sequence?
Solution 3. a) Phred quality score: ASCII value - 33 = Phred score 73 - 33 = 40
b) Probability of an error: P(error) = 10(−Q/10), where Q is the Phred score P(error) =
10(40/10)=104 = 0.0001
c) Expected number of errors in 1000 bases: E(errors) = Number of bases × P(error) E(errors)
= 1000 × 0.0001 = 0.1
d) Probability of exactly 5 errors in 1000 bases: This follows a binomial distribution: B(n, p) n =
1000, p = 0.0001
P(X = 5) = C(1000, 5) × (0.0001)5 × (0.9999)995
C(1000, 5) = 1000! / (5! × 995!) 8.25 × 1012
P(X = 5) 8.25 × 1012 × 1020 × 0.9005 7.43 × 10−8
Therefore: a) The Phred quality score is 40. b) The probability of an error is 0.0001. c) The
expected number of errors in 1000 bases is 0.1. d) The probability of exactly 5 errors in 1000
bases is approximately 7.43 × 10−8.
44 GENOME ASSEMBLY
Problem 4. In a de novo genome assembly project, you have the following information:
Estimated genome size: 100 Mbp
Read length: 150 bp
Desired coverage: 30x
Sequencing machine output: 300 million reads per run
Cost per run: $1000
a) How many reads are needed to achieve the desired coverage?
b) What is the total amount of sequence data needed in base pairs?
c) How many sequencing runs are required?
d) What is the total cost of sequencing?
e) If the assembly algorithm has a time complexity of O(n log n), where n is the number of
reads, estimate the relative time increase if we double the coverage to 60x.
Solution 4. a) Number of reads needed: Coverage = (Number of reads × Read length) /
Genome size 30 = (Number of reads × 150 bp) / (100 × 106 bp) Number of reads = (30 × 100
× 106) / 150 = 20 million reads
b) Total amount of sequence data: Data = Number of reads × Read length Data = 20 million ×
150 bp = 3 billion bp = 3 Gbp
c) Number of sequencing runs: Runs = Ceiling(Reads needed / Reads per run) Runs =
Ceiling(20 million / 300 million) = 1 run
d) Total cost: Cost = Number of runs × Cost per run Cost = 1 × $1000 = $1000
e) Time increase for doubled coverage: Original time: O(n log n), where n = 20 million New
time with 60x coverage: O(2n log(2n))
Relative increase = (2n log(2n)) / (n log n) = 2(log(2n) / log(n)) = 2(log(40 million) / log(20
million)) 2.1
Therefore: a) 20 million reads are needed. b) 3 Gbp of sequence data is needed. c) 1
sequencing run is required. d) The total cost of sequencing is $1000. e) Doubling the coverage
would increase the assembly time by a factor of approximately 2.1.
Consider a local alignment of two DNA sequences using the Smith-Waterman algorithm with the
following scoring scheme:
Match: +2
Mismatch: -1
Gap: -2
The sequences are: S1=ACGTACGTACGT
S2=ACGTACGTTCGT
Calculate the optimal local alignment score and provide the aligned sequences.
Solution 1. We’ll use dynamic programming to fill the scoring matrix.
Step 1: Initialize the matrix (Showing only part of the matrix due to space constraints)
A C G T A
0 0 0 0 0 0
A 0 2 0 0 0 2
C 0 0 4 2 0 0
G 0 0 2 6 4 2
T 0 0 0 4 8 6
A 0 2 0 2 6 10
Step 2: Fill the entire matrix (not shown due to space)
Step 3: Find the maximum score and trace back Maximum score: 24
Aligned sequences: S1:ACGTACGT-CGT
S2:ACGTACGTTCGT
Therefore, the optimal local alignment score is 24, and the aligned sequences are shown above.
Problem 2. In a DNA sequencing experiment, a read of length 100 bp is aligned to a
reference genome of length 3 billion bp using the Burrows-Wheeler Transform (BWT) and FM-
index. The average time to process one base pair during alignment is 10 nanoseconds.
a) Calculate the expected time to align this read.
b) If we have 1 million such reads, how long would it take to align all of them using a single
processor?
c) How many processors would we need to align all reads in under 1 hour?
Solution 2. a) Expected time to align one read: Time = Read length × Time per base pair
Time = 100 bp × 10 ns/bp = 1,000 ns = 1 μs
b) Time to align 1 million reads on a single processor: Total time = Number of reads × Time
per read Total time = 1,000,000 × 1 μs = 1,000,000 μs = 1 s
c) Number of processors needed for alignment under 1 hour: 1 hour = 3,600 s 1 s is already
fast enough, so we only need 1 processor.
If we want to be more precise: Processors needed = Ceiling(1 s / 3,600 s) = 1
Therefore: a) It takes 1 μs to align one read. b) It takes 1 s to align all 1 million reads on a
single processor. c) We need 1 processor to align all reads in under 1 hour.
45 ERROR CORRECTION AND QUALITY SCORES
Problem 3. In a DNA sequencing run, quality scores are provided in Phred+33 format. A
particular base has an ASCII value of 73.
a) What is the corresponding Phred quality score?
b) What is the probability of an error for this base call?
c) If we have a sequence of 1000 bases with this quality score, what is the expected number of
errors?
d) What is the probability of having exactly 5 errors in this 1000-base sequence?
Solution 3. a) Phred quality score: ASCII value - 33 = Phred score 73 - 33 = 40
b) Probability of an error: P(error) = 10(−Q/10), where Q is the Phred score P(error) =
10(40/10)=104 = 0.0001
c) Expected number of errors in 1000 bases: E(errors) = Number of bases × P(error) E(errors)
= 1000 × 0.0001 = 0.1
d) Probability of exactly 5 errors in 1000 bases: This follows a binomial distribution: B(n, p) n =
1000, p = 0.0001
P(X = 5) = C(1000, 5) × (0.0001)5 × (0.9999)995
C(1000, 5) = 1000! / (5! × 995!) 8.25 × 1012
P(X = 5) 8.25 × 1012 × 1020 × 0.9005 7.43 × 10−8
Therefore: a) The Phred quality score is 40. b) The probability of an error is 0.0001. c) The
expected number of errors in 1000 bases is 0.1. d) The probability of exactly 5 errors in 1000
bases is approximately 7.43 × 10−8.
46 GENOME ASSEMBLY
Problem 4. In a de novo genome assembly project, you have the following information:
Estimated genome size: 100 Mbp
Read length: 150 bp
Desired coverage: 30x
Sequencing machine output: 300 million reads per run
Cost per run: $1000
a) How many reads are needed to achieve the desired coverage?
b) What is the total amount of sequence data needed in base pairs?
c) How many sequencing runs are required?
d) What is the total cost of sequencing?
e) If the assembly algorithm has a time complexity of O(n log n), where n is the number of
reads, estimate the relative time increase if we double the coverage to 60x.
Solution 4. a) Number of reads needed: Coverage = (Number of reads × Read length) /
Genome size 30 = (Number of reads × 150 bp) / (100 × 106 bp) Number of reads = (30 × 100
× 106) / 150 = 20 million reads
b) Total amount of sequence data: Data = Number of reads × Read length Data = 20 million ×
150 bp = 3 billion bp = 3 Gbp
c) Number of sequencing runs: Runs = Ceiling(Reads needed / Reads per run) Runs =
Ceiling(20 million / 300 million) = 1 run
d) Total cost: Cost = Number of runs × Cost per run Cost = 1 × $1000 = $1000
e) Time increase for doubled coverage: Original time: O(n log n), where n = 20 million New
time with 60x coverage: O(2n log(2n))
Relative increase = (2n log(2n)) / (n log n) = 2(log(2n) / log(n)) = 2(log(40 million) / log(20
million)) 2.1
Therefore: a) 20 million reads are needed. b) 3 Gbp of sequence data is needed. c) 1
sequencing run is required. d) The total cost of sequencing is $1000. e) Doubling the coverage
would increase the assembly time by a factor of approximately 2.1.
Students also viewed