From owner-svn-ports-all@freebsd.org Sat Jan 23 19:31:51 2021 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 2412F4DBEB2; Sat, 23 Jan 2021 19:31:51 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DNR8R0613z4rc7; Sat, 23 Jan 2021 19:31:51 +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 EAA2D169B1; Sat, 23 Jan 2021 19:31:50 +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 10NJVopE054206; Sat, 23 Jan 2021 19:31:50 GMT (envelope-from jwb@FreeBSD.org) Received: (from jwb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 10NJVoZT053123; Sat, 23 Jan 2021 19:31:50 GMT (envelope-from jwb@FreeBSD.org) Message-Id: <202101231931.10NJVoZT053123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jwb set sender to jwb@FreeBSD.org using -f From: "Jason W. Bacon" Date: Sat, 23 Jan 2021 19:31:50 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r562414 - 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: 562414 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.34 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: Sat, 23 Jan 2021 19:31:51 -0000 Author: jwb Date: Sat Jan 23 19:31:49 2021 New Revision: 562414 URL: https://svnweb.freebsd.org/changeset/ports/562414 Log: biology/haplohseq: Fix example scripts for python 3 Also clean up plist Deleted: head/biology/haplohseq/files/patch-example_example__run.sh Modified: head/biology/haplohseq/Makefile head/biology/haplohseq/distinfo head/biology/haplohseq/files/patch-scripts_ldmap.py head/biology/haplohseq/files/patch-scripts_simple__phaser.py head/biology/haplohseq/pkg-plist Modified: head/biology/haplohseq/Makefile ============================================================================== --- head/biology/haplohseq/Makefile Sat Jan 23 19:30:35 2021 (r562413) +++ head/biology/haplohseq/Makefile Sat Jan 23 19:31:49 2021 (r562414) @@ -2,7 +2,7 @@ PORTNAME= haplohseq DISTVERSION= 0.1.2 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= biology MAINTAINER= jwb@FreeBSD.org @@ -26,9 +26,16 @@ MAKE_ENV= STRIP=${STRIP} SUB_FILES= haplohseq-example +pre-configure: + @${REINPLACE_CMD} \ + -e 's|/bin/bash|/bin/sh|' \ + -e 's|python|mkdir example_output; ${PYTHON_CMD}|' \ + -e 's|\.\./haplohseq|haplohseq|' \ + ${WRKSRC}/example/example_run.sh + post-install-EXAMPLES-on: ${INSTALL_SCRIPT} ${WRKDIR}/haplohseq-example ${STAGEDIR}${PREFIX}/bin - (cd ${WRKSRC} && ${COPYTREE_SHARE} "example ldmap scripts" ${STAGEDIR}${EXAMPLESDIR}) + (cd ${WRKSRC} && ${RM} example/*.orig scripts/*.orig && ${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 Sat Jan 23 19:30:35 2021 (r562413) +++ head/biology/haplohseq/distinfo Sat Jan 23 19:31:49 2021 (r562414) @@ -1,3 +1,3 @@ -TIMESTAMP = 1589733633 +TIMESTAMP = 1611421648 SHA256 (outpaddling-haplohseq-0.1.2_GH0.tar.gz) = 64f61023a6795decb680c23d142b1a349988d4c0e3bef8c7d52ca33bf42f29f0 SIZE (outpaddling-haplohseq-0.1.2_GH0.tar.gz) = 12084603 Modified: head/biology/haplohseq/files/patch-scripts_ldmap.py ============================================================================== --- head/biology/haplohseq/files/patch-scripts_ldmap.py Sat Jan 23 19:30:35 2021 (r562413) +++ head/biology/haplohseq/files/patch-scripts_ldmap.py Sat Jan 23 19:31:49 2021 (r562414) @@ -1,8 +1,42 @@ ---- scripts/ldmap.py.orig 2019-11-13 15:51:02 UTC +--- scripts/ldmap.py.orig 2021-01-23 17:32:15 UTC +++ scripts/ldmap.py -@@ -1,3 +1,5 @@ -+#!/usr/bin/env python2.7 -+ - import argparse - import sys - import random +@@ -29,10 +29,10 @@ class MapMaker: + coordinates of the haplotype marker genomic positions. + ''' + def __init__(self, markerFilename, haplotypesFilename): +- print "reading haplotype base coordinates ...." ++ print("reading haplotype base coordinates ....") + self.coords, self.coordIndexes, self.refs, self.alts = self.readMarkers(markerFilename) + # self.haplotypes = self.readHaplotypes(haplotypesFilename) +- print "reading haplotype panel ...." ++ print("reading haplotype panel ....") + self.markerCalls = self.readHaplotypes(haplotypesFilename, transpose = True) + + # reads from a vcf file of defined positions representing the haplotype data +@@ -118,7 +118,7 @@ class MapMaker: + # 1) COLLECT MARGINALS AND IDENTIFY SITES THAT ARE POLYMORPHIC + # If a site has only one allele in the haplotype panel it is not informative, so it won't be used + # in LD calculations. We may want to consider setting some minimum threshold for a minor allele frequency. +- print "collecting marginal allele counts and identifying polymorphic sites from haplotype panel ...." ++ print("collecting marginal allele counts and identifying polymorphic sites from haplotype panel ....") + for index in range(0,len(self.markerCalls)): + ref = self.refs[index] + alt = self.alts[index] +@@ -152,7 +152,7 @@ class MapMaker: + log.write("Num non-polymorphic sites: " + str(numNonpolymorphicSites) + "\n") + + # 2) CALCULATE D FOR POLYMORPHIC SITES COMPARED WITH N SITES TO THE RIGHT THAT ARE POLYMORPHIC +- print "calculating D between polymorphic sites and their neighbors ...." ++ print("calculating D between polymorphic sites and their neighbors ....") + dVals = [] + for i in range(0, len(polymorphicIndexes)): # the last coordinate won't have any partners + index_i = polymorphicIndexes[i] +@@ -244,7 +244,7 @@ class LDMap: + return ldMap + + def save(self, filename): +- print "saving ldmap to " + filename ++ print("saving ldmap to " + filename) + ldMapFile = open(filename, 'w') + ldMapFile.write("\t".join(["COORD","REF","ALT","PAIRED_ALLELES"]) + "\n") + for i in range(0,len(self.coords)): Modified: head/biology/haplohseq/files/patch-scripts_simple__phaser.py ============================================================================== --- head/biology/haplohseq/files/patch-scripts_simple__phaser.py Sat Jan 23 19:30:35 2021 (r562413) +++ head/biology/haplohseq/files/patch-scripts_simple__phaser.py Sat Jan 23 19:31:49 2021 (r562414) @@ -1,8 +1,31 @@ ---- scripts/simple_phaser.py.orig 2019-11-13 15:52:02 UTC +--- scripts/simple_phaser.py.orig 2021-01-23 17:25:56 UTC +++ scripts/simple_phaser.py -@@ -1,3 +1,5 @@ -+#!/usr/bin/env python2.7 -+ - import argparse - import random - import sys +@@ -108,7 +108,7 @@ class SimplePhaser: + return informativeHets, informativeCoords, informativeIndexes + + def getRefPairedAllele(self, anchorIndex, pairedIndex): +-# print "\t".join([str(anchorIndex), str(pairedIndex - anchorIndex - 1), str(len(self.ldMap.dVals)),str(len(self.ldMap.dVals[anchorIndex]))]) # prints intermarker counts ++# print("\t".join([str(anchorIndex), str(pairedIndex - anchorIndex - 1), str(len(self.ldMap.dVals)),str(len(self.ldMap.dVals[anchorIndex]))]) # prints intermarker counts) + if (pairedIndex - anchorIndex - 1) >= len(self.ldMap.dVals[anchorIndex]): + pRef = random.uniform(0,1) + if pRef > 0.5: +@@ -166,8 +166,8 @@ class SimplePhaser: + altHap = temp + + if pairedAllele not in [ref,alt]: +- print "pairedAllele not ref or alt " + ref + " " + alt +- print pairedAllele ++ print("pairedAllele not ref or alt " + ref + " " + alt) ++ print(pairedAllele) + + return phasedAlleles, informativeCoords + +@@ -182,7 +182,7 @@ class SimplePhaser: + elif candidateHap[i].upper() == phasedHaps[1][i].upper(): + currentMatch = 1 + else: +- print "ERROR: " + candidateHap[i] + " does not match " + phasedHaps[0][i] + " or " + phasedHaps[1][i] + "\t" + self.ldMap.coords[i] + "\t" + self.ldMap.refs[i] + "\t" + self.ldMap.alts[i] ++ print("ERROR: " + candidateHap[i] + " does not match " + phasedHaps[0][i] + " or " + phasedHaps[1][i] + "\t" + self.ldMap.coords[i] + "\t" + self.ldMap.refs[i] + "\t" + self.ldMap.alts[i]) + # # randomly assign match + # p0 = random.uniform(0,1) + # if p0 > 0.5: Modified: head/biology/haplohseq/pkg-plist ============================================================================== --- head/biology/haplohseq/pkg-plist Sat Jan 23 19:30:35 2021 (r562413) +++ head/biology/haplohseq/pkg-plist Sat Jan 23 19:31:49 2021 (r562414) @@ -5,6 +5,4 @@ bin/haplohseq %%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