从 fastq 文件中抽取一个样本
现在轮到您从一长串 reads 中抽取一个样本片段了。
您将使用上一个练习中读取的同一个文件。该文件包含 500 条 reads,每条长度为 50 bp。文件路径保存在名为 f 的对象中。
使用 FastqSampler(con = file_path, n = length)、set.seed() 和 yield(),您可以从该序列文件中抽取 100 条 reads 的子集。
本练习是课程的一部分
R 中的 Bioconductor 入门
练习说明
- 载入
ShortRead。 - 使用
set.seed(),取值为1234。 - 使用
FastqSampler(),以f中的小型 fastq 文件为输入,并选择 100 条 reads。 - 使用
yield()生成子序列。
交互式实操练习
通过完成这段示例代码来试试这个练习。
# 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
___