Abstract
Background
Predicting DNA copy number variations (CNVs) from spatial transcriptomics (ST), including Visium HD, or single-cell RNA-sequencing (scRNA-seq) data helps to distinguish malignant from non-malignant cells and to characterize the clonal architecture of tumor cells. Though there are existing methods of CNV analysis, they are often limited by slow speed, high memory consumption, lower accuracy in the absence of a reference for diploid cells, lower sensitivity at low read counts, and no support for clonal tree construction.
Results
To overcome these issues, we developed the R package fastCNV for detecting CNVs from ST, including Visium HD, or scRNA-seq data. FastCNV pools diploid references across samples and, within each sample, aggregates similar spots or cells with few reads into meta spots or cells. It automatically builds a clonality tree, and runs several times faster than other methods while using less memory. To measure the accuracy of fastCNV, we used 117 cancer cell line samples with both scRNA-seq and bulk whole-exome sequencing (WES) data. FastCNV identified CNVs highly correlated to those calculated from WES data (median correlation above 0.75), showing a significant improvement as compared to other methods such as inferCNV. Notably, fastCNV enables, for the first time, the analysis of CNVs from the Visium HD spatial transcriptomics technology. Applied to Visium HD breast cancer ST data, fastCNV identifies tumor subclones tightly related to different histologies, linking specific genetic aberrations to tumor progression.
Conclusions
FastCNV is a significant improvement on existing R methods for CNV detection from ST, including Visium HD, or scRNA-seq data in terms of speed, memory usage, sensitivity and accuracy. This highlights its potential to advance cancer research and personalized medicine. FastCNV is available at https://github.com/bioinfo-MUST/fastCNV.
Keywords: Bioinformatics, Copy number variation (CNV) analysis, Single cell, Spatial transcriptomics, Cancer genomics, Visium HD
Background
DNA copy number variations (CNVs) play a significant role in diverse pathologies, particularly in cancer. Structural alterations can be pathogenic through deletions inactivating tumor suppressor genes such as TP53 [1] and RB1 [2], or through amplifications activating oncogenes such as MYC [3] and ERBB2 (HER2) [4]. CNVs in cancer progressively accumulate, causing intratumoral heterogeneity and genomic instability. They have been found to be involved in tumor growth [5, 6] and drug resistance [7], thus affecting the prognosis of cancer patients [8]. In a clinical context, accurate detection of CNVs is essential to inform personalized therapeutic strategies [9, 10]. This detection is typically performed through DNA sequencing approaches, such as whole-exome sequencing (WES) or whole genome sequencing (WGS), assisted by computational tools including ControlFREEC [11], FACETS [12] or Wisecondor [13].
Several computational tools have been developed to infer CNVs from RNAseq data. They are based on the assumption that CNVs directly affect transcript abundance, in a way that amplifications usually lead to overexpression and deletions lead to underexpression [14, 15]. The relative level of expression against a diploid reference is used to predict gains and losses from patterns of over- and underexpression [15]. Nevertheless, not every one of the CNVs predicted from transcriptomic data translates into actual genomic alterations since gene expression is also determined by epigenetic mechanisms. Consequently, RNA-based CNV inference lacks the specificity required for clinical diagnostics. Nonetheless, it is extremely helpful in a research context. Notably, the inference of putative CNVs from single-cell or spatial transcriptomic datasets offers valuable insights into tumor heterogeneity and clonal architecture at less cost and complexity than parallel DNA-based profiling. Given the current technical and financial constraints on high-resolution DNA sequencing at the single cell or spatial level, transcriptome-based inference of CNVs represents a scalable and cost-effective alternative for studying tumor evolution and cellular diversity in situ [16].
Several methods have been developed to infer CNVs from ST or scRNA-seq data, including CopyKAT [17] inferCNV [18], SpatialInferCNV [19], Numbat [20] and HoneyBADGER [21] in R, as well as xClone [22] and infercnvpy [23] in Python. The oldest method, inferCNV, is still the most widely used tool in the R community (Supplementary Table 1). Among more recent methods, Numbat is also often cited.
Numbat, HoneyBADGER and xClone stand out for their haplotype-aware inference, which enables the detection of copy-neutral loss of heterozygosity (cnLOH) and focal amplifications. A unique feature of xClone is to identify potential whole-genome doubling. However, their reliance on raw sequencing data (FASTQ/BAM) limits their applicability on public datasets when only processed gene expression matrices are available.
Our primary motivation for developing fastCNV stemmed from the challenges we encountered with existing R-based tools, which are too slow and insufficiently flexible to seamlessly handle either ST or scRNAseq data indifferently [24, 25]. fastCNV was designed to address these challenges, offering improved computational efficiency and compatibility with diverse transcriptomic modalities. In addition, it incorporated advanced features such as integrated visualization tools and automated clonality tree construction, enabling comprehensive exploration of tumor heterogeneity and evolution.
To assess the accuracy of fastCNV results, we applied it to the scRNA-seq data of 117 cancer cell lines published by Kinker et al. [26]. Bulk WES data were also available for these 117 cell lines, all included in the Cancer Cell Line Encyclopedia (CCLE) database. The WES-based CNV profiles of these 117 cell lines, available on depmap.org (ID EH7555), were considered here as a ground-truth reference to benchmark fastCNV results. We further demonstrated the applicability of fastCNV to ST data by showing that it accurately discriminates tumor from non-tumor regions, using histopathological annotations as a reference standard. Importantly, we observed that distinct CNV-derived clones often correspond to regions with different morphological features within the tumor, highlighting the biological relevance of the inferred clonal architecture. Finally, we tested fastCNV on a Visium HD dataset, demonstrating its ability to successfully process high-resolution spatial transcriptomic data. To our knowledge, this constitutes the first CNV analysis performed on Visium HD, further underscoring the versatility of the fastCNV method.
Implementation
Input data
The fastCNV R package processes spatial transcriptomics or single cell RNA-sequencing data, previously imported using the Seurat R package [27] which produces Seurat objects. The main input of the fastCNV function is either a Seurat object, when dealing with one sample, or a list of Seurat objects, when dealing with several samples (Fig. 1). Working with a list of Seurat objects (each corresponding to one sample) allows us to share the information of several samples for some analytical steps, as illustrated later.
Fig. 1.

Overview of the fastCNV workflow. a The fastCNV() function takes as input a Seurat object (or a list of Seurat objects) and processes it to predict CNVs. It returns a Seurat object (or list of Seurat objects) with the corresponding CNV results. Optionally a graphical output (pangenomic heatmap(s)) can also be produced. b The CNVTree() function takes as input a Seurat Object with CNV results and returns an annotated clonality tree and its graphical representation
Diploid reference
Specifying spots/cells corresponding to a diploid reference is expected to improve the accuracy of fastCNV results. This can be done by indicating a variable (from the metadata table) and the related values corresponding to a diploid status. For example, for a variable called ‘cell type’ with the following values: ‘tumor’, ‘normal epithelium’, ‘immune’ and ‘stromal’, values other than ‘tumor’ would typically correspond to a diploid status. If this information is provided, fastCNV will gather the diploid reference spots/cells from all Seurat objects, meaning that the same reference will be used to analyze all Seurat objects. This pooling approach supposes that samples are of similar types, as it appears very challenging to define a universal diploid reference (for transcriptome data).
If no diploid reference is provided, which might produce suboptimal CNV results, all spots/cells will serve as the “diploid” reference and their pooling across Seurat objects is then optional.
Virtual increase in sequencing depth
A low sequencing depth, resulting in a low number of reads per spot/cell, is a limiting factor for the identification of CNVs. As a consequence, fastCNV first proceeds with a step aimed at aggregating similar spots/cells in meta-spots/meta-cells, in order to reach a sufficient total number of reads for the identification of CNVs (Cf. prepareCountsForCNVAnalysis function). To identify similar spots/cells, we perform unsupervised clustering of spots/cells, based on their expression profiles. To do so, we use the Seurat FindClusters() function for scRNA-seq data and, to integrate spatial information, the Banksy method [28] for Visium non-HD ST data. The clustering resolution can be adjusted by the user. The obtained clusters of spots/cells are further subdivided by cell type or histological feature, if this information is given. Within each (sub)cluster, the idea is now to obtain any partition (i.e., binning) of the spots/cells allowing to aggregate them into meta-spots/cells, each containing a minimum total number of reads (by default: 15,000 reads). We simply build this partition sequentially. Typically, in Visium (non-HD) ST data, meta-spots correspond to 1 to 3 original spots, using default parameters. This step leads to a new gene count matrix at the level of meta-spots or meta-cells. Finally, in the original gene count matrix, we impute each spot/cell with the corresponding meta-spot/meta-cell. Doing so we keep the original granularity in terms of spots/cells, while getting more reads per spot/cell.
Genomic regions
To calculate CNV scores per genomic region (Cf. CNVAnalysis function), we need to define genomic regions, i.e. segments of the genome including a certain number of genes.
We first map all the genes present in the gene count matrix (of the Seurat objects) to the human genome, using the gene information downloaded from Ensembl [29], which provides for each gene the corresponding chromosome and start/end positions. We also determine and store for each gene the chromosome arm information. Genes are then ordered according to their chromosome numbers and start positions.
As genes with low or null expression across most spots/cells are expected to be less informative for CNV identification, we keep only the N most expressed genes (default N = 7000), based on the average of raw counts across spots/cells from the diploid reference. If in any given chromosome arm, less than 200 genes are among the N selected genes, the 200 most expressed genes in that chromosome arm are also kept; in this case, the final gene selection contains more than N genes.
The above selected genes (ordered by genomic positions) are then used to build overlapping genomic regions covering all the genome, by using a moving window per chromosome arm and based on two user-defined parameters: (i) the size of each region, i.e. the number of genes it shall contain (default: 150 genes), and (ii) the step between two consecutive regions (default: 10 genes). Using the default parameters, about 250 genomic regions are obtained.
Raw CNV scores
The gene count matrix is log2-transformed (after adding 1 to all values) then zero-centered per spot/cell, yielding a normalized gene expression matrix. We then calculate per gene a scaling factor, corresponding to the average normalized expression across spots/cells serving as the diploid reference. When the reference is defined by several modalities of a variable (ex. cell type in {“normal epithelium”, ”immune”, ”stromal”}) the scaling factor is calculated as the average of the averages per modality. For each gene, the normalized data are scaled by subtracting the corresponding scaling factor. Then values below − 3 are set to -3, and those above 3 are set to 3; this truncation is performed to avoid overweighting genes with a high dynamic range. This yields a scaled normalized gene expression matrix, with all values between − 3 and 3.
For each genomic region, raw CNV scores are calculated per spot/cell as the average of the above defined scaled normalized data, across all genes included in the genomic region. We thus obtain a (genomic regions x spots/cells) matrix of CNV scores, for each Seurat object. This matrix is added to each Seurat object, as a new assay, labelled “rawGenomicScores”. By construction, all CNV scores range from − 3 to 3. CNV scores around zero generally correspond to a diploid status, while negative and positive CNV scores typically indicate losses and gains, respectively.
Denoised CNV scores
From the raw CNV scores we derive denoised CNV scores, where raw CNV scores around zero are set to zero. More precisely, we calculate per genomic region the 1st and 99th percentiles of raw CNV scores across spots/cells serving as the diploid reference. CNV scores falling between these two percentiles are then set to zero. The percentiles used for denoising can be adjusted by the user (Fig S1). The resulting matrix is added to each Seurat object, as a new assay, labelled “genomicScores”. The denoised CNV scores enhance the contrast between (putative) diploid and non-diploid statuses, which can notably be useful for graphical visualizations.
CNV fractions
The pangenomic CNV fraction for each cell/spot is computed as the proportion of non-zero denoised CNV scores across all genomic regions, independently for each Seurat object. The corresponding vector is added to the metadata matrix of each Seurat object, as a new column labelled “cnv_fraction”. The CNV fraction of any spot/cell ranges from 0 to 1, and reflects the proportion of genomic regions containing CNVs for that spot/cell, that is a score of chromosomal instability (CIN score). For a spot (ST data), it might also reflect the tumor purity (i.e., the proportion of tumor non-diploid cells within that spot).
CNV scores per chromosome arm
FastCNV computes CNV scores per chromosome arm (using denoised scores by default), resulting in a (spots/cells x chromosome arms) matrix (Cf. CNVPerChromosomeArm function). Each cell of this matrix contains the average CNV score across the genomic regions of the related chromosome arm, for the concerned spot/cell. This information is inserted as new columns (one per chromosome arm) in the metadata table of each Seurat object.
Clustering of spots/cells based on CNV scores
Within each Seurat object, we cluster spots or cells based on their CNV scores (using denoised scores by default), thus enabling subclonality to be detected, with distinct clusters assumed to represent distinct subclones (Cf. CNVCluster function). This is performed using hierarchical clustering (with Ward linkage and Manhattan distance) when the number of spots/cells is less than 30,000, and using the kmeans otherwise. The optimal number of clusters is automatically determined by identifying the inflection point, known as the elbow point, on the within-cluster sum of squares curve. Sometimes we obtain highly similar clusters differing solely slightly in terms of CNV scores intensities, which means that the same subclone is separated into several clusters. To avoid this problem, fastCNV merges clusters whose centroids are highly correlated. The clusters can be computed either across all the cells/spots, or across cells/spots related to specific annotations (e.g., only tumor cells/spots).
Pangenomic visualization of CNVs
The plotCNVResults function produces a pangenomic heatmap visualization of the CNV scores, for a given Seurat object. It is based on the ComplexHeatmap [30] package. Users can easily modify the annotations plotted in the heatmap, print it to the R console, and/or save it as a PDF or PNG file.
Clonality tree
The CNVTree function allows building a clonality tree from a Seurat object that includes CNV results. It starts with the (CNV-based) clusters of spots/cells, seen as subclones, and computes the centroid of each cluster. It thus produces a matrix (genomic regions x clusters) containing the average CNV score across spots/cells of each cluster for each genomic region (cf. generateCNVClonesMatrix function). It then computes pairwise distances between the cluster’s centroids, using the euclidean distance by default. The resulting distance matrix is then analyzed with phylogenetic functions from the ape [31] or phangorn [32] R packages (depending on the options chosen by the user) to infer the clonality tree structure (Cf. buildCNVTree function).
Each branch of the clonality tree is then automatically annotated in terms of the chromosome arm gains and losses shared by all children branches and not present in the parent branch (Cf. annotateCNVTree function). A user-defined threshold (to be applied on CNV scores) is used to filter the CNV events (i.e., gains and losses) considered in this analysis. The annotations (CNV events) of the clonality tree can also be manually curated to refine the final output.
Visualization of the clonality tree
The annotated clonality tree can be plotted using the plotCNVTree function, which is based on the ggtree package [33], enabling various customizations.
Results
Validation of fastCNV on CCLE cell line data
To evaluate the reliability of fastCNV results, we used 117 cancer cell lines from the CCLE database [34], for which both bulk WES and scRNA-seq data were publicly available. From the original pool of cell lines in Kinker et al. (n = 198), we selected those with more than 200 cells that passed quality control (n = 122). Then, we filtered this list to only those for which the true copy number was available in the R package ExperimentHub, resulting in a final set of 117 cell lines. We used the WES-based CNV data (gene level log copy number) as the ground-truth reference. It was retrieved using the ExperimentHub R package [35] (experiment ID: EH7555). The scRNA-seq data (raw gene counts) of these cell lines included 41,035 cells and were downloaded from the Broad Institute’s Single Cell Portal (series ID: SCP542).
We applied fastCNV to the scRNA-seq data of each cell line, obtaining raw and denoised CNV scores per genomic region and per cell. We did not specify a diploid reference in that case, as it was difficult to define given the wide diversity of cancer types in this series. We averaged scores across all cells of each cell line, obtaining a (genomic regions x cell lines) matrix for the raw CNV scores, and another for the denoised ones. We also averaged, per genomic region, the gene level WES-derived CNV data, obtaining a (genomic regions x cell lines) matrix. We then calculated per cell line the correlation between CNV scores obtained from fastCNV and those coming from WES data, as illustrated for the cell line TE10_OESOPHAGUS (Fig. 2a).
Fig. 2.

Validation of CNV scores on paired WES and scRNA-seq data of CCLE cell lines. a Scatter plot comparing raw CNV scores obtained using fastCNV on scRNA-seq data with WES-based CNV scores, for the TE10_OESOPHAGUS cell line. The dashed line represents the corresponding linear model. b Boxplot showing the distribution of per-cell-line correlations between predicted CNV scores and WES-based CNV scores for fastCNV (green), inferCNV (blue), xClone (purple), and Numbat (orange), computed on scRNA-seq data from 117 CCLE cell lines (each dot represents one cell line). Note that only 96 cell lines could be analysed with Numbat and 108 for xClone. P values correspond to paired t-tests comparing the correlations of fastCNV with those of inferCNV, xClone, and Numbat, respectively. c Boxplot showing the distribution of per-cell-line correlations between fastCNV raw CNV scores (scRNA-seq data) and WES-based CNV scores across 117 CCLE cell lines, where cell lines are grouped by degree of WES-based CNV fraction (<5%, 5-10%, 10-40%, >40%). d-e Barplots showing the median computational time (d) and peak RAM usage (e) for fastCNV, inferCNV, xClone and Numbat on 117 cell lines, excluding preprocessing steps
FastCNV raw CNV scores were overall highly correlated to the ground-truth (median = 0.76, mean 0.72) (Fig. 2b). Denoised CNV scores were also highly correlated to the reference (median = 0.71, mean = 0.67), but significantly less than raw scores (paired t-test P < 0.001) (Fig. S2).
The few cell lines with a weak correlation between WES-based (ground truth) and scRNA-seq derived CNV scores mostly had little to no CNV (Fig. 2c), those having a correlation below 0.5 showing a much lower CNV fraction (CIN score) than the other cell lines (Welch’s t-test, P < 0.001). The cell lines with a low (< 10%) WES-based CNV fraction largely corresponded to those having a low fastCNV-based CNV fraction (< 10%) (chi-squared test, P < 1e-10), showing that fastCNV identifies accurately tumor with a low CNV fraction.
Overall, these results demonstrate, across a broad range of cancer cell lines, that fastCNV provides accurate CNV results.
Comparison of fastCNV, inferCNV, Numbat and xClone on CCLE cell line data
We applied inferCNV to the same scRNA-seq data (gene count matrix). For each cell line, the inferCNV output consisted of a genes × cells matrix of raw CNV scores and a second matrix of denoised CNV scores. These scores are not directly referenced to genomic regions, but rather to a set of approximately 2,000 genes distributed along the genome. However, since each gene score is computed by aggregating information from neighboring genes, each gene effectively represents a genomic region. We averaged these scores across cells per cell line, obtaining two genes × cell lines matrices of averaged raw and denoised scores, respectively. We then extracted from the WES-based gene level log copy number data the subset corresponding to genes shared with the inferCNV output, yielding a genes × cell lines matrix. We calculated the per-cell-line correlation between inferCNV scores and WES-based scores. Raw scores were more correlated with the ground truth (median = 0.63, mean = 0.59) (Fig. 2b) than denoised scores (median = 0.57, mean = 0.53) (Fig. S2).
We also benchmarked xClone and Numbat on this CCLE cell line dataset, both needing BAM files as input. Since BAM files from this dataset are pooled by default, they were first split by cell line using SAMtools prior to CNV analysis.
For xClone, BAM files were first pre-processed separately for each cell line using the xcltk tool with default settings. The processed data from all cell lines were then combined into a single data object (AnnData) and analyzed together using xClone. All cells (across all cell lines) were designated as reference cells, and the cell line identity was used as the grouping variable. Copy number were estimated using xClone’s read depth ratio (RDR) module. To enable direct comparison with the WES-based ground truth, we exported a genes × cell lines matrix containing gene-level smoothed log ratio CNV scores averaged per cell line. We calculated the per-cell-line correlation between these scores and WES-based gene level log copy number data (median = 0.60, mean = 0.55) (Fig. 2b).
For Numbat, pileup and phasing of the sequencing reads were performed individually per cell line using default parameters. For all cell lines passing pileup, Numbat was then run with default parameters, yielding for each cell line a consensus segmentation file reporting CNV status (gain, neutral, or loss). We converted these segmentation files into a genes x cell lines matrix with discrete values representing CNV statuses (gain = 1, neutral = 0, loss = − 1). We calculated the per-cell-line correlation between these scores and WES-based gene level log copy number data (median = 0.31, mean = 0.31) (Fig. 2b). Note that Numbat reports discrete CNV states rather than continuous scores, which inherently limits the correlation with WES-based continuous log copy number values.
The CNV scores from fastCNV were significantly more correlated with the ground truth than those of inferCNV, Numbat, and xClone (paired t-test, all P < 0.001 ; Fig. 2b), demonstrating that fastCNV outperforms these methods on this metric in this benchmark. Regarding computational efficiency (Fig. 2d), fastCNV was approximately 12 times faster than inferCNV and more than 130 times faster than xClone and Numbat — not counting the substantial preprocessing steps required by these two methods — completing CNV inference for all 117 cell lines in approximately 90 s, compared to more than 18 min for inferCNV, more than 3 h for xClone, and almost 4 h for Numbat. Peak RAM usage for fastCNV was 47% that of inferCNV (15 GiB vs. 32 GiB), 21% that of xClone (73 GiB), and 16% that of Numbat (95 GiB) (Fig. 2e). All these tests were performed on a server with an AMD EPYC 9654 processor.
Application of fastCNV to colon cancer scRNA-seq data
We applied fastCNV to a colon cancer scRNA-seq sample (ID C113) from Pelka et al. series [36] (Fig. 3), containing epithelial, lymphoid, myeloid and mesenchymal cells (for a total of 1454 cells). We used non-epithelial cells as the diploid reference. The matrix of denoised CNV scores is shown as a pangenomic heatmap, with genomic regions (columns) ordered by chromosome, and cells (rows) organized in five CNV-based clusters (Fig. 3a). FastCNV infers a clonality tree from centroids (at the chromosome arm level) of these five clusters (Fig. 3b). The CNV annotations of the tree branches are derived from these centroids, discretized using a default threshold (Fig. 3c). We then calculated the UMAP embedding of the gene count matrix, thus identifying nine groups of cells, clearly related to distinct cell lineages, with epithelial (n = 4), lymphoid (n = 3), myeloid (n = 1), and mesenchymal (n = 1) groups (Fig. 3d). The four epithelial groups map to distinct subclones (Fig. 3e) and show different CNV fractions (Fig. 3f), three of them being clearly malignant. One of the epithelial groups shows a very low CNV fraction, and might correspond to pre-malignant cells. In conclusion, fastCNV allows here to identify malignant cells and the related clonal architecture, explaining a large part of the groups of cells that emerge from unsupervised analysis through UMAP embedding.
Fig. 3.

Illustration of subclonal heterogeneity in scRNA-seq colon cancer data. Analysis of the C113 colon cancer scRNA-seq sample from Pelka et al series. a Pangenomic heatmap showing the (cells x genomic regions) matrix of fastCNV denoised CNV scores. The genomic regions are in genomic order, the cells are ordered according to CNV clusters (1 to 4). CNV scores corresponding to copy gains (respectively losses) are in red (respectively blue), those corresponding to a diploid status are in white. The cell lineage of each cell is indicated (red: epithelial, blue: lymphoid, black: mesenchymal, green: myeloid). b Phylogenetic tree based on CNV clusters 1 to 4, seen as subclones, depicting the corresponding subclonal evolution in terms of CNV events. c Heatmap showing CNV scores per CNV cluster and chromosome arm, computed from the centroid profiles of each CNV cluster. d UMAP plot of the normalized scRNA-seq data showing cells colored by their lineage. e UMAP plot of single cells colored by CNV-based clusters. f UMAP plot showing the CNV fraction per cell
Application of fastCNV to colon cancer Visium ST data
We applied fastCNV to a colon cancer Visium ST FFPE sample (10x Genomics) from the Valdeolivas et al. series [37], containing spots annotated as tumor, non-tumor mucosa and immune cells (Fig. 4a-b). Histological annotations were derived from those provided in the original publication. For clarity, the original categories were grouped as follows: “epithelium&submucosa”, “non neo epithelium”, and “submucosa” were grouped under “NoTumor”; “IC aggregate_submucosa” was relabeled as “Lymphocytes”; and “tumor”, “tumor&stroma_IC met to high”, and “stroma_fibroblastic_IC high” were combined into the “Tumor” category. All the spots, except the tumor ones, were used as the diploid reference. The denoised CNV scores are presented in the form of a pangenomic heatmap, with spots organized in three CNV-based clusters (Fig. 4c). FastCNV infers a clonality tree from centroids (at the chromosome arm level) of these three clusters (Fig. 4d). The CNV annotations of the tree branches are derived from these centroids, discretized using a default threshold (Fig. 4e). To improve the CNV annotations of this clonality tree we manually curated them (Fig. 4f-g). The subclones are spatially segregated: subclone 1, devoid of CNV, maps to the non-tumor region, subclone 2, with numerous CNVs, maps to the right part of the tumor region and subclone 3, with an intermediate number of CNVs, maps to the left and bottom part of the tumor region (Fig. 4h). Accordingly, the spatial distribution of the CNV fractions also shows clear regional patterns (Fig. 4i).
Fig. 4.

Illustration of subclonal heterogeneity in spatial transcriptomics colon cancer data. Analysis of the SN048_A121573_Rep1 colon cancer Visium ST sample from Valdeolivas et al. series. a H&E coloration of the tissue slide. b Spots of the Visium ST slide are colored according to the histological annotation (tumor: red, non-tumor: blue, immune cells: green). c Pangenomic heatmap showing the (spots x genomic regions) matrix of fastCNV denoised CNV scores, with spots ordered according to CNV clusters (1 to 3). The histological annotations per spot are given on the right. d Phylogenetic tree based on CNV clusters 1 to 3, seen as subclones, depicting the corresponding subclonal evolution in terms of CNV events. e Heatmap showing CNV scores per CNV cluster and chromosome arm, computed from the centroid profiles of each CNV cluster. f Heatmap displaying discretized CNV events by chromosome arm (copy gain: red, copy loss: blue, diploid status: white) across CNV clusters after curation. g Phylogenetic tree based on CNV clusters 1 to 3. Branches are annotated using curated CNV events. Spots of the Visium ST slide are colored according to (h) CNV clusters (1: red, 2: green, 3: blue) and (i) pangenomic CNV fraction (low: white, high: blue)
Application of fastCNV to breast cancer Visium HD ST data
We applied fastCNV to a breast cancer Visium HD sample obtained from the 10x Genomics website (Fig. 5). Despite the high computational demands of this dataset — approximately 500,000 spots at 8 μm resolution and 150,000 spots at 16 μm resolution, fastCNV runs efficiently on a high-memory server, with peak RAM usage of ~ 200 GB for 8 μm resolution. At 16 μm resolution, the analysis can also be performed on a local workstation with 64 GB of RAM (peak usage ~ 50 GB). This sample contains tumor and non-tumor regions; the latter serves as the diploid reference (Fig. 5a). Based on the denoised CNV scores, six CNV-based clusters are identified (Fig. 5b). Some of these clusters show very different CNV fractions (Fig. 5c) and map to distinct tumor regions (Fig. 5d). The spatial distribution of these clusters shows that they corresponded closely to morphological patterns: cluster 4, with extensive CNVs, corresponds to a region of high histological grade, cluster 6 highlights a preinvasive ductal carcinoma in situ (DCIS) lesion, suggesting it evolved independently from the invasive tumor and did not acquire invasive traits, while cluster 5 characterized by the typical 1q gain and minimal rearrangement corresponds to a non-tumoral dysplastic lesion (Fig. 5e). Additional CNV metrics, such as CNV fraction and arm-level alterations, also delineate tumor subregions with distinct genomic profiles such as 11q gain or loss (Fig. 5f-g). Based on the CNV clusters, fastCNV reconstructed a clonality tree that describes the presumed sequence of subclone emergence and tumor evolution (Fig. 5h).
Fig. 5.

Illustration of subclonal heterogeneity in Visium HD breast cancer data. Analysis of the Visium_HD_FF_Human_Breast_Cancer Visium HD sample from the 10x Genomics database. a Spots of the Visium HD slide are colored according to tumor status (tumor: blue, non-tumor: pink). b Pangenomic heatmap showing the (spots x genomic regions) matrix of fastCNV denoised CNV scores, with spots ordered according to CNV clusters (1 to 6). The histological annotations per spot are given on the right. c Boxplots showing the pangenomic CNV fraction per CNV cluster. d Spots of the Visium HD slide are colored according to the CNV clusters (1 to 6). e H&E-stained slide, with contours focusing on regions related to distinct histologies. Spots of the Visium HD slide are colored according to (f) the pangenomic CNV fraction and (g) the CNV status for chromosome 11 arm q. h Phylogenetic tree based on CNV clusters 1 to 6. Branches are annotated using curated CNV events at the chromosome arm level
Collectively, these results demonstrate that fastCNV captures high-resolution, spatially resolved CNV heterogeneity, offering insights into tumor composition and evolutionary dynamics. To our knowledge, it is the only method demonstrated to run on Visium HD data.
Conclusions
fastCNV is a comprehensive tool balancing speed and accuracy to support the analysis of increasingly large and complex transcriptomics datasets, such as those generated by Visium HD technology. With efficient support for high-resolution data at tens to hundreds of thousands of spatial spots, fastCNV addresses the significant need for scalable CNV detection in spatial contexts. Its ability to distinguish tumor from non-tumor regions and resolve subclonal architecture provides valuable insights into tumor heterogeneity. The main limitations of fastCNV are its inability to identify copy-neutral LOH (cnLOH), focal amplifications, and whole-genome doubling, unlike haplotype-aware methods (e.g., Numbat, HoneyBADGER, xClone). These limitations stem directly from using only the gene count matrix as input. This choice ensures that fastCNV can be applied across a wide range of cases, particularly to public datasets lacking raw data (fastq/BAM). Moreover, fastCNV’s reduced computational resource requirements compared to existing approaches makes it accessible to a wider range of research settings. FastCNV also offers practical advantages in terms of ease of deployment. Unlike inferCNV, which relies on external dependencies such as JAGS that can present installation challenges in certain computing environments, fastCNV has minimal dependency requirements, facilitating straightforward installation. As transcriptomics moves forward towards higher resolution and complexity, fastCNV offers a robust foundation for further research aimed at unraveling the genetic and spatial dynamics of complex tissues.
Supplementary Information
Acknowledgements
We thank Roseline Vibert, Camilla Pilati, Bastien Rance and Alix Yan for fruitful discussions.
Computing environment
All the fastCNV analyses presented here were initially performed on a workstation with 20 CPU cores and 64 GB of RAM. However, as xClone and Numbat require substantially greater computational resources — particularly for pre-processing — all benchmarking analyses (Fig. 2) were subsequently run on a server equipped with an AMD EPYC 9654 processor.
Abbreviations
- CCLE
Cancer Cell Line Encyclopedia
- cnLOH
Copy-neutral loss of heterozygosity
- CNV
Copy number variations
- scRNA-seq
Single cell RNA sequencing
- ST
Spatial transcriptomics
- WES
Whole-exome sequencing
- WGS
Whole-genome sequencing
Authors' contributions
GC : Development, Data analysis, Interpretation, Writing – original draft, Writing – review & editing. MS : Development, Data Analysis. HC : Data Analysis, Interpretation, Writing – review. AC : Interpretation. NS : Feedback. LJ : Data Analysis. TZH : Data Analysis, Interpretation, Feedback, Writing – review & editing. SMR : Interpretation, Feedback. PLP : Interpretation, Writing – review & editing. CS : Supervision, Development, Interpretation, Feedback, Writing – review & editing. AdR : Supervision, Development, Interpretation, Feedback, Writing – original draft, Writing – review & editing. All authors read and approved the final manuscript.
Funding
This study was supported by grants from the French Ministry of Health, the French Ministry of Research and the French National Cancer Institute (Chair of Excellence 2021 ‘Bioinformatics in Oncology’ – IDEX Université Paris Cité ; PRT-K 2023 IMPROCOCA – Université Paris Cité ; PRT-K 2022 SELECT – Institut Curie ; Tabac 2019 SENACLE – Gustave Roussy ; SIRIC 2025 CARPEM – AP-HP), the French League Against Cancer (Equipe Labellisée LNCC 2023), the Foundation for Medical Research (PhD fellowship 2020 for M. Sroussi), the ARC Foundation for Research Against Cancer (PhD fellowship 2023 for A. Cazelles), the European Union Horizon Europe program (GENIAL project, grant N° 101096312 – ULB ; THRIVE project, grant N°101136622 - IDIBAPS).
Data availability
The scRNA-seq data for the 117 cancer cell lines from the CCLE are publicly available via the Broad Institutes Single Cell Portal under accession number SCP542. The scRNA-seq colon expression count matrix is accessible through GEO under accession [GSE178341](https:/www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE178341). The spatial transcriptomics slide of colon cancer tissue used in this study is available on Zenodo at [https://zenodo.org/records/7760264](https:/zenodo.org/records/7760264). The Visium HD breast slide can be accessed via 10x Genomics' public datasets portal at [https://www.10xgenomics.com/datasets](https:/www.10xgenomics.com/datasets). The fastCNV R package is available on GitHub (https://github.com/bioinfo-MUST/fastCNV) and Zenodo (https://doi.org/10.5281/zenodo.21339142).
Declarations
Ethics approval and consent to participate
Not applicable.
Consent for publication
Not applicable.
Competing interests
AdR received fees from Qlucore, and is a cofounder and shareholder of Minos Biosciences and Lilo biomedical solutions. PLP is a cofounder and shareholder of MethysDX. He received personal fees from MSD, Biocartis, BMS, Servier, Pierre Fabre. The remaining authors declare that they have no competing interests.
Supplementary Information
The online version contains supplementary material available at https://doi.org/10.1186/s13073-026-01731-w.
Footnotes
Publisher’s note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Gadea Cabrejas and Marine Sroussi contributed equally to this work.
Clarice Groeneveld and Aurélien de Reyniès jointly supervised this work.
References
- 1.Shah V, Johnson DC, Sherborne AL, et al. Subclonal TP53 copy number is associated with prognosis in multiple myeloma. Blood. 2018;132(23):2465–9. 10.1182/blood-2018-06-857250. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 2.Livide G, Epistolato MC, Amenduni M, et al. Epigenetic and copy number variation analysis in retinoblastoma by MS-MLPA. Pathol Oncol Res. 2012;18(3):703–12. 10.1007/s12253-012-9498-8. [DOI] [PubMed] [Google Scholar]
- 3.Lee KS, et al. c-MYC Copy-Number Gain Is an Independent Prognostic Factor in Patients with Colorectal Cancer. PLOS One vol. Oct. 2015;10(1). . 10 e0139727. 10.1371/journal.pone.0139727 [DOI] [PMC free article] [PubMed]
- 4.Slamon DJ, Clark GM, Wong SG, Levin WJ, Ullrich A, McGuire WL. Human breast cancer: correlation of relapse and survival with amplification of the HER-2/neu oncogene. Science. 1987;235(4785):177 – 82. 10.1126/science.3798106. PMID: 3798106. [DOI] [PubMed]
- 5.Ren L, Liu J, Gou K, Xing C. Copy number variation and high expression of DNA topoisomerase II alpha predict worse prognosis of cancer: a meta-analysis. J Cancer. 2018;9(12):2082–92. 10.7150/jca.23681. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 6.Sdeor E, Okada H, Saad R, Ben-Yishay T, Ben-David U. Aneuploidy as a driver of human cancer. Nat Genet. 2024;56(10):2014–26. 10.1038/s41588-024-01916-2 . Epub 2024 Oct 2. PMID: 39358600. [DOI] [PubMed] [Google Scholar]
- 7.Sharma, S. V., Lee, D. Y., Li, B., Quinlan, M. P., Takahashi, F., Maheswaran, S.,… Settleman, J. (2007). A chromatin-mediated reversible drug-tolerant state in cancer cell subpopulations. Cell, 141(1), 69–80. 10.1016/j.cell.2010.02.027. [DOI] [PMC free article] [PubMed]
- 8.Liu L, Bai X, Wang J, et al. Combination of TMB and CNA stratifies prognostic and predictive responses to immunotherapy across metastatic cancer. Clin Cancer Res. 2019;25(24):7413–23. 10.1158/1078-0432.CCR-19-0558. [DOI] [PubMed] [Google Scholar]
- 9.Riggs ER, Andersen EF, Cherry AM, Kantarci S, Kearney H, Patel A, Raca G, Ritter DI, South ST, Thorland EC, Pineda-Alvarez D, Aradhya S, Martin CL. Technical standards for the interpretation and reporting of constitutional copy-number variants: a joint consensus recommendation of the American College of Medical Genetics and Genomics (ACMG) and the Clinical Genome Resource (ClinGen). Genet Med. 2020;22(2):245–257. 10.1038/s41436-019-0686-8. Epub 2019 Nov 6. Erratum in: Genet Med. 2021;23(11):2230. doi: 10.1038/s41436-021-01150-9. PMID: 31690835; PMCID: PMC7313390. [DOI] [PMC free article] [PubMed]
- 10.Sun S, Ji Y, Shao D, Xu Y, Yang X, Sun L, Li N, Huang H, Wu Q. Genomic insights into prenatal diagnosis of congenital heart defects: value of CNV-seq and WES in clinical practice. Front Genet. 2024;15:1448383. 10.3389/fgene.2024.1448383. PMID: 39205944; PMCID: PMC11349688. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 11.Boeva V, Popova T, Bleakley K, Chiche P, Cappo J, Schleiermacher G, Janoueix-Lerosey I, Delattre O, Barillot E. Control-FREEC: a tool for assessing copy number and allelic content using next-generation sequencing data. Bioinformatics. 2012 Feb 1;28(3):423-5. 10.1093/bioinformatics/btr670. Epub 2011 Dec 6. PMID: 22155870; PMCID: PMC3268243. [DOI] [PMC free article] [PubMed]
- 12.Shen R, Seshan VE. FACETS: allele-specific copy number and clonal heterogeneity analysis tool for high-throughput DNA sequencing. Nucleic Acids Res. 2016 Sep 19;44(16):e131. 10.1093/nar/gkw520. Epub 2016 Jun 7. PMID: 27270079; PMCID: PMC5027494. [DOI] [PMC free article] [PubMed]
- 13.Straver R, Sistermans EA, Holstege H, Visser A, Oudejans CB, Reinders MJ. WISECONDOR: detection of fetal aberrations from shallow sequencing maternal plasma based on a within-sample comparison scheme. Nucleic Acids Res. 2014 Mar;42(5):e31. 10.1093/nar/gkt992. Epub 2013 Oct 28. PMID: 24170809; PMCID: PMC3950725. [DOI] [PMC free article] [PubMed]
- 14.Patel AP, Tirosh I, Trombetta JJ, Shalek AK, Gillespie SM, Wakimoto H, Cahill DP, Nahed BV, Curry WT, Martuza RL, Louis DN, Rozenblatt-Rosen O, Suvà ML, Regev A, Bernstein BE. Single-cell RNA-seq highlights intratumoral heterogeneity in primary glioblastoma. Science. 2014;344(6190):1396–401. 10.1126/science.1254257 . Epub 2014 Jun 12. PMID: 24925914; PMCID: PMC4123637. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 15.Tirosh I, Venteicher AS, Hebert C, Escalante LE, Patel AP, Yizhak K, Fisher JM, Rodman C, Mount C, Filbin MG, Neftel C, Desai N, Nyman J, Izar B, Luo CC, Francis JM, Patel AA, Onozato ML, Riggi N, Livak KJ, Gennert D, Satija R, Nahed BV, Curry WT, Martuza RL, Mylvaganam R, Iafrate AJ, Frosch MP, Golub TR, Rivera MN, Getz G, Rozenblatt-Rosen O, Cahill DP, Monje M, Bernstein BE, Louis DN, Regev A, Suvà ML. Single-cell RNA-seq supports a developmental hierarchy in human oligodendroglioma. Nature. 2016;539(7628):309–13. 10.1038/nature20123 . Epub 2016 Nov 2. PMID: 27806376; PMCID: PMC5465819. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 16.Navin NE. The first five years of single-cell cancer genomics and beyond. Genome Res. 2015;25(10):1499–507. 10.1101/gr.191098.115 . PMID: 26430160; PMCID: PMC4579335. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 17.Gao, R., Bai, S., Henderson, Y. C., Lin, Y., Schalck, A., Yan, Y., … Navin, N. E.(2021). Delineating copy number and clonal substructure in human tumors from single-cell transcriptomes. Nature Biotechnology, 39(5), 599–608. 10.1038/s41587-020-00795-2. [DOI] [PMC free article] [PubMed]
- 18.Tickle T, Tirosh I, Georgescu C, Brown M, Haas B. inferCNV of the Trinity CTAT Project. Broad Institute of MIT and Harvard, Cambridge, MA, USA: Klarman Cell Observatory; 2019. https://github.com/broadinstitute/inferCNV. [Google Scholar]
- 19.Erickson A, He M, Berglund E, et al. Spatially resolved clonal copy number alterations in benign and malignant tissue. Nature. 2022;608:360–7. 10.1038/s41586-022-05023-2. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 20.Gao T, Soldatov R, Sarkar H, Kurkiewicz A, Biederstedt E, Loh PR, Kharchenko P. Haplotype-aware analysis of somatic copy number variations from single-cell transcriptomes. Nat Biotechnol. 2022. 10.1038/s41587-022-01380-4. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 21.Fan J, Lee HO, Lee S, et al. Linking transcriptional and genetic tumor heterogeneity through allele analysis of single-cell RNA-seq data. Genome Res. 2018;28(8):1217–27. 10.1101/gr.228080.117. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 22.Huang R et al. Aug. Robust analysis of allele-specific copy number alterations from scRNA-seq data with XClone. Nature communications vol. 15,1 6684. 6 2024, 10.1038/s41467-024-51026-0. [DOI] [PMC free article] [PubMed]
- 23.https://github.com/icbi-lab/infercnvpy.
- 24.Xin Chen LT, Chen FZ, Chen W, Wu H, Zhu B, Moos M Jr, Farmer A, Zhang X, Xiong W, Gong S, Jones W, Mason CE, Wu S, Wang CXC. A benchmarking study of copy number variation inference methods using single-cell RNA-sequencing data. Precision Clin Med. 2025;pbaf011. 10.1093/pcmedi/pbaf011. [DOI] [PMC free article] [PubMed]
- 25.Minfang Song S, Ma G, Wang Y, Wang Z, Yang B, Xie T, Guo X, Huang L. Zhang, Benchmarking copy number aberrations inference tools using single-cell multi-omics datasets, Briefings in Bioinformatics, Volume 26, Issue 2, March 2025, bbaf076. 10.1093/bib/bbaf076 [DOI] [PMC free article] [PubMed]
- 26.Kinker GS, et al. Pan-cancer single-cell RNA-seq identifies recurring programs of cellular heterogeneity. Nat Genet vol. 2020;52(11):1208–18. 10.1038/s41588-020-00726-6. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 27.Hao Y, Stuart T, Kowalski MH, Choudhary S, Hoffman P, Hartman A, Srivastava A, Molla G, Madad S, Fernandez-Granda C, Satija R. Dictionary learning for integrative, multimodal and scalable single-cell analysis. Nat Biotechnol. 2023;41(11):1633–43. 10.1038/s41587-023-01767-y. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 28.Singhal V, et al. BANKSY unifies cell typing and tissue domain segmentation for scalable spatial omics data analysis. Nat Genet vol. 2024;56(3):431–41. 10.1038/s41588-024-01664-3. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 29.Andrew D, Yates P, Achuthan W, Akanni J, Allen J, Allen J, Alvarez-Jarreta M, Ridwan Amode IM, Armean AG, Azov R, Bennett J, Bhai K, Billis S, Boddu JoséC, Marugán C, Cummins C, Davidson K, Dodiya R, Fatima A, Gall CG, Giron L, Gil T, Grego L, Haggerty E, Haskell T, Hourlier OG, Izuogu SH, Janacek T, Juettemann M, Kay M, Schmitt H, Schuilenburg D, Sheppard JE, Loveland, Fergal J, Martin J, Morales JM, Mudge. Matthieu Muffato, Emily Perry, Magali Ruffier, Stephen J Trevanion, Fiona Cunningham, Kevin L Howe, Daniel R Zerbino, Paul Flicek, Ensembl 2020, Nucleic Acids Research, Volume 48, Issue D1, 08 January 2020, Pages D682–D688. 10.1093/nar/gkz966. [DOI]
- 30.Zuguang Gu R, Eils M, Schlesner. Complex heatmaps reveal patterns and correlations in multidimensional genomic data. Bioinformatics. September 2016;32:2847–9. 10.1093/bioinformatics/btw313. [DOI] [PubMed]
- 31.Paradis E, Schliep K. ape 5.0: an environment for modern phylogenetics and evolutionary analyses in R. Bioinformatics. 2019;35(3):526–528. 10.1093/bioinformatics/bty633. PMID: 30016406. [DOI] [PubMed]
- 32.Schliep KP. phangorn: phylogenetic analysis in R. Bioinformatics. 2011;27(4):592–3. 10.1093/bioinformatics/btq706 . Epub 2010 Dec 17. PMID: 21169378; PMCID: PMC3035803. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 33.Yu G, Smith D, Zhu H, Guan Y, Lam TT. ggtree: an R package for visualization and annotation of phylogenetic trees with their covariates and other associated data. Methods Ecol Evol. 2017;8:28–36. 10.1111/2041-210X.12628. [DOI] [Google Scholar]
- 34.Barretina J et al. Mar. The Cancer Cell Line Encyclopedia enables predictive modelling of anticancer drug sensitivity. Nature vol. 483,7391 603-7. 28 2012, 10.1038/nature11003. [DOI] [PMC free article] [PubMed]
- 35.Morgan M, Shepherd L. (2025). ExperimentHub: Client to access ExperimentHub ressources. 10.18129/B9.bioc.ExperimentHub, R package version 3.0.0. https://bioconductor.org/packages/ExperimentHub.
- 36.Pelka K, Hofree M, Chen JH, et al. Spatially organized multicellular immune hubs in human colorectal cancer. Cell. 2021;184(18):4734–e475220. 10.1016/j.cell.2021.08.003. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 37.Valdeolivas A, Amberg B, Giroud N, et al. Profiling the heterogeneity of colorectal cancer consensus molecular subtypes using spatial transcriptomics. NPJ Precis Oncol. 2024;8(1):10. 10.1038/s41698-023-00488-4. Published 2024 Jan 10. [DOI] [PMC free article] [PubMed] [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Supplementary Materials
Data Availability Statement
The scRNA-seq data for the 117 cancer cell lines from the CCLE are publicly available via the Broad Institutes Single Cell Portal under accession number SCP542. The scRNA-seq colon expression count matrix is accessible through GEO under accession [GSE178341](https:/www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE178341). The spatial transcriptomics slide of colon cancer tissue used in this study is available on Zenodo at [https://zenodo.org/records/7760264](https:/zenodo.org/records/7760264). The Visium HD breast slide can be accessed via 10x Genomics' public datasets portal at [https://www.10xgenomics.com/datasets](https:/www.10xgenomics.com/datasets). The fastCNV R package is available on GitHub (https://github.com/bioinfo-MUST/fastCNV) and Zenodo (https://doi.org/10.5281/zenodo.21339142).
