---
title: "Multi-Sample Analysis (3 Samples)"
author: "Zaoqu Liu"
date: "`r Sys.Date()`"
output: 
  rmarkdown::html_vignette:
    toc: true
    toc_depth: 3
vignette: >
  %\VignetteIndexEntry{Multi-Sample Analysis (3 Samples)}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(
  echo = TRUE, 
  eval = FALSE,
  message = FALSE, 
  warning = FALSE
)
```

## Introduction

This vignette demonstrates multi-sample comparison using three glioblastoma samples from GSE131928.

## Load Data

```{r load-data}
# Load multi-sample glioblastoma data
load(url("https://www.dropbox.com/s/esqvnltucdqajg1/listCountMtx.RData?raw=1"))

# Examine structure
names(listCountMtx)
sapply(listCountMtx, ncol)
```

## Run Multi-Sample Comparison

```{r run-multi}
library(SCEVAN)

multiSampleComparisonClonalCN(
  listCountMtx,
  analysisName = "GBM_3samples",
  organism = "human",
  par_cores = 20,
  plotTree = TRUE
)
```

## Output Visualizations

### Combined OncoPrint

Shows shared and sample-specific alterations across all samples:

**File:** `GBM_3samples_allOncoHeat.png`

### Cross-Sample Phylogeny

Phylogenetic tree showing relationships between samples:

**File:** `GBM_3samples_CloneTree.png`

## Summary

The multi-sample analysis enables:

- Identification of clonal (shared) alterations
- Detection of sample-specific alterations
- Cross-sample evolutionary relationships

## Session Info

```{r session, eval=TRUE}
sessionInfo()
```
