[med-svn] [emmax] 04/10: Added example for the invocation of emmax once plink was run (or at least the ped file is available).
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 7313df96c8d80bc14ea61d7bf4ac2e7cafb4acf8
Author: Steffen Moeller <moeller at debian.org>
Date: Wed Jun 12 13:19:00 2013 +0000
Added example for the invocation of emmax once
plink was run (or at least the ped file is available).
---
debian/emmax.examples | 1 +
debian/patches/logfile.patch | 24 ++++++++++++++++++++++++
debian/patches/series | 1 +
debian/plink2emmax.sh | 33 +++++++++++++++++++++++++++++++++
4 files changed, 59 insertions(+)
diff --git a/debian/emmax.examples b/debian/emmax.examples
new file mode 100644
index 0000000..8204456
--- /dev/null
+++ b/debian/emmax.examples
@@ -0,0 +1 @@
+debian/plink2emmax.sh
diff --git a/debian/patches/logfile.patch b/debian/patches/logfile.patch
new file mode 100644
index 0000000..40fbdf3
--- /dev/null
+++ b/debian/patches/logfile.patch
@@ -0,0 +1,24 @@
+Index: emmax-0~beta.20100307/emmax.c
+===================================================================
+--- emmax-0~beta.20100307.orig/emmax.c
++++ emmax-0~beta.20100307/emmax.c
+@@ -1529,11 +1529,14 @@
+
+ void emmax_error( const char* format, ... ) {
+ va_list args;
+- fprintf(g_logh.fp, "ERROR: ");
+- va_start (args, format);
+- vfprintf(g_logh.fp, format, args);
+- va_end (args);
+- fprintf(g_logh.fp,"\n");
++ if (g_logh.fp) {
++ // the logfile may not be available
++ fprintf(g_logh.fp, "ERROR: ");
++ va_start (args, format);
++ vfprintf(g_logh.fp, format, args);
++ va_end (args);
++ fprintf(g_logh.fp,"\n");
++ }
+
+ fprintf(stderr, "ERROR: ");
+ va_start (args, format);
diff --git a/debian/patches/series b/debian/patches/series
index 22b0179..f270a1f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@ paths.patch
aborts.patch
install.patch
clean.patch
+logfile.patch
diff --git a/debian/plink2emmax.sh b/debian/plink2emmax.sh
new file mode 100755
index 0000000..c372825
--- /dev/null
+++ b/debian/plink2emmax.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+# Directly adapted from
+# http://genome.sph.umich.edu/wiki/EMMAX
+
+set -e
+
+nosuffix=$1
+
+# preparing genomic input
+if [ ! -r $nosuffix.ped ]; then
+ if [ -r $nosuffix.bed ]; then
+ p-link --bfile $nosuffix --out --recode $nosuffix
+ else
+ echo "E: Could not find '$nosuffix.ped' or '$nosuffix.bed'."
+ exit -1
+ fi
+fi
+p-link --file $nosuffix --recode12 --output-missing-genotype 0 --transpose --out $nosuffix
+
+# Preparing phenotype input
+# Exchange -9 and 0 as phenotypes with NA
+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
+emmax-kin -v -d 10 $nosuffix
+
+# Run EMMAX Association
+emmax -v -d 10 -t $nosuffix -p $nosuffix.emmax_phenotypes -k $nosuffix.BN.kinf -o $nosuffix.emmax
+
+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