This function sums the log of read depth of the lowest depth divide by the total depth of the position minus of likelihood of the allelic fraction of 0.5 for a block. If the phase is known, the SNVs in the same haplotype are grouped together.

calcAFMLRNA(snpPosHetero)

Arguments

snpPosHetero

a data.frame containing the SNV information for a specific block (gene if RNA-seq). The data.frame must contain those columns:

cnt.ref

a single integer representing the coverage for the reference allele.

cnt.alt

a single integer representing the coverage for the alternative allele.

phase

a single integer indicating the phase of the variant if known, 3 if not known

Value

a list for the block with the information relative to the heterozygotes. The list contains:

lR

a single numeric representing the sum of the log of read depth of the lowest depth divide by the total depth of the position minus of likelihood of the allelic fraction of 0.5.

aFraction

a single numeric representing the allele fraction estimation.

sumAlleleLow

a integer representing the sum of the allele read depth of the lowest read allele depth

sumAlleleHigh

a integer representing the sum of the allele read depth of the highest read allele depth

Author

Pascal Belleau, Astrid Deschênes and Alexander Krasnitz

Examples


## Loading demo dataset containing SNV information
data(snpPositionDemo)

## Only use a subset of heterozygote SNVs related to one block
subset <- snpPositionDemo[which(snpPositionDemo$block.id == 2750 &
                  snpPositionDemo$hetero), c("cnt.ref", "cnt.alt", "phase")]

result <- RAIDS:::calcAFMLRNA(subset)

head(result)
#> $lR
#> [1] 4.057862
#> 
#> $aFraction
#> [1] 0.3389831
#> 
#> $nPhase
#> [1] 0
#> 
#> $sumAlleleLow
#> [1] 60
#> 
#> $sumAlleleHigh
#> [1] 117
#>