R/fastq_utils.R

Defines functions get_seqid change_header

## a collection of functions to manupilate fastq inputs
## supplement ShortRead package

change_header = function(x, header){
    ## x is a ShortReadQ class
    ## this is essentially the missing id<- method
    ShortReadQ(sread=sread(x), quality = quality(x), id = BStringSet(header))
}

get_seqid = function(x, header){
    ## x is a ShortReadQ class
    sub("^(\\S+).*", "\\1", ShortRead::id(x))
}
czhu/R_nanopore documentation built on Dec. 19, 2021, 7:10 p.m.