Calculates nucleotide frequency of reads in bam file
Usage
ntfreq(bam_file, ntlength, toRNA = TRUE, count_type = "total")
Arguments
bam_file
An object of class data.frame or DataFrame
ntlength
An integer specifying the length of the sequence to quantify
toRNA
A logical value on whether to translate the DNA sequence to RNA
count_type
A character string on how to count the nucleotides. Can be either "total" or "unique". If total is selected, the function will look for the countcolumn and multiply the reads by its number of occurence when calculating the frequency.
Value
Returns a data.frame of the frequency of nucleotides (either A/C/G/T or A/C/G/U) at each position up to the specified ntlength