seqbias.fit {seqbias} | R Documentation

## Fitting seqbias models

### Description

Fits a seqbias module given a reference sequence and reads in BAM format

### Usage

    seqbias.fit(ref_fn, reads_fn, n = 1e5, L = 15, R = 15)

### Arguments

`ref_fn` | filename of a reference sequence against which the reads are aligned, in FASTA format.
`reads_fn` | filename of aligned reads in BAM format.
`n` | train on at most this many reads.
`L` | consider at most L positions to the left of the read start.
`R` | consider at most R positions to the right of the read start.

### Details

A Bayesian network is trained on the first `n` unique reads in the provided BAM file, predicting the posterior probability of a read beginning at a position given the surrounding sequence. This is used to discern the sequencing bias: how more or less likely a read is to fall on a particular position.

The abundance of region can be more accurately assessed by normalizing (dividing) each position by its predicted bias.

### Value

A vector of reals giving the predicted sequencing bias for each position.

### Note

Both the BAM file and the FASTA file should be indexed, with, 'samtools index' and, 'samtools faidx' respectively.

### Author(s)

Daniel Jones dcjones@cs.washington.edu

### See Also

`seqbias.predict`

### Examples

      reads_fn <- system.file( "extra/example.bam", package = "seqbias" )
      ref_fn <- system.file( "extra/example.fa", package = "seqbias" )

      sb <- seqbias.fit( ref_fn, reads_fn )

      I <- GRanges( c('seq1'), IRanges( c(1), c(5000) ), strand = c('-') )

      bias <- seqbias.predict( sb, I )

[Package seqbias version 1.28.0 Index]