Title: | Isolation-Forest Based 'CNV' Detection from 'NGS' Data |
Version: | 0.1.0 |
URL: | https://github.com/SimCab-CHU/ifCNVR |
Description: | Automatically detects Copy Number Variations (CNV) from Next Generation Sequencing data using a machine learning algorithm, Isolation forest. More details about the method can be found in the paper by Cabello-Aguilar (2022) <doi:10.1101/2022.01.03.474771>. |
License: | GPL-3 |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 7.1.2 |
Imports: | data.table, rmarkdown, isotree |
Depends: | R (≥ 2.10) |
NeedsCompilation: | no |
Packaged: | 2022-02-15 06:11:14 UTC; admin |
Author: | Simon Cabello-Aguilar
|
Maintainer: | Simon Cabello-Aguilar <s-cabelloaguilar@chu-montpellier.fr> |
Repository: | CRAN |
Date/Publication: | 2022-02-15 19:40:02 UTC |
CreateReadsMatrix
Description
CreateReadsMatrix
Usage
CreateReadsMatrix(
bamPath,
bedFile,
bedtoolsPath,
outputFile = "n",
verbose = TRUE
)
Arguments
bamPath |
a path leading to the .bam and .bai files |
bedFile |
a path leading to the .bed file (Warning replace chrX by X in the position) |
bedtoolsPath |
the path leading to bedtools |
outputFile |
(optional) a path leading to a text file |
verbose |
a boolean |
Value
a reads matrix
Examples
bamPath <- system.file("extdata/",package = "ifCNVR")
bed <- system.file("bedFile.bed",package = "ifCNVR")
bedtools <- 'n'
readsMatrix <- CreateReadsMatrix(bamPath, bed, bedtools)
abSamples
Description
abSamples
Usage
abSamples(readsMatrix, conta = "auto", q = 0.99, verbose = TRUE)
Arguments
readsMatrix |
a matrix of the number of reads per target |
conta |
a parameter for the isotree function |
q |
quantile |
verbose |
a boolean |
Value
the aberrant and normal samples
Examples
readsMatrix = data.frame(targets=paste0("target_",seq(1,50)), matrix(runif(500),nrow=50,ncol=10))
abSamples(readsMatrix)
abTargets
Description
abTargets
Usage
abTargets(readsMatrix, abSamples, opt = "regular", pred = 0.6)
Arguments
readsMatrix |
the reads matrix |
abSamples |
the abSamples list result of the abSamples function |
opt |
"regular" or "extensive" a parameter |
pred |
a threshold on the isolation forest outlier prediction (range=[0,1[) |
Value
a list of dataframes of the targets tagged as outliers
Examples
abTargets(readsMatrixExample,abSamples(readsMatrixExample))
calculate Ratio
Description
calculate Ratio
Usage
calculateRatio(readsMatrix, abSamples, roi, soi)
Arguments
readsMatrix |
the reads matrix |
abSamples |
the abSamples list result of the abSamples function |
roi |
the region of interest |
soi |
the sample of interest |
Value
the ratio associated with the abTargets
Examples
calculateRatio(readsMatrixExample, abSamples(readsMatrixExample), "EGFR-Ex20", "sample_2")
calculate Score
Description
calculate Score
Usage
calculateScore(
readsMatrix,
abSamples,
abTargets,
roi = "Gene",
sep = "-",
thrScore = 7
)
Arguments
readsMatrix |
a reads matrix with samples in columns and targets in lines (the first column are the targets) |
abSamples |
the abSamples list result of the abSamples function |
abTargets |
a list of dataframes of the targets tagged as outliers result of the abTargets() function |
roi |
the region of interest (Gene or Gene-Exon) |
sep |
a character the separator between roi in the bed file |
thrScore |
(default 0) a threshold on the localization score |
Value
the score associated with the abSamples in the desired roi
Examples
abS <- abSamples(readsMatrixExample)
abT <- abTargets(readsMatrixExample,abSamples(readsMatrixExample))
calculateScore(readsMatrixExample, abS, abT, sep="-")
generateReport
Description
generateReport
Usage
generateReport(outputFile = "n", readsMatrix, resTable, CNVpos)
Arguments
outputFile |
a path to the html output file |
readsMatrix |
the reads matrix |
resTable |
the table result of the CalculateScore() function |
CNVpos |
the CNVpos list result of the abSamples function |
Value
a html report
Examples
generateReport()
normalizeReads
Description
normalizeReads
Usage
normalizeReads(readsMatrix)
Arguments
readsMatrix |
a reads matrix with samples in columns and targets in lines (the first column are the targets) |
Value
a normalized reads matrix
Examples
normReads <- normalizeReads(readsMatrixExample)
Example dataset
Description
A dataset for the examples
Usage
readsMatrixExample
Format
A data frame with 11 rows and 6 variables:
- targets
the targets
- sample_1
the number of reads in sample 1
- sample_2
the number of reads in sample 2
- sample_3
the number of reads in sample 3
- sample_4
the number of reads in sample 4
- sample_5
the number of reads in sample 5
...
scoring
Description
scoring
Usage
scoring(k, n, N)
Arguments
k |
number of modified targets on the region |
n |
number of targets on the region |
N |
number of targets in the panel |
Value
the confidence score
Examples
scoring(10,20,150)