R/allelicFraction_internal.R
calcAFMLRNA.Rd
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)
a data.frame
containing the SNV information for a specific block (gene if RNA-seq).
The data.frame
must contain those columns:
a single integer
representing the coverage for
the reference allele.
a single integer
representing the coverage for
the alternative allele.
a single integer
indicating the phase of the variant
if known, 3
if not known
a list
for the block with the information
relative to the heterozygotes.
The list
contains:
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.
a single numeric
representing the allele
fraction estimation.
a integer
representing the
sum of the allele read depth of the lowest read allele depth
a integer
representing the
sum of the allele read depth
of the highest read allele depth
## 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
#>