readCounts {ASpli} | R Documentation

## Summarize read overlaps

### Description

Summarize read overlaps against all feature levels

### Usage

      readCounts( features, bam, targets, cores = 1, readLength,
                     maxISize, minAnchor = 10)

### Arguments

`features` | An object of class ASpliFeatures. It is a list of GRanges at gene, bin and junction level
`bam` | List of GAlignments objects corresponding to bam files of samples.
`targets` | A dataframe containing sample, bam and experimental factors columns
`readLength` | Read length of sequenced library. It is used for compute E1I and IE2 read summarization
`maxISize` | maximum intron expected size. Junctions longer than this size will be dicarded
`cores` | Number of cores to use. Default is 1
`minAnchor` | Minimum percentage of read that should be aligned to an exon-intron boundary

### Value

An object of class ASpliCounts. Each slot is a dataframe containing features metadata and read counts. Summarization is reported at gene, bin, junction and intron flanking regions (E1I, IE2).

### Author(s)

Estefania Mancini, Javier Iserte, Marcelo Yanovsky, Ariel Chernomoretz

### See Also

Accesors: `countsg`, `countsb`, `countsj`, `countse1i`, `countsie2`, `rdsg`, `rdsb`, Export: `writeCounts`

### Examples

      # Create a transcript DB from gff/gtf annotation file.
      # Warnings in this examples can be ignored.
      library(GenomicFeatures)
      genomeTxDb <- makeTxDbFromGFF( system.file('extdata','genes.mini.gtf',
                                     package="ASpli") )

      # Create an ASpliFeatures object from TxDb
      features <- binGenome( genomeTxDb )

      # Define bam files, sample names and experimental factors for targets.
      bamFileNames <- c( "A_C_0.bam", "A_C_1.bam", "A_C_2.bam",
                         "A_D_0.bam", "A_D_1.bam", "A_D_2.bam" )
      targets <- data.frame(
                   row.names = paste0('Sample_',c(1:6)),
                   bam = system.file( 'extdata', bamFileNames, package="ASpli" ),
                   factor1 = c( 'C','C','C','D','D','D') )

      # Load reads from bam files
      bams <- loadBAM( targets )

      # Read counts from bam files
      counts   <- readCounts( features, bams, targets, cores = 1, readLength = 100,
                              maxISize = 50000 )
      # Export data
      writeCounts( counts, output.dir = "only_counts" )

[Package ASpli version 1.10.0 Index]