R/GetQSData.R

Defines functions GetQSData

Documented in GetQSData

GetQSData <-
function(flnm, min.pct=0.1, type="DNA"){ 
    ##  Read amplicon aligned sequences with abundance data, filter
    ##    at a minimum given abundance, and sort by mutations and
    ##    abundance.
        ##    flnm: Path to the fasta file
        ## min.pct: Minimum abundance allowed
        ##    type: DNA or AA
    if(!is(min.pct, "numeric")) 
        stop("The min.pct argument must be numeric \n")
    # Read the fasta file
    lst <- ReadAmplSeqs(flnm, type)
    # Vector for filtering
    fl <- lst$nr/sum(lst$nr)*100 >= min.pct
    # Order the fasta files filtered
    lst <- SortByMutations(lst$hseqs[fl], lst$nr[fl])
    return(list(seqs=lst$bseqs, nr=lst$nr, nm=lst$nm))
}

Try the QSutils package in your browser

Any scripts or data that you put into this service are public.

QSutils documentation built on Nov. 8, 2020, 7:42 p.m.