Title: | Isolation-Forest Based 'CNV' Detection from 'NGS' Data |
---|---|
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>. |
Authors: | Simon Cabello-Aguilar [aut, cre]
|
Maintainer: | Simon Cabello-Aguilar <[email protected]> |
License: | GPL-3 |
Version: | 0.1.0 |
Built: | 2025-02-26 03:29:23 UTC |
Source: | https://github.com/simcab-chu/ifcnv-r |
abSamples
abSamples(readsMatrix, conta = "auto", q = 0.99)
abSamples(readsMatrix, conta = "auto", q = 0.99)
readsMatrix |
a matrix of the number of reads per target |
conta |
a parameter for the isotree function |
q |
quantile |
the aberrant and normal samples
readsMatrix = data.frame(targets=paste0("target_",seq(1,50)), matrix(runif(500),nrow=50,ncol=10)) abSamples(readsMatrix)
readsMatrix = data.frame(targets=paste0("target_",seq(1,50)), matrix(runif(500),nrow=50,ncol=10)) abSamples(readsMatrix)
abTargets
abTargets(readsMatrix, abSamples, opt = "regular", pred = 0.6)
abTargets(readsMatrix, abSamples, opt = "regular", pred = 0.6)
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[) |
a list of dataframes of the targets tagged as outliers
abTargets(readsMatrixExample,abSamples(readsMatrixExample))
abTargets(readsMatrixExample,abSamples(readsMatrixExample))
calculate Ratio
calculateRatio(readsMatrix, abSamples, roi, soi)
calculateRatio(readsMatrix, abSamples, roi, soi)
readsMatrix |
the reads matrix |
abSamples |
the abSamples list result of the abSamples function |
roi |
the region of interest |
soi |
the sample of interest |
the ratio associated with the abTargets
calculateRatio(readsMatrixExample, abSamples(readsMatrixExample), "EGFR-Ex20", "sample_2")
calculateRatio(readsMatrixExample, abSamples(readsMatrixExample), "EGFR-Ex20", "sample_2")
calculate Score
calculateScore( readsMatrix, abSamples, abTargets, roi = "Gene", sep = "-", thrScore = 7 )
calculateScore( readsMatrix, abSamples, abTargets, roi = "Gene", sep = "-", thrScore = 7 )
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 |
the score associated with the abSamples in the desired roi
abS <- abSamples(readsMatrixExample) abT <- abTargets(readsMatrixExample,abSamples(readsMatrixExample)) calculateScore(readsMatrixExample, abS, abT, sep="-")
abS <- abSamples(readsMatrixExample) abT <- abTargets(readsMatrixExample,abSamples(readsMatrixExample)) calculateScore(readsMatrixExample, abS, abT, sep="-")
CreateReadsMatrix
CreateReadsMatrix( bamPath, bedFile, bedtoolsPath, outputFile = "n", verbose = TRUE )
CreateReadsMatrix( bamPath, bedFile, bedtoolsPath, outputFile = "n", verbose = TRUE )
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 |
a reads matrix
bamPath <- system.file("extdata/",package = "ifCNVR") bed <- system.file("bedFile.bed",package = "ifCNVR") bedtools <- 'n' readsMatrix <- CreateReadsMatrix(bamPath, bed, bedtools)
bamPath <- system.file("extdata/",package = "ifCNVR") bed <- system.file("bedFile.bed",package = "ifCNVR") bedtools <- 'n' readsMatrix <- CreateReadsMatrix(bamPath, bed, bedtools)
generateReport
generateReport(outputFile = "n", readsMatrix, resTable, CNVpos)
generateReport(outputFile = "n", readsMatrix, resTable, CNVpos)
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 |
a html report
generateReport()
generateReport()
normalizeReads
normalizeReads(readsMatrix)
normalizeReads(readsMatrix)
readsMatrix |
a reads matrix with samples in columns and targets in lines (the first column are the targets) |
a normalized reads matrix
normReads <- normalizeReads(readsMatrixExample)
normReads <- normalizeReads(readsMatrixExample)
A dataset for the examples
readsMatrixExample
readsMatrixExample
A data frame with 11 rows and 6 variables:
the targets
the number of reads in sample 1
the number of reads in sample 2
the number of reads in sample 3
the number of reads in sample 4
the number of reads in sample 5
...
scoring
scoring(k, n, N)
scoring(k, n, N)
k |
number of modified targets on the region |
n |
number of targets on the region |
N |
number of targets in the panel |
the confidence score
scoring(10,20,150)
scoring(10,20,150)