fixed_filter: Remove a fixed number of bases of a ShortReadQ object from 3'...

Description Usage Arguments Value Author(s) Examples

View source: R/fixed_filter.R

Description

The program removes a given number of bases from the 3' or 5' regions of the sequences contained in a ShortReadQ object

Usage

1
fixed_filter(input, trim3 = NA, trim5 = NA)

Arguments

input

ShortReadQ object

trim3

Number of bases to remove from 3'

trim5

Number of bases to remove from 5'

Value

Filtered ShortReadQ object

Author(s)

Leandro Roser learoser@gmail.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
require('Biostrings')
require('ShortRead')

# create 6 sequences of width 20
 
set.seed(10)
input <- random_seq(6, 20)

# create qualities of width 20 

set.seed(10)
input_q <- random_qual(c(30,40), slength = 6, swidth = 20, 
encod = 'Sanger')


# create names
input_names <- seq_names(6)

# create ShortReadQ object
my_read <- ShortReadQ(sread = input, quality = input_q, id = input_names)

# apply the filter 
filtered3 <- fixed_filter(my_read, trim5 = 5)

filtered5 <- fixed_filter(my_read, trim3 = 5)

filtered3and5 <- fixed_filter(my_read, trim3 = 10, trim5 = 5)

# look at the trimmed sequences
sread(filtered3)
sread(filtered5)
sread(filtered3and5)

FastqCleaner documentation built on Nov. 8, 2020, 5:05 p.m.