Extract a sample from a fastq file
It is your turn to draw a sample piece from a sequence of many reads.
You will use the same file you've read in the previous exercise. This file has 500 reads, each of 50 bp. The file path is stored in an object called f
.
Using FastqSampler(con = file_path, n = length)
, set.seed()
, and yield()
you can subset 100 reads from your sequence file.
Diese Übung ist Teil des Kurses
Introduction to Bioconductor in R
Anleitung zur Übung
- Load
ShortRead
. - Use
set.seed()
with value1234
. - Use
FastqSampler()
with the small fastq file located inf
and select 100 reads. - Use
yield()
to generate the sub sequence.
Interaktive Übung
Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.
# Load ShortRead
library(ShortRead)
# Set a seed for sampling
___
# Use FastqSampler with f and select 100 reads
fs <- ___(con = ___, ___ = ___)
# Generate new sample yield
my_sample <- ___
# Print my_sample
___