pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

ddocent: Upgrade to latest release



Module Name:	pkgsrc-wip
Committed By:	Jason W. Bacon <bacon%NetBSD.org@localhost>
Pushed By:	outpaddling
Date:		Thu Mar 22 19:10:26 2018 -0500
Changeset:	ac0e41734c9d5cfbd7fffceb21e26a5690736ea6

Modified Files:
	ddocent/DESCR
	ddocent/Makefile
	ddocent/PLIST
	ddocent/distinfo
	ddocent/patches/patch-dDocent
Added Files:
	ddocent/files/ddocent-test
	ddocent/files/ddocent-test-cleanup
Removed Files:
	ddocent/TODO
	ddocent/buildlink3.mk

Log Message:
ddocent: Upgrade to latest release

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=ac0e41734c9d5cfbd7fffceb21e26a5690736ea6

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 ddocent/DESCR                      |   3 +-
 ddocent/Makefile                   |  98 ++++++++++------
 ddocent/PLIST                      |  10 --
 ddocent/TODO                       |   1 -
 ddocent/buildlink3.mk              |  12 --
 ddocent/distinfo                   |   8 +-
 ddocent/files/ddocent-test         | 227 +++++++++++++++++++++++++++++++++++++
 ddocent/files/ddocent-test-cleanup |   8 ++
 ddocent/patches/patch-dDocent      |  64 +++++++++--
 9 files changed, 358 insertions(+), 73 deletions(-)

diffs:
diff --git a/ddocent/DESCR b/ddocent/DESCR
index 845dbab1b0..a0737b992f 100644
--- a/ddocent/DESCR
+++ b/ddocent/DESCR
@@ -1 +1,2 @@
-[description of the port]
+Simple bash wrapper to QC, assemble, map, and call SNPs from almost any kind of
+RAD sequencin
diff --git a/ddocent/Makefile b/ddocent/Makefile
index 1871a3b3fe..0850632447 100644
--- a/ddocent/Makefile
+++ b/ddocent/Makefile
@@ -1,56 +1,84 @@
 # $NetBSD$
 #
 ###########################################################
-#               Generated by fbsd2pkg                     #
+#                  Generated by fbsd2pkg                  #
+#              Thu Mar 22 18:28:27 CDT 2018               #
 ###########################################################
 
-DISTNAME=	ddocent-${PORTVERSION}
+PKGNAME=	dDocent-${PORTVERSION}
 CATEGORIES=	biology
-MASTER_SITES=	http://acadix.biz/Ports/distfiles/
-EXTRACT_SUFX=	.tar.xz
-PKGNAME=	ddocent-${PORTVERSION}
+MASTER_SITES=	${MASTER_SITE_GITHUB:=jpuritz/}
+GITHUB_PROJECT=	dDocent
+GITHUB_TAG=	v${PORTVERSION}
 
-MAINTAINER=	dsiercks%uwm.edu@localhost
-HOMEPAGE=	http://ddocent.wordpress.com/
-COMMENT=	Bash pipeline for ddRAD sequencing
+MAINTAINER=	bacon%NetBSD.org@localhost
+HOMEPAGE=	http://ddocent.com
+COMMENT=	Bash pipeline for RAD sequencing
 LICENSE=	mit
 
-NO_BUILD=	yes
-
-REPLACE_BASH=	scripts/*.sh scripts/dDocent_filters
-REPLACE_PERL=	scripts/*.pl
-
-PORTVERSION=	2015.11.30
+# Notes on 2015.11.30 snapshot:
+# bedtools version: https://github.com/jpuritz/dDocent/issues/15
+# New ddocent works with 2.23.0 or >= 2.26.0
+# vcftools 0.1.14 does not report version the same as 0.1.11, so
+# dDocent script fails to recognize it.  Should be easy to patch
+# assuming 0.1.14 is usable.
+# 0.1.15 reports version properly.
+# Do we really need trimadap?  It used to be part of seqtk.
+# ddocent test data do not unpack with FreeBSD 11.1 /usr/bin/unzip
+DEPENDS=	mawk>=0:../../lang/mawk \
+		gawk>=0:../../lang/gawk \
+		gnuplot>=0:../../graphics/gnuplot \
+		parallel>=0:../../parallel/parallel \
+		bwa>=0.7.13:../../biology/bwa \
+		cdhit>=0:../../biology/cdhit \
+		samtools>=1.3:../../wip/samtools \
+		vcftools>=0.1.15:../../wip/vcftools \
+		Trimmomatic>=0:../../wip/trimmomatic \
+		bamtools>=0:../../wip/bamtools \
+		stacks>=0:../../wip/stacks \
+		rainbow>=0:../../wip/rainbow \
+		trimadap>=0:../../wip/trimadap \
+		seqtk>=0:../../wip/seqtk \
+		bedtools2>=2.26.0:../../wip/bedtools2 \
+		pear-merger>=0:../../wip/pear-merger \
+		freebayes:../../wip/freebayes \
+		vcflib>=0:../../wip/vcflib
 
-# This subst is applied on top of patch-dDocent
-# Do not apply it within the source dist, or it will get picked up
-# next time the patch is generated with pkg-diff or mkpatches
+## These follow patch-dDocent, so don't apply them within the source tree,
+## or they'll get picked up by patch generators and hard-code PREFIX
 SUBST_CLASSES+=		prefix
 SUBST_STAGE.prefix=	post-install
-SUBST_FILES.prefix=	${DESTDIR}${PREFIX}/bin/dDocent
-SUBST_SED.prefix=	-e 's|%%PREFIX%%|${PREFIX}|g'
+SUBST_SED.prefix+=	-i ''
+SUBST_SED.prefix+=	-e 's|%%PREFIX%%|${PREFIX}|g'
+SUBST_SED.prefix+=	-e 's|%%JAVAJARDIR%%|${JAVAJARDIR}|g'
+SUBST_FILES.prefix+=	${DESTDIR}${PREFIX}/bin/dDocent
 
-DEPENDS+=	gnuplot>=3.7:../../graphics/gnuplot \
-		cdhit>=4.6:../../biology/cdhit \
-		parallel>=0:../../parallel/parallel \
-		gawk>=0:../../lang/gawk \
-		vcftools>=0.1.11:../../wip/vcftools \
-		stacks>=0:../../wip/stacks \
-		Trimmomatic:../../wip/trimmomatic \
-		seqtk>=0:../../wip/seqtk \
-		bedtools2>=2.23.0:../../wip/bedtools2 \
-		pear-merger>=0:../../wip/pear \
-		mawk>=0:../../lang/mawk
+USE_LANGUAGES=	# None
+REPLACE_BASH=	scripts/*.sh scripts/dDocent_filters dDocent
+REPLACE_PERL=	scripts/*.pl
+REPLACE_PYTHON=	scripts/*.py
+NO_BUILD=	yes
+USE_TOOLS=	bash perl unzip
+
+PORTVERSION=	2.2.25
+JAVAJARDIR=	${PREFIX}/share/java/classes
 
 INSTALLATION_DIRS=	bin
 
 do-install:
+	${MKDIR} ${DESTDIR}${PREFIX}/bin
 	${INSTALL_SCRIPT} \
 		${WRKSRC}/dDocent \
-		${WRKSRC}/scripts/* ${DESTDIR}${PREFIX}/bin
+		${WRKSRC}/*.sh \
+		${FILESDIR}/ddocent-test \
+		${FILESDIR}/ddocent-test-cleanup \
+		${WRKSRC}/scripts/*.sh \
+		${WRKSRC}/scripts/*.pl \
+		${WRKSRC}/scripts/dDocent_filters \
+		${DESTDIR}${PREFIX}/bin
 
-.include "../../wip/bamtools/buildlink3.mk"
-.include "../../wip/freebayes/buildlink3.mk"
-.include "../../wip/samtools0119/buildlink3.mk"
-.include "../../wip/vcflib/buildlink3.mk"
+# Convert any _DEPENDS above that have a buildlink3.mk
+# .include "../..///buildlink3.mk"
+# Linux doesn't have zlib in the base, so just in case...
+# .include "../../devel/zlib/buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/ddocent/PLIST b/ddocent/PLIST
index 64f3d8ace7..48d96a5493 100644
--- a/ddocent/PLIST
+++ b/ddocent/PLIST
@@ -1,11 +1 @@
 @comment $NetBSD$
-bin/ErrorCount.sh
-bin/ReferenceOpt.sh
-bin/Rename_SequenceFiles.sh
-bin/dDocent
-bin/dDocent_filters
-bin/filter_hwe_by_pop.pl
-bin/filter_missing_ind.sh
-bin/pop_missing_filter.sh
-bin/remake_reference.sh
-bin/remove.bad.hap.loci.sh
diff --git a/ddocent/TODO b/ddocent/TODO
deleted file mode 100644
index b687356e6b..0000000000
--- a/ddocent/TODO
+++ /dev/null
@@ -1 +0,0 @@
-Clean up and test
diff --git a/ddocent/buildlink3.mk b/ddocent/buildlink3.mk
deleted file mode 100644
index b82245f541..0000000000
--- a/ddocent/buildlink3.mk
+++ /dev/null
@@ -1,12 +0,0 @@
-# $NetBSD$
-
-BUILDLINK_TREE+=	ddocent
-
-.if !defined(DDOCENT_BUILDLINK3_MK)
-DDOCENT_BUILDLINK3_MK:=
-
-BUILDLINK_API_DEPENDS.ddocent+=	ddocent>=2015.11.30
-BUILDLINK_PKGSRCDIR.ddocent?=	../../wip/ddocent
-.endif	# DDOCENT_BUILDLINK3_MK
-
-BUILDLINK_TREE+=	-ddocent
diff --git a/ddocent/distinfo b/ddocent/distinfo
index e7166015fa..6afd6c110d 100644
--- a/ddocent/distinfo
+++ b/ddocent/distinfo
@@ -1,7 +1 @@
-$NetBSD$
-
-SHA1 (ddocent-2015.11.30.tar.xz) = f28e87ae4b4c26d5a771f71cb05e5ba03433d7ee
-RMD160 (ddocent-2015.11.30.tar.xz) = e1b45882d611208bdf68badae4bd9a7e93ecae05
-SHA512 (ddocent-2015.11.30.tar.xz) = a19751347fa503351182260bff2688e89c418f6f62e5de63658df6e90a4ecf7dae1d677b7416332ba61335ad04a0203b788c43e8b392f61fb40be20bd5b3b102
-Size (ddocent-2015.11.30.tar.xz) = 47672 bytes
-SHA1 (patch-dDocent) = f7de578aa81fcd0680a9b221bf47cdd44b353763
+SHA1 (patch-dDocent) = b78a93e5f78b8a6c291244f5290c73372c0aa202
diff --git a/ddocent/files/ddocent-test b/ddocent/files/ddocent-test
new file mode 100755
index 0000000000..3aa6ab5d3a
--- /dev/null
+++ b/ddocent/files/ddocent-test
@@ -0,0 +1,227 @@
+#!/usr/bin/env bash
+
+set -ex
+
+##########################################################################
+#   Function description:
+#       Pause until user presses return
+##########################################################################
+
+pause()
+{
+    set +x
+    local junk
+    
+    printf "Press return to continue..."
+    read junk
+    set -x
+}
+
+
+##########################################################################
+#   Not necessary if invoking scripts with "bash script-name" as shown
+#   in the dDocent tutorial, but supplied for completeness.  Tutorial
+#   scripts have also been patched upstream to usr /usr/bin/env, but
+#   we won't assume they'll all stay that way.
+##########################################################################
+
+fix_bash_path()
+{
+    # Don't echo these commands
+    set +x
+    if [ $# != 1 ]; then
+	printf "Usage: $0 script\n"
+	exit 1
+    fi
+    sed -i.bak -e "s|#!/bin/bash|#!/usr/bin/env bash|g" $1
+    set -x
+}
+
+
+##########################################################################
+#   Main
+##########################################################################
+
+##########################################################################
+#   Workarounds for running dDocent from FreeBSD ports and Pkgsrc.
+#   Include this section in any scripts running dDocent commands.
+##########################################################################
+
+# Hack to allow remake_reference.sh, etc. to find trimmomatic.
+# trimmomatic.jar and adapter files are not an executables and should not
+# be in PATH according to filesystem hierarchy standards, but the dDocent
+# scripts are coded to look for them there, because that's how dDocent
+# installs the bundled Trimmomatic.
+if [ -e /usr/local/share/java/classes/trimmomatic.jar ]; then
+    export PATH=${PATH}:/usr/local/share/java/classes:/usr/local/share/trimmomatic/adapters
+elif [ -e $PKGSRC/lib/java/trimmomatic.jar ]; then
+    export PATH=${PATH}:$PKGSRC/lib/java:$PKGSRC/share/trimmomatic/adapters
+else
+    printf "Error: Trimmomatic is not installed in a known location.\n" >> /dev/stderr
+fi
+
+if ! pwd | fgrep dDocent-test; then
+    mkdir -p dDocent-test
+    cd dDocent-test
+fi
+
+# remake_reference.sh and some other scripts use GNU extensions in awk
+# commands.  Trick systems into using gawk to get around this without
+# having to patch every script.
+mkdir -p ddocent-bin
+ln -sf `which gawk` ddocent-bin/awk
+ln -sf `which python2.7` ddocent-bin/python
+export PATH=`pwd`/ddocent-bin:$PATH
+
+##########################################################################
+#   Actual dDocent commands below
+##########################################################################
+
+##########################################################################
+#   Command sequence from the dDocent tutorial on Github.  See link below.
+##########################################################################
+
+cat << EOM
+
+This script runs the test commands described at
+
+https://github.com/jpuritz/dDocent/blob/master/tutorials/Reference%20Assembly%20Tutorial.md
+
+You may want to follow along on this web page as the script runs.  It will
+pause after each step to allow checking the output.
+
+EOM
+
+mkdir -p Data
+cd Data
+
+if [ ! -e data.zip ]; then
+    curl --insecure -L -o data.zip \
+	'https://www.dropbox.com/s/t09xjuudev4de72/data.zip?dl=0'
+fi
+
+# Hack: current data.zip contains data.zip.  ??!
+if [ ! -e simRRLs2.py ]; then
+    yes | unzip data.zip || true
+fi
+
+head SimRAD.barcodes
+
+cut -f2 SimRAD.barcodes > barcodes
+head barcodes
+
+process_radtags -1 SimRAD_R1.fastq.gz -2 SimRAD_R2.fastq.gz -b barcodes \
+    -e ecoRI --renz_2 mspI -r -i gzfastq
+ls
+
+rm *rem*
+if [ ! -e Rename_for_dDocent.sh ]; then
+    curl --insecure -L -O https://github.com/jpuritz/dDocent/raw/master/Rename_for_dDocent.sh
+    fix_bash_path Rename_for_dDocent.sh
+fi
+
+bash Rename_for_dDocent.sh SimRAD.barcodes
+ls *.fq.gz
+
+ls *.F.fq.gz > namelist
+sed -i'' -e 's/.F.fq.gz//g' namelist
+AWK1='BEGIN{P=1}{if(P==1||P==2){gsub(/^[@]/,">");print}; if(P==4)P=0; P++}'
+AWK2='!/>/'
+AWK3='!/NNN/'
+PERLT='while (<>) {chomp; $z{$_}++;} while(($k,$v) = each(%z)) {print "$v\t$k\n";}'
+
+cat namelist | parallel --no-notice -j 8 "zcat {}.F.fq.gz | mawk '$AWK1' | mawk '$AWK2' > {}.forward"
+cat namelist | parallel --no-notice -j 8 "zcat {}.R.fq.gz | mawk '$AWK1' | mawk '$AWK2' > {}.reverse"
+cat namelist | parallel --no-notice -j 8 "paste -d '-' {}.forward {}.reverse | mawk '$AWK3' | sed 's/-/NNNNNNNNNN/' | perl -e '$PERLT' > {}.uniq.seqs"
+
+cat *.uniq.seqs > uniq.seqs
+for i in {2..20};
+do 
+echo $i >> pfile
+done
+cat pfile | parallel --no-notice "echo -n {}xxx && mawk -v x={} '\$1 >= x' uniq.seqs | wc -l" | mawk  '{gsub("xxx","\t",$0); print;}'| sort -g > uniqseq.data
+rm pfile
+cat uniqseq.data
+
+gnuplot << \EOF 
+set terminal dumb size 120, 30
+set autoscale
+set xrange [2:20] 
+unset label
+set title "Number of Unique Sequences with More than X Coverage (Counted within individuals)"
+set xlabel "Coverage"
+set ylabel "Number of Unique Sequences"
+plot 'uniqseq.data' with lines notitle
+pause -1
+EOF
+
+parallel --no-notice -j 8 mawk -v x=4 \''$1 >= x'\' ::: *.uniq.seqs | cut -f2 | perl -e 'while (<>) {chomp; $z{$_}++;} while(($k,$v) = each(%z)) {print "$v\t$k\n";}' > uniqCperindv
+wc -l uniqCperindv
+
+for ((i = 2; i <= 10; i++));
+do
+echo $i >> ufile
+done
+
+cat ufile | parallel --no-notice "echo -n {}xxx && mawk -v x={} '\$1 >= x' uniqCperindv | wc -l" | mawk  '{gsub("xxx","\t",$0); print;}'| sort -g > uniqseq.peri.data
+rm ufile
+gnuplot << \EOF 
+set terminal dumb size 120, 30
+set autoscale 
+unset label
+set title "Number of Unique Sequences present in more than X Individuals"
+set xlabel "Number of Individuals"
+set ylabel "Number of Unique Sequences"
+plot 'uniqseq.peri.data' with lines notitle
+pause -1
+EOF
+
+mawk -v x=4 '$1 >= x' uniqCperindv > uniq.k.4.c.4.seqs
+wc -l uniq.k.4.c.4.seqs
+
+cut -f2 uniq.k.4.c.4.seqs > totaluniqseq
+mawk '{c= c + 1; print ">Contig_" c "\n" $1}' totaluniqseq > uniq.fasta
+
+sed -e 's/NNNNNNNNNN/\t/g' uniq.fasta | cut -f1 > uniq.F.fasta
+cd-hit-est -i uniq.F.fasta -o xxx -c 0.8 -T 0 -M 0 -g 1
+
+mawk '{if ($1 ~ /Cl/) clus = clus + 1; else  print $3 "\t" clus}' xxx.clstr | sed 's/[>Contig_,...]//g' | sort -g -k1 > sort.contig.cluster.ids
+paste sort.contig.cluster.ids totaluniqseq > contig.cluster.totaluniqseq
+sort -k2,2 -g contig.cluster.totaluniqseq | sed -e 's/NNNNNNNNNN/\t/g' > rcluster
+
+cut -f2 rcluster | uniq | wc -l
+
+rainbow div -i rcluster -o rbdiv.out
+rainbow div -i rcluster -o rbdiv.out -f 0.5 -K 10
+rainbow merge -o rbasm.out -a -i rbdiv.out
+rainbow merge -o rbasm.out -a -i rbdiv.out -r 2
+
+# If missing fdesc mount for bash, <(echo "E") will not work
+# cat rbasm.out <(echo "E") |sed 's/[0-9]*:[0-9]*://g' | mawk ' {
+echo "E" > endfile
+cat rbasm.out endfile |sed 's/[0-9]*:[0-9]*://g' | mawk ' {
+if (NR == 1) e=$2;
+else if ($1 ~/E/ && lenp > len1) {c=c+1; print ">dDocent_Contig_" e "\n" seq2 "NNNNNNNNNN" seq1; seq1=0; seq2=0;lenp=0;e=$2;fclus=0;len1=0;freqp=0;lenf=0}
+else if ($1 ~/E/ && lenp <= len1) {c=c+1; print ">dDocent_Contig_" e "\n" seq1; seq1=0; seq2=0;lenp=0;e=$2;fclus=0;len1=0;freqp=0;lenf=0}
+else if ($1 ~/C/) clus=$2;
+else if ($1 ~/L/) len=$2;
+else if ($1 ~/S/) seq=$2;
+else if ($1 ~/N/) freq=$2;
+else if ($1 ~/R/ && $0 ~/0/ && $0 !~/1/ && len > lenf) {seq1 = seq; fclus=clus;lenf=len}
+else if ($1 ~/R/ && $0 ~/0/ && $0 ~/1/) {seq1 = seq; fclus=clus; len1=len}
+else if ($1 ~/R/ && $0 ~!/0/ && freq > freqp && len >= lenp || $1 ~/R/ && $0 ~!/0/ && freq == freqp && len > lenp) {seq2 = seq; lenp = len; freqp=freq}
+}' > rainbow.fasta
+
+cd-hit-est -i rainbow.fasta -o referenceRC.fasta -M 0 -T 0 -c 0.9
+
+if [ ! -e remake_reference.sh ]; then
+    curl --insecure -L -O https://github.com/jpuritz/dDocent/raw/master/scripts/remake_reference.sh
+    fix_bash_path remake_reference.sh
+fi
+bash remake_reference.sh 4 4 0.90 PE 2
+
+if [ ! -e ReferenceOpt.sh ]; then
+    curl --insecure -L -O https://github.com/jpuritz/dDocent/raw/master/scripts/ReferenceOpt.sh
+    fix_bash_path ReferenceOpt.sh
+fi
+bash ReferenceOpt.sh 4 8 4 8 PE 16
diff --git a/ddocent/files/ddocent-test-cleanup b/ddocent/files/ddocent-test-cleanup
new file mode 100755
index 0000000000..4189b3bb03
--- /dev/null
+++ b/ddocent/files/ddocent-test-cleanup
@@ -0,0 +1,8 @@
+#!/bin/sh -e
+
+if pwd | fgrep dDocent-test; then
+    rm -rf .*.bak Data ddocent-bin
+else
+    printf "$0 can only be run in a dDocent-test directory.\n"
+    exit 1
+fi
diff --git a/ddocent/patches/patch-dDocent b/ddocent/patches/patch-dDocent
index aa59eb91ab..d1d524d1e1 100644
--- a/ddocent/patches/patch-dDocent
+++ b/ddocent/patches/patch-dDocent
@@ -1,24 +1,74 @@
 $NetBSD$
 
---- dDocent.orig	2015-11-30 19:35:04.016417718 -0600
-+++ dDocent	2015-11-30 19:40:47.765418264 -0600
+--- dDocent.orig	2018-03-06 14:22:03 UTC
++++ dDocent
 @@ -27,15 +27,15 @@ do
  	fi
  done
  
 -if find ${PATH//:/ } -maxdepth 1 -name trimmomatic*jar 2> /dev/null| grep -q 'trim' ; then
 -	TRIMMOMATIC=$(find ${PATH//:/ } -maxdepth 1 -name trimmomatic*jar 2> /dev/null | head -1)
-+if [ -e %%PREFIX%%/lib/java/trimmomatic-0.35.jar ]; then
-+	TRIMMOMATIC=%%PREFIX%%/lib/java/trimmomatic-0.35.jar
++if [ -e %%JAVAJARDIR%%/trimmomatic.jar ]; then
++       TRIMMOMATIC=%%JAVAJARDIR%%/trimmomatic.jar
  	else
      echo "The dependency trimmomatic is not installed or is not in your" '$PATH'"."
      NUMDEP=$((NUMDEP + 1))
  	fi
- 	
+ 
 -if find ${PATH//:/ } -maxdepth 1 -name TruSeq2-PE.fa 2> /dev/null | grep -q 'Tru' ; then
 -	ADAPTERS=$(find ${PATH//:/ } -maxdepth 1 -name TruSeq2-PE.fa 2> /dev/null | head -1)
-+if [ -e %%PREFIX%%/share/Trimmomatic/adapters/TruSeq2-PE.fa ]; then
-+	ADAPTERS=%%PREFIX%%/share/Trimmomatic/adapters/TruSeq2-PE.fa
++if [ -e %%PREFIX%%/share/trimmomatic/adapters ]; then
++       ADAPTERS=%%PREFIX%%/share/trimmomatic/adapters
  	else
      echo "The file listing adapters (included with trimmomatic) is not installed or is not in your" '$PATH'"."
      NUMDEP=$((NUMDEP + 1))
+@@ -80,6 +80,7 @@ FREEB=(`freebayes | grep -oh 'v[0-9].*' 
+         	exit 1
+         fi         	
+ VCFTV=$(vcftools | grep VCF | grep -oh '[0-9]*[a-z]*)$' | sed 's/[a-z)]//')
++	echo $VCFTV
+ 	if [ "$VCFTV" -lt "10" ]; then
+         	echo "The version of VCFtools installed in your" '$PATH' "is not optimized for dDocent."
+         	echo "Please install at least version 0.1.11"
+@@ -89,7 +90,7 @@ VCFTV=$(vcftools | grep VCF | grep -oh '
+         elif [ "$VCFTV" -ge "12" ]; then
+                 VCFGTFLAG="--max-missing"
+ 	fi
+-BWAV=$(bwa 2>&1 | mawk '/Versi/' | sed 's/Version: //g' | sed 's/0.7.//g' | sed 's/-.*//g' | cut -c 1-2)
++BWAV=$(bwa 2>&1 | mawk '/Versi/' | sed 's/Version: //g' | sed 's/0.7.//g' | sed 's/a*-.*//g')
+ 	if [ "$BWAV" -lt "13" ]; then
+         	echo "The version of bwa installed in your" '$PATH' "is not optimized for dDocent."
+         	echo "Please install at least version 0.7.13"
+@@ -747,7 +748,14 @@ else
+ fi
+ 
+ #Tries to get number of processors, if not asks user
+-NUMProc=( `grep -c ^processor /proc/cpuinfo 2> /dev/null` ) 
++if [ `uname` = Linux ]; then
++    NUMProc=( `grep -c ^processor /proc/cpuinfo 2> /dev/null` ) 
++elif [ `uname` = FreeBSD ]; then
++    NUMProc=( `sysctl -n hw.ncpu` ) 
++else
++    printf "Unsupported platform: `uname`\n"
++    exit 1
++fi
+ NUMProc=$(($NUMProc + 0)) 
+ 
+ echo "dDocent detects $NUMProc processors available on this system."
+@@ -764,7 +772,15 @@ if [ $NUMProc -lt 1 ]; then
+ fi
+ 
+ #Tries to get maximum system memory, if not asks user
+-MAXMemory=$(($(grep -Po '(?<=^MemTotal:)\s*[0-9]+' /proc/meminfo | tr -d " ") / 1048576))G
++if [ `uname` = Linux ]; then
++    MAXMemory=$(($(grep -Po '(?<=^MemTotal:)\s*[0-9]+' /proc/meminfo | tr -d " ") / 1048576))G
++elif [ `uname` = FreeBSD ]; then
++    MAXMemory=`sysctl -n hw.realmem`
++    MAXMemory=$((MAXMemory / 1073741824))G
++else
++    printf "Unsupported platform: `uname`\n"
++    exit 1
++fi
+ 
+ echo "dDocent detects $MAXMemory maximum memory available on this system."
+ echo "Please enter the maximum memory to use for this analysis. The size can be postfixed with 


Home | Main Index | Thread Index | Old Index