R/allelicFraction_internal.R
tableBlockAF.Rd
The function evaluates a score about loss of heterozygosity and allelic fraction for each block. It generates specific information about the variants in the block, like the number of homozygotes or heterozygotes. In the case of RNA-seq, the blocks are genes.
tableBlockAF(snpPos)
a data.frame
containing only heterozygote
SNV information. The
data.frame
contain those columns:
a single integer
representing the unique identifier
of the block.
a single numeric
representing the final allelic
fraction; not computed yet, -1
value assigned to all entries.
a single integer
representing the possible allelic
fraction in absence of loss of heterozygosity (LOH).
a single integer
representing the coverage for
the alternative allele.
a single integer
representing the number of SNV
phases.
a single integer
representing the sum of the
alleles with the less coverage.
a single integer
representing the sum of
the alleles with more coverage.
a single numeric
for the homozygotes log10 of the product
frequencies of the allele not found in the profile (not a probability).
a single numeric
log10 product frequency allele
in population.
a single numeric
representing the score
lH
- lM
.
a single integer
representing the number of
homozygote SNVs per block.
a single integer
representing the number of
SNVs retained per block.
a single integer
representing the number of
heterozygote SNVs per block.
## Loading demo dataset containing SNV information
data(snpPositionDemo)
## Retain SNVs on chromosome 1
subset <- snpPositionDemo[which(snpPositionDemo$snp.chr == 1),]
##Compile the information about the SNVs for each block
result <- RAIDS:::tableBlockAF(subset)
head(result)
#> block nbHomo nbKeep nbHetero aRF aFraction lR nPhase
#> block 3833 0 1 1 -1 -1.0000000 -1.0000000 -1
#> block1 3834 1 1 0 -1 -1.0000000 -1.0000000 -1
#> block2 2693 2 4 2 -1 0.4166667 0.2908852 0
#> block3 2750 25 29 4 -1 0.3389831 4.0578619 0
#> block4 2714 7 7 0 -1 -1.0000000 -1.0000000 -1
#> block5 2689 8 8 0 -1 -1.0000000 -1.0000000 -1
#> sumAlleleLow sumAlleleHigh lH lM lRhomo
#> block -1 -1 1.00000000 1.00000000 0.000000e+00
#> block1 0 544 -0.03545753 -0.03545753 -2.081668e-17
#> block2 20 28 1.00000000 1.00000000 0.000000e+00
#> block3 60 117 1.00000000 1.00000000 0.000000e+00
#> block4 0 112 -0.10612196 -0.05374429 -5.237766e-02
#> block5 0 136 -1.16008188 -0.53606843 -6.240135e-01