# Filter sequences of a FASTQ file by length

`length_filter.Rd`

The program removes from a ShortReadQ object those sequences with a length lower than rm.min or/and higher than rm.max

    length_filter(input, rm.min = NA, rm.max = NA)

## Arguments

input | `ShortReadQ` object
rm.min | Threshold value for the minimun number of bases
rm.max | Threshold value for the maximum number of bases

## Value

Filtered `ShortReadQ` object

## Examples

    require('Biostrings')
    require('ShortRead')

    # create  ShortReadQ object width widths between 1 and 100

     set.seed(10)
    input <- random_length(100, widths = 1:100)

    # apply the filter, removing sequences length < 10 or length > 80
    filtered <- length_filter(input, rm.min = 10, rm.max = 80)

    # look at the filtered sequences
    sread(filtered)#>   A DNAStringSet instance of length 73
    #>      width seq
    #>  [1]    74 GTACTTCCACAGTCAACCCGCCGACTTGGAGAA...CCGGGCGGTTATTCCCCTAGTGATCTTACTAAG
    #>  [2]    76 ATTTGCAATACCTAAGCGAAGTGACAGATATGT...TCCAGGCAAGTGCGCGGACATCAATTACCACAC
    #>  [3]    55 AATTAAATATGACTCGCGTATCGCACGTGACCCCTTTGATGCGGACTACCATTCA
    #>  [4]    72 CAGCTCAAGAAATTGGAATTTGTGCTGGTAAGG...CTGAACGCTCCGTCTCTCTCAATTAAGACCGTT
    #>  [5]    54 ATCCGCCGTTAAGACATTCCACGCGGCAGAGCTTGAGCAATCAGTGACGCCGGG
    #>  ...   ... ...
    #> [69]    77 TGGCCACGCGCCCTATATTCCGCGCAGTTTCAT...ACCGCTGGTTTATTTCTAATTGGTTTCCCACTG
    #> [70]    78 TCGGCTGTTATACCGGGTTGCCCTTCCATGAGA...AAAAAAGTCAAAACGTTCGGCCGCTGCACTCAT
    #> [71]    34 TCGTATACAGCGAGTGTCTAACTTGAAGGTATTA
    #> [72]    64 GATCTGAACTGCAGTTGACTGCCTCATTAACGCGTTACGGACTACTGGGGGAAAGGTGGCTACC
    #> [73]    63 CAGGGAGGCCATGTCCTCGGGAAGAGATAGAGCGGGACGGCTGCCTAGTGGCAGTACCCGCTC