Index: head/biology/haplohseq/Makefile =================================================================== --- head/biology/haplohseq/Makefile (revision 562413) +++ head/biology/haplohseq/Makefile (revision 562414) @@ -1,36 +1,43 @@ # $FreeBSD$ PORTNAME= haplohseq DISTVERSION= 0.1.2 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= biology MAINTAINER= jwb@FreeBSD.org 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 python:3.6+ USE_GITHUB= yes GH_ACCOUNT= outpaddling OPTIONS_DEFINE= EXAMPLES MAKEFILE= makefile LDFLAGS+= -lpthread 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) .include Index: head/biology/haplohseq/distinfo =================================================================== --- head/biology/haplohseq/distinfo (revision 562413) +++ head/biology/haplohseq/distinfo (revision 562414) @@ -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 Index: head/biology/haplohseq/files/patch-example_example__run.sh =================================================================== --- head/biology/haplohseq/files/patch-example_example__run.sh (revision 562413) +++ head/biology/haplohseq/files/patch-example_example__run.sh (nonexistent) @@ -1,24 +0,0 @@ ---- 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 \ Property changes on: head/biology/haplohseq/files/patch-example_example__run.sh ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/biology/haplohseq/files/patch-scripts_ldmap.py =================================================================== --- head/biology/haplohseq/files/patch-scripts_ldmap.py (revision 562413) +++ head/biology/haplohseq/files/patch-scripts_ldmap.py (revision 562414) @@ -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)): Index: head/biology/haplohseq/files/patch-scripts_simple__phaser.py =================================================================== --- head/biology/haplohseq/files/patch-scripts_simple__phaser.py (revision 562413) +++ head/biology/haplohseq/files/patch-scripts_simple__phaser.py (revision 562414) @@ -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: Index: head/biology/haplohseq/pkg-plist =================================================================== --- head/biology/haplohseq/pkg-plist (revision 562413) +++ head/biology/haplohseq/pkg-plist (revision 562414) @@ -1,10 +1,8 @@ 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