Skip to content

Instantly share code, notes, and snippets.

@gatoravi
Last active August 29, 2015 14:24
Show Gist options
  • Save gatoravi/9a9277cc0cdabf5c1dcf to your computer and use it in GitHub Desktop.
Save gatoravi/9a9277cc0cdabf5c1dcf to your computer and use it in GitHub Desktop.
create_igv_batch_from_bed.sh
#! /bin/bash
#This script takes 2 arguments
#The first script is the BAM file
#The second is the BED file
bam=$1
bed=$2
awk -v bam=$bam 'BEGIN { print "new\ngenome hg19\nload "bam"\nsnapshotDirectory ./snapshots/" } { gsub("chr", "", $1); if(NR > 1) print "goto "$1"\t"$2-10"\t"$2+10"\nsort base\ncollapse\nsnapshot"; }' $bed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment