Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
---
id: getting-started
title: Getting Started
sidebar_label: Getting Started
slug: /
sidebar_position: 1
---

import Tabs from '@theme/Tabs';
Expand Down
6 changes: 6 additions & 0 deletions docs/Tutorials/GenomeTracks/atacseq-gtracks-deeptools.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
---
id: atacseq-gtracks-deeptools
title: "ATAC-seq Genome Tracks (Deeptools)"
sidebar_label: "ATAC-seq Genome Tracks (Deeptools)"
sidebar_position: 2
---
6 changes: 6 additions & 0 deletions docs/Tutorials/GenomeTracks/chipexo-gtracks-deeptools.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
---
id: chipexo-gtracks-deeptools
title: "ChIP-exo Genome Tracks (Deeptools)"
sidebar_label: "ChIP-exo Genome Tracks (Deeptools)"
sidebar_position: 1
---
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
---
id: genome-tracks-tutorial
title: "Making Genome Tracks Tutorial"
sidebar_label: "Genome Tracks (BigWig)"
id: custom-gtracks-scriptmanager
title: "Making Custom Genome Tracks Tutorial"
sidebar_label: "Custom Tracks (ScriptManager/Kent Tools)"
sidebar_position: 3
---

import Tabs from '@theme/Tabs';
Expand DownExpand Up@@ -69,7 +70,7 @@ OR


<div class="tutorial-img-flow-container">
<img src={require('./img/download-yep-home.png').default} style={{width:60+'%'}} />
<img src={require('../QuickStart/img/download-yep-home.png').default} style={{width:60+'%'}} />
</div>

1. Navigate to [www.yeastepigenome.org][yep-stencil] and search for Reb1
Expand All@@ -78,8 +79,8 @@ OR
4. Unzip the resulting file ‘12141_YEP.zip’ and inspect the contents of the new `12141_YEP` folder. It should contain a file called `12141_filtered.bam`.

<div class="tutorial-img-flow-container">
<img src={require('./img/download-yep-reb1.png').default} style={{width:50+'%'}} />
<img src={require('./img/download-yep-reb1-metadata.png').default} style={{width:50+'%'}} />
<img src={require('../QuickStart/img/download-yep-reb1.png').default} style={{width:50+'%'}} />
<img src={require('../QuickStart/img/download-yep-reb1-metadata.png').default} style={{width:50+'%'}} />
</div>

### XXXX.chrom.sizes Reference File
Expand Down
5 changes: 5 additions & 0 deletions docs/Tutorials/GenomeTracks/index.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
---
title: "Making Genome Tracks"
sidebar_label: "Genome Tracks"
sidebar_position: 2
---
232 changes: 232 additions & 0 deletions docs/Tutorials/PeakCalling/atacseq-pcalling-macs.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
---
id: atacseq-pcalling-macs
title: "ATAC-seq Peak Calling (MACS)"
sidebar_label: "ATAC-seq Peak Calling (MACS)"
sidebar_position: 3
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import Link from '@docusaurus/Link';

_Performing ATAC-seq peak calling with MACS2_

**Goal:** This tutorial provides a guide to peak calling using MACS2 and data generated by the [Stanford Encode Project][encode-project].

---

## Background

### What is MACS2?
**MACS2 (Model-based Analysis of ChIP-Seq)** is a widely used program to detect **peaks** — enriched regions in sequencing data where reads pile up.
- For **ChIP-seq**, peaks correspond to transcription factor binding sites.
- For **ATAC-seq**, peaks correspond to **open chromatin regions** cut by the Tn5 transposase.

That’s why we use MACS2 for ATAC-seq: it helps us identify the regions of the genome that are likely regulatory hotspots.

---
## Download Data

You need one set of genomic coordinate regions to investigate (BED) and one file of sequencing data alignments (BAM) to complete this exercise. [Read more about the BED/BAM file formats here.][file-formats]


### BED File
This is the set of transcription start site (TSS) annotations for the GRCh38 genome build that has been subsampled down to 2000 sites for quick tutorial purposes. A more formal analysis may use a more complete set of annotations (many more sites).

<Link
className="button button--secondary"
target="\_blank"
href="/sample_data/atac-seq-tutorial/UCSC_GRCh38_knownGene_GENCODEV3_TSS_2000bp_SUBSAMPLE-2000-Sites.bed" >
Download sample BED file
</Link>

<br />
<br />

:::caution
If your BED file downloads with a `.txt` extension, make sure to change the filename to a `.bed` extension. For this tutorial, the BED file is named `UCSC_GRCh38_knownGene_GENCODEV3_TSS_2000bp_SUBSAMPLE-2000-Sites.bed`.
:::

### BAM File
This is the set of read alignments from the [ENCODE Project][encode-project] (`ENCFF205TSU.bam`).

<Link
className="button button--secondary"
href="https://www.encodeproject.org/files/ENCFF205TSU/@@download/ENCFF205TSU">
Download sample BAM file
</Link>

<br />
<br />

:::caution
The BAM file is ~2.5GB large so make sure you have enough space on your machine before downloading.
:::

## Peak Calling ATAC-seq with MACS2

### 1. Install MACS2
There are two common ways to install bioinformatics software: **pip** and **conda**.

- **pip**: the Python package manager. It installs Python-based tools (like MACS2) into your environment.
- **conda**: an environment manager that can install packages (both Python and non-Python) with all dependencies. Widely used in bioinformatics. We’ll show both methods,

#### 1.1 Install using pip

```bash
# Create a clean Python environment
python3 -m venv macs2_env
source macs2_env/bin/activate

# Update pip and install MACS2
pip install --upgrade pip wheel
pip install numpy
pip install MACS2
```

#### 1.2 Install using conda

```bash
conda create -n macs2_env python=3.8
conda activate macs2_env
conda install -c bioconda macs2
```

### 2. Generate BAI index file
A BAI index file is required for each BAM file of interest (i.e., the tag occupancy data you want to plot). This file allows for rapid access of the sorted and aligned sequence reads (BAM file).

:::tip

SAM/BAM standard is to keep BAI file in same directory as BAM file with the ScriptManager-generated filename.

```bash
samtools index ENCFF205TSU.bam
```

### 3. Run MACS2 for ATAC-seq
ATAC-seq is slightly different from ChIP-seq because fragments are shifted by Tn5 transposase insertions and you usually call peaks with paired-end BAM.

```bash
macs2 callpeak -t ENCFF205TSU.bam \
-f BAMPE \
-g hs \
-n sample_ATAC \
--outdir macs2_output \
--shift -100 --extsize 200 \
-q 0.01
```

Key flags explained:
- -f BAMPE: Paired-end BAM input
- -g hs: Human genome
- --shift -100 --extsize 200: Adjusts for Tn5 integration offset
- -q 0.01: False Discovery Rate Threshold

The output files should be the follwoing:
- **sample_ATAC_peaks.narrowPeak**: Peak regions (main file to use downstream)
- **sample_ATAC_peaks.xls**: Detailed peak statistics
- **sample_ATAC_summits.bed**: Summit positions

### 4. Convert 'sample_ATAC_peaks.narrowPeak' file to BED File

```bash
cd macs2_output
cut -f1-3 sample_ATAC_peaks.narrowPeak > sample_ATAC_peaks.bed
awk '{print $1"\t"$2-1000"\t"$2+1000}' sample_ATAC_top1000_summits.bed > summits_1000bp.bed
```

:::note
The file of this BED file is very large, so we use 1000bp to around each summit in order reduce processing time.
:::

The output file should be the follwoing:
- **sample_ATAC_peaks.bed**

### 5. ScriptManager for TagPileup
ScriptManager can plot composite pileups and heatmaps using BAM + BED.

##### 5.1 Index Bam File: BAM Manipulation ➡️ [__BAM-BAI Indexer__][bam-indexer]
```bash
ENCFF205TSU.bam
ENCFF205TSU.bam.bai # Need to generate this file to proceed.
```
:::

<div class="tutorial-img-flow-container">
<img src={require('./img/bam_atacseq_peakcalling.png').default} style={{width:60+'%',}}/>
<i class="fa-solid fa-arrow-right fa-lg"></i>
<img src={require('./img/gui-bamidx-complete.png').default} style={{width:30+'%',}}/>
</div>

:::note
The speed of this step scales with the size of the BAM file. Generally this step 30 sec for a 100 MB BAM file but may take 1-2 min for a multi-GB BAM file.
:::


#### 5.2 TagPileup: Sequence Read Analysis ➡️ [__Tag Pileup__][tag-pileup]
Use **"Full Fragment"** in the top right, then select **"Combined"** color , **"Output Composite"**, **"CDT"**, and **"Output GZIP"**. Then, proceed to "Output Directory".

<div class="tutorial-img-flow-container">
<img src={require('./img/atacseq_peak_tagpileup.png').default} style={{width:100+'%',}}/>
</div>

<div class="tutorial-img-flow-container">
<img src={require('./img/atacseq_peak_pileup.png').default} style={{width:100+'%',}}/>
</div>


### 6. ScriptManager for Heatmap

#### 6.1 Sort BED file by CDT file: Coordinate File Manipulation ➡️ [__Sort BED__][sort-bed]

<div class="tutorial-img-flow-container">
<img src={require('./img/atacseq_peak_sortcdt.png').default} style={{width:100+'%',}}/>
</div>


#### 6.2 Heatmap: Figure Generation ➡️ [__Heat Map__][heatmap] and Figure Generation ➡️ [__Label Heatmaps__][label-heatmap]

<div class="tutorial-img-flow-container">
<img src={require('./img/atacseq_pea_heatmapgen.png').default} style={{width:55+'%',}}/>
<i class="fa-solid fa-arrow-right fa-lg"></i>
<img src={require('./img/atacseq_peak_heatmap.png').default} style={{width:45+'%',}}/>
</div>

## Command-Line shell script for ScriptManager

The following shell commands records the locations for a BED file, a BAM file, and the anticipated OUTPUT basename as environmental variables to derive the corresponding composite plot values and heatmaps. This can serve as a template for you to write out your own workflows as bash scripts that execute command-line style ScriptManager.

```bash
SCRIPTMANAGER=/path/to/ScriptManager.jar
BEDFILE=/path/to/sample_ATAC_top1000_summits.bed
BAMFILE=/path/to/ENCFF205TSU.bam
OUTPUT=/path/to/myoutput

samtools index $BAMFILE

java -jar $SCRIPTMANAGER read-analysis tag-pileup --combined --full-fragment $OUTPUT\_1000bp.bed $BAMFILE -o $OUTPUT\_composite.out -M $OUTPUT\_matrix
java -jar $SCRIPTMANAGER coordinate-manipulation sort-bed -c 1000 $OUTPUT\_1000bp.bed $OUTPUT\_matrix_combined.cdt -o $OUTPUT\_SORT
java -jar $SCRIPTMANAGER figure-generation heatmap -p .95 --black $OUTPUT\_SORT.cdt -o $OUTPUT\_heatmap.png

# Output files:
# - /path/to/myoutput_composite.out
# - /path/to/myoutput_matrix_combined.cdt
# - /path/to/myoutput_SORT.bed
# - /path/to/myoutput_SORT.cdt
# - /path/to/myoutput_heatmap.png
```

[encode-project]: https://www.encodeproject.org/experiments/ENCFF205TSU













6 changes: 6 additions & 0 deletions docs/Tutorials/PeakCalling/chipexo-pcalling-chexmix.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
---
id: chipexo-pcalling-chexmix
title: "ChIP-exo Peak Calling (ChExMix)"
sidebar_label: "ChIP-exo Peak Calling (ChExMix)"
sidebar_position: 2
---
6 changes: 6 additions & 0 deletions docs/Tutorials/PeakCalling/chipexo-pcalling-genetrack.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
---
id: chipexo-pcalling-genetrack
title: "ChIP-exo Peak Calling (Genetrack/CWPair)"
sidebar_label: "ChIP-exo Peak Calling (Genetrack/CWPair)"
sidebar_position: 1
---
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions docs/Tutorials/PeakCalling/index.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
---
title: "Peak Calling"
sidebar_label: "Peak Calling"
sidebar_position: 3
---
1 change: 1 addition & 0 deletions docs/Tutorials/PeakCalling/procap-pcalling-genetrack.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
a
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Restructure tutorials by alimadeen04 · Pull Request #16 · CEGRcode/scriptmanager-docs · GitHub
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
---
id: getting-started
title: Getting Started
sidebar_label: Getting Started
slug: /
sidebar_position: 1
---

import Tabs from '@theme/Tabs';
Expand Down
6 changes: 6 additions & 0 deletions docs/Tutorials/GenomeTracks/atacseq-gtracks-deeptools.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
---
id: atacseq-gtracks-deeptools
title: "ATAC-seq Genome Tracks (Deeptools)"
sidebar_label: "ATAC-seq Genome Tracks (Deeptools)"
sidebar_position: 2
---
6 changes: 6 additions & 0 deletions docs/Tutorials/GenomeTracks/chipexo-gtracks-deeptools.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
---
id: chipexo-gtracks-deeptools
title: "ChIP-exo Genome Tracks (Deeptools)"
sidebar_label: "ChIP-exo Genome Tracks (Deeptools)"
sidebar_position: 1
---
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
---
id: genome-tracks-tutorial
title: "Making Genome Tracks Tutorial"
sidebar_label: "Genome Tracks (BigWig)"
id: custom-gtracks-scriptmanager
title: "Making Custom Genome Tracks Tutorial"
sidebar_label: "Custom Tracks (ScriptManager/Kent Tools)"
sidebar_position: 3
---

import Tabs from '@theme/Tabs';
Expand DownExpand Up@@ -69,7 +70,7 @@ OR


<div class="tutorial-img-flow-container">
<img src={require('./img/download-yep-home.png').default} style={{width:60+'%'}} />
<img src={require('../QuickStart/img/download-yep-home.png').default} style={{width:60+'%'}} />
</div>

1. Navigate to [www.yeastepigenome.org][yep-stencil] and search for Reb1
Expand All@@ -78,8 +79,8 @@ OR
4. Unzip the resulting file ‘12141_YEP.zip’ and inspect the contents of the new `12141_YEP` folder. It should contain a file called `12141_filtered.bam`.

<div class="tutorial-img-flow-container">
<img src={require('./img/download-yep-reb1.png').default} style={{width:50+'%'}} />
<img src={require('./img/download-yep-reb1-metadata.png').default} style={{width:50+'%'}} />
<img src={require('../QuickStart/img/download-yep-reb1.png').default} style={{width:50+'%'}} />
<img src={require('../QuickStart/img/download-yep-reb1-metadata.png').default} style={{width:50+'%'}} />
</div>

### XXXX.chrom.sizes Reference File
Expand Down
5 changes: 5 additions & 0 deletions docs/Tutorials/GenomeTracks/index.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
---
title: "Making Genome Tracks"
sidebar_label: "Genome Tracks"
sidebar_position: 2
---
232 changes: 232 additions & 0 deletions docs/Tutorials/PeakCalling/atacseq-pcalling-macs.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
---
id: atacseq-pcalling-macs
title: "ATAC-seq Peak Calling (MACS)"
sidebar_label: "ATAC-seq Peak Calling (MACS)"
sidebar_position: 3
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import Link from '@docusaurus/Link';

_Performing ATAC-seq peak calling with MACS2_

**Goal:** This tutorial provides a guide to peak calling using MACS2 and data generated by the [Stanford Encode Project][encode-project].

---

## Background

### What is MACS2?
**MACS2 (Model-based Analysis of ChIP-Seq)** is a widely used program to detect **peaks** — enriched regions in sequencing data where reads pile up.
- For **ChIP-seq**, peaks correspond to transcription factor binding sites.
- For **ATAC-seq**, peaks correspond to **open chromatin regions** cut by the Tn5 transposase.

That’s why we use MACS2 for ATAC-seq: it helps us identify the regions of the genome that are likely regulatory hotspots.

---
## Download Data

You need one set of genomic coordinate regions to investigate (BED) and one file of sequencing data alignments (BAM) to complete this exercise. [Read more about the BED/BAM file formats here.][file-formats]


### BED File
This is the set of transcription start site (TSS) annotations for the GRCh38 genome build that has been subsampled down to 2000 sites for quick tutorial purposes. A more formal analysis may use a more complete set of annotations (many more sites).

<Link
className="button button--secondary"
target="\_blank"
href="/sample_data/atac-seq-tutorial/UCSC_GRCh38_knownGene_GENCODEV3_TSS_2000bp_SUBSAMPLE-2000-Sites.bed" >
Download sample BED file
</Link>

<br />
<br />

:::caution
If your BED file downloads with a `.txt` extension, make sure to change the filename to a `.bed` extension. For this tutorial, the BED file is named `UCSC_GRCh38_knownGene_GENCODEV3_TSS_2000bp_SUBSAMPLE-2000-Sites.bed`.
:::

### BAM File
This is the set of read alignments from the [ENCODE Project][encode-project] (`ENCFF205TSU.bam`).

<Link
className="button button--secondary"
href="https://www.encodeproject.org/files/ENCFF205TSU/@@download/ENCFF205TSU">
Download sample BAM file
</Link>

<br />
<br />

:::caution
The BAM file is ~2.5GB large so make sure you have enough space on your machine before downloading.
:::

## Peak Calling ATAC-seq with MACS2

### 1. Install MACS2
There are two common ways to install bioinformatics software: **pip** and **conda**.

- **pip**: the Python package manager. It installs Python-based tools (like MACS2) into your environment.
- **conda**: an environment manager that can install packages (both Python and non-Python) with all dependencies. Widely used in bioinformatics. We’ll show both methods,

#### 1.1 Install using pip

```bash
# Create a clean Python environment
python3 -m venv macs2_env
source macs2_env/bin/activate

# Update pip and install MACS2
pip install --upgrade pip wheel
pip install numpy
pip install MACS2
```

#### 1.2 Install using conda

```bash
conda create -n macs2_env python=3.8
conda activate macs2_env
conda install -c bioconda macs2
```

### 2. Generate BAI index file
A BAI index file is required for each BAM file of interest (i.e., the tag occupancy data you want to plot). This file allows for rapid access of the sorted and aligned sequence reads (BAM file).

:::tip

SAM/BAM standard is to keep BAI file in same directory as BAM file with the ScriptManager-generated filename.

```bash
samtools index ENCFF205TSU.bam
```

### 3. Run MACS2 for ATAC-seq
ATAC-seq is slightly different from ChIP-seq because fragments are shifted by Tn5 transposase insertions and you usually call peaks with paired-end BAM.

```bash
macs2 callpeak -t ENCFF205TSU.bam \
-f BAMPE \
-g hs \
-n sample_ATAC \
--outdir macs2_output \
--shift -100 --extsize 200 \
-q 0.01
```

Key flags explained:
- -f BAMPE: Paired-end BAM input
- -g hs: Human genome
- --shift -100 --extsize 200: Adjusts for Tn5 integration offset
- -q 0.01: False Discovery Rate Threshold

The output files should be the follwoing:
- **sample_ATAC_peaks.narrowPeak**: Peak regions (main file to use downstream)
- **sample_ATAC_peaks.xls**: Detailed peak statistics
- **sample_ATAC_summits.bed**: Summit positions

### 4. Convert 'sample_ATAC_peaks.narrowPeak' file to BED File

```bash
cd macs2_output
cut -f1-3 sample_ATAC_peaks.narrowPeak > sample_ATAC_peaks.bed
awk '{print $1"\t"$2-1000"\t"$2+1000}' sample_ATAC_top1000_summits.bed > summits_1000bp.bed
```

:::note
The file of this BED file is very large, so we use 1000bp to around each summit in order reduce processing time.
:::

The output file should be the follwoing:
- **sample_ATAC_peaks.bed**

### 5. ScriptManager for TagPileup
ScriptManager can plot composite pileups and heatmaps using BAM + BED.

##### 5.1 Index Bam File: BAM Manipulation ➡️ [__BAM-BAI Indexer__][bam-indexer]
```bash
ENCFF205TSU.bam
ENCFF205TSU.bam.bai # Need to generate this file to proceed.
```
:::

<div class="tutorial-img-flow-container">
<img src={require('./img/bam_atacseq_peakcalling.png').default} style={{width:60+'%',}}/>
<i class="fa-solid fa-arrow-right fa-lg"></i>
<img src={require('./img/gui-bamidx-complete.png').default} style={{width:30+'%',}}/>
</div>

:::note
The speed of this step scales with the size of the BAM file. Generally this step 30 sec for a 100 MB BAM file but may take 1-2 min for a multi-GB BAM file.
:::


#### 5.2 TagPileup: Sequence Read Analysis ➡️ [__Tag Pileup__][tag-pileup]
Use **"Full Fragment"** in the top right, then select **"Combined"** color , **"Output Composite"**, **"CDT"**, and **"Output GZIP"**. Then, proceed to "Output Directory".

<div class="tutorial-img-flow-container">
<img src={require('./img/atacseq_peak_tagpileup.png').default} style={{width:100+'%',}}/>
</div>

<div class="tutorial-img-flow-container">
<img src={require('./img/atacseq_peak_pileup.png').default} style={{width:100+'%',}}/>
</div>


### 6. ScriptManager for Heatmap

#### 6.1 Sort BED file by CDT file: Coordinate File Manipulation ➡️ [__Sort BED__][sort-bed]

<div class="tutorial-img-flow-container">
<img src={require('./img/atacseq_peak_sortcdt.png').default} style={{width:100+'%',}}/>
</div>


#### 6.2 Heatmap: Figure Generation ➡️ [__Heat Map__][heatmap] and Figure Generation ➡️ [__Label Heatmaps__][label-heatmap]

<div class="tutorial-img-flow-container">
<img src={require('./img/atacseq_pea_heatmapgen.png').default} style={{width:55+'%',}}/>
<i class="fa-solid fa-arrow-right fa-lg"></i>
<img src={require('./img/atacseq_peak_heatmap.png').default} style={{width:45+'%',}}/>
</div>

## Command-Line shell script for ScriptManager

The following shell commands records the locations for a BED file, a BAM file, and the anticipated OUTPUT basename as environmental variables to derive the corresponding composite plot values and heatmaps. This can serve as a template for you to write out your own workflows as bash scripts that execute command-line style ScriptManager.

```bash
SCRIPTMANAGER=/path/to/ScriptManager.jar
BEDFILE=/path/to/sample_ATAC_top1000_summits.bed
BAMFILE=/path/to/ENCFF205TSU.bam
OUTPUT=/path/to/myoutput

samtools index $BAMFILE

java -jar $SCRIPTMANAGER read-analysis tag-pileup --combined --full-fragment $OUTPUT\_1000bp.bed $BAMFILE -o $OUTPUT\_composite.out -M $OUTPUT\_matrix
java -jar $SCRIPTMANAGER coordinate-manipulation sort-bed -c 1000 $OUTPUT\_1000bp.bed $OUTPUT\_matrix_combined.cdt -o $OUTPUT\_SORT
java -jar $SCRIPTMANAGER figure-generation heatmap -p .95 --black $OUTPUT\_SORT.cdt -o $OUTPUT\_heatmap.png

# Output files:
# - /path/to/myoutput_composite.out
# - /path/to/myoutput_matrix_combined.cdt
# - /path/to/myoutput_SORT.bed
# - /path/to/myoutput_SORT.cdt
# - /path/to/myoutput_heatmap.png
```

[encode-project]: https://www.encodeproject.org/experiments/ENCFF205TSU













6 changes: 6 additions & 0 deletions docs/Tutorials/PeakCalling/chipexo-pcalling-chexmix.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
---
id: chipexo-pcalling-chexmix
title: "ChIP-exo Peak Calling (ChExMix)"
sidebar_label: "ChIP-exo Peak Calling (ChExMix)"
sidebar_position: 2
---
6 changes: 6 additions & 0 deletions docs/Tutorials/PeakCalling/chipexo-pcalling-genetrack.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
---
id: chipexo-pcalling-genetrack
title: "ChIP-exo Peak Calling (Genetrack/CWPair)"
sidebar_label: "ChIP-exo Peak Calling (Genetrack/CWPair)"
sidebar_position: 1
---
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions docs/Tutorials/PeakCalling/index.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
---
title: "Peak Calling"
sidebar_label: "Peak Calling"
sidebar_position: 3
---
1 change: 1 addition & 0 deletions docs/Tutorials/PeakCalling/procap-pcalling-genetrack.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
a
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Restructure tutorials by alimadeen04 · Pull Request #16 · CEGRcode/scriptmanager-docs · GitHub
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
---
id: getting-started
title: Getting Started
sidebar_label: Getting Started
slug: /
sidebar_position: 1
---

import Tabs from '@theme/Tabs';
Expand Down
6 changes: 6 additions & 0 deletions docs/Tutorials/GenomeTracks/atacseq-gtracks-deeptools.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
---
id: atacseq-gtracks-deeptools
title: "ATAC-seq Genome Tracks (Deeptools)"
sidebar_label: "ATAC-seq Genome Tracks (Deeptools)"
sidebar_position: 2
---
6 changes: 6 additions & 0 deletions docs/Tutorials/GenomeTracks/chipexo-gtracks-deeptools.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
---
id: chipexo-gtracks-deeptools
title: "ChIP-exo Genome Tracks (Deeptools)"
sidebar_label: "ChIP-exo Genome Tracks (Deeptools)"
sidebar_position: 1
---
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
---
id: genome-tracks-tutorial
title: "Making Genome Tracks Tutorial"
sidebar_label: "Genome Tracks (BigWig)"
id: custom-gtracks-scriptmanager
title: "Making Custom Genome Tracks Tutorial"
sidebar_label: "Custom Tracks (ScriptManager/Kent Tools)"
sidebar_position: 3
---

import Tabs from '@theme/Tabs';
Expand DownExpand Up@@ -69,7 +70,7 @@ OR


<div class="tutorial-img-flow-container">
<img src={require('./img/download-yep-home.png').default} style={{width:60+'%'}} />
<img src={require('../QuickStart/img/download-yep-home.png').default} style={{width:60+'%'}} />
</div>

1. Navigate to [www.yeastepigenome.org][yep-stencil] and search for Reb1
Expand All@@ -78,8 +79,8 @@ OR
4. Unzip the resulting file ‘12141_YEP.zip’ and inspect the contents of the new `12141_YEP` folder. It should contain a file called `12141_filtered.bam`.

<div class="tutorial-img-flow-container">
<img src={require('./img/download-yep-reb1.png').default} style={{width:50+'%'}} />
<img src={require('./img/download-yep-reb1-metadata.png').default} style={{width:50+'%'}} />
<img src={require('../QuickStart/img/download-yep-reb1.png').default} style={{width:50+'%'}} />
<img src={require('../QuickStart/img/download-yep-reb1-metadata.png').default} style={{width:50+'%'}} />
</div>

### XXXX.chrom.sizes Reference File
Expand Down
5 changes: 5 additions & 0 deletions docs/Tutorials/GenomeTracks/index.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
---
title: "Making Genome Tracks"
sidebar_label: "Genome Tracks"
sidebar_position: 2
---
232 changes: 232 additions & 0 deletions docs/Tutorials/PeakCalling/atacseq-pcalling-macs.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
---
id: atacseq-pcalling-macs
title: "ATAC-seq Peak Calling (MACS)"
sidebar_label: "ATAC-seq Peak Calling (MACS)"
sidebar_position: 3
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import Link from '@docusaurus/Link';

_Performing ATAC-seq peak calling with MACS2_

**Goal:** This tutorial provides a guide to peak calling using MACS2 and data generated by the [Stanford Encode Project][encode-project].

---

## Background

### What is MACS2?
**MACS2 (Model-based Analysis of ChIP-Seq)** is a widely used program to detect **peaks** — enriched regions in sequencing data where reads pile up.
- For **ChIP-seq**, peaks correspond to transcription factor binding sites.
- For **ATAC-seq**, peaks correspond to **open chromatin regions** cut by the Tn5 transposase.

That’s why we use MACS2 for ATAC-seq: it helps us identify the regions of the genome that are likely regulatory hotspots.

---
## Download Data

You need one set of genomic coordinate regions to investigate (BED) and one file of sequencing data alignments (BAM) to complete this exercise. [Read more about the BED/BAM file formats here.][file-formats]


### BED File
This is the set of transcription start site (TSS) annotations for the GRCh38 genome build that has been subsampled down to 2000 sites for quick tutorial purposes. A more formal analysis may use a more complete set of annotations (many more sites).

<Link
className="button button--secondary"
target="\_blank"
href="/sample_data/atac-seq-tutorial/UCSC_GRCh38_knownGene_GENCODEV3_TSS_2000bp_SUBSAMPLE-2000-Sites.bed" >
Download sample BED file
</Link>

<br />
<br />

:::caution
If your BED file downloads with a `.txt` extension, make sure to change the filename to a `.bed` extension. For this tutorial, the BED file is named `UCSC_GRCh38_knownGene_GENCODEV3_TSS_2000bp_SUBSAMPLE-2000-Sites.bed`.
:::

### BAM File
This is the set of read alignments from the [ENCODE Project][encode-project] (`ENCFF205TSU.bam`).

<Link
className="button button--secondary"
href="https://www.encodeproject.org/files/ENCFF205TSU/@@download/ENCFF205TSU">
Download sample BAM file
</Link>

<br />
<br />

:::caution
The BAM file is ~2.5GB large so make sure you have enough space on your machine before downloading.
:::

## Peak Calling ATAC-seq with MACS2

### 1. Install MACS2
There are two common ways to install bioinformatics software: **pip** and **conda**.

- **pip**: the Python package manager. It installs Python-based tools (like MACS2) into your environment.
- **conda**: an environment manager that can install packages (both Python and non-Python) with all dependencies. Widely used in bioinformatics. We’ll show both methods,

#### 1.1 Install using pip

```bash
# Create a clean Python environment
python3 -m venv macs2_env
source macs2_env/bin/activate

# Update pip and install MACS2
pip install --upgrade pip wheel
pip install numpy
pip install MACS2
```

#### 1.2 Install using conda

```bash
conda create -n macs2_env python=3.8
conda activate macs2_env
conda install -c bioconda macs2
```

### 2. Generate BAI index file
A BAI index file is required for each BAM file of interest (i.e., the tag occupancy data you want to plot). This file allows for rapid access of the sorted and aligned sequence reads (BAM file).

:::tip

SAM/BAM standard is to keep BAI file in same directory as BAM file with the ScriptManager-generated filename.

```bash
samtools index ENCFF205TSU.bam
```

### 3. Run MACS2 for ATAC-seq
ATAC-seq is slightly different from ChIP-seq because fragments are shifted by Tn5 transposase insertions and you usually call peaks with paired-end BAM.

```bash
macs2 callpeak -t ENCFF205TSU.bam \
-f BAMPE \
-g hs \
-n sample_ATAC \
--outdir macs2_output \
--shift -100 --extsize 200 \
-q 0.01
```

Key flags explained:
- -f BAMPE: Paired-end BAM input
- -g hs: Human genome
- --shift -100 --extsize 200: Adjusts for Tn5 integration offset
- -q 0.01: False Discovery Rate Threshold

The output files should be the follwoing:
- **sample_ATAC_peaks.narrowPeak**: Peak regions (main file to use downstream)
- **sample_ATAC_peaks.xls**: Detailed peak statistics
- **sample_ATAC_summits.bed**: Summit positions

### 4. Convert 'sample_ATAC_peaks.narrowPeak' file to BED File

```bash
cd macs2_output
cut -f1-3 sample_ATAC_peaks.narrowPeak > sample_ATAC_peaks.bed
awk '{print $1"\t"$2-1000"\t"$2+1000}' sample_ATAC_top1000_summits.bed > summits_1000bp.bed
```

:::note
The file of this BED file is very large, so we use 1000bp to around each summit in order reduce processing time.
:::

The output file should be the follwoing:
- **sample_ATAC_peaks.bed**

### 5. ScriptManager for TagPileup
ScriptManager can plot composite pileups and heatmaps using BAM + BED.

##### 5.1 Index Bam File: BAM Manipulation ➡️ [__BAM-BAI Indexer__][bam-indexer]
```bash
ENCFF205TSU.bam
ENCFF205TSU.bam.bai # Need to generate this file to proceed.
```
:::

<div class="tutorial-img-flow-container">
<img src={require('./img/bam_atacseq_peakcalling.png').default} style={{width:60+'%',}}/>
<i class="fa-solid fa-arrow-right fa-lg"></i>
<img src={require('./img/gui-bamidx-complete.png').default} style={{width:30+'%',}}/>
</div>

:::note
The speed of this step scales with the size of the BAM file. Generally this step 30 sec for a 100 MB BAM file but may take 1-2 min for a multi-GB BAM file.
:::


#### 5.2 TagPileup: Sequence Read Analysis ➡️ [__Tag Pileup__][tag-pileup]
Use **"Full Fragment"** in the top right, then select **"Combined"** color , **"Output Composite"**, **"CDT"**, and **"Output GZIP"**. Then, proceed to "Output Directory".

<div class="tutorial-img-flow-container">
<img src={require('./img/atacseq_peak_tagpileup.png').default} style={{width:100+'%',}}/>
</div>

<div class="tutorial-img-flow-container">
<img src={require('./img/atacseq_peak_pileup.png').default} style={{width:100+'%',}}/>
</div>


### 6. ScriptManager for Heatmap

#### 6.1 Sort BED file by CDT file: Coordinate File Manipulation ➡️ [__Sort BED__][sort-bed]

<div class="tutorial-img-flow-container">
<img src={require('./img/atacseq_peak_sortcdt.png').default} style={{width:100+'%',}}/>
</div>


#### 6.2 Heatmap: Figure Generation ➡️ [__Heat Map__][heatmap] and Figure Generation ➡️ [__Label Heatmaps__][label-heatmap]

<div class="tutorial-img-flow-container">
<img src={require('./img/atacseq_pea_heatmapgen.png').default} style={{width:55+'%',}}/>
<i class="fa-solid fa-arrow-right fa-lg"></i>
<img src={require('./img/atacseq_peak_heatmap.png').default} style={{width:45+'%',}}/>
</div>

## Command-Line shell script for ScriptManager

The following shell commands records the locations for a BED file, a BAM file, and the anticipated OUTPUT basename as environmental variables to derive the corresponding composite plot values and heatmaps. This can serve as a template for you to write out your own workflows as bash scripts that execute command-line style ScriptManager.

```bash
SCRIPTMANAGER=/path/to/ScriptManager.jar
BEDFILE=/path/to/sample_ATAC_top1000_summits.bed
BAMFILE=/path/to/ENCFF205TSU.bam
OUTPUT=/path/to/myoutput

samtools index $BAMFILE

java -jar $SCRIPTMANAGER read-analysis tag-pileup --combined --full-fragment $OUTPUT\_1000bp.bed $BAMFILE -o $OUTPUT\_composite.out -M $OUTPUT\_matrix
java -jar $SCRIPTMANAGER coordinate-manipulation sort-bed -c 1000 $OUTPUT\_1000bp.bed $OUTPUT\_matrix_combined.cdt -o $OUTPUT\_SORT
java -jar $SCRIPTMANAGER figure-generation heatmap -p .95 --black $OUTPUT\_SORT.cdt -o $OUTPUT\_heatmap.png

# Output files:
# - /path/to/myoutput_composite.out
# - /path/to/myoutput_matrix_combined.cdt
# - /path/to/myoutput_SORT.bed
# - /path/to/myoutput_SORT.cdt
# - /path/to/myoutput_heatmap.png
```

[encode-project]: https://www.encodeproject.org/experiments/ENCFF205TSU













6 changes: 6 additions & 0 deletions docs/Tutorials/PeakCalling/chipexo-pcalling-chexmix.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
---
id: chipexo-pcalling-chexmix
title: "ChIP-exo Peak Calling (ChExMix)"
sidebar_label: "ChIP-exo Peak Calling (ChExMix)"
sidebar_position: 2
---
6 changes: 6 additions & 0 deletions docs/Tutorials/PeakCalling/chipexo-pcalling-genetrack.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
---
id: chipexo-pcalling-genetrack
title: "ChIP-exo Peak Calling (Genetrack/CWPair)"
sidebar_label: "ChIP-exo Peak Calling (Genetrack/CWPair)"
sidebar_position: 1
---
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions docs/Tutorials/PeakCalling/index.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
---
title: "Peak Calling"
sidebar_label: "Peak Calling"
sidebar_position: 3
---
1 change: 1 addition & 0 deletions docs/Tutorials/PeakCalling/procap-pcalling-genetrack.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
a
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Restructure tutorials by alimadeen04 · Pull Request #16 · CEGRcode/scriptmanager-docs · GitHub
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
---
id: getting-started
title: Getting Started
sidebar_label: Getting Started
slug: /
sidebar_position: 1
---

import Tabs from '@theme/Tabs';
Expand Down
6 changes: 6 additions & 0 deletions docs/Tutorials/GenomeTracks/atacseq-gtracks-deeptools.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
---
id: atacseq-gtracks-deeptools
title: "ATAC-seq Genome Tracks (Deeptools)"
sidebar_label: "ATAC-seq Genome Tracks (Deeptools)"
sidebar_position: 2
---
6 changes: 6 additions & 0 deletions docs/Tutorials/GenomeTracks/chipexo-gtracks-deeptools.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
---
id: chipexo-gtracks-deeptools
title: "ChIP-exo Genome Tracks (Deeptools)"
sidebar_label: "ChIP-exo Genome Tracks (Deeptools)"
sidebar_position: 1
---
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
---
id: genome-tracks-tutorial
title: "Making Genome Tracks Tutorial"
sidebar_label: "Genome Tracks (BigWig)"
id: custom-gtracks-scriptmanager
title: "Making Custom Genome Tracks Tutorial"
sidebar_label: "Custom Tracks (ScriptManager/Kent Tools)"
sidebar_position: 3
---

import Tabs from '@theme/Tabs';
Expand DownExpand Up@@ -69,7 +70,7 @@ OR


<div class="tutorial-img-flow-container">
<img src={require('./img/download-yep-home.png').default} style={{width:60+'%'}} />
<img src={require('../QuickStart/img/download-yep-home.png').default} style={{width:60+'%'}} />
</div>

1. Navigate to [www.yeastepigenome.org][yep-stencil] and search for Reb1
Expand All@@ -78,8 +79,8 @@ OR
4. Unzip the resulting file ‘12141_YEP.zip’ and inspect the contents of the new `12141_YEP` folder. It should contain a file called `12141_filtered.bam`.

<div class="tutorial-img-flow-container">
<img src={require('./img/download-yep-reb1.png').default} style={{width:50+'%'}} />
<img src={require('./img/download-yep-reb1-metadata.png').default} style={{width:50+'%'}} />
<img src={require('../QuickStart/img/download-yep-reb1.png').default} style={{width:50+'%'}} />
<img src={require('../QuickStart/img/download-yep-reb1-metadata.png').default} style={{width:50+'%'}} />
</div>

### XXXX.chrom.sizes Reference File
Expand Down
5 changes: 5 additions & 0 deletions docs/Tutorials/GenomeTracks/index.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
---
title: "Making Genome Tracks"
sidebar_label: "Genome Tracks"
sidebar_position: 2
---
232 changes: 232 additions & 0 deletions docs/Tutorials/PeakCalling/atacseq-pcalling-macs.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
---
id: atacseq-pcalling-macs
title: "ATAC-seq Peak Calling (MACS)"
sidebar_label: "ATAC-seq Peak Calling (MACS)"
sidebar_position: 3
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import Link from '@docusaurus/Link';

_Performing ATAC-seq peak calling with MACS2_

**Goal:** This tutorial provides a guide to peak calling using MACS2 and data generated by the [Stanford Encode Project][encode-project].

---

## Background

### What is MACS2?
**MACS2 (Model-based Analysis of ChIP-Seq)** is a widely used program to detect **peaks** — enriched regions in sequencing data where reads pile up.
- For **ChIP-seq**, peaks correspond to transcription factor binding sites.
- For **ATAC-seq**, peaks correspond to **open chromatin regions** cut by the Tn5 transposase.

That’s why we use MACS2 for ATAC-seq: it helps us identify the regions of the genome that are likely regulatory hotspots.

---
## Download Data

You need one set of genomic coordinate regions to investigate (BED) and one file of sequencing data alignments (BAM) to complete this exercise. [Read more about the BED/BAM file formats here.][file-formats]


### BED File
This is the set of transcription start site (TSS) annotations for the GRCh38 genome build that has been subsampled down to 2000 sites for quick tutorial purposes. A more formal analysis may use a more complete set of annotations (many more sites).

<Link
className="button button--secondary"
target="\_blank"
href="/sample_data/atac-seq-tutorial/UCSC_GRCh38_knownGene_GENCODEV3_TSS_2000bp_SUBSAMPLE-2000-Sites.bed" >
Download sample BED file
</Link>

<br />
<br />

:::caution
If your BED file downloads with a `.txt` extension, make sure to change the filename to a `.bed` extension. For this tutorial, the BED file is named `UCSC_GRCh38_knownGene_GENCODEV3_TSS_2000bp_SUBSAMPLE-2000-Sites.bed`.
:::

### BAM File
This is the set of read alignments from the [ENCODE Project][encode-project] (`ENCFF205TSU.bam`).

<Link
className="button button--secondary"
href="https://www.encodeproject.org/files/ENCFF205TSU/@@download/ENCFF205TSU">
Download sample BAM file
</Link>

<br />
<br />

:::caution
The BAM file is ~2.5GB large so make sure you have enough space on your machine before downloading.
:::

## Peak Calling ATAC-seq with MACS2

### 1. Install MACS2
There are two common ways to install bioinformatics software: **pip** and **conda**.

- **pip**: the Python package manager. It installs Python-based tools (like MACS2) into your environment.
- **conda**: an environment manager that can install packages (both Python and non-Python) with all dependencies. Widely used in bioinformatics. We’ll show both methods,

#### 1.1 Install using pip

```bash
# Create a clean Python environment
python3 -m venv macs2_env
source macs2_env/bin/activate

# Update pip and install MACS2
pip install --upgrade pip wheel
pip install numpy
pip install MACS2
```

#### 1.2 Install using conda

```bash
conda create -n macs2_env python=3.8
conda activate macs2_env
conda install -c bioconda macs2
```

### 2. Generate BAI index file
A BAI index file is required for each BAM file of interest (i.e., the tag occupancy data you want to plot). This file allows for rapid access of the sorted and aligned sequence reads (BAM file).

:::tip

SAM/BAM standard is to keep BAI file in same directory as BAM file with the ScriptManager-generated filename.

```bash
samtools index ENCFF205TSU.bam
```

### 3. Run MACS2 for ATAC-seq
ATAC-seq is slightly different from ChIP-seq because fragments are shifted by Tn5 transposase insertions and you usually call peaks with paired-end BAM.

```bash
macs2 callpeak -t ENCFF205TSU.bam \
-f BAMPE \
-g hs \
-n sample_ATAC \
--outdir macs2_output \
--shift -100 --extsize 200 \
-q 0.01
```

Key flags explained:
- -f BAMPE: Paired-end BAM input
- -g hs: Human genome
- --shift -100 --extsize 200: Adjusts for Tn5 integration offset
- -q 0.01: False Discovery Rate Threshold

The output files should be the follwoing:
- **sample_ATAC_peaks.narrowPeak**: Peak regions (main file to use downstream)
- **sample_ATAC_peaks.xls**: Detailed peak statistics
- **sample_ATAC_summits.bed**: Summit positions

### 4. Convert 'sample_ATAC_peaks.narrowPeak' file to BED File

```bash
cd macs2_output
cut -f1-3 sample_ATAC_peaks.narrowPeak > sample_ATAC_peaks.bed
awk '{print $1"\t"$2-1000"\t"$2+1000}' sample_ATAC_top1000_summits.bed > summits_1000bp.bed
```

:::note
The file of this BED file is very large, so we use 1000bp to around each summit in order reduce processing time.
:::

The output file should be the follwoing:
- **sample_ATAC_peaks.bed**

### 5. ScriptManager for TagPileup
ScriptManager can plot composite pileups and heatmaps using BAM + BED.

##### 5.1 Index Bam File: BAM Manipulation ➡️ [__BAM-BAI Indexer__][bam-indexer]
```bash
ENCFF205TSU.bam
ENCFF205TSU.bam.bai # Need to generate this file to proceed.
```
:::

<div class="tutorial-img-flow-container">
<img src={require('./img/bam_atacseq_peakcalling.png').default} style={{width:60+'%',}}/>
<i class="fa-solid fa-arrow-right fa-lg"></i>
<img src={require('./img/gui-bamidx-complete.png').default} style={{width:30+'%',}}/>
</div>

:::note
The speed of this step scales with the size of the BAM file. Generally this step 30 sec for a 100 MB BAM file but may take 1-2 min for a multi-GB BAM file.
:::


#### 5.2 TagPileup: Sequence Read Analysis ➡️ [__Tag Pileup__][tag-pileup]
Use **"Full Fragment"** in the top right, then select **"Combined"** color , **"Output Composite"**, **"CDT"**, and **"Output GZIP"**. Then, proceed to "Output Directory".

<div class="tutorial-img-flow-container">
<img src={require('./img/atacseq_peak_tagpileup.png').default} style={{width:100+'%',}}/>
</div>

<div class="tutorial-img-flow-container">
<img src={require('./img/atacseq_peak_pileup.png').default} style={{width:100+'%',}}/>
</div>


### 6. ScriptManager for Heatmap

#### 6.1 Sort BED file by CDT file: Coordinate File Manipulation ➡️ [__Sort BED__][sort-bed]

<div class="tutorial-img-flow-container">
<img src={require('./img/atacseq_peak_sortcdt.png').default} style={{width:100+'%',}}/>
</div>


#### 6.2 Heatmap: Figure Generation ➡️ [__Heat Map__][heatmap] and Figure Generation ➡️ [__Label Heatmaps__][label-heatmap]

<div class="tutorial-img-flow-container">
<img src={require('./img/atacseq_pea_heatmapgen.png').default} style={{width:55+'%',}}/>
<i class="fa-solid fa-arrow-right fa-lg"></i>
<img src={require('./img/atacseq_peak_heatmap.png').default} style={{width:45+'%',}}/>
</div>

## Command-Line shell script for ScriptManager

The following shell commands records the locations for a BED file, a BAM file, and the anticipated OUTPUT basename as environmental variables to derive the corresponding composite plot values and heatmaps. This can serve as a template for you to write out your own workflows as bash scripts that execute command-line style ScriptManager.

```bash
SCRIPTMANAGER=/path/to/ScriptManager.jar
BEDFILE=/path/to/sample_ATAC_top1000_summits.bed
BAMFILE=/path/to/ENCFF205TSU.bam
OUTPUT=/path/to/myoutput

samtools index $BAMFILE

java -jar $SCRIPTMANAGER read-analysis tag-pileup --combined --full-fragment $OUTPUT\_1000bp.bed $BAMFILE -o $OUTPUT\_composite.out -M $OUTPUT\_matrix
java -jar $SCRIPTMANAGER coordinate-manipulation sort-bed -c 1000 $OUTPUT\_1000bp.bed $OUTPUT\_matrix_combined.cdt -o $OUTPUT\_SORT
java -jar $SCRIPTMANAGER figure-generation heatmap -p .95 --black $OUTPUT\_SORT.cdt -o $OUTPUT\_heatmap.png

# Output files:
# - /path/to/myoutput_composite.out
# - /path/to/myoutput_matrix_combined.cdt
# - /path/to/myoutput_SORT.bed
# - /path/to/myoutput_SORT.cdt
# - /path/to/myoutput_heatmap.png
```

[encode-project]: https://www.encodeproject.org/experiments/ENCFF205TSU













6 changes: 6 additions & 0 deletions docs/Tutorials/PeakCalling/chipexo-pcalling-chexmix.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
---
id: chipexo-pcalling-chexmix
title: "ChIP-exo Peak Calling (ChExMix)"
sidebar_label: "ChIP-exo Peak Calling (ChExMix)"
sidebar_position: 2
---
6 changes: 6 additions & 0 deletions docs/Tutorials/PeakCalling/chipexo-pcalling-genetrack.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
---
id: chipexo-pcalling-genetrack
title: "ChIP-exo Peak Calling (Genetrack/CWPair)"
sidebar_label: "ChIP-exo Peak Calling (Genetrack/CWPair)"
sidebar_position: 1
---
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions docs/Tutorials/PeakCalling/index.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
---
title: "Peak Calling"
sidebar_label: "Peak Calling"
sidebar_position: 3
---
1 change: 1 addition & 0 deletions docs/Tutorials/PeakCalling/procap-pcalling-genetrack.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
a
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' Restructure tutorials by alimadeen04 · Pull Request #16 · CEGRcode/scriptmanager-docs · GitHub
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
---
id: getting-started
title: Getting Started
sidebar_label: Getting Started
slug: /
sidebar_position: 1
---

import Tabs from '@theme/Tabs';
Expand Down
6 changes: 6 additions & 0 deletions docs/Tutorials/GenomeTracks/atacseq-gtracks-deeptools.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
---
id: atacseq-gtracks-deeptools
title: "ATAC-seq Genome Tracks (Deeptools)"
sidebar_label: "ATAC-seq Genome Tracks (Deeptools)"
sidebar_position: 2
---
6 changes: 6 additions & 0 deletions docs/Tutorials/GenomeTracks/chipexo-gtracks-deeptools.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
---
id: chipexo-gtracks-deeptools
title: "ChIP-exo Genome Tracks (Deeptools)"
sidebar_label: "ChIP-exo Genome Tracks (Deeptools)"
sidebar_position: 1
---
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
---
id: genome-tracks-tutorial
title: "Making Genome Tracks Tutorial"
sidebar_label: "Genome Tracks (BigWig)"
id: custom-gtracks-scriptmanager
title: "Making Custom Genome Tracks Tutorial"
sidebar_label: "Custom Tracks (ScriptManager/Kent Tools)"
sidebar_position: 3
---

import Tabs from '@theme/Tabs';
Expand DownExpand Up@@ -69,7 +70,7 @@ OR


<div class="tutorial-img-flow-container">
<img src={require('./img/download-yep-home.png').default} style={{width:60+'%'}} />
<img src={require('../QuickStart/img/download-yep-home.png').default} style={{width:60+'%'}} />
</div>

1. Navigate to [www.yeastepigenome.org][yep-stencil] and search for Reb1
Expand All@@ -78,8 +79,8 @@ OR
4. Unzip the resulting file ‘12141_YEP.zip’ and inspect the contents of the new `12141_YEP` folder. It should contain a file called `12141_filtered.bam`.

<div class="tutorial-img-flow-container">
<img src={require('./img/download-yep-reb1.png').default} style={{width:50+'%'}} />
<img src={require('./img/download-yep-reb1-metadata.png').default} style={{width:50+'%'}} />
<img src={require('../QuickStart/img/download-yep-reb1.png').default} style={{width:50+'%'}} />
<img src={require('../QuickStart/img/download-yep-reb1-metadata.png').default} style={{width:50+'%'}} />
</div>

### XXXX.chrom.sizes Reference File
Expand Down
5 changes: 5 additions & 0 deletions docs/Tutorials/GenomeTracks/index.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
---
title: "Making Genome Tracks"
sidebar_label: "Genome Tracks"
sidebar_position: 2
---
232 changes: 232 additions & 0 deletions docs/Tutorials/PeakCalling/atacseq-pcalling-macs.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
---
id: atacseq-pcalling-macs
title: "ATAC-seq Peak Calling (MACS)"
sidebar_label: "ATAC-seq Peak Calling (MACS)"
sidebar_position: 3
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import Link from '@docusaurus/Link';

_Performing ATAC-seq peak calling with MACS2_

**Goal:** This tutorial provides a guide to peak calling using MACS2 and data generated by the [Stanford Encode Project][encode-project].

---

## Background

### What is MACS2?
**MACS2 (Model-based Analysis of ChIP-Seq)** is a widely used program to detect **peaks** — enriched regions in sequencing data where reads pile up.
- For **ChIP-seq**, peaks correspond to transcription factor binding sites.
- For **ATAC-seq**, peaks correspond to **open chromatin regions** cut by the Tn5 transposase.

That’s why we use MACS2 for ATAC-seq: it helps us identify the regions of the genome that are likely regulatory hotspots.

---
## Download Data

You need one set of genomic coordinate regions to investigate (BED) and one file of sequencing data alignments (BAM) to complete this exercise. [Read more about the BED/BAM file formats here.][file-formats]


### BED File
This is the set of transcription start site (TSS) annotations for the GRCh38 genome build that has been subsampled down to 2000 sites for quick tutorial purposes. A more formal analysis may use a more complete set of annotations (many more sites).

<Link
className="button button--secondary"
target="\_blank"
href="/sample_data/atac-seq-tutorial/UCSC_GRCh38_knownGene_GENCODEV3_TSS_2000bp_SUBSAMPLE-2000-Sites.bed" >
Download sample BED file
</Link>

<br />
<br />

:::caution
If your BED file downloads with a `.txt` extension, make sure to change the filename to a `.bed` extension. For this tutorial, the BED file is named `UCSC_GRCh38_knownGene_GENCODEV3_TSS_2000bp_SUBSAMPLE-2000-Sites.bed`.
:::

### BAM File
This is the set of read alignments from the [ENCODE Project][encode-project] (`ENCFF205TSU.bam`).

<Link
className="button button--secondary"
href="https://www.encodeproject.org/files/ENCFF205TSU/@@download/ENCFF205TSU">
Download sample BAM file
</Link>

<br />
<br />

:::caution
The BAM file is ~2.5GB large so make sure you have enough space on your machine before downloading.
:::

## Peak Calling ATAC-seq with MACS2

### 1. Install MACS2
There are two common ways to install bioinformatics software: **pip** and **conda**.

- **pip**: the Python package manager. It installs Python-based tools (like MACS2) into your environment.
- **conda**: an environment manager that can install packages (both Python and non-Python) with all dependencies. Widely used in bioinformatics. We’ll show both methods,

#### 1.1 Install using pip

```bash
# Create a clean Python environment
python3 -m venv macs2_env
source macs2_env/bin/activate

# Update pip and install MACS2
pip install --upgrade pip wheel
pip install numpy
pip install MACS2
```

#### 1.2 Install using conda

```bash
conda create -n macs2_env python=3.8
conda activate macs2_env
conda install -c bioconda macs2
```

### 2. Generate BAI index file
A BAI index file is required for each BAM file of interest (i.e., the tag occupancy data you want to plot). This file allows for rapid access of the sorted and aligned sequence reads (BAM file).

:::tip

SAM/BAM standard is to keep BAI file in same directory as BAM file with the ScriptManager-generated filename.

```bash
samtools index ENCFF205TSU.bam
```

### 3. Run MACS2 for ATAC-seq
ATAC-seq is slightly different from ChIP-seq because fragments are shifted by Tn5 transposase insertions and you usually call peaks with paired-end BAM.

```bash
macs2 callpeak -t ENCFF205TSU.bam \
-f BAMPE \
-g hs \
-n sample_ATAC \
--outdir macs2_output \
--shift -100 --extsize 200 \
-q 0.01
```

Key flags explained:
- -f BAMPE: Paired-end BAM input
- -g hs: Human genome
- --shift -100 --extsize 200: Adjusts for Tn5 integration offset
- -q 0.01: False Discovery Rate Threshold

The output files should be the follwoing:
- **sample_ATAC_peaks.narrowPeak**: Peak regions (main file to use downstream)
- **sample_ATAC_peaks.xls**: Detailed peak statistics
- **sample_ATAC_summits.bed**: Summit positions

### 4. Convert 'sample_ATAC_peaks.narrowPeak' file to BED File

```bash
cd macs2_output
cut -f1-3 sample_ATAC_peaks.narrowPeak > sample_ATAC_peaks.bed
awk '{print $1"\t"$2-1000"\t"$2+1000}' sample_ATAC_top1000_summits.bed > summits_1000bp.bed
```

:::note
The file of this BED file is very large, so we use 1000bp to around each summit in order reduce processing time.
:::

The output file should be the follwoing:
- **sample_ATAC_peaks.bed**

### 5. ScriptManager for TagPileup
ScriptManager can plot composite pileups and heatmaps using BAM + BED.

##### 5.1 Index Bam File: BAM Manipulation ➡️ [__BAM-BAI Indexer__][bam-indexer]
```bash
ENCFF205TSU.bam
ENCFF205TSU.bam.bai # Need to generate this file to proceed.
```
:::

<div class="tutorial-img-flow-container">
<img src={require('./img/bam_atacseq_peakcalling.png').default} style={{width:60+'%',}}/>
<i class="fa-solid fa-arrow-right fa-lg"></i>
<img src={require('./img/gui-bamidx-complete.png').default} style={{width:30+'%',}}/>
</div>

:::note
The speed of this step scales with the size of the BAM file. Generally this step 30 sec for a 100 MB BAM file but may take 1-2 min for a multi-GB BAM file.
:::


#### 5.2 TagPileup: Sequence Read Analysis ➡️ [__Tag Pileup__][tag-pileup]
Use **"Full Fragment"** in the top right, then select **"Combined"** color , **"Output Composite"**, **"CDT"**, and **"Output GZIP"**. Then, proceed to "Output Directory".

<div class="tutorial-img-flow-container">
<img src={require('./img/atacseq_peak_tagpileup.png').default} style={{width:100+'%',}}/>
</div>

<div class="tutorial-img-flow-container">
<img src={require('./img/atacseq_peak_pileup.png').default} style={{width:100+'%',}}/>
</div>


### 6. ScriptManager for Heatmap

#### 6.1 Sort BED file by CDT file: Coordinate File Manipulation ➡️ [__Sort BED__][sort-bed]

<div class="tutorial-img-flow-container">
<img src={require('./img/atacseq_peak_sortcdt.png').default} style={{width:100+'%',}}/>
</div>


#### 6.2 Heatmap: Figure Generation ➡️ [__Heat Map__][heatmap] and Figure Generation ➡️ [__Label Heatmaps__][label-heatmap]

<div class="tutorial-img-flow-container">
<img src={require('./img/atacseq_pea_heatmapgen.png').default} style={{width:55+'%',}}/>
<i class="fa-solid fa-arrow-right fa-lg"></i>
<img src={require('./img/atacseq_peak_heatmap.png').default} style={{width:45+'%',}}/>
</div>

## Command-Line shell script for ScriptManager

The following shell commands records the locations for a BED file, a BAM file, and the anticipated OUTPUT basename as environmental variables to derive the corresponding composite plot values and heatmaps. This can serve as a template for you to write out your own workflows as bash scripts that execute command-line style ScriptManager.

```bash
SCRIPTMANAGER=/path/to/ScriptManager.jar
BEDFILE=/path/to/sample_ATAC_top1000_summits.bed
BAMFILE=/path/to/ENCFF205TSU.bam
OUTPUT=/path/to/myoutput

samtools index $BAMFILE

java -jar $SCRIPTMANAGER read-analysis tag-pileup --combined --full-fragment $OUTPUT\_1000bp.bed $BAMFILE -o $OUTPUT\_composite.out -M $OUTPUT\_matrix
java -jar $SCRIPTMANAGER coordinate-manipulation sort-bed -c 1000 $OUTPUT\_1000bp.bed $OUTPUT\_matrix_combined.cdt -o $OUTPUT\_SORT
java -jar $SCRIPTMANAGER figure-generation heatmap -p .95 --black $OUTPUT\_SORT.cdt -o $OUTPUT\_heatmap.png

# Output files:
# - /path/to/myoutput_composite.out
# - /path/to/myoutput_matrix_combined.cdt
# - /path/to/myoutput_SORT.bed
# - /path/to/myoutput_SORT.cdt
# - /path/to/myoutput_heatmap.png
```

[encode-project]: https://www.encodeproject.org/experiments/ENCFF205TSU













6 changes: 6 additions & 0 deletions docs/Tutorials/PeakCalling/chipexo-pcalling-chexmix.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
---
id: chipexo-pcalling-chexmix
title: "ChIP-exo Peak Calling (ChExMix)"
sidebar_label: "ChIP-exo Peak Calling (ChExMix)"
sidebar_position: 2
---
6 changes: 6 additions & 0 deletions docs/Tutorials/PeakCalling/chipexo-pcalling-genetrack.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
---
id: chipexo-pcalling-genetrack
title: "ChIP-exo Peak Calling (Genetrack/CWPair)"
sidebar_label: "ChIP-exo Peak Calling (Genetrack/CWPair)"
sidebar_position: 1
---
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions docs/Tutorials/PeakCalling/index.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
---
title: "Peak Calling"
sidebar_label: "Peak Calling"
sidebar_position: 3
---
1 change: 1 addition & 0 deletions docs/Tutorials/PeakCalling/procap-pcalling-genetrack.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
a
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Restructure tutorials by alimadeen04 · Pull Request #16 · CEGRcode/scriptmanager-docs · GitHub
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
---
id: getting-started
title: Getting Started
sidebar_label: Getting Started
slug: /
sidebar_position: 1
---

import Tabs from '@theme/Tabs';
Expand Down
6 changes: 6 additions & 0 deletions docs/Tutorials/GenomeTracks/atacseq-gtracks-deeptools.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
---
id: atacseq-gtracks-deeptools
title: "ATAC-seq Genome Tracks (Deeptools)"
sidebar_label: "ATAC-seq Genome Tracks (Deeptools)"
sidebar_position: 2
---
6 changes: 6 additions & 0 deletions docs/Tutorials/GenomeTracks/chipexo-gtracks-deeptools.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
---
id: chipexo-gtracks-deeptools
title: "ChIP-exo Genome Tracks (Deeptools)"
sidebar_label: "ChIP-exo Genome Tracks (Deeptools)"
sidebar_position: 1
---
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
---
id: genome-tracks-tutorial
title: "Making Genome Tracks Tutorial"
sidebar_label: "Genome Tracks (BigWig)"
id: custom-gtracks-scriptmanager
title: "Making Custom Genome Tracks Tutorial"
sidebar_label: "Custom Tracks (ScriptManager/Kent Tools)"
sidebar_position: 3
---

import Tabs from '@theme/Tabs';
Expand DownExpand Up@@ -69,7 +70,7 @@ OR


<div class="tutorial-img-flow-container">
<img src={require('./img/download-yep-home.png').default} style={{width:60+'%'}} />
<img src={require('../QuickStart/img/download-yep-home.png').default} style={{width:60+'%'}} />
</div>

1. Navigate to [www.yeastepigenome.org][yep-stencil] and search for Reb1
Expand All@@ -78,8 +79,8 @@ OR
4. Unzip the resulting file ‘12141_YEP.zip’ and inspect the contents of the new `12141_YEP` folder. It should contain a file called `12141_filtered.bam`.

<div class="tutorial-img-flow-container">
<img src={require('./img/download-yep-reb1.png').default} style={{width:50+'%'}} />
<img src={require('./img/download-yep-reb1-metadata.png').default} style={{width:50+'%'}} />
<img src={require('../QuickStart/img/download-yep-reb1.png').default} style={{width:50+'%'}} />
<img src={require('../QuickStart/img/download-yep-reb1-metadata.png').default} style={{width:50+'%'}} />
</div>

### XXXX.chrom.sizes Reference File
Expand Down
5 changes: 5 additions & 0 deletions docs/Tutorials/GenomeTracks/index.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
---
title: "Making Genome Tracks"
sidebar_label: "Genome Tracks"
sidebar_position: 2
---
232 changes: 232 additions & 0 deletions docs/Tutorials/PeakCalling/atacseq-pcalling-macs.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
---
id: atacseq-pcalling-macs
title: "ATAC-seq Peak Calling (MACS)"
sidebar_label: "ATAC-seq Peak Calling (MACS)"
sidebar_position: 3
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import Link from '@docusaurus/Link';

_Performing ATAC-seq peak calling with MACS2_

**Goal:** This tutorial provides a guide to peak calling using MACS2 and data generated by the [Stanford Encode Project][encode-project].

---

## Background

### What is MACS2?
**MACS2 (Model-based Analysis of ChIP-Seq)** is a widely used program to detect **peaks** — enriched regions in sequencing data where reads pile up.
- For **ChIP-seq**, peaks correspond to transcription factor binding sites.
- For **ATAC-seq**, peaks correspond to **open chromatin regions** cut by the Tn5 transposase.

That’s why we use MACS2 for ATAC-seq: it helps us identify the regions of the genome that are likely regulatory hotspots.

---
## Download Data

You need one set of genomic coordinate regions to investigate (BED) and one file of sequencing data alignments (BAM) to complete this exercise. [Read more about the BED/BAM file formats here.][file-formats]


### BED File
This is the set of transcription start site (TSS) annotations for the GRCh38 genome build that has been subsampled down to 2000 sites for quick tutorial purposes. A more formal analysis may use a more complete set of annotations (many more sites).

<Link
className="button button--secondary"
target="\_blank"
href="/sample_data/atac-seq-tutorial/UCSC_GRCh38_knownGene_GENCODEV3_TSS_2000bp_SUBSAMPLE-2000-Sites.bed" >
Download sample BED file
</Link>

<br />
<br />

:::caution
If your BED file downloads with a `.txt` extension, make sure to change the filename to a `.bed` extension. For this tutorial, the BED file is named `UCSC_GRCh38_knownGene_GENCODEV3_TSS_2000bp_SUBSAMPLE-2000-Sites.bed`.
:::

### BAM File
This is the set of read alignments from the [ENCODE Project][encode-project] (`ENCFF205TSU.bam`).

<Link
className="button button--secondary"
href="https://www.encodeproject.org/files/ENCFF205TSU/@@download/ENCFF205TSU">
Download sample BAM file
</Link>

<br />
<br />

:::caution
The BAM file is ~2.5GB large so make sure you have enough space on your machine before downloading.
:::

## Peak Calling ATAC-seq with MACS2

### 1. Install MACS2
There are two common ways to install bioinformatics software: **pip** and **conda**.

- **pip**: the Python package manager. It installs Python-based tools (like MACS2) into your environment.
- **conda**: an environment manager that can install packages (both Python and non-Python) with all dependencies. Widely used in bioinformatics. We’ll show both methods,

#### 1.1 Install using pip

```bash
# Create a clean Python environment
python3 -m venv macs2_env
source macs2_env/bin/activate

# Update pip and install MACS2
pip install --upgrade pip wheel
pip install numpy
pip install MACS2
```

#### 1.2 Install using conda

```bash
conda create -n macs2_env python=3.8
conda activate macs2_env
conda install -c bioconda macs2
```

### 2. Generate BAI index file
A BAI index file is required for each BAM file of interest (i.e., the tag occupancy data you want to plot). This file allows for rapid access of the sorted and aligned sequence reads (BAM file).

:::tip

SAM/BAM standard is to keep BAI file in same directory as BAM file with the ScriptManager-generated filename.

```bash
samtools index ENCFF205TSU.bam
```

### 3. Run MACS2 for ATAC-seq
ATAC-seq is slightly different from ChIP-seq because fragments are shifted by Tn5 transposase insertions and you usually call peaks with paired-end BAM.

```bash
macs2 callpeak -t ENCFF205TSU.bam \
-f BAMPE \
-g hs \
-n sample_ATAC \
--outdir macs2_output \
--shift -100 --extsize 200 \
-q 0.01
```

Key flags explained:
- -f BAMPE: Paired-end BAM input
- -g hs: Human genome
- --shift -100 --extsize 200: Adjusts for Tn5 integration offset
- -q 0.01: False Discovery Rate Threshold

The output files should be the follwoing:
- **sample_ATAC_peaks.narrowPeak**: Peak regions (main file to use downstream)
- **sample_ATAC_peaks.xls**: Detailed peak statistics
- **sample_ATAC_summits.bed**: Summit positions

### 4. Convert 'sample_ATAC_peaks.narrowPeak' file to BED File

```bash
cd macs2_output
cut -f1-3 sample_ATAC_peaks.narrowPeak > sample_ATAC_peaks.bed
awk '{print $1"\t"$2-1000"\t"$2+1000}' sample_ATAC_top1000_summits.bed > summits_1000bp.bed
```

:::note
The file of this BED file is very large, so we use 1000bp to around each summit in order reduce processing time.
:::

The output file should be the follwoing:
- **sample_ATAC_peaks.bed**

### 5. ScriptManager for TagPileup
ScriptManager can plot composite pileups and heatmaps using BAM + BED.

##### 5.1 Index Bam File: BAM Manipulation ➡️ [__BAM-BAI Indexer__][bam-indexer]
```bash
ENCFF205TSU.bam
ENCFF205TSU.bam.bai # Need to generate this file to proceed.
```
:::

<div class="tutorial-img-flow-container">
<img src={require('./img/bam_atacseq_peakcalling.png').default} style={{width:60+'%',}}/>
<i class="fa-solid fa-arrow-right fa-lg"></i>
<img src={require('./img/gui-bamidx-complete.png').default} style={{width:30+'%',}}/>
</div>

:::note
The speed of this step scales with the size of the BAM file. Generally this step 30 sec for a 100 MB BAM file but may take 1-2 min for a multi-GB BAM file.
:::


#### 5.2 TagPileup: Sequence Read Analysis ➡️ [__Tag Pileup__][tag-pileup]
Use **"Full Fragment"** in the top right, then select **"Combined"** color , **"Output Composite"**, **"CDT"**, and **"Output GZIP"**. Then, proceed to "Output Directory".

<div class="tutorial-img-flow-container">
<img src={require('./img/atacseq_peak_tagpileup.png').default} style={{width:100+'%',}}/>
</div>

<div class="tutorial-img-flow-container">
<img src={require('./img/atacseq_peak_pileup.png').default} style={{width:100+'%',}}/>
</div>


### 6. ScriptManager for Heatmap

#### 6.1 Sort BED file by CDT file: Coordinate File Manipulation ➡️ [__Sort BED__][sort-bed]

<div class="tutorial-img-flow-container">
<img src={require('./img/atacseq_peak_sortcdt.png').default} style={{width:100+'%',}}/>
</div>


#### 6.2 Heatmap: Figure Generation ➡️ [__Heat Map__][heatmap] and Figure Generation ➡️ [__Label Heatmaps__][label-heatmap]

<div class="tutorial-img-flow-container">
<img src={require('./img/atacseq_pea_heatmapgen.png').default} style={{width:55+'%',}}/>
<i class="fa-solid fa-arrow-right fa-lg"></i>
<img src={require('./img/atacseq_peak_heatmap.png').default} style={{width:45+'%',}}/>
</div>

## Command-Line shell script for ScriptManager

The following shell commands records the locations for a BED file, a BAM file, and the anticipated OUTPUT basename as environmental variables to derive the corresponding composite plot values and heatmaps. This can serve as a template for you to write out your own workflows as bash scripts that execute command-line style ScriptManager.

```bash
SCRIPTMANAGER=/path/to/ScriptManager.jar
BEDFILE=/path/to/sample_ATAC_top1000_summits.bed
BAMFILE=/path/to/ENCFF205TSU.bam
OUTPUT=/path/to/myoutput

samtools index $BAMFILE

java -jar $SCRIPTMANAGER read-analysis tag-pileup --combined --full-fragment $OUTPUT\_1000bp.bed $BAMFILE -o $OUTPUT\_composite.out -M $OUTPUT\_matrix
java -jar $SCRIPTMANAGER coordinate-manipulation sort-bed -c 1000 $OUTPUT\_1000bp.bed $OUTPUT\_matrix_combined.cdt -o $OUTPUT\_SORT
java -jar $SCRIPTMANAGER figure-generation heatmap -p .95 --black $OUTPUT\_SORT.cdt -o $OUTPUT\_heatmap.png

# Output files:
# - /path/to/myoutput_composite.out
# - /path/to/myoutput_matrix_combined.cdt
# - /path/to/myoutput_SORT.bed
# - /path/to/myoutput_SORT.cdt
# - /path/to/myoutput_heatmap.png
```

[encode-project]: https://www.encodeproject.org/experiments/ENCFF205TSU













6 changes: 6 additions & 0 deletions docs/Tutorials/PeakCalling/chipexo-pcalling-chexmix.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
---
id: chipexo-pcalling-chexmix
title: "ChIP-exo Peak Calling (ChExMix)"
sidebar_label: "ChIP-exo Peak Calling (ChExMix)"
sidebar_position: 2
---
6 changes: 6 additions & 0 deletions docs/Tutorials/PeakCalling/chipexo-pcalling-genetrack.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
---
id: chipexo-pcalling-genetrack
title: "ChIP-exo Peak Calling (Genetrack/CWPair)"
sidebar_label: "ChIP-exo Peak Calling (Genetrack/CWPair)"
sidebar_position: 1
---
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions docs/Tutorials/PeakCalling/index.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
---
title: "Peak Calling"
sidebar_label: "Peak Calling"
sidebar_position: 3
---
1 change: 1 addition & 0 deletions docs/Tutorials/PeakCalling/procap-pcalling-genetrack.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
a
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); Restructure tutorials by alimadeen04 · Pull Request #16 · CEGRcode/scriptmanager-docs · GitHub
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
---
id: getting-started
title: Getting Started
sidebar_label: Getting Started
slug: /
sidebar_position: 1
---

import Tabs from '@theme/Tabs';
Expand Down
6 changes: 6 additions & 0 deletions docs/Tutorials/GenomeTracks/atacseq-gtracks-deeptools.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
---
id: atacseq-gtracks-deeptools
title: "ATAC-seq Genome Tracks (Deeptools)"
sidebar_label: "ATAC-seq Genome Tracks (Deeptools)"
sidebar_position: 2
---
6 changes: 6 additions & 0 deletions docs/Tutorials/GenomeTracks/chipexo-gtracks-deeptools.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
---
id: chipexo-gtracks-deeptools
title: "ChIP-exo Genome Tracks (Deeptools)"
sidebar_label: "ChIP-exo Genome Tracks (Deeptools)"
sidebar_position: 1
---
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
---
id: genome-tracks-tutorial
title: "Making Genome Tracks Tutorial"
sidebar_label: "Genome Tracks (BigWig)"
id: custom-gtracks-scriptmanager
title: "Making Custom Genome Tracks Tutorial"
sidebar_label: "Custom Tracks (ScriptManager/Kent Tools)"
sidebar_position: 3
---

import Tabs from '@theme/Tabs';
Expand DownExpand Up@@ -69,7 +70,7 @@ OR


<div class="tutorial-img-flow-container">
<img src={require('./img/download-yep-home.png').default} style={{width:60+'%'}} />
<img src={require('../QuickStart/img/download-yep-home.png').default} style={{width:60+'%'}} />
</div>

1. Navigate to [www.yeastepigenome.org][yep-stencil] and search for Reb1
Expand All@@ -78,8 +79,8 @@ OR
4. Unzip the resulting file ‘12141_YEP.zip’ and inspect the contents of the new `12141_YEP` folder. It should contain a file called `12141_filtered.bam`.

<div class="tutorial-img-flow-container">
<img src={require('./img/download-yep-reb1.png').default} style={{width:50+'%'}} />
<img src={require('./img/download-yep-reb1-metadata.png').default} style={{width:50+'%'}} />
<img src={require('../QuickStart/img/download-yep-reb1.png').default} style={{width:50+'%'}} />
<img src={require('../QuickStart/img/download-yep-reb1-metadata.png').default} style={{width:50+'%'}} />
</div>

### XXXX.chrom.sizes Reference File
Expand Down
5 changes: 5 additions & 0 deletions docs/Tutorials/GenomeTracks/index.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
---
title: "Making Genome Tracks"
sidebar_label: "Genome Tracks"
sidebar_position: 2
---
232 changes: 232 additions & 0 deletions docs/Tutorials/PeakCalling/atacseq-pcalling-macs.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
---
id: atacseq-pcalling-macs
title: "ATAC-seq Peak Calling (MACS)"
sidebar_label: "ATAC-seq Peak Calling (MACS)"
sidebar_position: 3
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import Link from '@docusaurus/Link';

_Performing ATAC-seq peak calling with MACS2_

**Goal:** This tutorial provides a guide to peak calling using MACS2 and data generated by the [Stanford Encode Project][encode-project].

---

## Background

### What is MACS2?
**MACS2 (Model-based Analysis of ChIP-Seq)** is a widely used program to detect **peaks** — enriched regions in sequencing data where reads pile up.
- For **ChIP-seq**, peaks correspond to transcription factor binding sites.
- For **ATAC-seq**, peaks correspond to **open chromatin regions** cut by the Tn5 transposase.

That’s why we use MACS2 for ATAC-seq: it helps us identify the regions of the genome that are likely regulatory hotspots.

---
## Download Data

You need one set of genomic coordinate regions to investigate (BED) and one file of sequencing data alignments (BAM) to complete this exercise. [Read more about the BED/BAM file formats here.][file-formats]


### BED File
This is the set of transcription start site (TSS) annotations for the GRCh38 genome build that has been subsampled down to 2000 sites for quick tutorial purposes. A more formal analysis may use a more complete set of annotations (many more sites).

<Link
className="button button--secondary"
target="\_blank"
href="/sample_data/atac-seq-tutorial/UCSC_GRCh38_knownGene_GENCODEV3_TSS_2000bp_SUBSAMPLE-2000-Sites.bed" >
Download sample BED file
</Link>

<br />
<br />

:::caution
If your BED file downloads with a `.txt` extension, make sure to change the filename to a `.bed` extension. For this tutorial, the BED file is named `UCSC_GRCh38_knownGene_GENCODEV3_TSS_2000bp_SUBSAMPLE-2000-Sites.bed`.
:::

### BAM File
This is the set of read alignments from the [ENCODE Project][encode-project] (`ENCFF205TSU.bam`).

<Link
className="button button--secondary"
href="https://www.encodeproject.org/files/ENCFF205TSU/@@download/ENCFF205TSU">
Download sample BAM file
</Link>

<br />
<br />

:::caution
The BAM file is ~2.5GB large so make sure you have enough space on your machine before downloading.
:::

## Peak Calling ATAC-seq with MACS2

### 1. Install MACS2
There are two common ways to install bioinformatics software: **pip** and **conda**.

- **pip**: the Python package manager. It installs Python-based tools (like MACS2) into your environment.
- **conda**: an environment manager that can install packages (both Python and non-Python) with all dependencies. Widely used in bioinformatics. We’ll show both methods,

#### 1.1 Install using pip

```bash
# Create a clean Python environment
python3 -m venv macs2_env
source macs2_env/bin/activate

# Update pip and install MACS2
pip install --upgrade pip wheel
pip install numpy
pip install MACS2
```

#### 1.2 Install using conda

```bash
conda create -n macs2_env python=3.8
conda activate macs2_env
conda install -c bioconda macs2
```

### 2. Generate BAI index file
A BAI index file is required for each BAM file of interest (i.e., the tag occupancy data you want to plot). This file allows for rapid access of the sorted and aligned sequence reads (BAM file).

:::tip

SAM/BAM standard is to keep BAI file in same directory as BAM file with the ScriptManager-generated filename.

```bash
samtools index ENCFF205TSU.bam
```

### 3. Run MACS2 for ATAC-seq
ATAC-seq is slightly different from ChIP-seq because fragments are shifted by Tn5 transposase insertions and you usually call peaks with paired-end BAM.

```bash
macs2 callpeak -t ENCFF205TSU.bam \
-f BAMPE \
-g hs \
-n sample_ATAC \
--outdir macs2_output \
--shift -100 --extsize 200 \
-q 0.01
```

Key flags explained:
- -f BAMPE: Paired-end BAM input
- -g hs: Human genome
- --shift -100 --extsize 200: Adjusts for Tn5 integration offset
- -q 0.01: False Discovery Rate Threshold

The output files should be the follwoing:
- **sample_ATAC_peaks.narrowPeak**: Peak regions (main file to use downstream)
- **sample_ATAC_peaks.xls**: Detailed peak statistics
- **sample_ATAC_summits.bed**: Summit positions

### 4. Convert 'sample_ATAC_peaks.narrowPeak' file to BED File

```bash
cd macs2_output
cut -f1-3 sample_ATAC_peaks.narrowPeak > sample_ATAC_peaks.bed
awk '{print $1"\t"$2-1000"\t"$2+1000}' sample_ATAC_top1000_summits.bed > summits_1000bp.bed
```

:::note
The file of this BED file is very large, so we use 1000bp to around each summit in order reduce processing time.
:::

The output file should be the follwoing:
- **sample_ATAC_peaks.bed**

### 5. ScriptManager for TagPileup
ScriptManager can plot composite pileups and heatmaps using BAM + BED.

##### 5.1 Index Bam File: BAM Manipulation ➡️ [__BAM-BAI Indexer__][bam-indexer]
```bash
ENCFF205TSU.bam
ENCFF205TSU.bam.bai # Need to generate this file to proceed.
```
:::

<div class="tutorial-img-flow-container">
<img src={require('./img/bam_atacseq_peakcalling.png').default} style={{width:60+'%',}}/>
<i class="fa-solid fa-arrow-right fa-lg"></i>
<img src={require('./img/gui-bamidx-complete.png').default} style={{width:30+'%',}}/>
</div>

:::note
The speed of this step scales with the size of the BAM file. Generally this step 30 sec for a 100 MB BAM file but may take 1-2 min for a multi-GB BAM file.
:::


#### 5.2 TagPileup: Sequence Read Analysis ➡️ [__Tag Pileup__][tag-pileup]
Use **"Full Fragment"** in the top right, then select **"Combined"** color , **"Output Composite"**, **"CDT"**, and **"Output GZIP"**. Then, proceed to "Output Directory".

<div class="tutorial-img-flow-container">
<img src={require('./img/atacseq_peak_tagpileup.png').default} style={{width:100+'%',}}/>
</div>

<div class="tutorial-img-flow-container">
<img src={require('./img/atacseq_peak_pileup.png').default} style={{width:100+'%',}}/>
</div>


### 6. ScriptManager for Heatmap

#### 6.1 Sort BED file by CDT file: Coordinate File Manipulation ➡️ [__Sort BED__][sort-bed]

<div class="tutorial-img-flow-container">
<img src={require('./img/atacseq_peak_sortcdt.png').default} style={{width:100+'%',}}/>
</div>


#### 6.2 Heatmap: Figure Generation ➡️ [__Heat Map__][heatmap] and Figure Generation ➡️ [__Label Heatmaps__][label-heatmap]

<div class="tutorial-img-flow-container">
<img src={require('./img/atacseq_pea_heatmapgen.png').default} style={{width:55+'%',}}/>
<i class="fa-solid fa-arrow-right fa-lg"></i>
<img src={require('./img/atacseq_peak_heatmap.png').default} style={{width:45+'%',}}/>
</div>

## Command-Line shell script for ScriptManager

The following shell commands records the locations for a BED file, a BAM file, and the anticipated OUTPUT basename as environmental variables to derive the corresponding composite plot values and heatmaps. This can serve as a template for you to write out your own workflows as bash scripts that execute command-line style ScriptManager.

```bash
SCRIPTMANAGER=/path/to/ScriptManager.jar
BEDFILE=/path/to/sample_ATAC_top1000_summits.bed
BAMFILE=/path/to/ENCFF205TSU.bam
OUTPUT=/path/to/myoutput

samtools index $BAMFILE

java -jar $SCRIPTMANAGER read-analysis tag-pileup --combined --full-fragment $OUTPUT\_1000bp.bed $BAMFILE -o $OUTPUT\_composite.out -M $OUTPUT\_matrix
java -jar $SCRIPTMANAGER coordinate-manipulation sort-bed -c 1000 $OUTPUT\_1000bp.bed $OUTPUT\_matrix_combined.cdt -o $OUTPUT\_SORT
java -jar $SCRIPTMANAGER figure-generation heatmap -p .95 --black $OUTPUT\_SORT.cdt -o $OUTPUT\_heatmap.png

# Output files:
# - /path/to/myoutput_composite.out
# - /path/to/myoutput_matrix_combined.cdt
# - /path/to/myoutput_SORT.bed
# - /path/to/myoutput_SORT.cdt
# - /path/to/myoutput_heatmap.png
```

[encode-project]: https://www.encodeproject.org/experiments/ENCFF205TSU













6 changes: 6 additions & 0 deletions docs/Tutorials/PeakCalling/chipexo-pcalling-chexmix.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
---
id: chipexo-pcalling-chexmix
title: "ChIP-exo Peak Calling (ChExMix)"
sidebar_label: "ChIP-exo Peak Calling (ChExMix)"
sidebar_position: 2
---
6 changes: 6 additions & 0 deletions docs/Tutorials/PeakCalling/chipexo-pcalling-genetrack.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
---
id: chipexo-pcalling-genetrack
title: "ChIP-exo Peak Calling (Genetrack/CWPair)"
sidebar_label: "ChIP-exo Peak Calling (Genetrack/CWPair)"
sidebar_position: 1
---
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions docs/Tutorials/PeakCalling/index.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
---
title: "Peak Calling"
sidebar_label: "Peak Calling"
sidebar_position: 3
---
1 change: 1 addition & 0 deletions docs/Tutorials/PeakCalling/procap-pcalling-genetrack.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
a
Loading