From owner-svn-ports-all@freebsd.org Sun Nov 17 15:00:15 2019 Return-Path: Delivered-To: svn-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5E24E1C2568; Sun, 17 Nov 2019 15:00:15 +0000 (UTC) (envelope-from jwb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47GFcv1HL8z4PBD; Sun, 17 Nov 2019 15:00:15 +0000 (UTC) (envelope-from jwb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E91701B776; Sun, 17 Nov 2019 15:00:14 +0000 (UTC) (envelope-from jwb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAHF0EFq067958; Sun, 17 Nov 2019 15:00:14 GMT (envelope-from jwb@FreeBSD.org) Received: (from jwb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAHF0D5A067951; Sun, 17 Nov 2019 15:00:13 GMT (envelope-from jwb@FreeBSD.org) Message-Id: <201911171500.xAHF0D5A067951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jwb set sender to jwb@FreeBSD.org using -f From: "Jason W. Bacon" Date: Sun, 17 Nov 2019 15:00:13 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r517828 - in head/biology/haplohseq: . files X-SVN-Group: ports-head X-SVN-Commit-Author: jwb X-SVN-Commit-Paths: in head/biology/haplohseq: . files X-SVN-Commit-Revision: 517828 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Nov 2019 15:00:15 -0000 Author: jwb Date: Sun Nov 17 15:00:13 2019 New Revision: 517828 URL: https://svnweb.freebsd.org/changeset/ports/517828 Log: biology/haplohseq: Switch to distfile with example data Add script to run on example input Minor fix to report inadequate VCF input Added: head/biology/haplohseq/files/haplohseq-example.in (contents, props changed) head/biology/haplohseq/files/patch-example_example__run.sh (contents, props changed) head/biology/haplohseq/files/patch-scripts_ldmap.py (contents, props changed) head/biology/haplohseq/files/patch-scripts_simple__phaser.py (contents, props changed) head/biology/haplohseq/files/patch-src_FreqPhase.cpp (contents, props changed) head/biology/haplohseq/pkg-plist (contents, props changed) Modified: head/biology/haplohseq/Makefile head/biology/haplohseq/distinfo Modified: head/biology/haplohseq/Makefile ============================================================================== --- head/biology/haplohseq/Makefile Sun Nov 17 14:52:05 2019 (r517827) +++ head/biology/haplohseq/Makefile Sun Nov 17 15:00:13 2019 (r517828) @@ -2,10 +2,9 @@ PORTNAME= haplohseq DISTVERSION= 0.1.2 +PORTREVISION= 1 CATEGORIES= biology -MASTER_SITES= https://mirror1.hpc.uwm.edu/Distfiles/ \ - https://mirror2.hpc.uwm.edu/Distfiles/ -DISTNAME= haplohseq_source-${DISTVERSION} +MASTER_SITES= https://acadix.biz/Ports/distfiles/ MAINTAINER= jwb@FreeBSD.org COMMENT= Identify regions of allelic imbalance @@ -13,15 +12,21 @@ COMMENT= Identify regions of allelic imbalance LICENSE= MIT LIB_DEPENDS= libboost_system.so:devel/boost-libs +RUN_DEPENDS= R-cran-optparse>0:devel/R-cran-optparse -USES= compiler:c++11-lang gmake localbase:ldflags zip +USES= compiler:c++11-lang gmake localbase:ldflags python:2.7 tar:xz +OPTIONS_DEFINE= EXAMPLES + MAKEFILE= makefile -WRKSRC= ${WRKDIR}/haplohseq_source LDFLAGS+= -lpthread MAKE_ENV= STRIP=${STRIP} -PLIST_FILES= bin/haplohseq +SUB_FILES= haplohseq-example + +post-install-EXAMPLES-on: + ${INSTALL_SCRIPT} ${WRKDIR}/haplohseq-example ${STAGEDIR}${PREFIX}/bin + (cd ${WRKSRC} && ${COPYTREE_SHARE} "example ldmap scripts" ${STAGEDIR}${EXAMPLESDIR}) do-test: @(cd ${WRKSRC}/build/test && ${FILESDIR}/run-tests) Modified: head/biology/haplohseq/distinfo ============================================================================== --- head/biology/haplohseq/distinfo Sun Nov 17 14:52:05 2019 (r517827) +++ head/biology/haplohseq/distinfo Sun Nov 17 15:00:13 2019 (r517828) @@ -1,3 +1,3 @@ -TIMESTAMP = 1567118170 -SHA256 (haplohseq_source-0.1.2.zip) = 35f8fe6718020e6eacdc309d28fc5dd3cc7c6e8400da1d962fdf6fb52d4e90c5 -SIZE (haplohseq_source-0.1.2.zip) = 63620 +TIMESTAMP = 1573660978 +SHA256 (haplohseq-0.1.2.tar.xz) = 0e7474f6af6b41c4b38f5f4549344714ec022e2adfc4aa9d00e0d420483e260a +SIZE (haplohseq-0.1.2.tar.xz) = 8108896 Added: head/biology/haplohseq/files/haplohseq-example.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/biology/haplohseq/files/haplohseq-example.in Sun Nov 17 15:00:13 2019 (r517828) @@ -0,0 +1,37 @@ +#!/bin/sh -e + +########################################################################## +# Script description: +# Run haplohseq example +# +# https://sites.google.com/site/integrativecancergenomics/software/haplohseq +# +# History: +# Date Name Modification +# 2019-11-13 Jason Bacon Begin +########################################################################## + +usage() +{ + printf "Usage: $0 directory\n" + exit 1 +} + + +########################################################################## +# Main +########################################################################## + +if [ $# != 1 ]; then + usage +fi + +dir="$1" + +if [ -e "$dir" ]; then + printf "'$dir' already exists. Please remove it or specify another.\n" + exit 1 +fi +cp -R %%EXAMPLESDIR%% "$dir" +cd "$dir/example" +sh ./example_run.sh Added: head/biology/haplohseq/files/patch-example_example__run.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/biology/haplohseq/files/patch-example_example__run.sh Sun Nov 17 15:00:13 2019 (r517828) @@ -0,0 +1,24 @@ +--- example/example_run.sh.orig 2019-11-13 15:45:57 UTC ++++ example/example_run.sh +@@ -1,4 +1,4 @@ +-#! /bin/bash ++#!/bin/sh + + # Example: + # Identify allelic imbalance (AI) given a tumor +@@ -6,13 +6,13 @@ + # of the GATK. This involves the following 3 steps. + + printf "STEP 1: PHASING 1KG HET SITES ...\n" +-python ../scripts/simple_phaser.py \ ++python2.7 ../scripts/simple_phaser.py \ + --ldmap ../ldmap/hg19.exome.ldmap \ + --vcf example_input/tumor_exome.vcf \ + -o example_output/tumor_exome + + printf "\nSTEP 2: IDENTIFYING REGIONS OF AI ...\n" +-../haplohseq \ ++haplohseq \ + --vcf example_output/tumor_exome.hap.vcf \ + --phased example_output/tumor_exome.hap \ + --event_prevalence 0.1 \ Added: head/biology/haplohseq/files/patch-scripts_ldmap.py ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/biology/haplohseq/files/patch-scripts_ldmap.py Sun Nov 17 15:00:13 2019 (r517828) @@ -0,0 +1,8 @@ +--- scripts/ldmap.py.orig 2019-11-13 15:51:02 UTC ++++ scripts/ldmap.py +@@ -1,3 +1,5 @@ ++#!/usr/bin/env python2.7 ++ + import argparse + import sys + import random Added: head/biology/haplohseq/files/patch-scripts_simple__phaser.py ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/biology/haplohseq/files/patch-scripts_simple__phaser.py Sun Nov 17 15:00:13 2019 (r517828) @@ -0,0 +1,8 @@ +--- scripts/simple_phaser.py.orig 2019-11-13 15:52:02 UTC ++++ scripts/simple_phaser.py +@@ -1,3 +1,5 @@ ++#!/usr/bin/env python2.7 ++ + import argparse + import random + import sys Added: head/biology/haplohseq/files/patch-src_FreqPhase.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/biology/haplohseq/files/patch-src_FreqPhase.cpp Sun Nov 17 15:00:13 2019 (r517828) @@ -0,0 +1,29 @@ +--- src/FreqPhase.cpp.orig 2019-11-13 14:19:06 UTC ++++ src/FreqPhase.cpp +@@ -5,6 +5,7 @@ + * Email: sanlucas@gmail.com + */ + ++#include + #include "FreqPhase.h" + + namespace haplohseq { +@@ -180,10 +181,17 @@ double FreqPhase::meanValue(const std::v + double FreqPhase::medianValue(const std::vector& values) { + double median; + size_t size = values.size(); ++ ++ // We can probably detect this condition earlier while loading the VCF ++ if ( size == 0 ) { ++ std::cerr << "FreqPhase::medianValue(): values vector is empty." << std::endl; ++ std::cerr << "Make sure your VCF has all of GT:AD:DP in the FORMAT column." << std::endl; ++ exit(EX_DATAERR); ++ } + std::vector tempFreqs(values); + sort(tempFreqs.begin(), tempFreqs.end()); + +- if (size % 2 == 0) { ++ if (size % 2 == 0) { + median = (tempFreqs[size / 2 - 1] + tempFreqs[size / 2]) / 2; + } + else { Added: head/biology/haplohseq/pkg-plist ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/biology/haplohseq/pkg-plist Sun Nov 17 15:00:13 2019 (r517828) @@ -0,0 +1,11 @@ +bin/haplohseq +%%PORTEXAMPLES%%bin/haplohseq-example +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/example/example_input/tumor_exome.vcf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/example/example_run.sh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ldmap/hg19.exome.ldmap +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/scripts/haplohseq_plot.R +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/scripts/ldmap.py +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/scripts/ldmap.py.orig +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/scripts/simple_phaser.py +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/scripts/simple_phaser.py.orig +%%PORTEXAMPLES%%@dir %%EXAMPLESDIR%%/example/example_output