View source: R/bam_processing.R
import_bams | R Documentation |
Import and process BAM files.
import_bams( experiment, paired, sample_sheet = NULL, soft_remove = 3, proper_pair = NULL, remove_secondary = TRUE, remove_duplicate = FALSE )
experiment |
TSRexploreR object. |
paired |
Whether the BAMs are paired (TRUE) or unpaired (FALSE). |
sample_sheet |
A sample sheet data.frame or tab delimited file. Must have the columns 'sample_name', 'file_1', and 'file_2'. Additional meta-data columns can be added with sample information such as condition and batch. |
soft_remove |
Remove read if greater than this number of soft-clipped bases is present at its 5' most end. |
proper_pair |
Remove reads flagged as improperly paired. TRUE by default when data is paired-end. |
remove_secondary |
Remove secondary alignments (TRUE). |
remove_duplicate |
Remove duplicate reads (paired-end only) (TRUE). |
Import BAMs using the information from the sample sheet. If the BAMs are from paired-end data, 'proper_pair' allows removal of reads without a proper-pair SAM flag. Additionally 'remove_secondary' and 'remove_duplicate' will remove reads with the secondary alignment and duplicate flags set.
Most TSS mapping methodologies tend to add at least one non-templated base at the 5' end of the read. Furthermore, template switching reverse transcription (TSRT)-based methods such as STRIPE-seq or nanoCAGE can have up to 3 or 4 non-templated 5' bases. We recommend setting 'soft_remove' to at minimum 3 because of this, which removes the read if the given number of soft-clip bases is exceeded.
TSRexploreR object with BAM GRanges and soft-clipped base information.
bam_file <- system.file("extdata", "S288C.bam", package="TSRexploreR") assembly <- system.file("extdata", "S288C_Assembly.fasta", package="TSRexploreR") samples <- data.frame(sample_name="S288C", file_1=bam_file, file_2=NA) exp <- tsr_explorer(sample_sheet=samples, genome_assembly=assembly) import_bams(exp, paired=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.