Session Ready
Exercise

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.

Instructions
100 XP
  • Load ShortRead.
  • Use set.seed() with value 1234.
  • Use FastqSampler() with the small fastq file located in f and select 100 reads.
  • Use yield() to generate the sub sequence.