
max_per_command_threads=16

tools {

  samtools {
     probe = "%bin% 2>&1 | grep Version | awk '{ print \$2 }'"
     desc = "A suite of utilities for sorting, indexing, viewing and calling variants on NGS data"
     link = "http://samtools.sourceforge.net/"
  }

  bwa {
     probe = "%bin% 2>&1 | grep Version | awk '{ print \$2 }'"
     desc = "BWA is a software package for mapping low-divergent short read sequences against a large reference genome"
     link = "http://bio-bwa.sourceforge.net/"
     installPath="./tools/bwa/current"
     installExe="bwa"
     var="BWA"
     install = """
         mkdir -p tools/bwa
         cd tools/bwa
         curl -o bwa.tar.bz2 'http://internode.dl.sourceforge.net/project/bio-bwa/bwa-0.7.12.tar.bz2'
         tar -xjf bwa.tar.bz2
         cd bwa-*
         make
         cd ..
         VER=`echo bwa-* | grep -o '[0-9.]\\{1,10\\}'`
         mv bwa-* \$VER
         ln -s \$VER current
     """
  }
  
  xhmm {
         desc = """
            Uses principal component analysis (PCA) normalization and a hidden Markov model 
            (HMM) to detect and genotype copy number variation (CNV) from normalized 
            read-depth data from targeted sequencing experiments.
         """
         installPath="./tools/xhmm/trunk"
         
         installExe="xhmm"
         
         install = """
           mkdir -p tools/xhmm
           cd tools/xhmm      
           curl -o master.zip https://bitbucket.org/statgen/xhmm/get/master.zip
           unzip master.zip
           mv statgen* trunk
           cd trunk         
           make
         """

         probe = "%bin% --version | awk '{ print \$2 }'"
         
         license = """
            XHMM licensing is unclear; you should review the statements on the 
            XHMM web site [https://atgu.mgh.harvard.edu/xhmm/] and on the user group
            forum https://groups.google.com/a/broadinstitute.org/forum/#!topic/xhmm-users/zNqbOKFwtUs
            to decide if you are eligible to use XHMM.
         """.stripIndent()

         link = "https://atgu.mgh.harvard.edu/xhmm/"
  }
  
  ExomeDepth {
      desc = """
      CNV detection from Exome Data
      """
      installExe="Rscript"
  }
  
  VariantAnnotation {
      desc = """
      Utilities for annotating variants in R
      """

      installExe="Rscript"
  }
  
  CODEX {
    desc = """
    CNV detection from Exome Data using the CODEX algorithm
    """
    installExe="Rscript"
  }
  
  'cn.mops' {
      desc = "Detection of copy number from exome and targeted sequencing data using a mixture of Poisson distributions."
      installExe="Rscript"
  }
  
  conifer {
      desc = """
          Detection of copy number variants from exome and targeted sequencing data
      """

      probe = """
          python tools/conifer/0.2.2/conifer.py --version 2>&1 | awk '{ print \$2 }'
      """

      installExe="conifer.py"
      installPath="tools/conifer/0.2.2"
      
      install = """
          mkdir -p tools/conifer
          cd tools/conifer
          curl -o 'conifer-0.2.2.tar.gz' 'http://internode.dl.sourceforge.net/project/conifer/CoNIFER%200.2.2/conifer_v0.2.2.tar.gz'
          tar -xzf conifer-0.2.2.tar.gz
          mv conifer_v0.2.2 0.2.2
      """
  }
  
  pandas {
      
      desc ="""
          Python library for data analysis
      """
  
      probe = """
          pip show pandas | grep '^Version' | awk '{ print \$2 }'
      """
  
      installExe="pip,conda"
  }
  
  pytables {
      desc ="""
          Python library for data analysis
      """
  
      probe = """
          conda list pytables | grep pytables | awk '{ print \$2 }'
      """
  
      // NB: have had a lot of trouble making pytable work with pip
      installExe="pip,conda"  
  }
  
  matplotlib {
      desc ="""
          Python library for plotting
      """

      probe = """
          conda list matplotlib | grep matplotlib | awk '{ print \$2 }'
      """

      installExe="pip,conda"
  }

  seaborn {
      desc ="""
          Python library for plotting
      """

      probe = """
          conda list seaborn | grep seaborn | awk '{ print \$2 }'
      """

      installExe="pip,conda"
  }

  bowtie {
    probe = "%bin% --version | grep 'bowtie version'| awk '{ print \$3 }'"
  }
  
  fastqc {
    probe = "%bin% --version | awk '{ print \$2 }'"
  }

  coverageBed {
    probe = "%bin% coverageBed 2>&1 | grep Version | grep -o '[0-9\\.]*'"
  }

  fastx_clipper {
    probe = "%bin% -h | grep 'Part of' | grep -o '[0-9]\\.[0-9]*'"
    link = "http://hannonlab.cshl.edu/fastx_toolkit/index.html"
    desc = "Removes sequencing adapters / linkers from reads based on sequence"
  }

  'convert2annovar.pl' {
     probe="%bin% | grep Version | grep -o '[0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}'"
     module="Annovar"
     link="http://www.openbioinformatics.org/annovar/"
  }
  
  'summarize_annovar.pl' {
     probe="%bin% | grep Version | grep -o '[0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}'"
     module="Annovar"
     link="http://www.openbioinformatics.org/annovar/"
  }
  
  bowtie2 {
    probe = "%bin% --version | grep 'bowtie2-align version'| awk '{ print \$3 }'"
  }

  GenomeAnalysisTK {
    probe = "java -Xmx64m -jar %bin% 2>&1 | grep -o 'version [-0-9\\.a-z]*' | awk '{ print \$2 }'"
    link = "http://www.broadinstitute.org/gsa/wiki/index.php/Home_Page"
    desc = "A suite of tools for working with human medical resequencing projects"
    module="GATK"
  }

  MarkDuplicates {
    probe = "ls `dirname %bin%`/picard-*.jar | grep -o '[0-9]\\.[0-9]*'"
    link = "http://picard.sourceforge.net/command-line-overview.shtml#MarkDuplicates"
    desc = "Finds and removes PCR duplicates from SAM / BAM alignments"
    module="Picard"
  }

  signalp {
    probe = "signalp -v | cut -d ',' -f1"
    link = "http://www.cbs.dtu.dk/services/SignalP/"
    desc = "SignalP predicts the presence and location of signal peptide cleavage sites in amino acid sequences from different organisms."
  }

  'variant_effect_predictor.pl' {
      probe = "perl %bin% | grep '^version' | awk '{print \$2}'"
      desc = "Ensembl Variant Effect Predictor"
      module = "VEP"
  }

  igvtools {
      probe = "%bin% version | grep -o 'Version [0-9.]*' | grep -o '[0-9.]*'"
      desc = "IGV Tools for indexing, sorting querying BAM, BED, VCF and other files"
      link = "http://www.broadinstitute.org/igv/igvtools"
      module = "IGV Tools"
  }

  ls {
    probe = "%bin% --version | grep coreutils | awk '{ print \$4 }'"
    desc = "lists information about files and directories"
    link = "http://www.gnu.org/software/coreutils/manual/coreutils#ls-invocation"
  }
}
