[med-svn] [emmax] 06/10: Found and corrected issues with plink2emmax.sh.

Andreas Tille tille at debian.org
Tue Dec 5 14:31:02 UTC 2017


This is an automated email from the git hooks/post-receive script.

tille pushed a commit to branch master
in repository emmax.

commit 7cb99d49f969b62bf0ce01d1a86f4c376679e6ad
Author: Steffen Moeller <moeller at debian.org>
Date:   Thu Jun 13 08:55:12 2013 +0000

    Found and corrected issues with plink2emmax.sh.
---
 debian/changelog      |  6 ++++++
 debian/plink2emmax.sh | 32 ++++++++++++++++++++++++++++----
 2 files changed, 34 insertions(+), 4 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index e5d4ef4..77f8677 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+emmax (0~beta.20100307-2) UNRELEASED; urgency=low
+
+  * Added example script to transform .ped files for emmax
+
+ -- Steffen Moeller <moeller at debian.org>  Thu, 13 Jun 2013 10:47:43 +0200
+
 emmax (0~beta.20100307-1) UNRELEASED; urgency=low
 
   * Initial release pending, not uploaded because of unknown license.
diff --git a/debian/plink2emmax.sh b/debian/plink2emmax.sh
index c372825..d347cd0 100755
--- a/debian/plink2emmax.sh
+++ b/debian/plink2emmax.sh
@@ -3,31 +3,55 @@
 # Directly adapted from 
 # http://genome.sph.umich.edu/wiki/EMMAX
 
-set -e
 
 nosuffix=$1
 
+if [ "x" -eq "x$nosuffix" ]; then
+	echo "Usage: plink2emmax.sh <plinkfile>"
+	echo
+	echo "The plinkfile should not have a suffix. <plinkfile>.ped or <plinkfile.bed> need to exist."
+	echo
+	exit -1
+fi
+
+set -e
+
 # preparing genomic input
 if [ ! -r $nosuffix.ped ]; then
 	if [ -r $nosuffix.bed ]; then
-		p-link --bfile $nosuffix --out --recode $nosuffix
+		echo "I: Could not find ped file at '$nosuffix.ped' but found bedfile. Transforming that to .ped to later read phenotypes, expected at column 6."
+		p-link --bfile $nosuffix --recode --out $nosuffix
 	else
 		echo "E: Could not find '$nosuffix.ped' or '$nosuffix.bed'."
 		exit -1
 	fi
 fi
+echo
+echo "I: Transforming .ped file into .tped"
+echo
 p-link --file $nosuffix --recode12 --output-missing-genotype 0 --transpose --out $nosuffix
 
 # Preparing phenotype input
 # Exchange -9 and 0 as phenotypes with NA
+echo
+echo "I: Reading phenotypes from .ped file into file '$nosuffix.emmax_phenotypes'"
+echo
 awk '{print $1,$2,$6}' $nosuffix.ped > $nosuffix.emmax_phenotypes
 sed -i 's/-9$/NA/' $nosuffix.emmax_phenotypes
 sed -i 's/0$/NA/' $nosuffix.emmax_phenotypes
 
-# Creating Marker-Based Kinship Matrix
+
+# Rynnung emmax - first creating matrix, then using it
+
+echo
+echo "I: Creating Marker-Based Kinship Matrix"
+echo
 emmax-kin -v -d 10 $nosuffix
 
-# Run EMMAX Association
+echo
+echo "I: Run EMMAX Association"
+echo
 emmax -v -d 10 -t $nosuffix -p $nosuffix.emmax_phenotypes -k $nosuffix.BN.kinf -o $nosuffix.emmax
 
+echo 
 echo "I: emmax completed successfully. Find results in '$nosuffix.emmax.ps'."

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/emmax.git



More information about the debian-med-commit mailing list