filter_unmapped_reads: Filter unmapped reads

Description Usage Arguments Value Examples

Description

This function will to remove all unmapped reads or lines in a .bam file (warning: overwrites the original file!). This function is needed because combining multiple .bam files from different microbial libraries may lead to some reads that mapped to one library and have unmapped entries from another library. This will just remove any unmapped entries and leave all referene mapped lines in the .bam file.

Usage

1

Arguments

bamfile

Location for the .bam file to filter/remove all unmapped reads

Value

This function will overwrite the existing .bam file with a new .bam file in the same location that has only mapped lines. The function iself returns the output .bam file name.

Examples

1
2
3
4
5
download_refseq('viral', compress = FALSE)
mk_subread_index('viral.fasta')
readPath <- system.file("extdata", "virus_example.fastq", package = "animalcules.preprocess")
Rsubread::align(index = "viral", readfile1 = readPath, output_file = "virus_example.bam")
filtered <- filter_unmapped_reads("virus_example.bam")

wevanjohnson/animalcules.preprocess documentation built on May 11, 2019, 8:26 p.m.