For detailed documentation please visit: https://cfdnapro.readthedocs.io/en/latest/
cfDNAPro is designed for research only.
Unlike genomic DNA, cfDNA has specific fragmentation patterns. Ambiguous definition of "fragment length" by various alignment software is raising concerns: see page 9 footnote in SAM file format spec: https://samtools.github.io/hts-specs/SAMv1.pdf
Cell-free DNA data fragmentomic analysis requires single-molecule level resolution, which further emphasizes the importance of accurate/un-biased feature extraction.
cfDNAPro
is designed to resolve this issue and standardize the cfDNA fragmentomic analysis using the bioconductor R ecosystem.
cfDNAPro
is specifically written for cell-free DNA paire-ed whole-genome sequencing data.
Its ensures accurate (i.e. up-to-standard) calculation of fragmentomic features (e.g., fragment lengths and motif)
cfDNApro
can extract (i.e., "quantify in a standandised and robust way") these features/bio-markers:
- fragment length
- fragment start/end/upstream/downstream motifs
- copy number variation
- single nucleotide mutation
- more...
Feature extration depends on essential data objects/R packages in the Bioconductor ecosystem, such as Rsamtools
, plyranges
, GenomicAlignments
, GenomeInfoDb
and Biostrings
.
Data engineering depends on packges in the tidyverse ecosystem, such as dplyr
, and stringr
.
All plots depend on ggplot2
R packge.
For issues/feature request etc., please contact:
Author: Haichao Wang
wanghaichao2014@gmail.com
Author: Paulius D. Mennea
paulius.mennea@cruk.cam.ac.uk
Nitzan Rosenfeld Lab admin mailbox:
Rosenfeld.LabAdmin@cruk.cam.ac.uk
Read in bam file, return the fragment length counts. A straightforward and frequent user case: calculate the fragment size of a bam file, use the following code:
# install cfDNAPro newest version
if (!require(devtools)) install.packages("devtools")
devtools::install_github("hw538/cfDNAPro", build_vignettes = FALSE)
# calculate insert size of a bam file
library(cfDNAPro)
frag_lengths <- read_bam_insert_metrics(bamfile = "/path/to/bamfile.bam")
The returned dataframe contains two columns, i.e., "insert_size" (fragment length) and "All_Reads.fr_count" (the count of the fragment length). A screenshot of the output:
Read bam file, return the fragment name (i.e. read name in bam file) and alignment coordinates in GRanges object in R. If needed, you can convert the GRanges into a dataframe and the fragment length is stored in the "width" column.
library(cfDNAPro)
# read bam file, do alignment curation
frags <- readBam(bamfile = "/path/to/bamfile.bam")
# convert GRanges object to a dataframe in R
frag_df <- as.data.frame(frags)
A screenshot of the output:
![image](https://private-user-images.githubusercontent.com/15274940/242287179-49f9cc93-d6af-4503-9b65-bbfea7b5ba87.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQxNTc1NDYsIm5iZiI6MTcyNDE1NzI0NiwicGF0aCI6Ii8xNTI3NDk0MC8yNDIyODcxNzktNDlmOWNjOTMtZDZhZi00NTAzLTliNjUtYmJmZWE3YjViYTg3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODIwVDEyMzQwNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQ5Y2M5MTYyMTgwMWIzN2I5ZGMyNjBjNzBhZGEyN2VkMzVjYjkwNDg3MTg1NmNjZmRjOThjM2E3ZDYyNGE1OGYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.PM74LDdZbrigly_W01mVxYsyZiEdUqMn_-Nmer3Fr8I)
- multiple updates
- Resolved issues when building vignette
- Various updates
- Added/Updated readBam() functions
- In addition to "bam" and "picard" files as the input, now we accept
"cfdnapro" as input_type to various functions, this 'cfdnapro' input is exactly
the output of
read_bam_insert_metrics
function in cfDNAPro package. It is a tsv file containing two columns, i.e., "insert_size" (fragment length) and "All_Reads.fr_count" (the count of the fragment length).
- added support for hg38-NCBI version, i.e. GRCh38
- Modified vignette.
- Modified vignette.
- Added 'cfDNAPro' into the "watched tag".
- Now cfDNAPro supports bam file as input for data characterisation.
- Coding style improvements.
- Documentation improvements.
- Submitted to Bioconductor.
Please install our latest version(highly recommended):
if (!require(devtools)) install.packages("devtools")
library(devtools)
devtools::install_github("hw538/cfDNAPro", build_vignettes = TRUE, dependencies = TRUE)
# run below instead if you don't want to build vignettes inside R
# devtools::install_github("hw538/cfDNAPro", build_vignettes = FALSE, dependencies = FALSE)
Or install the released/steady version (i.e., not newest version, some functions might be missing in comparison to functions shown in this webpage) via Bioconductor:
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("cfDNAPro")
visit: https://cfdnapro.readthedocs.io/en/latest/
Please cite package ‘cfDNAPro’ in publications:
Haichao Wang, Paulius Mennea, Elkie Chan, Hui Zhao, Christopher G. Smith, Tomer Kaplan, Florian Markowetz, Nitzan Rosenfeld(2024). cfDNAPro:An R/Bioconductor package to extract and visualise cell-free DNA biological features. R package version 1.7.1 https://github.com/hw538/cfDNAPro