[{"content":" Foundation models for single-cell transcriptomics learn cell representations from millions of profiles, but are commonly pretrained on unordered cells and therefore do not explicitly condition on cell history. We introduce single-cell Transformer-iN-Transformer (scTNT), which conditions gene-expression reconstruction on inferred trajectories, represented here as ordered cell sequences. scTNT combines a frozen reduced-layer scGPT autoencoder with a trainable decoder-only transformer over sequences of latent cell embeddings and is trained by masked gene-expression reconstruction. On a CD8 T-cell exhaustion dataset with optimal transport-derived cell sequences, scTNT improves masked reconstruction relative to the scGPT baseline and outperforms alternative sequence backbones under controlled evaluations. We further propose a gradient-based gene-history attribution pipeline and apply TRRUST regulon enrichment to generate hypotheses about context-associated regulatory programs. ICLR workshop 2026 ","permalink":"https://wenjie-fan.github.io/posts/sctnt/","summary":"\u003cbr/\u003e\n\u003cfigure\u003e\n    \u003cimg align=\"right\" src=\"differentiation.png\" style=\"width: 340px; margin: 0px 0px 5px 20px;\" class=\"img_floats\" /\u003e\n\u003c/figure\u003e\n\u003cp\u003eFoundation models for single-cell transcriptomics learn cell representations from millions of profiles, but are commonly pretrained on unordered cells and therefore do not explicitly condition on cell history. We introduce single-cell Transformer-iN-Transformer (scTNT), which conditions gene-expression reconstruction on inferred trajectories, represented here as ordered cell sequences. scTNT combines a frozen reduced-layer scGPT autoencoder with a trainable decoder-only transformer over sequences of latent cell embeddings and is trained by masked gene-expression reconstruction. On a CD8 T-cell exhaustion dataset with optimal transport-derived cell sequences, scTNT improves masked reconstruction relative to the scGPT baseline and outperforms alternative sequence backbones under controlled evaluations. We further propose a gradient-based gene-history attribution pipeline and apply TRRUST regulon enrichment to generate hypotheses about context-associated regulatory programs.\n\u003cbr/\u003e \u003cbr/\u003e\n\u003ca href=\"/posts/sctnt/sctnt.pdf\"\u003e\u003cstrong\u003eICLR workshop 2026\u003c/strong\u003e\u003c/a\u003e    \u003c/p\u003e","title":"Trajectory-Conditioned Modelling of Single-Cell Expression"},{"content":" Principal component analysis (PCA) is frequently used for the visualization and unsupervised clustering of mass spectrometry (MS) proteomics data. However, there is no intuitive method to handle missing values, and the intricate structure of experimental design is often neglected. A typical example is data from biological experiments with replicate structure, which displays both variations and correlations among replicates, and suffers from incomplete observations. Probabilistic principal component analysis (PPCA) recovers missing values soundly within a probabilistic framework, yet it still overlooks the replicate-wise variations.\nIn this study, we extend PPCA to be conscious of the replicated model for MS data with replicated structures and possibly broader. We present two distinct inference approaches: one focuses on the likelihood model by the Expectation-Maximization (EM) algorithm, while the other lies in the Bayesian framework employing the Markov chain Monte Carlo (MCMC) method. Our findings indicate that both approaches yield more nuanced analyses, some aspects of which have previously been ignored by researchers. The likelihood-centric approach hints replicates that may be unsuitable for PCA and tackles the challenge of missing values. In contrast, the Bayesian approach provides insightful visualizations, quantifies clustering uncertainty, and determines the risk-minimizing clustering rule. Report Github Vignettes: EM algorithm\nThis is a project supervised by Dr. Oliver Crook from the University of Oxford.\n","permalink":"https://wenjie-fan.github.io/posts/replicateppca/","summary":"\u003cbr/\u003e\n\u003cfigure\u003e\n    \u003cimg align=\"right\" src=\"emPPCA.jpg\" style=\"width: 340px; margin: 0px 0px 5px 20px;\" class=\"img_floats\" /\u003e\n\u003c/figure\u003e\n\u003cp\u003ePrincipal component analysis (PCA) is frequently used for the visualization and unsupervised clustering of mass spectrometry (MS) proteomics data. However, there is no intuitive method to handle missing values, and the intricate structure of experimental design is often neglected. A typical example is data from biological experiments with replicate structure, which displays both variations and correlations among replicates, and suffers from incomplete observations. Probabilistic principal component analysis (PPCA) recovers missing values soundly within a probabilistic framework, yet it still overlooks the replicate-wise variations.\u003c/p\u003e","title":"Probabilistic Principal Component Analysis for Replicated Data in Proteomics"},{"content":" Imagine stretching a long strip of PET, often the plastic deformation is violent, and the sample just breaks. However, sometimes the film can be stretched for more than 2 times in length, and the stress actually oscillates. The obvious manifestation is a pattern consists of opaque and translucent stripes, shown as the gif on the right. This region is what we called \u0026ldquo;neck\u0026rdquo;, which has smaller width and thickness than the undeformed part. Our main purpose is to predict the stress-strain curve when stretching a polymer film, as well as for which parameters there will be such an oscillation. The following report will include the model and the numerical scheme to this problem. The slides (extracting from the report) are used to present findings and propose future experiments to Dr. Chaoying Wan, Warwick Manufacturing Group. Project Report Slides This is a summer project supervised by Prof. Ed Brambley from the University of Warwick. I\u0026rsquo;m very grateful to him for his enthusiastic and responsible supervision on the project.\nPhoto with Prof. Ed Brambley\n","permalink":"https://wenjie-fan.github.io/posts/polymer/","summary":"\u003cbr/\u003e\n\u003cfigure\u003e\n    \u003cimg align=\"right\" src=\"polymer.gif\" style=\"width: 330px; margin: 0px 0px 5px 20px;\" class=\"img_floats\" /\u003e\n\u003c/figure\u003e\n\u003cp\u003eImagine stretching a long strip of PET, often the plastic deformation is violent, and the sample just breaks. \u003cbr/\u003e \u003cbr/\u003e\nHowever, sometimes the film can be stretched for more than 2 times in length, and the stress actually oscillates. The obvious manifestation is a pattern consists of opaque and translucent stripes, shown as the gif on the right. This region is what we called \u0026ldquo;neck\u0026rdquo;, which has smaller width and thickness than the undeformed part. Our main purpose is to predict the stress-strain curve when stretching a polymer film, as well as for which parameters there will be such an oscillation.\n\u003cbr/\u003e \u003cbr/\u003e\nThe following report will include the model and the numerical scheme to this problem. \u003cbr/\u003e\nThe slides (extracting from the report) are used to present findings and propose future experiments to \u003ca href=\"https://warwick.ac.uk/fac/sci/wmg/people/profile?id=1271420\"\u003eDr. Chaoying Wan\u003c/a\u003e, Warwick Manufacturing Group.\n\u003cbr/\u003e \u003cbr/\u003e\n\u003ca href=\"/posts/polymer/Refinements_on_a_novel_model_for_oscillatory_neck_propagation_in_polymer_films.pdf\"\u003e\u003cstrong\u003eProject Report\u003c/strong\u003e\u003c/a\u003e     \u003ca href=\"/posts/polymer/slides.pdf\"\u003e\u003cstrong\u003eSlides\u003c/strong\u003e\u003c/a\u003e\n\u003cbr/\u003e\u003c/p\u003e","title":"Oscillatory Neck Propagation in Polymer Films"},{"content":" I am a PhD student at the University of Tübingen, supervised by Prof. Dr. Manfred Claassen and Dr. Antonio Orvieto.\nMy research lies in the intersection of deep learning and single-cell biology, with a specific focus on developing statistical methods to address challenges in healthcare.\nPrior to my PhD, I obtained my Master\u0026rsquo;s and Bachelor\u0026rsquo;s degree in Mathematics and Statistics from Keble College, University of Oxford.\nEducation 🎓 PhD in Computer Science University of Tübingen 2024 - ongoing 🎓 MMath in Mathematics and Statistics University of Oxford 2020 - 2024 Interests Machine learning Computational biology More about myself I enjoy taking photographs and own a Fujifilm XT-4 with a couple lenses: XF33mmF1.4, XF70-300mmF4-5.6, and XF16-80mmF4. Some of my photos are available here.\n","permalink":"https://wenjie-fan.github.io/about/","summary":"\u003cfigure\u003e\n\u003cimg src=\"self2.jpg\" class=\"img_floats\" align=\"left\" style=\"width: 260px; height: 330px; object-fit: cover; object-position: center 85%; margin: 0px 30px 0px 0px;\"/\u003e\n\u003c/figure\u003e\n\u003cp\u003eI am a PhD student at the University of Tübingen, supervised by \u003ca href=\"https://claassenlab.github.io/people/manfred-claassen.html\"\u003eProf. Dr. Manfred Claassen\u003c/a\u003e and \u003ca href=\"http://orvi.altervista.org/\"\u003eDr. Antonio Orvieto\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003eMy research lies in the intersection of deep learning and single-cell biology, with a specific focus on developing statistical methods to address challenges in healthcare.\u003c/p\u003e\n\u003cp\u003ePrior to my PhD, I obtained my Master\u0026rsquo;s and Bachelor\u0026rsquo;s degree in Mathematics and Statistics from Keble College, University of Oxford.\u003c/p\u003e","title":"About"},{"content":" Latent Dirichlet Allocation via Gibbs sampling Latent Dirichlet Allocation (LDA) is a classic model for topic modelling, which often appears in natural language processing. The model can also be extended to analyse, for example, transcriptomics data. Below is an implementation via a Gibbs sampler, tested on a corpus of short articles. This Markov chain Monte Carlo (MCMC) approach was proposed by Thomas L. Griffiths and Mark Steyvers in their paper \u0026ldquo;Finding scientific topics\u0026rdquo;. HTML\n","permalink":"https://wenjie-fan.github.io/misc/","summary":"\u003chr\u003e\n\u003ch3 id=\"latent-dirichlet-allocation-via-gibbs-sampling\"\u003eLatent Dirichlet Allocation via Gibbs sampling\u003c/h3\u003e\n\u003cp\u003eLatent Dirichlet Allocation (LDA) is a classic model for topic modelling, which often appears in natural language processing. The model can also be extended to analyse, for example, transcriptomics data. Below is an implementation via a Gibbs sampler, tested on a corpus of short articles. This Markov chain Monte Carlo (MCMC) approach was proposed by Thomas L. Griffiths and Mark Steyvers in their paper \u0026ldquo;Finding scientific topics\u0026rdquo;.\n\u003ca href=\"/LDA_CG.html\"\u003e\u003cspan style=\"display:inline-block;background-color:rgb(180,180,180);color:white;padding:0px 10px;border-radius:4px;\"\u003e\u003cfont size='3'\u003eHTML\u003c/font\u003e\u003c/span\u003e\u003c/a\u003e\u003c/p\u003e","title":"Miscellaneous"},{"content":"2023 Heathrow Airport, London, UK Kyoto, Japan Kyoto, Japan Shibuya, Tokyo, Japan Asakusa, Tokyo, Japan Tokyo Tower, Tokyo, Japan Tuen Mun, Hong Kong SAR, China Whitby, UK Whitby, UK Saltburn, UK York, UK York, UK Cappadocia, Turkeyie Fethiye, Turkeyie Istanbul, Turkeyie Zermatt, Switzerland Grindelward, Switzerland Luzern, Switzerland Zurich, Switzerland 2022 Disneyland, Paris Pompidou, Paris ","permalink":"https://wenjie-fan.github.io/photos/","summary":"\u003ch2 id=\"2023\"\u003e2023\u003c/h2\u003e\n\u003cfigure\u003e\n\u003cfigure class=\"align-center \"\u003e\n    \u003cimg loading=\"lazy\" src=\"2023/heathrow.JPEG#center\"/\u003e \n\u003c/figure\u003e\n\n\u003cfigcaption align = \"right\"\u003e\u003ch6\u003e Heathrow Airport, London, UK \u003c/h6\u003e\u003c/figcaption\u003e\n\u003c/figure\u003e\n\u003cbr/\u003e\n\u003cdiv style=\"display: flex; justify-content: center; align-items: center; gap: 20px;\"\u003e\n    \u003cfigure style=\"margin: 0; width: 50%;\"\u003e\n        \u003cimg src=\"2023/kiyomizu.JPEG\" alt=\"Kiyomizu\" style=\"width: 100%;\"\u003e\n        \u003cfigcaption style=\"text-align: right;\"\u003e\u003ch6\u003eKyoto, Japan\u003c/h6\u003e\u003c/figcaption\u003e\n    \u003c/figure\u003e\n    \u003cfigure style=\"margin: 0; width: 50%;\"\u003e\n        \u003cimg src=\"2023/kyoto1.JPEG\" alt=\"Kyoto1\" style=\"width: 100%;\"\u003e\n        \u003cfigcaption style=\"text-align: right;\"\u003e\u003ch6\u003eKyoto, Japan\u003c/h6\u003e\u003c/figcaption\u003e\n    \u003c/figure\u003e\n\u003c/div\u003e\n\u003cbr/\u003e\n\u003cdiv style=\"display: flex; justify-content: center; align-items: center; gap: 20px;\"\u003e\n    \u003cfigure style=\"margin: 0; width: 50%;\"\u003e\n        \u003cimg src=\"2023/shibuya.JPEG\" alt=\"Shibuya\" style=\"width: 100%;\"\u003e\n        \u003cfigcaption style=\"text-align: right;\"\u003e\u003ch6\u003eShibuya, Tokyo, Japan\u003c/h6\u003e\u003c/figcaption\u003e\n    \u003c/figure\u003e\n    \u003cfigure style=\"margin: 0; width: 50%;\"\u003e\n        \u003cimg src=\"2023/asakusa.JPEG\" alt=\"Asakusa\" style=\"width: 100%;\"\u003e\n        \u003cfigcaption style=\"text-align: right;\"\u003e\u003ch6\u003eAsakusa, Tokyo, Japan\u003c/h6\u003e\u003c/figcaption\u003e\n    \u003c/figure\u003e\n\u003c/div\u003e\n\u003cbr/\u003e\n\u003cfigure\u003e\n\u003cfigure class=\"align-center \"\u003e\n    \u003cimg loading=\"lazy\" src=\"2023/tokyo_tower.JPEG#center\"/\u003e \n\u003c/figure\u003e\n\n\u003cfigcaption align = \"right\"\u003e\u003ch6\u003e Tokyo Tower, Tokyo, Japan \u003c/h6\u003e\u003c/figcaption\u003e\n\u003c/figure\u003e\n\u003cbr/\u003e\n\u003cfigure\u003e\n\u003cfigure class=\"align-center \"\u003e\n    \u003cimg loading=\"lazy\" src=\"2023/tuen_mun.JPEG#center\"/\u003e \n\u003c/figure\u003e\n\n\u003cfigcaption align = \"right\"\u003e\u003ch6\u003e Tuen Mun, Hong Kong SAR, China \u003c/h6\u003e\u003c/figcaption\u003e\n\u003c/figure\u003e\n\u003cbr/\u003e\n\u003cdiv style=\"display: flex; justify-content: center; align-items: center; gap: 20px;\"\u003e\n    \u003cfigure style=\"margin: 0; width: 50%;\"\u003e\n        \u003cimg src=\"2023/whitby.JPEG\" alt=\"Whitby1\" style=\"width: 100%;\"\u003e\n        \u003cfigcaption style=\"text-align: right;\"\u003e\u003ch6\u003eWhitby, UK\u003c/h6\u003e\u003c/figcaption\u003e\n    \u003c/figure\u003e\n    \u003cfigure style=\"margin: 0; width: 50%;\"\u003e\n        \u003cimg src=\"2023/whitby_sea.JPEG\" alt=\"Whitby2\" style=\"width: 100%;\"\u003e\n        \u003cfigcaption style=\"text-align: right;\"\u003e\u003ch6\u003eWhitby, UK\u003c/h6\u003e\u003c/figcaption\u003e\n    \u003c/figure\u003e\n\u003c/div\u003e\n\u003cbr/\u003e\n\u003cfigure\u003e\n\u003cfigure class=\"align-center \"\u003e\n    \u003cimg loading=\"lazy\" src=\"2023/saltburn.JPEG#center\"/\u003e \n\u003c/figure\u003e\n\n\u003cfigcaption align = \"right\"\u003e\u003ch6\u003e Saltburn, UK \u003c/h6\u003e\u003c/figcaption\u003e\n\u003c/figure\u003e\n\u003cbr/\u003e\n\u003cdiv style=\"display: flex; justify-content: center; align-items: center; gap: 20px;\"\u003e\n    \u003cfigure style=\"margin: 0; width: 50%;\"\u003e\n        \u003cimg src=\"2023/york_guitar.JPEG\" alt=\"York1\" style=\"width: 100%;\"\u003e\n        \u003cfigcaption style=\"text-align: right;\"\u003e\u003ch6\u003eYork, UK\u003c/h6\u003e\u003c/figcaption\u003e\n    \u003c/figure\u003e\n    \u003cfigure style=\"margin: 0; width: 50%;\"\u003e\n        \u003cimg src=\"2023/york_park.JPEG\" alt=\"York2\" style=\"width: 100%;\"\u003e\n        \u003cfigcaption style=\"text-align: right;\"\u003e\u003ch6\u003eYork, UK\u003c/h6\u003e\u003c/figcaption\u003e\n    \u003c/figure\u003e\n\u003c/div\u003e\n\u003cbr/\u003e\n\u003cdiv style=\"display: flex; justify-content: center; align-items: center; gap: 20px;\"\u003e\n    \u003cfigure style=\"margin: 0; width: 50%;\"\u003e\n        \u003cimg src=\"2023/cappadocia.JPEG\" alt=\"turkey1\" style=\"width: 100%;\"\u003e\n        \u003cfigcaption style=\"text-align: right;\"\u003e\u003ch6\u003eCappadocia, Turkeyie\u003c/h6\u003e\u003c/figcaption\u003e\n    \u003c/figure\u003e\n    \u003cfigure style=\"margin: 0; width: 50%;\"\u003e\n        \u003cimg src=\"2023/fethiye.JPEG\" alt=\"turkey2\" style=\"width: 100%;\"\u003e\n        \u003cfigcaption style=\"text-align: right;\"\u003e\u003ch6\u003eFethiye, Turkeyie\u003c/h6\u003e\u003c/figcaption\u003e\n    \u003c/figure\u003e\n\u003c/div\u003e\n\u003cbr/\u003e\n\u003cfigure\u003e\n\u003cfigure class=\"align-center \"\u003e\n    \u003cimg loading=\"lazy\" src=\"2023/istanbul.JPEG#center\"/\u003e \n\u003c/figure\u003e\n\n\u003cfigcaption align = \"right\"\u003e\u003ch6\u003e Istanbul, Turkeyie \u003c/h6\u003e\u003c/figcaption\u003e\n\u003c/figure\u003e\n\u003cbr/\u003e\n\u003cdiv style=\"display: flex; justify-content: center; align-items: center; gap: 20px;\"\u003e\n    \u003cfigure style=\"margin: 0; width: 50%;\"\u003e\n        \u003cimg src=\"2023/zermatt.JPEG\" alt=\"Zermatt\" style=\"width: 100%;\"\u003e\n        \u003cfigcaption style=\"text-align: right;\"\u003e\u003ch6\u003eZermatt, Switzerland\u003c/h6\u003e\u003c/figcaption\u003e\n    \u003c/figure\u003e\n    \u003cfigure style=\"margin: 0; width: 50%;\"\u003e\n        \u003cimg src=\"2023/grindelward.JPEG\" alt=\"Grindelward\" style=\"width: 100%;\"\u003e\n        \u003cfigcaption style=\"text-align: right;\"\u003e\u003ch6\u003eGrindelward, Switzerland\u003c/h6\u003e\u003c/figcaption\u003e\n    \u003c/figure\u003e\n\u003c/div\u003e\n\u003cbr/\u003e\n\u003cfigure\u003e\n\u003cfigure class=\"align-center \"\u003e\n    \u003cimg loading=\"lazy\" src=\"2023/luzern.JPEG#center\"/\u003e \n\u003c/figure\u003e\n\n\u003cfigcaption align = \"right\"\u003e\u003ch6\u003e Luzern, Switzerland \u003c/h6\u003e\u003c/figcaption\u003e\n\u003c/figure\u003e\n\u003cbr/\u003e\n\u003cfigure\u003e\n\u003cfigure class=\"align-center \"\u003e\n    \u003cimg loading=\"lazy\" src=\"2023/zurich.JPEG#center\"/\u003e \n\u003c/figure\u003e\n\n\u003cfigcaption align = \"right\"\u003e\u003ch6\u003e Zurich, Switzerland \u003c/h6\u003e\u003c/figcaption\u003e\n\u003c/figure\u003e\n\u003cbr/\u003e\n\u003ch2 id=\"2022\"\u003e2022\u003c/h2\u003e\n\u003cfigure\u003e\n\u003cfigure class=\"align-center \"\u003e\n    \u003cimg loading=\"lazy\" src=\"2022/Disneyland.JPG#center\"/\u003e \n\u003c/figure\u003e\n\n\u003cfigcaption align = \"right\"\u003e\u003ch6\u003e Disneyland, Paris \u003c/h6\u003e\u003c/figcaption\u003e\n\u003c/figure\u003e\n\u003cbr/\u003e\n\u003cfigure\u003e\n\u003cfigure class=\"align-center \"\u003e\n    \u003cimg loading=\"lazy\" src=\"2022/Pompidou.jpeg#center\"/\u003e \n\u003c/figure\u003e\n\n\u003cfigcaption align = \"right\"\u003e\u003ch6\u003e Pompidou, Paris \u003c/h6\u003e\u003c/figcaption\u003e\n\u003c/figure\u003e","title":"Photo Gallery"}]