Commit 4eb4b3b8 authored by Blaise Li's avatar Blaise Li

Auto load modules in bam2bigwig.sh

parent c4715fde
......@@ -10,7 +10,7 @@
# the first one with library names and the second with size factors.
# If it is a value, it shoud be the size factor.
# Requires:
# * bedops (for bedmap)
# * bedops (for bedmap) -> module load bedops/2.4.36
# * python3 -> module load Python/3.6.0
# * samtools -> module load samtools/1.9
# * bedtools -> module load bedtools/2.25.0
......@@ -18,6 +18,16 @@
# * parallel (for niceload) -> module load parallel/20170122
# * UCSC-tools (for bedGraphToBigWig) -> module load UCSC-tools/v373
load_tools ()
{
[ bedops --version 2> /dev/null ] || module load bedops/2.4.36
[ python3 -V 2> /dev/null ] || module load bedops/2.4.36
[ samtools --version 2> /dev/null ] || module load samtools/1.9
[ bedtools --version 2> /dev/null ] || module load bedtools/2.25.0
[ niceload --version 2> /dev/null ] || module load parallel/20170122
[ bedGraphToBigWig 2> /dev/null ] || module load UCSC-tools/v373
}
workdir=$(mktemp -d)
cleanup()
......@@ -42,6 +52,8 @@ error_exit ()
mawk --version 1> /dev/null 2> /dev/null || alias mawk='awk'
load_tools || error_exit "Some tools are not available"
bam=${1}
bin_file=${2}
# Example of how to generate the bin_file from iGenome data:
......@@ -50,6 +62,7 @@ bin_file=${2}
# | sed 's/SN://g' | sed 's/LN://' \
# | bedops --chop 10 - \
# > Caenorhabditis_elegans/Ensembl/WBcel235/Sequence/genome_binned_10.bed
# A genome.dict file can be extracted from a bam file: samtools view -H <bam file>
# Ensure we use a 3 columns minimal bed for bin_file:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment