Quantification of gene expression from RNA-seq data is a prerequisite for transcriptome analysis such as differential gene expression analysis and gene co-expression network construction. Individual RNA-seq experiments are larger and combining multiple experiments from sequence repositories can result in datasets with thousands of samples. Processing hundreds to thousands of RNA-seq data can result in challenges related to data management, access to sufficient computational resources, navigation of high-performance computing (HPC) systems, installation of required software dependencies, and reproducibility. Processing of larger and deeper RNA-seq experiments will become more common as sequencing technology matures.GEMmaker, is a nf-core compliant, Nextflow workflow, that quantifies gene expression from small to massive RNA-seq datasets. GEMmaker ensures results are highly reproducible through the use of versioned containerized software that can be executed on a single workstation, institutional compute cluster, Kubernetes platform or the cloud. GEMmaker supports popular alignment and quantification tools providing results in raw and normalized formats. GEMmaker is unique in that it can scale to process thousands of local or remote stored samples without exceeding available data storage.Workflows that quantify gene expression are not new, and many already address issues of portability, reusability, and scale in terms of access to CPUs. GEMmaker provides these benefits and adds the ability to scale despite low data storage infrastructure. This allows users to process hundreds to thousands of RNA-seq samples even when data storage resources are limited. GEMmaker is freely available and fully documented with step-by-step setup and execution instructions.The online version contains supplementary material available at 10.1186/s12859-022-04629-7. Transcriptome sequencing (RNA-seq) is used in the life sciences to explore gene–gene and gene-trait relationships . The fuln x m matrix of n genes and m samples with values representing gene expression levels. Quantification of gene expression levels is performed using popular tools such as HISAT2 [Individual RNA-seq experiment increasingly include hundreds to thousands of samples. These experiments are often made available on public repositories–such as the National Center for Biotechnology Information (NCBI) –allowings HISAT2 , Salmon s HISAT2 , kallists HISAT2 , or STARs HISAT2 . Examples HISAT2  for datas HISAT2  for conts HISAT2  for stors HISAT2 ) for reas HISAT2 .Several automated RNA-seq workflows have been created to ease the burden of managing the steps of RNA-seq processing. These include Pipelines in Genomics (PiGx) , VisualiA popular advancement in workflow construction is the use of framework software to construct and then manage execution of the workflow. Popular examples include Galaxy , Kepler To assist bioinformaticians in the development of portable, standards-based reproducible workflows, the nf-core framework  was deveHere we introduce an RNA-seq workflow named GEMmaker. Despite the existence of other workflows, it grew from the need to process 26,055 SRA runs from 17,018 SRA experiments. Unfortunately, the nf-core/rnaseq workflow was not able to scale to this large dataset as it would exhaust available storage. When thousands of RNA-seq samples are used, intermediate files can exceed available compute storage as is the case of the HISAT2 tool which can quickly consume terabytes of storage when hundreds or thousands of samples require processing. Other gene quantification tools such as Salmon  require The inability to scale without overrunning user data storage is a limitation of Nextflow rather than the nf-core/rnaseq workflow, which could overrun user storage—especially for large datasets. There are two key factors inhibiting scaling. First, Nextflow does not currently support cleanup of intermediate files. Second, Nextflow tends to execute all instances of the same step  before moving to the next step  compounding the challenge of cleanup of intermediate files since cleanup cannot occur until later steps are completed.Until the time that Nextflow supports a file cleanup strategy, a solution is needed to support RNA-seq workflows that need to scale without overrunning storage. Ideally, the solution would be to contribute code to the nf-core/rnaseq workflow to support file cleanup, but the nf-core standards require that workflows only support native Nextflow functionality. GEMmaker, therefore, exists to provide a workflow that supports massive scaling of RNA-seq processing when storage is limited. GEMmaker v2.1 is fully nf-core compatible and can be used in the same manner as any nf-core workflow. It provides much of the functionality of the nf-core/rnaseq workflow as well as the portability and reproducibility benefits inherit with Nextflow and nf-core workflows. GEMmaker is not better than other workflows in terms of accuracy of results or improved computational time, so we do not compare it to other workflows. Rather, it is meant to process increasingly large datasets without overrunning storage using the same steps that are common in other RNA-seq workflows. The following describes the implementation of GEMmaker and provides storage performance results.Arabidopsis thaliana Illumina datasets:GEMmaker uses Nextflow and is a combination of Groovy scripts for interfacing with Nextflow, Python scripts for wrangling intermediate data, and Bash scripts for execution of each software tool in the workflow. Nextflow was selected as the framework because it is widely used, is well supported, has a robust community of workflow creators in the life sciences, supports multiple computing platforms and supports containerization systems such as Docker and Singularity. Nextflow allows for execution of workflows from a command-line interface, which is common with most HPC platforms. These attributes make GEMmaker relatively easy to use. The following is an example command-line for execution of GEMmaker on a local machine using Singularity (for containerization), quantification using Salmon, and a file containing a list of SRA run IDs for GEMmaker adopts the nf-core recommendations and standards to provide consistency in functionality with other popular nf-core workflows.GEMmaker uses a variety of software tools for gene expression-level quantification and quality control that can be selected by the user. These software are listed in Table As mentioned previously, GEMmaker is designed to scale. It can scale to process increasingly larger experiments (or large numbers of samples from public repositories) that can include hundreds to thousands of RNA-seq samples without intermediate files overrunning available compute storage. It supports execution on a large variety of computational platforms such that researchers can take full advantage of the compute facilities available to them including local desktop workstations, institutional clusters, national-funded resources such as XSEDE , the Pac–max_cpus argument. On a compute cluster, this could be tens to hundreds. Nextflow is then instructed to automatically begin processing any samples that appear in the “processing” folder. As usual, Nextflow will process samples in parallel, using all CPUs, by first executing the first step for all samples, then the second for all samples, and so forth. However, because GEMmaker limits the number of samples to the number of CPUs, when a sample completes a step, it will move to the next step because Nextflow does not see any samples waiting. When a sample fully completes all steps, GEMmaker will then move the sample from the “processing” folder into the “done” folder and will move one sample from the “stage” folder into the “processing” folder. Nextflow sees this new sample in the “processing” folder and immediately begins processing that sample through each step. There is no lag between the time one sample finishes, and another begins and Nextflow should keep all CPUs consistently busy processing samples in parallel. As the workflow progresses for each sample, GEMmaker will cleanup unwanted intermediate files. This ensures space is cleaned before more samples begin processing. If the user specifies a –max_cpu size that does not exceed the resources of the computational platform, then GEMmaker can successfully process hundreds to thousands of samples.To ensure storage requirements are not exceeded, GEMmaker moves input FASTQ files between three folders: “stage”, “processing” and “done”. Initially all samples are placed in the “stage” folder and GEMmaker will move into the “processing” folder as many samples as there are CPUs available. The user sets the number of CPUs that the workflow can use with the While GEMmaker, by default, cleans all intermediate files, there are arguments that can be provided, as described in the online documentation, to control which intermediate files are removed. Users can keep downloaded SRA and FASTQ files, trimmed FASTQ files, SAM and BAM alignment files, and kallisto and Salmon pseudoalignment files. If any of these files are needed for downstream analyses they can be retained.–max_cpus setting higher than storage will support, then GEMmaker may not be able to cleanup intermediate files before overrunning storage. It is difficult to recommend a value which maximizes the trade-off between the number of CPUs and storage requirements because RNA-seq samples and genomic reference sequences can be dramatically different in size, resulting in different sized intermediate files. However, using averaged values from the sample data reported here, we provide a rough recommendation that users have about 30 times the storage of an average sample size, times the number of CPUs when using HISAT2. For an average sample size of 2.5GBs this would require 75 GB per CPU. For kallisto and Salmon we recommend 7 times the storage of an average sample per CPU (17GBs).The speed at which the samples are processed depends on the number of processors and available memory of the compute nodes. Users with limited CPUs or RAM may need more time to process all samples. If users set the To ensure portability between HPC systems, GEMmaker makes use of containerized software. This alleviate the burden of installing the same software versions on every computational system on which it is run. All GEMmaker dependent software are provided in the GEMmaker docker image and their versions are listed in Table Oryza sativa (rice) RNA-seq dataset (NCBI SRA accession PRJNA301554) [Arabidopsis thaliana 26,055-runs from NCBI.We tested GEMmaker on WSU's Kamiak cluster which uses the SLURM scheduler , ClemsonA301554) , and theArabidopsis thaliana sequenced using the Illumina platform. The list of SRA run IDs is provided as Additional file The 475 rice dataset consists of samples from two subspecies of rice, subdivided into 4 genotypes, grown in a hydroponic environment that underwent treatments of heat stress, drought stress and control. Measurements were taken every 15 min for several hours with 2 replicates. We selected this dataset to demonstrate execution of a large single experiment on a typical stand-alone workstation that researchers may have available to them. The Arabidopsis 26,055 dataset was selected using all Illumina RNA-seq datasets available at the time the list was collected. An SRA experiment can contain multiple runs which resulted in 17,018 SRA experiments. This included both paired and non-paired RNA-seq runs for With the option to clean intermediate files enabled, all the quantification tools consumed less than 1 Tb of storage. At maximum, HISAT2 consumed 680 GB, kallisto 322 GB, Salmon 342 GB, and STAR 701 GB. When intermediate files were not cleaned, both Salmon and kallisto consumed approximately 12 TB of storage, HISAT2 38 TB and Star 41 TB. Salmon and kallisto took less time (~ 3 days) than STAR (4 days), or HISAT2 (~ 5.5 days) to run. Compute time is strongly dependent on each computer’s hardware and the queue size. Therefore, this test could have run quicker if the number of CPUs were increased. The range of storage space (between 322 and 680 GB) required to execute GEMmaker on this set of 475 samples, with intermediate file cleaning enabled, is commonly available on stand-alone workstations.–max_cpus setting of 120 . We used the kallisto pipeline, and GEMmaker completed processing the 26 K runs over 28 days. We designed GEMmaker so that if a dataset is corrupted, or if information was incorrectly entered into NCBI that it would report these and then continue with other samples. This reduces downtime and allows the user to look at these files manually. GEMmaker reported that of the 26 K runs, 19 SRA files had no metadata available via NCBI web services and could not be retrieved; 179 had missing download URLs; 3 samples were corrupted after download; and 1 failed to download due to a network timeout. Just as with the rice data, GEMmaker was instructed to clean intermediate files  and keep only raw and TPM count files, but actual storage usage was not measured during runtime. The results folder consumed 48 GB of storage.To demonstrate processing of tens of thousands of RNA-seq datasets, the 26 K SRA runs were processed on WSU’s Kamiak HPC cluster with a –max_cpus is used  and Nextflow is preempted this may result in higher storage usage from directories with failed jobs. Third, related to usability, GEMmaker does not have a graphical user interface (GUI). Users familiar with the UNIX command line will not see this as an issue, but those who have limited experience may find this difficult. Finally, GEMmaker was not designed for data security. Users with sensitive data will need to coordinate with data security experts to ensure processing is executed in a secure facility.Despite the advantages that GEMmaker affords, it has limitations. First, we could not include every quantification tool made to date; users who need other tools are encouraged to request features on the GEMmaker GitHub issue queue. Second, if GEMmaker is preempted before it completes, as was the case with the 26 K Arabidopsis dataset, then there may be working directories that do not get cleaned. Because GEMmaker is a Nextflow workflow, it can resume execution where it left off. However, Nextflow creates new working directories for each step of the workflow for each sample and when it is resumed it creates new working folders—the folders with failed steps remain. When a sample completes a step, then GEMmaker can clean up the working directories that were successful but there is not a mechanism in Nextflow to know about the directories with failed results so that they can be cleaned. As a result, if a high GEMmaker addresses issues of scale for processing massive RNA-seq experiments with hundreds to thousands of samples . While automated RNA-seq workflows already exist, GEMmaker is unique in that it does not overrun data storage facilities yet provides similar functionality to that of gold-standard RNA-seq workflows. GEMmaker allows researchers to take advantage of existing smaller computing infrastructure which can be beneficial if there is limited access to larger facilities. GEMmaker returns count data in various formats  so that results can be used in downstream transcriptome analyses such as differential gene expression, regulatory network construction and gene co-expression analysis.Project name: GEMmakerhttps://github.com/SystemsGenetics/GEMmakerProject home page: Operating systems(s): Platform independentProgramming language: Nextflow Groovy, Python and bashOther requirements: Nextflow and Java. Docker or singularity are optional but suggestedAny restrictions to use by non-academics: GPL v2.0 license.Additional file 1: NCBI SRR IDs.


Feature identification and manual inspection is currently still an integral part of biological data analysis in single-cell sequencing. Features such as expressed genes and open chromatin status are selectively studied in specific contexts, cell states or experimental conditions. While conventional analysis methods construct a relatively static view on gene candidates, artificial neural networks have been used to model their interactions after hierarchical gene regulatory networks. However, it is challenging to identify consistent features in this modeling process due to the inherently stochastic nature of these methods. Therefore, we propose using ensembles of autoencoders and subsequent rank aggregation to extract consensus features in a less biased manner. Here, we performed sequencing data analyses of different modalities either independently or simultaneously as well as with other analysis tools. Our resVAE ensemble method can successfully complement and find additional unbiased biological insights with minimal data processing or feature selection steps while giving a measurement of confidence, especially for models using stochastic or approximation algorithms. In addition, our method can also work with overlapping clustering identity assignment suitable for transitionary cell types or cell fates in comparison to most conventional tools. A plethora of tools have been developed over the years for the analysis of high-throughput single-cell data  and made great contributions towards enabling the exploration and analysis of the omics landscape of different tissues and organs at an unprecedented resolution. Yet regardless of the tools or methods, human intervention is required to validate or further elucidate the hypotheses through the identification of markers or characteristic features  for the different cell populations clustered by cell type, perturbation, or other conditions and labels. Conventional methods and tools primarily perform highly variable genes (HVGs) or differentially expressed genes (DEGs) analyses based on the different clusters through statistical testing that often generate an extensive list of genes that are ranked according to their logarithmic fold change values or significance scores . These iThese conventional analysis techniques backed by sound statistical tests and methods remain the gold standard for well-established tasks they excel at. However, machine or deep learning methods that can complement the nature of biological data are increasingly being applied as the complexity of these single-cell data increases. In contrast to statistical methods that look at genes in isolation, methodologies involving the use of deep learning techniques are context-aware and can deal with non-linearities. Moreover, as we gain access to new technologies and techniques that make new data collection possible, it is even more crucial to ensure that these data can be studied and analyzed using similar tools. In particular, the characteristics of variational autoencoders (VAE) make them suitable to address some of the most common tasks in analyzing single-cell sequencing datasets, especially when it involves the comparison or identification of cell populations . A typicHowever, neural networks are non-deterministic during training, as they make use of random partitioning of data, initialization of weights, sampling in each iteration, regularization in terms of dropouts etc. . This raWe previously introduced the restricted latent variational autoencoder (resVAE) neural network architecture that enables the decomposition of single-cell transcriptomic data into population-based features in a hierarchical manner that closely resemble biological systems . Our intWith an ensemble, multiple models can be combined to produce better results than what an individual model alone could achieve. Meanwhile, rank aggregation allows us to retain the ranking information from the different ranked results and combine them into a single ranking. We trained multiple resVAE models on the same inputs to learn the cluster-specific features independently. Next, we combined the outputs of all the models and introduced different rank aggregation algorithms that could reduce them into a single ranked consensus, which results in more robust and consistent outputs as compared to using only a single model . FurtherTo demonstrate that resVAE ensemble can identify features relevant to the experiment based on the input data and annotations, we first performed the analysis on a simulated synthetic dataset used to model myeloid differentiation in hematopoiesis as previously described by EKLF and Fli-1 as the defining feature for each of these clusters, respectively, as expected. Additional findings that conformed to experimental data were recapitulated too, such as GATA-1 being identified in both Erythrocytes and Megakaryocytes clusters. Similarly, features in the Monocytes cluster were identified consistently, with PU.1, cJun, EgrNab and C/EBPvice versa . The main differences are most apparent in populations that are more heterogeneous and less consistent in terms of expression profile. This is most evident in sBmid which is not only very close and similar to sB, but would also incorporate similar cells belonging to the sC and sD populations in the soft clustering method . In clusIn addition, resVAE ensemble successfully recapitulated meaningful results as defined in the transcription factors of the simulation . For exaRegardless of the cluster assignment methods used, resVAE ensemble consistently identified not only features that can distinctly separate dissimilar populations, but also features that can be used to distinguish similar sub-clusters. Unsurprisingly, the features identified by resVAE ensemble can be affected by the fluidity of the clusters. In the case of hard clusters assignment, the identified features are more pronounced in the relevant clusters, whereas in the case of partial or mixed identities, the identified features are not as pronounced and tend to bleed into similar clusters . DependiIn short, we successfully demonstrated that resVAE ensemble can be used with both discrete and mixed or partial cell identities that could characterize transitory cell types or cell states more accurately.To further investigate and demonstrate the performance of resVAE ensemble in gene sets identification tasks in actual biological data, we next applied the methodology on interferon (IFN) nts data , which ants data .To assess the performance of resVAE ensemble in elucidating cluster identities, we artificially split all the clusters into two partitions of equal sizes . In totaCD48, CTSC, CYBB, RTN4 etc.) have immune-related functions as well. Since the CD14 Monocytes constitute the largest population of cells in this dataset, resVAE ensemble was able to better learn the characteristics of these cells and identify genes more confidently.In fact, we were able to identify consistent features that are relevant to the clusters. This is most prominent between the two partitions of the CD14 Mono cluster , left thversus the Erythrocytes 1 cluster . This contrast between almost identical (CD14 Mono 1 and CD14 Mono 2) versus highly dissimilar clusters (CD14 Mono 1 and Eryth 1) can be observed in the Andrews curves plot  and Eryth 1 (mustard) lines. Once again, this confirmed that resVAE ensemble can consistently distinguish between these different cell populations and identify genes that are relevant in the cluster-specific context.Next, we also compared the genes identified by resVAE ensemble in the CD14 Monocytes 1 cluster  cluster , middle,ves plot , where tCD9, FLNA, TLN1, PLA2G7, SERPING1, APLP2, ANXA5, MARCKS etc.), cell adhesion , cell motility (TPM4 etc.) and mediators of immune relevance   . resVAE .) CD40; , a cell vice versa, thus potentially enabling a systematic approach to elucidate cluster identities. In addition, we showed that the performance of resVAE ensemble conforms to the clusters in a context-aware manner such that the number of clusters involved and their similarities did not seem to negatively affect the performance. resVAE not only identified genes consistently between the partitions, but also identified some genes that would be similarly identified using conventional methods such as Seurat and MAST  also utilizes VAEs in the form of pre-selected pathway modules that only act on the participating genes to encourage module independence . Hence, Currently, clustering analysis is the standard in single-cell data analyses, where cells within the same cluster are treated in a homogenous manner. Archetypal analysis could be another option especially for transitionary cell types or states, where populations are described in terms of combinations of archetypes. We have shown that resVAE ensemble can be used in a similar fashion in the bifurcation model experiment, where populations were assigned by their similarities to specific archetypes. scAAnet is another tool that utilizes autoencoder for archetypal analysis by optimizing the archetypal constraint in the shared latent space . InteresIn terms of data analysis, we demonstrated that resVAE ensemble can be used on different single-cell data modalities, including scRNA-seq and scATAC-seq. In addition, we also showed that resVAE ensemble can be used to identify features for joint analysis of multi-modal data in combination with other tools. resVAE ensemble can further be used with cluster assignment methods that assign partial or mixed identities for the different clusters, which cannot be usually performed in most conventional tools used to analyze these data.Overall, we introduced rank aggregation of ensembles that improved the consistency and reproducibility of the results. In fact, we believe that the ensemble and rank aggregation approach introduced can be applied to other similar methods to potentially yield better results. Moreover, it is possible to combine the results from resVAE with the results from other methodologies in the ensemble, whether they are widely used end-to-end analysis workflows or niche tools targeting specific use cases or even upcoming tools.Conventional methodologies used for single-cell data predominantly focus on comparing highly variable or differentially expressed features across different populations. Deep learning or approximation-based algorithms can be used to identify features in single-cell data in a hierarchical manner in line with biological systems. However, these methods can produce different results due to their inherent randomness. Here, we used deep ensembles on our resVAE architecture to improve the reliability and consistency of the results. Moreover, resVAE ensemble can give a measure of confidence or consistency for the identified features. Finally, this method can be used to integrate results from different methodologies and algorithms to produce a consensus result.resVAE ensemble is built on top of the restricted latent variational autoencoder (resVAE), which we introduced in our earlier publication . Apart fIn short, the cost function of the resVAE architecture consists of two parts, namely the reconstruction loss and the KL-divergence, respectively. The reconstruction loss measures the mean-squared error between the original inputs and the outputs of the autoencoder, which in our case is usually the cell by feature matrix. The KL divergence is a measure to quantify the similarity between probability distributions. Here, accuracy . The βeriments . We alsoeriments .Weights initialization methods can play a critical role in training neural networks to convergence . While rApart from the implementation of new activation functions for the non-linearities, we also improvised the kernel initialization method of the dense layers based on the activation function used. Now, the He Uniform kernel initialization method is paired with ReLU activations, while the Xavier or Glorot Uniform method is paired with hyperbolic tangent-based activations, which should be a better pairing as demonstrated in multiple studies and experiments .Moreover, we adopted the combination of Rectified Adam (RAdam) with the Lookahead mechanism as our optimizer. The original Adam optimizer with its adaptive learning rate is known to suffer from bad convergence problems especially during the early stage of training, where the variance is undesirably large due to the limited amount of training samples. RAdam attempts to address this by introducing a dynamic rectifier term that adjusts the adaptive momentum of Adam by stabilizing the variance of the adaptive learning rate while avoiding the need for manual warmup . MeanwhiWhile we primarily demonstrated the use of ensemble on identical inputs with varying combinations of To further improve the gene candidates produced from the cut-offs in situations where it is difficult to identify definite elbow and knee points from the rank plots, a new cut-off calculation method is implemented. First, the data is split into Here, we have an example where the new method would improve the performance by producing more consistent cut-offs and restricting the number of features selected . In thesWe implemented the Robust Ranking Aggregation (RRA) algorithm  in Pythovia rGREAT (The human PBMC scRNA-seq and scATAC-seq datasets for the analysis were obtained from 10x Genomics as detailed in the Data Availability section. The myeloid differentiation simulated dataset is included in Scanpy , while ta rGREAT , which a


Recent advances in multiplexed imaging methods allow simultaneous detection of dozens of proteins and hundreds of RNAs, enabling deep spatial characterization of both healthy and diseased tissues. Parameters for the design of optimal multiplex imaging studies, especially those estimating how much area has to be imaged to capture all cell phenotype clusters, are lacking. Here, using a spatial transcriptomic atlas of healthy and tumor human tissues, we developed a statistical framework that determines the number and area of fields of view necessary to accurately identify all cell phenotypes that are part of a tissue. Using this strategy on imaging mass cytometry data, we identified a measurement of tissue spatial segregation that enables optimal experimental design. This strategy will enable an improved design of multiplexed imaging studies. A statistical approach for optimal design of multiplexed imaging studies has been developed. It determines experimental parameters that facilitate cell phenotype identification. Experiments using these technologies have enhanced our understanding of biological systems ranging from human immune cells5 to whole cnidarian organisms6. Clear guidelines exist to determine the optimal experimental design of sequencing studies, including the total number of cells and sequencing depth necessary for detection of rare cell types or transcripts7.In the last decade, single-cell technologies for proteomic8. Multiplexed imaging techniques are modern counterparts of histological analyses and aim to detect a given set of cell types and their state based on target markers. Therefore, the ability of a multiplexed imaging experiment to recover every expected cell type that is present in a given tissue section is essential. Guidelines for optimal design of multiplexed imaging experiments, such as those performed using imaging mass cytometry (IMC)9, MIBI10 and CODEX11, and in situ hybridization methods, such as sequential fluorescence in situ hybridization (seqFISH)12 and multiplexed error-robust fluorescence in situ hybridization (MERFISH)13, have not been developed. Given that current highly multiplexed tissue imaging methods have low spatial throughput and high costs, such guidelines, especially to estimate the area to be measured to capture the phenotypic heterogeneity of a tissue, are urgently needed. As it is possible to model the probability of detecting an object when imaging a given area14, a solid theoretical foundation for modeling and interpreting the outputs of multiplexed imaging experiments exists. Building on pioneering work on the number of regions that must be imaged to characterize the intensity distribution of a single fluorescent marker and single cell type15, we report the development of a strategy to determine the minimal number of fields of view (FoVs) necessary to identify all main cell phenotypes across various healthy and tumor tissues.Increasingly, single-cell transcriptomic and proteomic measurements are performed with spatial resolution16) and are assumed to provide an exhaustive description of cell phenotypes present in the tissue. Using these spatial transcriptomic data, we wanted to assess how many FoVs must be measured with another spatial imaging technology to capture all present phenotypes. We used 22 previously collected Visium datasets on 12 different types of tissue  is the mean number of recovered clusters, NO corresponds to the total number of observed clusters and τ indicates how many regions must be imaged to recover most of the known cell phenotypes. According to this model, 2τ FoVs must be imaged to recover 86% of known clusters. This model fitted well across all Visium datasets .To model the relationship between the number of clusters and the number of FoVs, we used a model derived from the analysis of homogeneous Poisson point processes:w, on spatial sampling efficiency by performing the same simulated IMC analysis with various values of w. As expected, fewer regions needed to be imaged to recover all known clusters when w values were larger , implying that the number of clusters notably impacts the value of τ and explains the difference in τ values between healthy and tumor samples.We then explored whether there was a relationship between τ and the granularity of the initial clustering analysis. To test this, we aggregated the most similar pairs of cell phenotypes for each sample by determining the correlation between mean expression profiles, performed a sampling analysis to compute τ and then merged the next two most similar clusters, repeating until only two clusters remained . We observed a strong correlation (R2 = 0.76) between the matched θ and τ parameter values  divergence between the estimated proportions of cell phenotypes from a given number of sampled FoVs and the real proportions computed using the whole dataset. We observed that the KL divergence substantially decreases when increasing the number of sampled regions  of two human formalin-fixed paraffin-embedded lymph node sections using IMC with two antibody panels . In a separate validation, our model also fit well to a lung tumor dataset generated using highly multiplexed single-molecule fluorescence in situ hybridization (Nanostring CosMX) and the relation between τ and w was also conserved . These results support a hypothesis that α is a technology-independent but tissue-dependent parameter. Intuitively, α can be seen as a measure of cell phenotype spatial segregation  and breast cancer tissue —using the values fitted on Visium datasets. First, we observed that the number of recovered clusters was not affected by the fragmentation of the FoVs for the heart sample but only by the total imaged area Fig. . In cont80% Fig. .2) of a representative sample of a given cohort using a multiplexed imaging technology, ideally the same as the one planned to be finally used . Specifically, definition of α as invariant for a given tissue is robust within a recovery threshold of 20–70 cells; outside of this range, α estimation might be unreliable, and values outside of this range should therefore not be used with this model. Also, the recovery threshold will affect 18. Although we focused on the recovery of multiple cell phenotypes rather than a single type of cell 19, it is likely that a similar phenomenon of spatial segregation determines the efficacy of this type of sampling. In summary, our approach provides essential guidance for the study of tissue structures using multiplex imaging in a time and cost-efficient manner.Beyond application to the design of multiplexed imaging experiments, our results could also be used in the field of anatomical pathology, wherein the current standard for the classification of samples is the analysis of one to four circular punches of variable diameter (600 µm to 2 mm)Lymph nodes were obtained from organ donors under research consent from University of Florida Institutional Review Board (IRB201600029). These were obtained as for transplant with central flushing after cross-clamp before excion from the mesentery. The tissue was then shipped on wet ice in UW buffer (University of Wisconsin transplant buffer) to the university of Florida before being fixed in 10% Neutral Buffered Formalin for 16 hours before embedding paraffin.support.10xgenomics.com/spatial-gene-expression/datasets/), the Gene Expression Omnibus (GEO) or the Zenodo data portals. Individual access numbers are provided in Supplementary Table k-nearest-neighbor graph was built using the ‘makeKnnGraph’ function, with parameter k set to 15 and using a cosine distance before performing a community detection analysis with the ‘getKnnClusters’ function with default parameters (corresponding to Louvain’s community detection21).Visium data were downloaded from the 10x Genomics website . Detailed of the downloaded samples are available in Supplementary Table Targeted Visium datasets were downloaded from the 10x Genomics website . Each channel was normalized by performing a Poisson regression between the total channel intensity and the cell size (in pixels); the Pearson’s residuals were extracted as the new scaled values. The cells were then clustered by first building a k-nearest-neighbor graph with 15 neighbors (using cosine distance) and then clustered using Louvain’s community detection implemented in the igraph package with default parameters24.The raw .MCD (MathCad document) files were processed using the Steinbock pipeline, v.0.70https://nanostring.com/products/cosmx-spatial-molecular-imager/ffpe-dataset/ (three replicates of Lung5 sample). Data were processed using the same approach as for IMC data except that only the 200 most variable genes were selected by computing the multinomial deviance D of each gene, the deviance of a given gene expression vector x over m cells being defined as:xi being the number of RNA molecules in cell iand n the total number of RNA molecules detected for this gene. The 200 genes with the highest deviance were selected and used for further analysis. Following the processing of the data, a regular sampling analysis was performed on each sample as described above.Data corresponding to the three lung cancer CoxMX samples were downloaded from T spots belonging to that cluster were located in the drawn squares. The threshold T was changed based on the type of data: it was set to three spots for Visium data, 50 cells for the IMC lymph node and CosMX lung cancer data, and 20 cells for the IMC breast cancer data. As an individual Visium spot has a diameter of 50 µm, one can assume that between 10 to 20 cells can be mapped to a single spot, especially in highly dense tissues. Therefore, we chose the threshold of three spots so that the results obtained from Visium data could be compared to the one from IMC data. This sampling was repeated 50 times to obtain a robust estimate.To simulate spatial sampling strategies, we created a simple function that iteratively selects a random point on the sample, ‘draws’ a square with the sampled point at the center and then checks whether this square overlaps with previously sampled squares. In case of overlap, the point is removed and a new point is sampled. A cluster was considered as detected by a given spatial sampling (set of sampled FoVs) if more than ƛ. The probability that a random square of size w contains no points is equal to exp(−ƛw2). A basic property of HPP processes is that the probability of finding no points in r independent  squares is exp(−ƛrw2), and therefore the probability of finding at least one point is 1 − exp(−ƛrw2). As we examined NO different cell phenotypes , the mean number of recovered phenotypes for a fixed number of squares N(r) is NO × (1 − exp(−ƛrw2)), thus justifying the use of equation  and ten FoVs for each individual FoV of the IMC breast cancer dataset, resulting in 1,000 total FoVs.P is the sampled proportion vector and Q is the proportion vector computed using the full dataset.Similarly to the spatial sampling analysis described above, we randomly sampled a given number of non-overlapping FoV and quantified the number of spots belonging to each cell phenotype. For each independent sampling, we transformed the obtained count vector to a proportion vector by dividing by the total number of sampled cells and computed the corresponding KL divergencer corresponds to the number of FoVs sampled, KL(r) to the mean KL divergence when r FoVs are sampled, and KLO, KLb and θ are parameters to determine. KLO can be interpreted as the mean KL divergence observed with one FoV, and θ corresponds to how many regions must be imaged to have a low KL divergence. Lastly, KLb is the baseline KL divergence, that is, the minimal KL divergence observed.To link the KL divergence and the number of sampled FoV, we used the following equation:x represents the number of FoVs and y the mean KL detected. The theta parameter corresponds to the θ parameter described in equation  for 1 h at room temperature, before incubation with antibodies (diluted in blocking buffer) overnight at 4 °C. Nuclear staining was then performed by adding an iridium solution (5 nM) diluted in TBS (1:100 dilution) to the sample and incubating for 5 min. The samples were then washed three times (10 min per wash) in TBS and dried. Images were acquired using an Hyperion Imaging System, with the ablation frequency set to 200 Hz and the ablation energy set to 6 dB, with X and Y steps set to 1 µm.R2 < 0.9) were removed and the slope of the regression was taken as the estimate of α. If we combine equations  and analyzed using the following strategy: we first aggregated all cancer clusters (clusters 14 to 27) into a single cluster as the cancer clusters displayed a strong patient specificity. For each FoV, we progressively reduced the size of the image by factors of 1.1, 1.2, 1.5, 1.8, 2.2, 2.5 and 3.0 and computed the number of recovered clusters. We then performed a linear regression between the log-transformed number of recovered clusters and the size of the reduced FoV using the ‘lm’ core function. FoVs with a low-quality model (r (number of regions) and w (width of FoV), we substituted equation  and computed N for different ratios of r and w with a constant r×w2  value.To compare both samples, we dropped the Further information on research design is available in the Any methods, additional references, Nature Portfolio reporting summaries, source data, extended data, supplementary information, acknowledgements, peer review information; details of author contributions and competing interests; and statements of data and code availability are available at 10.1038/s41592-022-01692-z.Supplementary InformationPractical guide to optimize multiplexed imaging experiment.Reporting SummarySupplementary Table 1List of spatial transcriptomic datasets used in the manuscript.Supplementary Table 2IMC panels for lymph node imaging.Supplementary Table 3Computed values of alpha for various human healthy and tumor tissues.


Liquid biopsy offers great promise for noninvasive cancer diagnostics, while the lack of adequate target characterization and analysis hinders its wide application. Single-cell RNA sequencing (scRNA-seq) is a powerful technology for cell characterization. Integrating scRNA-seq into a CTC-focused liquid biopsy study can perhaps classify CTCs by their original lesions. However, the lack of CTC scRNA-seq data accumulation and prior knowledge hinders further development. Therefore, we design CTC-Tracer, a transfer learning-based algorithm, to correct the distributional shift between primary cancer cells and CTCs to transfer lesion labels from the primary cancer cell atlas to CTCs. The robustness and accuracy of CTC-Tracer are validated by 8 individual standard datasets. We apply CTC-Tracer on a complex dataset consisting of RNA-seq profiles of single CTCs, CTC clusters from a BRCA patient, and two xenografts, and demonstrate that CTC-Tracer has potential in knowledge transfer between different types of RNA-seq data of lesions and CTCs. Liquid biopsy offers great promise for noninvasive cancer diagnostics, while the lack of adequate target characterization and analysis hinders its wide application. Here, the authors design a transfer learning-based algorithm to transfer lesion labels from the primary cancer cell atlas to circulating tumor cells. In particular, lesion tracing based on CTCs is the basis for real-time analysis of lesion number and location, thus enabling noninvasive monitoring of tumor development and metastasis. However, lesion tracing based on CTCs requires excellent characterization of CTC heterogeneity, as well as an efficient data mapping between reference datasets and newly obtained characterization data of CTCs. Unfortunately, these are currently not available due to the rarity of CTCs in peripheral blood4. The identification, characterization, and large-scale analysis of CTCs are challenging issues5. There remains an unmet challenge to locate the primary and/or metastatic lesions of CTCs.Circulating tumor cells (CTCs), which are cells detached from primary tumors and/or metastatic lesions, are the metastatic precursors of tumors. CTCs provide crucial insights into cancer biology and can be isolated from peripheral blood throughout the course of the disease. Thus, they are important targets of liquid biopsy. Liquid biopsy focusing on CTC identification and analysis can aid in early patient prognoses and guide the appropriate personalized therapy7. Based on these single-cell expression profile atlases, cancer cell type annotation, cancer lesion annotation, and cell group-specific up/down expressed gene identification can be achieved by supervised or unsupervised learning strategies. Since CTCs are rich in pathological information, integrating scRNA-seq analysis into a CTC study would reveal more detail about lesions and thus provide noninvasive surveillance of cancers3. In particular, single-cell expression characterization of CTCs provides an opportunity to carry out lesion tracing and may bring about a new revolution in liquid biopsy.As a promising and powerful technology for cellular molecular heterogeneity characterization, single-cell RNA sequencing (scRNA-seq) technologies have been widely applied in cancer research, resulting in an accumulation of a large amount of scRNA-seq data on tumor tissues8. Several studies have been undertaken to improve the reliability and simplicity of CTC capture and sequencing10. However, due to the lack of data accumulation and prior knowledge in the field of CTC scRNA-seq analysis, it is still difficult to acquire histogenesis information about CTCs from scRNA-seq omics data. Considering that CTCs are detached from primary cancer tissues, mapping CTCs to the atlas of primary cancer cells is an alternative strategy for lesion tracing based on CTCs. Nonetheless, the differences between CTCs and primary cancer cells pose an additional challenge. For noninvasive lesion tracing, there is still a need for a computational algorithm that can efficiently map scRNA-seq data on CTCs to reference atlases of primary cells from lesions. Such data will provide knowledge of histogenesis from the limited scRNA-seq data of CTCs, regardless of the scRNA-seq platform or cancer type.However, unlike primary tumor-related studies, previous CTC-derived studies mainly focus on the detection and enumeration of CTCs, with the result that few studies with scRNA-seq data are available. Additionally, the extremely low frequency and the difficulty of CTC capture also make single-cell sequencing of CTCs technically challenging, leading to the paucity of scRNA-seq data accumulation in this field1, there is always heterogeneity among patients, and CTCs are different from primary cancer cells11. Thus, effective knowledge transfer is required. As a well-known methodology in the field of transfer learning, domain adaptation (DA) aims to transfer knowledge of a source domain to a different but similar target domain, where all source-domain samples are labeled13. Based on the availability of labeled data in the target domain, DA can be classified into three categories: unsupervised DA, semi-supervised DA, and fully-supervised DA15. Because unsupervised DA assumes that the target-domain samples are unlabeled, it is most suitable for our situation, in which the lesion origins of CTCs are always unknown. Using the large collection of scRNA-seq data on primary tumors7, this paper introduces an unsupervised deep transfer-learning method called CTC-Tracer to transfer the histogenesis information learned from primary tumor cells to CTCs via efficiently mapping the scRNA-seq profiles of CTCs to the primary tumor scRNA-seq atlas. Thereby, CTC-Tracer can trace the original lesions of CTCs, distinguish CTCs from background cells (such as leukocytes) and discover the gene markers of CTCs.Nevertheless, although cancer cells from the same lesions share similar cancer-specific biomarkersLesion tracing based on single-cell expression profiles of CTCs is the foundation for real-time analysis of lesions. However, this requires a large number of CTC scRNA-seq data tagged with original lesions as the reference, but this is difficult to achieve due to the difficulty of CTC enrichment and capture, as well as the lack of attention to CTC single-cell characterization in the past. To address this challenge, we developed CTC-Tracer, which employs a transfer learning strategy to efficiently use knowledge from large cancer single-cell atlases to trace the original lesions of CTCs. In detail, using scRNA-seq expression profiles of CTCs isolated from blood samples as input, CTC-Tracer is designed to accurately identify CTCs and trace the sources of their lesions, and can also detect their expression changes relative to the lesion cells Fig. . As the To conduct transfer learning, CTC-Tracer takes the lesion-labeled scRNA-seq expression matrix from the reference atlas of the primary tumors as a source-domain dataset and the unlabeled scRNA-seq expression matrix of CTCs as a target-domain dataset. To carry out efficient lesion tracing of CTCs, CTC-Tracer integrates two learning modes: transductive and inductive learning, which are two concepts in the field of machine learning. Generally speaking, inductive learning infers labels for test samples  using a previously-trained model. On the other hand, transductive learning infers labels for test samples by retraining the previous model with training samples and features of test samples (a more detailed definition can be seen in Supplementary Note 16 (detailed in Methods). This way, we match samples with the same semantic class (defined in Methods) from different domains and assign pseudo labels for the samples in the target domain according to its matching source-domain samples (more details in the Methods).Like general DA methods, our model contains two modules: a feature extractor module that converts an input matrix to a feature vector representation, and a classifier module that assigns each feature vector representation to one category  of the source domain Fig. . In the Using a lesion-labeled scRNA-seq matrix of primary cancer cells , which is developed based on a binary classification model 18 to include a comprehensive background map of blood cells into the source dataset, and treating all tumor samples as a single class, CTC-Tracer can be used to distinguish blood cells from CTCs. Thus, CTC-Tracer is able to classify background cells in a new test dataset into categories of blood cells, and may accurately detect lesions using scRNA-seq data from roughly obtained CTC datasets (such as a CTC dataset enriched by density-gradient centrifugation), which will considerably improve the clinical application of liquid biopsy.CTCs are present at very low concentrations in the peripheral blood of most cancer patients, ranging from 1 to 10 cells per 10 mL. Thus, 0 to several hundred CTCs may be retained in 1000 to 10,000 background cells (mostly blood cells) after enrichment, posing a significant challenge for subsequent analysis (such as lesion tracing)del Fig. , to distTo verify the effectiveness of CTC-Tracer in this task, we integrated 372 CTCs  is then used to evaluate the performance based on the softmax values generated by CTC-Tracer. CTC-Tracer demonstrates an average AUC of 1.000 with a standard deviation (SD) of 0.000 across five replicates for the PBMC dataset and an average AUC of 0.999 with an SD of 4.000e-7 for the blood cell dataset Fig. . Using t23. We further validated the effects of a previously uncharacterized sodium/potassium-ATPase interacting protein NKAIN4 on cancer cell migration with wound healing assay. Using the pro-metastasis esophageal cancer cell line KYSE150, we found that overexpression of NKAIN4 suppresses the migration capacity of the cancer cells , which retrieves genes that are highly expressed relative to one another on CTCs or primary cells after CTC identification and lesion tracing. As a proof of concept, we performed differential expression analysis (DEA) between the collected CTCs  and primary cells (50318 cells from 25 tumor types). In total 1393 genes with significant changes were identified from the DEA  and domain-discrepancy loss (lcdd). To demonstrate the necessity of lreg and lcdd in the loss function, an ablation study was carried out, and the results indicated that all of these three loss items are indispensable . To evaluate the extensibility of the pre-trained CTC-Tracer model to a new batch of CTC data, we collected four external scRNA-seq samples from four independent published studies as Target dataset 2 with a total of 451 CTCs from two types of cancers  of CTC-Tracer showed significant advantages in terms of prediction accuracy and robustness across different datasets with various data scales and cancer types from different sequencing platforms in a moderate running time Fig. . In part24. The results indicated that CTC-Tracer can effectively map samples from different batches and reduce the distance between them  patient and two mouse models was obtained and tested by CTC-Tracer.In addition to single CTCs, CTCs can be found in the blood as cell aggregates, known as CTC clusters composed of several CTCs or CTCs and neutrophilsWe first applied CTC-Tracer on the 36 CTC objects from the BRCA patient  in the transductive learning mode to refine the model. CTC-Tracer achieved high accuracy across these samples  and xenografts 99.40%). We hypothesize that, due to CTC-Tracer’s ability to accurately classify CTCs, it is able to identify representable hidden gene signatures during its training process. When the fraction of WBC in the clusters is low, the expression trend of these gene signatures will not be affected, and consequently, neither will the outcome. To demonstrate our hypothesis, we measured the accuracy of CTC-Tracer on CTC-WBC clusters with varying WBC fractions using simulation samples. CTC-Tracer was found to be highly accurate (>90%) when the CTC fraction in the pseudo-aggregates was greater than or equal to 17% (both transductive and inductive learning modes) across various hosts , lesion tracing, and gene marker identification. CTC-Tracer is a multi-classification process that uses the accumulated single-cell transcriptome of primary cancer cells as the source sample and the related lesion type as category labels, then uses a domain adaptation strategy to correct the domain shift between primary cells in the source sample and CTCs in the target sample to achieve lesion annotation for CTCs Fig. . Compare38, but activated androgen receptor (AR) signaling provides a signature of breast CTCs associated with bone metastasis37. Using single-cell data from primary cancers as a reference, CTC-tracer adopts an unsupervised domain adaptation strategy to identify the origin of CTCs from many, rather than one or two, specific cancer types. The application of such general tools to CTCs analysis may help both the biologist and the physician to better interpret the information within the single-cell transcriptome.Many of the existing methods for tracing the origin of CTCs focus on understanding their unique biological features, which lack comprehensive analysis at the system level. For example, several studies indicated that the Notch pathway and immunomodulatory, inflammatory and mitogenicactivated pathways are signatures of breast cancer CTCs associated with brain metastasis29. Since CTC-Tracer integrates a binary classifier to distinguish CTCs from blood cells, CTC-Tracer can identify the CTCs from complicated samples, such as samples contaminated with WBC cells, that can be obtained by a simple technique such as density gradient enrichment17. This expands the sample types for CTCs analysis from purified CTCs to a much broader range of samples, which may further facilitate application of CTCs analysis.Currently, the analysis of CTCs relies heavily on accurate CTC capture, which requires significant experimental expertize and may result in cell loss and fixation issuesIn summary, CTC-Tracer presented excellent efficiency and accuracy while analyzing scRNA-seq data of various cancer types from different platforms, thus highlighting its potential for application to a broad range of CTC data sets. The launch of CTC-tracer opens an exciting avenue to promote the application of liquid biopsy in both basic research and clinical applications.CTC-Tracer is designed to trace the original lesion of CTCs, distinguish CTCs from PBMCs and infer gene markers that may participate in metastasis. The user can perform the trace in either the inductive learning or transductive learning mode by providing the gene expression matrix of CTCs normalized by log2TPM + 1)  as input. In the transductive learning mode, contrary to the inductive learning mode where we can use the pre-trained model directly, we must train the model in advance before prediction. In the inductive learning mode, only CTCs from cancers that have been pre-trained can be predicted well. We will continue to collect CTC scRNA-seq datasets from different cancers to retrain and refine the model. The pre-trained model was obtained in the transductive learning mode. In the default setting, we provide 25 types of primary tumors and PBMC datasets as source-domain samples and 4 CTC datasets from different cancers  as pre-trained target-domain samples (detailed in Supplementary Table  (Transcrlr) gradually. The detailed reduction principle is as follows:i and n represent the current iteration step in an epoch and the current number of epochs, respectively, N represents the total number of epochs for training, d refers to the max iteration number in an epoch, which is the integer quotient of the total number of target samples and the number of batch sizes. Respectively, gamma and power are two preset constants . In general, our model will reach convergence at ~500 epochs in ~15 mins.In the transductive learning mode, the features of the primary tumor and CTC datasets serve as features in source and target domains, respectively. The labels of source-domain samples are provided, while the labels on the target-domain samples are the learning targets. The model is then optimized by an Adam optimizer with a weight decay of 0.0005. The initial learning rate is set to 0.00005. The batch size is set to 64. Then the inverse decay scheduler is used to reduce the learning rate . The classifier contains three fully connected layers with the input layer connected via a 100-node hidden layer by the ReLU activation function. The number of output nodes is equal to the number of categories in the source data .CTC-Tracer contains two fully connected neural networks (CNNs), the feature extractor and the classifier. The feature extractor consists of four fully connected layers with hidden layers containing 1024 and 512 neurons, respectively. The hidden layers are connected by Rectified Linear Unit (ReLU) activation functionsTo overcome domain shift between primary cancer cells and CTCs, we adopted an unsupervised domain adaptation to achieve knowledge transfer (see details in the next section). After adaptation, all CTC samples were assigned with pseudo labels from the categories of the primary tumors. We then trained the classifier with labeled primary tumor samples and the pseudo-labeled CTC samples. More content on Algorithm methodology is described in the next section (Algorithm methodology).41. As a result, several excellent ideas have been proposed to solve domain shifts. Our model is based on a common assumption in recent universal domain adaptation studies16, that samples from both domains with the corresponding semantic classes will have the closest distance to each other in the sample space after clustering. Thus, the core idea of this model is to take the domain-specific clusters that have the minimum distance from each other as the consensus clusters across domains. Then, we assign target clusters with the corresponding pseudo labels of matched source clusters. Finally, we update the neural network parameters by optimizing objective functions, i.e., prototypical regularization and contrastive domain discrepancy. The detailed process is described in the following sections.Our model is based on domain adaptation, a branch of transfer learning that aims transfer of knowledge from source-domain samples to different, but similar, target-domain samples. Recently, multiple domain adaptation methods have been developedk-means, is a vector quantization approach derived from signal processing42. Given a collection of n observations , each of which is a D-dimensional vector, k-means clustering attempts to split the n observations into k (k ≤ n) groups  to minimize the within-cluster distances and maximize the distance between any two clusters. The goal is to minimize the pairwise squared deviations of points  within the same cluster while maximizing the difference in squared deviations between points in distinct clusters.After the process of feature embedding, the first task is determination of the cluster centers of both domains. The clustering method used in our domain adaptation process, called During the process of clustering, the first step is to determine the number of common semantic-level classes shared by the source and target domains.16 to associate common clusters from both domains. First, the cycle-consistent clusters are identified as common classes based on semantic-level consensus across cluster centers. Second, we adopt a metric named “domain consensus score” k-means clustering, the nearest cluster centers in both domains are searched for each cluster center. When the nearest clusters from different domains act as mutual nearest clusters, the pair of clusters reaches cluster consensus.After 16 is then determined through the collection of samples that reach consensus.After the CCM process, the second step is, for each sample from a paired cluster that reaches cluster consensus, to search its nearest cluster center in other domains. If the sample’s nearest center in other domain matches those achieved by CCM, these samples are defined as having reached consensus. The domain consensus scorek) across domains, i.e., returns 1 when m refers to the total number of source-domain samples in the source cluster. Equally, we can obtain the corresponding consensus score  of the consensus score of two views as the consensus score of this matched pair, which is called the domain consensus score:Since there are no labels in the target domain, the next task is to determine the exact class numbers for target domain samples. We solved this problem by a metric named the “domain consensus score”, which consists of an evaluation by two views. For example, given paired clustersWe calculate domain consensus scores of all the matched pairs obtained in the CCM process for the next training step.k value optimization”. This procedure involves an iteration of the domain consensus scores calculation by increasing k (k is the number of clusters to form as well as the number of centroids to generate). In the cluster center searching process of the k-means algorithm, we increase k until it converges to the preset maximum number of epochs. The k is optimized to make the domain consensus scores reach the maximum value, i.e., the k value with the highest domain consensus score is chosen as the best one. Eventually, we determine the suitable number of clusters in the target domain and reveal the categories of each defined target cluster. The domain shift is corrected by this process.After the previous processes, the suitable number of classes for target clustering remains unknown. Therefore, we perform a process named “After the processes described above, we determined the class categories and the common classes of both domains. As a result, we can assign pseudo labels to target-domain samples according to the result of clustering. In the next step, we optimize the neural network parameters by presetting objective functions with the pseudo-labeled target-domain samples.After the process of clustering, we determine the pseudo labels of target-domain samples. In the optimization process, we apply three objective functions to update the parameters of neural networks. The three objectives are (i) prototypical regularizer, (ii) contrastive domain discrepancy (CDD), and (iii) the cross-entropy loss function.k is the total number of target cluster centers, vi is the L2-normalized feature vector of the ith target-domain sample (T refers to Transpose operation), and τ is a temperature parameter that affects the density of distribution, adjusted to 0.1 by trial and error.We apply a prototypical regularizer to target-domain samples to improve the discriminability of target clusters. In detail, let Since every target-domain sample is assigned to corresponding common clusters, in order to reduce intra-class differences and widen the inter-class gap, we adopt contrastive domain discrepancy (CDD) to promote class-aware alignment over identified common samples. As a result, the model performs more accurate clustering. The formulation of CDD is as follows:xi, we define the output of the l-th layer as ϕl (xi), with the model parameterized by 44 formalizes the difference between two distributions with mean embeddings in the reproducing kernel Hilbert space (RKHS):H is a unit ball in RKHS. The squared value of MMD is then computed using the empirical kernel mean embeddings for a layer l:xs∈S′⊂S, xt∈T′⊂T,ns = |S′|,nt = |T′|. The S′ and T′ are the mini-batch source and target data randomly sampled from source (S) and target dataset (T). kl signifies the kernel used for the deep neural network’s l-th layer. CDD is based on MMD and takes both intra- and inter-class discrepancy into account.Given an input 1, c2 that could be the same or different, supposingDH ise1, e2 and e3 are defined as:Specifically, as for two classes cns is the number of source-domain samples, Cs denotes the total number of cluster centers for source-domain samples, σ is the softmax function.overall objective function is defined as:lce represents the cross-entropy loss on source-domain samples in Eq. lcdd is the domain alignment loss on both domain samples in Eq. lreg corresponds to the regularizer in Eq. λ and ω are set to 0.1 and 3.0 respectively. Then, i and n represent the current iteration step in an epoch and the current number of epochs, N represents the total number of epochs. Similarly, d is the max iteration number in an epoch.The cross-entropy loss function is used to optimize the classification performance of source domain samples. The definition of cross-entropy is shown in Eq. Finally, in the inference process, each target-domain sample is assigned a class label from the prototype bank Generally speaking, our model will execute the processes above iteratively before reaching convergence or meeting expectations. Finally, as a result of iterative training, the model can precisely assign the exact labels to target-domain samples and construct a common representation space for the source and target domains.CNP0000095), 167 BRCA (GSE109761), 77 PC (GSE67980), 15 MEL (GSE157745) from 4 published studies was collected as target data (Target dataset 1). An scRNA-seq expression matrix with 451 CTCs , PRJNA471754, 6 MEL(GSE38495) from 4 published studies was treated as test data (Target dataset 2). An RNA-seq expression matrix consisted of expression profiles from 13 single CTCs, 17 CTC clusters, and 6 CTC-WBC clusters of a BRCA patient from a recently published work that was treated as re-training data. And the RNA-seq profiles of 104 single CTCs, 107 CTC clusters, and 59 CTC-WBC clusters of two xenografts from the same study were treated as test data. The blood cell atlas data matrix consisted of 7643 blood cells was collected from GSE149938. The detailed information on these datasets can be found in Supplementary Table 2(TPM+1), where TPM was defined as transcripts per million.A scRNA-seq expression matrix consisting of 50318 cells from 25 primary tumors, a PBMC dataset collected from CancerSEA and several publicly accessible databases (detailed in Data availability), and used as source-domain data. After removing CTCs, the source-domain data matrix consisted of 44572 primary tumor cells and 5746 PBMCs. Meanwhile an scRNA-seq expression matrix with 372 CTCs (including 113 HCC (45 pipeline v2.3.0 (github.com/broadinstitute/Drop-seq).The CTC datasets in target and test data were filtered according to the original articles, and we accepted the conclusions of the articles as the ground truth for CTCs. For scRNA-seq from 3'end or 5'end counting protocols, paired-end sequence data were first processed by filtering out reads having minimum barcode quality scores below 10. Second, the reads were trimmed to remove any noise from the adapter sequence or ployA tails, and the clean data were aligned to the human (GRCh38) reference genome assembly with STAR v2.7.3a  with default settings. To quantify the gene expression, uniquely mapped reads were used to generate an expression profile for downstream analysis. The above data processing steps were referred to as Drop-seq12 , the previous training process for tranductive learning tasks was susceptible to the overfitting phenomenon ; therefore we accelerate the decay of learning rate (set “power” to 10) to obtain a more general model for the inductive learning task.The model used to evaluate inductive learning was obtained via a CTC-Tracer (transductive learning mode) with the 372 CTCs  and uniform manifold approximation and projection (UMAP) analyses were used to embed the cells into two-dimensional spaces. Then, to quantitatively evaluate the cell distance among source-domain and target-domain data before and after transfer learning, MMD is used based on the t-SNE embedding results.46, scmap47 (including ScMapCell and ScMapCluster), SVM, Seurat48, SingleCellNet49, ScAdapt50, CHETAH51, scArches52 and Symphony53 on our task. We used the hyperparameters recommended by these tools and ran the programs under the corresponding tutorials. We chose the accuracy score as the final prediction metric, which is described as the proportion of correctly predicted samples. Two comparisons (comparison I and II) were conducted to evaluate the performance of CTC-Tracer in the transductive and inductive learning modes. Except for SVM and superCT, all other algorithms in comparison I were performed in transductive learning mode using labeled source-domain samples and unlabeled target-domain samples as input and inferring the category labels of the target-domain samples during the training procedure. In comparison II, CTC-Tracer was executed using inductive learning with labeled source-domain samples and unlabeled target-domain samples as input, and the obtained pre-trained model was then used to predict the category labels of the target samples. To evaluate the accuracy of other methods, we initially trained the models (model 1) of ten other methods using the same input (the labels of CTCs were provided in training samples for these methods) as CTC-Tracer. Then, in order to avoid noisy information from primary tumor cells, we trained models (model 2) of these 10 methods using CTCs as training data alone. The analysis of SVM, superCT, and ScAdapt were conducted in inductive learning mode since they can be used in inductive learning mode, whereas models of other methods were trained in their inflexible, built-in transductive learning mode.To evaluate the accuracy of CTC-Tracer, we compared it with 10 other cell annotation tools, including SuperCT54 (a python package) to identify differentially expressed genes  among different categories. Cells are assigned to different categories according to users. In this study, cells were separated into two categories: CTCs and primary cancer cells. Genes with resulting p-value < 0.05 and logFC > 4 were considered for further analysis. CTC-Tracer also integrates the R package ‘clusterProfiler’55 to perform Gene Ontology analysis based on the top 30 markers .After filtering and annotating CTCs, CTC-Tracer incorporates a marker identification process as an auxiliary function. CTC-Tracer utilizes raw gene expression matrices as input and integrates the ‘rank genes groups’ function of scanpyNKIAN4 (NM_021426.4) was synthesized by GenScript and cloned to pLenti-EF1a-PGK construct. The primers used to generate plasmids and the PCR program are provided in Supplementary Table The cDNA sequence of NKAIN4 constructs and were virus packing constructs were transfected into 293 T cells using Lipofectamine 2000 (Thermo Fisher Scientific). Virus supernatant was collected 48 h after transfection. The KYSE150 cells were infected with viral supernatant in the presence of 10 μg/ml polybrene (Genomeditech) and were then selected in growth media containing 2 μg/ml puromycin (Beyotime). Reagents are listed in Supplementary Table The 293 T cells were cultured in Dulbecco’s modified Eagle’s medium (DMEM) (Gibco) medium supplemented with 10% FBS (Gibco), 1% Penicillin-Streptomycin Solution (Thermo fisher). The KYSE150 cells were cultured in RPMI 1640 medium (Gibco) supplemented with 10% FBS, 1% Penicillin-Streptomycin Solution. The cells were maintained in a 37 °C humidified incubator supplied with 5% CO2. Lentiviral Once the cells reached confluent within a monolayer, a single scratch was made using a sterile 200 μL pipette tip. Images were obtained at 0 h and 12 h. The width of the scratch was determined using the Image J software.Further information on research design is available in the supplementary informationReporting Summary


Feature selection is an independent technology for high-dimensional datasets that has been widely applied in a variety of fields. With the vast expansion of information, such as bioinformatics data, there has been an urgent need to investigate more effective and accurate methods involving feature selection in recent decades. Here, we proposed the hybrid MMPSO method, by combining the feature ranking method and the heuristic search method, to obtain an optimal subset that can be used for higher classification accuracy. In this study, ten datasets obtained from the UCI Machine Learning Repository were analyzed to demonstrate the superiority of our method. The MMPSO algorithm outperformed other algorithms in terms of classification accuracy while utilizing the same number of features. Then we applied the method to a biological dataset containing gene expression information about liver hepatocellular carcinoma (LIHC) samples obtained from The Cancer Genome Atlas (TCGA) and Genotype-Tissue Expression (GTEx). On the basis of the MMPSO algorithm, we identified a 18-gene signature that performed well in distinguishing normal samples from tumours. Nine of the 18 differentially expressed genes were significantly up-regulated in LIHC tumour samples, and the area under curves (AUC) of the combination seven genes  in classifying tumours with normal samples was greater than 0.99. Six genes  were significantly correlated with survival time. The MMPSO algorithm can be used to effectively extract features from a high-dimensional dataset, which will provide new clues for identifying biomarkers or therapeutic targets from biological data and more perspectives in tumor research. K highest-scoring features, feature subset selection selects the subset of features that perform well together. Some heuristic search strategies  of the dataset and I* denotes the maximum mutual information of D—G with the i-by-j grid, where the default B(n) = n0.6.In the Pbest. The other is called Gbest, which is determined by the entire particle swarm. After determining the Gbest and Pbest values, the particle updates its speed and position based on The particle swarm optimization (PSO) algorithm is a heuristic search algorithm that originated from studies of bird predation behavior . The firk represents the number of iterations; Vkand Xk represent the particle’s current velocity and position, respectively; r1, r2 are random values between ; c1, c2 are the learning factors; ω is the inertia weight, which is used to control the influence of the last iteration’s speed on the current speed. A smaller and larger ω can strengthen the PSO algorithm’s local or global search ability, respectively.In the above equations, K features as the input of the next step to reduce the computational load for the PSO. The K features were used in the third step to initialize the particle swam and calculate the fitness of each particle. For the wrapper feature selection algorithm, only the classification accuracy is used as the fitness function to guide the feature selection process, which will lead to a larger scale of the selected feature subset   . NselectHere, we respectively compared the classification accuracy of the MMPSO method with the results of other algorithms, including mRMR , ILFS R, ReliefFhttps://toil-xena-hub.s3.us-east-1.amazonaws.com/download/TCGA-GTEx-TARGET-gene-exp-counts.deseq2-normalized.log2.gz.A total of eleven datasets were used in this study; the basic information about the datasets was shown in c1: 2; c2: 2; ω: 0.9; α: 0.95; β: 0.05.In this section, we focused on testing the accuracy of our proposed MMPSO method and compared it with other methods of mRMR, ILFS, ReliefF, Mutinffs, FSV, Fisher, CFS and UFSOL. All experiments in this study were carried out on a Windows 10 system with an Intel(R) Xeon(R) CPU E5-2420, 1.9 Ghz processor with 16 GB RAM. Our proposed algorithm was implemented in MATLAB 2020b, and the PSO parameters were as follows: population size: 100; number of iterations: 50; K was 100. When the number of original features was greater than 100, the top 100 features from the ranking result were selected as the PSO input for the MMPSO method; otherwise, all features were selected as the input. In P < 0.01 in the Wilcoxon rank sum test with continuity correction, Wald and P value, as shown in After analyzing the first ten datasets, we employed the MMPSO method on the LIHC dataset to identify features (gene biomarkers) that can be used to distinguish the tumor group from the normal group with high accuracy. Different from the previous datasets, LIHC is an unbalanced dataset containing 371 tumor samples and 160 normal samples. Therefore, the preprocessing was needed and the number of genes was reduced from over 60,000 to 15,185 after preprocessing. When the genes were ranked by the mRMR based on MIC method, the top 100 genes were selected and input into PSO to identify the best gene signatures. Finally, we obtained a signature of 18 genes through the MMPSO algorithm, that had better classification compared to other methods. The 18 genes were ACTN1, CACHD1, ERAP2, FAM171A1, FKBP1B, HIST1H2BC, PLVAP, PRKD1, RPL7AP6, ADRA2B, DMKN, FNDC4, NPC1L1, POMC, PYROXD2, RBP1, TRIM29, and ZBED9, with the relative expression of the first nine genes significantly increasing in tumors and the last nine genes decreasing  survival curve was performed by using the “survival” and “survminer” packages in R. For each gene, the cut-off points obtaining from “survminer” package then divided gene expression values into the high (high) and the low (low) groups. We identified that higher expression levels of CACHD1, FKBP1B, PRKD1, and RPL7AP6 were associated with worse overall survival (OS) time, whereas higher expression levels of ADRA2B, PYROXD2 were associated with better OS, as shown in High-dimensional data such as text data, multimedia data, aerospace collection data and biometric data have become more common in recent years . The neeN, 2N combinations of features must be tried using the greedy strategy, which is unsustainable for ordinary computer systems, especially when the number of features is very large  for further analysis. After performing the MMPSO algorithm, a signature including 18 genes was identified as significant biomarkers for distinguishing between tumor and normal groups. The PCA and ROC analysis results all confirmed that the biomarkers we selected have great discrimination ability, while six biomarkers were significantly associated with the overall survival of patients. Furthermore, we need to discuss the significance of these biomarkers from a biological perspective. Studies  identifiK features as the PSO input without a theoretical foundation. Therefore, there is still some space for improvement in selecting a better subset of features for high-dimensional datasets, and we will advance this in future works.In this paper, we proposed the MMPSO hybrid algorithm to identify a feature subset for high-dimensional dataset. The experimental data provided evidences that our method outperformed others. More importantly, by applying our proposed algorithm to the biological LIHC dataset, we obtained the gene signatures in classifying tumors and normal samples with high efficacy. Our study also has several limitations. Despite the fact that we used rapidMic to accelerate the calculation, the computational complexity for too many features remains relatively high. In addition, we selected only the top 10.7717/peerj-cs.933/supp-1Supplemental Information 1Click here for additional data file.10.7717/peerj-cs.933/supp-2Supplemental Information 2Click here for additional data file.10.7717/peerj-cs.933/supp-3Supplemental Information 3Click here for additional data file.10.7717/peerj-cs.933/supp-4Supplemental Information 4Click here for additional data file.10.7717/peerj-cs.933/supp-5Supplemental Information 5Click here for additional data file.