-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from MoTrPAC/nicolerg-patch-1
Add docs for BAM to bigWig conversion
- Loading branch information
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# BAM to bigWig conversion | ||
|
||
The [bigWig file format](https://genome.ucsc.edu/goldenPath/help/bigWig.html) is a convenient way to view dense, continuous data in a genome browser. Follow these steps to convert BAMs to bigWigs for viewing in a genome browser. | ||
|
||
### Dependencies | ||
- [samtools](http://www.htslib.org/) | ||
- [deeptools](https://deeptools.readthedocs.io/en/develop/content/installation.html) | ||
|
||
### Usage | ||
1. Download/locate the BAMs you would like to convert. | ||
2. For each BAM file, run [bam2bigwig.sh](../scripts/bam2bigwig.sh) as follows: | ||
```bash | ||
bam=/path/to/${viallabel}.Aligned.sortedByCoord.out.bam | ||
outdir=/path/to/bigwig | ||
bash bam2bigwig.sh ${bam} ${outdir} | ||
``` | ||
|
||
This will generate `${outdir}/${viallabel}.bw`. Each job requires <1G of memory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
# convert a single BAM to bigwig format | ||
# usage: bash bam2bigwig.sh /path/to/90251015803.Aligned.sortedByCoord.out /path/to/bigwigs | ||
# this command will generate /path/to/bigwigs/90251015803.bw | ||
# | ||
# dependencies: samtools, deeptools | ||
|
||
bam=$1 | ||
outdir=$2 | ||
|
||
prefix=$(basename ${bam} | sed "s/\.Aligned.*//") | ||
samtools index ${bam} | ||
bamCoverage -b ${bam} -o ${outdir}/${prefix}.bw |