Number of mapped reads/fragments will be counted and fraction of such reads/fragments will be calculated.
a character vector giving the names of SAM/BAM format files. Format of input files is automatically determined by the function.
logical, indicating whether reads or fragments (read pairs) should be counted. If
logical, indicating if only properly paired reads will be counted. This is only applicable for paired end data.
This function uses the
FLAG field in the SAM/BAM to look for mapped reads and count them.
Reads/fragments, which have more than one reported location, will be reported only once.
When counting single end reads, counting reads has the same meaning with counting fragments (the results are identical).
A data frame containing the total number of reads, number of mapped reads and proportion of mapped reads for each library.
Wei Shi and Yang Liao
1 2 3 4 5 6 7 8 9 10 11 12 13
# build an index using the sample reference sequence provided in the package # and save it to the current directory library(Rsubread) ref <- system.file("extdata","reference.fa",package="Rsubread") buildindex(basename="./reference_index",reference=ref) # align the sample read data provided in this packge to the sample reference # and save the mapping results to the current directory reads <- system.file("extdata","reads.txt.gz",package="Rsubread") align(index="./reference_index",readfile1=reads,output_file="./Rsubread_alignment.BAM") # get the percentage of successfully mapped reads propmapped("./Rsubread_alignment.BAM")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.