--- author: Sam White toc-title: Contents toc-depth: 5 toc-location: left date: 2018-09-26 17:58:17+00:00 layout: post slug: bedgraph-olympia-oyster-transcriptome-with-olurida_v081-genome-assembly title: Bedgraph – Olympia oyster transcriptome with Olurida_v081 genome assembly categories: - 2018 - Miscellaneous tags: - bedgraph - bedtools - IGV - mox - Olurida_v081 - olympia oyster - Ostrea lurida - transcriptome --- I took the sorted BAM file from [yesterday's corrected RNAseq genome alignment](https://robertslab.github.io/sams-notebook/posts/2018/2018-09-25-transcriptome-alignment-olympia-oyster-rnaseq-reads-aligned-to-genome-with-hisat2/) and converted it to a bedgraph using BEDTools genomeCoverageBed tool. Analysis took place on our HPC Mox node. SBATCH script file: * [20180926_oly_RNAseq_bedgraphs.sh](https://owl.fish.washington.edu/Athaliana/20180926_oly_RNAseq_bedgraphs/20180926_oly_RNAseq_bedgraphs.sh)
#!/bin/bash
## Job Name
#SBATCH --job-name=20180926_oly_bedgraphs
## Allocation Definition
#SBATCH --account=srlab
#SBATCH --partition=srlab
## Resources
## Nodes
#SBATCH --nodes=1
## Walltime (days-hours:minutes:seconds format)
#SBATCH --time=5-00:00:00
## Memory per node
#SBATCH --mem=500G
##turn on e-mail notification
#SBATCH --mail-type=ALL
#SBATCH --mail-user=samwhite@uw.edu
## Specify the working directory for this job
#SBATCH --workdir=/gscratch/scrubbed/samwhite/20180926_oly_RNAseq_bedgraphs
# Load Python Mox module for Python module availability
module load intel-python3_2017
# Document programs in PATH (primarily for program version ID)
date >> system_path.log
echo "" >> system_path.log
echo "System PATH for $SLURM_JOB_ID" >> system_path.log
echo "" >> system_path.log
printf "%0.s-" {1..10} >> system_path.log
echo ${PATH} | tr : \\n >> system_path.log
# Set sorted transcriptome assembly bam file
oly_transcriptome_bam=/gscratch/scrubbed/samwhite/20180925_oly_RNAseq_genome_hisat2/20180925_Olurida_v081.sorted.bam
# Set program paths
bedtools=/gscratch/srlab/programs/bedtools-2.27.1/bin
samtools=/gscratch/srlab/programs/samtools-1.9/samtools
# Create bedgraph
## Reports depth at each position (-bg in bedgraph format) and report regions with zero coverage (-a).
## Screens for portions of reads coming from exons (-split).
## Add genome browser track line to header of bedgraph file.
${bedtools}/genomeCoverageBed \
-ibam ${oly_transcriptome_bam} \
-bga \
-split \
-trackline \
> 20180926_oly_RNAseq.bedgraph
* * *
# RESULTS
Output folder:
* [20180926_oly_RNAseq_bedgraphs/](https://owl.fish.washington.edu/Athaliana/20180926_oly_RNAseq_bedgraphs/)
Bedgraph file (1.2GB):
* [20180926_oly_RNAseq_bedgraphs/20180926_oly_RNAseq.bedgraph](https://owl.fish.washington.edu/Athaliana/20180926_oly_RNAseq_bedgraphs/20180926_oly_RNAseq.bedgraph)
Loaded in to IGV to verify things looked OK:
![Screencap of bedgraph in IGV](https://owl.fish.washington.edu/Athaliana/20180926_oly_RNAseq_coverage_IGV.png)