Skip to content

Instantly share code, notes, and snippets.

@nuada
Last active August 29, 2015 13:56
Show Gist options
  • Save nuada/8861670 to your computer and use it in GitHub Desktop.
Save nuada/8861670 to your computer and use it in GitHub Desktop.
Compare regions of reference sequences
#!/bin/bash
# usage: refdiff.sh <h37>.bed <hg19>.bed
bedtools getfasta -fi /resources/h37/human_g1k_v37.fasta -bed $1 -fo - | sed -e 's/MT/M/' | tr '[:lower:]' '[:upper:]' > tmp.h37.fasta
bedtools getfasta -fi /resources/hg19/ucsc.hg19.fasta -bed $2 -fo - | sed -e 's/chr//' | tr '[:lower:]' '[:upper:]' > tmp.hg19.fasta
diff -u tmp.h*.fasta
rm tmp.h*.fasta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment