Package 'ifCNVR'

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

Help Index


abSamples

Description

abSamples

Usage

abSamples(readsMatrix, conta = "auto", q = 0.99)

Arguments

readsMatrix

a matrix of the number of reads per target

conta

a parameter for the isotree function

q

quantile

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="-")

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)

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)