CommencerCommencer gratuitement

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.

Cet exercice fait partie du cours

Introduction to Bioconductor in R

Afficher le cours

Instructions

  • 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.

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# 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
___
Modifier et exécuter le code