View source: R/MODULE_2_PREP.R
bam2count | R Documentation |
Function to generate a read counts table from bam files
bam2count(bamfolder, annotation)
bamfolder |
Path to the folder containing bam files (one bam file per sample is expected) |
annotation |
Annotation data table produced by |
This function is designed for bam files generated by mapping to a transcriptome (not a genome).
For each sample, it counts the number of reads mapping to different chromosomes (the 'seqname' bam field).
Annotation must be provided to ensure a complete transcript list, including those with zero counts.
Low count transcripts can be filtered out later using the min_count_filter
function.
RNA and RPF bam files can be placed in the same folder and imported together using this function if CELP bias correction on RPF counts is not desired.
If CELP correction is desired, RNA and RPF bams should be placed in separate folders.
RNA bams should be imported using this function; RPF bams should be imported using the bamtolist_rW
function following the CELP workflow.
A data frame where the first column contains transcript IDs and the remaining columns contain read counts in imported samples.
rna_count_LMCN <- bam2count(bamfolder = "./Data/Bam/RNA", annotation = annotation_human_cDNA) rpf_count_LMCN <- bam2count(bamfolder = "./Data/Bam/RPF", annotation = annotation_human_cDNA)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.