ComenzarEmpieza gratis

Filtering reads on the go!

What if, from all of the reads in a file, you are only interested in some of those reads? You can use a filter!

Let's say that you are interested only in those reads that start with the pattern "ATGCA". A tiny filtering function can do the job, making use of the srFilter() function:

myStartFilter <- srFilter(function(x) substr(sread(x), 1, 5) == "ATGCA")

This function, which has been created for you, takes a ShortRead derived object as an input and outputs the reads starting with the pattern "ATGCA". Let's put this function to use!

Este ejercicio forma parte del curso

Introduction to Bioconductor in R

Ver curso

Ejercicio interactivo práctico

Prueba este ejercicio completando el código de muestra.

# Load package ShortRead
library(ShortRead)

# Check class of fqsample
___

# Filter reads into selectedReads using myStartFilter
selectedReads <- fqsample[___(___)]

# Check class of selectedReads
___
Editar y ejecutar código