Skip to content

Instantly share code, notes, and snippets.

@afrendeiro
Last active September 17, 2018 19:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save afrendeiro/2ba0d2bb3a5710c51c0f to your computer and use it in GitHub Desktop.
Save afrendeiro/2ba0d2bb3a5710c51c0f to your computer and use it in GitHub Desktop.
Get static files used in bioinformatics (genomes, indexes, annotations)
for GENOME in hg19 mm10 danRer10
do
# Static files
mkdir -p resources/${GENOME}
cd resources/${GENOME}
### Genome
wget http://hgdownload.cse.ucsc.edu/goldenPath/${GENOME}/bigZips/${GENOME}.2bit
twoBitToFa ${GENOME}.2bit ${GENOME}.fa
samtools faidx ${GENOME}.fa
cd ../..
### Bowtie2 genome index
mkdir -p resources/${GENOME}/forBowtie2
cd resources/${GENOME}/forBowtie2
wget ftp://ftp.ccb.jhu.edu/pub/data/bowtie2_indexes/${GENOME}.zip
unzip ${GENOME}.zip
cd ../../..
### Chromosome sizes
cd resources
mysql --user=genome --host=genome-mysql.cse.ucsc.edu -A -e \
"select chrom, size from ${GENOME}.chromInfo" | tail -n +2 > ${GENOME}/${GENOME}.chrom-sizes.tsv
cd ..
### Hisat index
mkdir -p resources/${GENOME}/forHisat
cd resources/${GENOME}/forHisat
wget ftp://ftp.ccb.jhu.edu/pub/data/hisat_indexes/hg19_hisat.tar.gz
tar xfz hg19_hisat.tar.gz
cd ../../..
### Mappability regions
if [ $GENOME == hg19 ]
then
mkdir -p resources/${GENOME}/mappability
cd resources/${GENOME}/mappability
for readLength in 24 36 50
do
wget http://hgdownload.cse.ucsc.edu/goldenPath/hg19/encodeDCC/wgEncodeMapability/wgEncodeCrgMapabilityAlign${readLength}mer.bigWig
bigWigToBedgraph wgEncodeCrgMapabilityAlign${readLength}mer.bigWig wgEncodeCrgMapabilityAlign${readLength}mer.bedgraph
awk '$4 == 1 {OFS="\t"; print $1, $2, $3}' wgEncodeCrgMapabilityAlign${readLength}mer.bedgraph > wgEncodeCrgMapabilityAlign${readLength}mer.bed
done
cd ../../..
fi
done
# ERCCs
mkdir -p resources/ercc
cd resources/ercc
wget https://tools.lifetechnologies.com/content/sfs/manuals/cms_095047.txt
wget https://tools.lifetechnologies.com/content/sfs/manuals/cms_095046.txt
cd ../..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment