From 777bd5df436ce676f58a11aa59f79191078f889b Mon Sep 17 00:00:00 2001 From: Nicole Gay Date: Wed, 30 Sep 2020 15:36:23 -0700 Subject: [PATCH 1/3] Create bam2bigwig.md --- docs/bam2bigwig.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 docs/bam2bigwig.md diff --git a/docs/bam2bigwig.md b/docs/bam2bigwig.md new file mode 100644 index 0000000..4d09831 --- /dev/null +++ b/docs/bam2bigwig.md @@ -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 output the bigwig files in `${outdir}`. Each job requires <1G of memory. From c366b243a45f6c4010118ff8b85a4f6a74d763b4 Mon Sep 17 00:00:00 2001 From: Nicole Gay Date: Wed, 30 Sep 2020 15:39:11 -0700 Subject: [PATCH 2/3] Create bam2bigwig.sh --- scripts/bam2bigwig.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 scripts/bam2bigwig.sh diff --git a/scripts/bam2bigwig.sh b/scripts/bam2bigwig.sh new file mode 100644 index 0000000..44b0e20 --- /dev/null +++ b/scripts/bam2bigwig.sh @@ -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 From 2d0d3733edaa6570d57c0b25fe47d23442b25288 Mon Sep 17 00:00:00 2001 From: Nicole Gay Date: Wed, 30 Sep 2020 15:41:13 -0700 Subject: [PATCH 3/3] Update bam2bigwig.md --- docs/bam2bigwig.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/bam2bigwig.md b/docs/bam2bigwig.md index 4d09831..b6e9dc4 100644 --- a/docs/bam2bigwig.md +++ b/docs/bam2bigwig.md @@ -15,4 +15,4 @@ outdir=/path/to/bigwig bash bam2bigwig.sh ${bam} ${outdir} ``` -This will output the bigwig files in `${outdir}`. Each job requires <1G of memory. +This will generate `${outdir}/${viallabel}.bw`. Each job requires <1G of memory.