[Genabel-commits] r1408 - pkg/GenABEL/src/GAlib

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Nov 20 04:07:04 CET 2013


Author: maksim
Date: 2013-11-20 04:07:02 +0100 (Wed, 20 Nov 2013)
New Revision: 1408

Modified:
   pkg/GenABEL/src/GAlib/convert_snp_merlin.cpp
   pkg/GenABEL/src/GAlib/gwaa.c
Log:
Correction of style

Modified: pkg/GenABEL/src/GAlib/convert_snp_merlin.cpp
===================================================================
--- pkg/GenABEL/src/GAlib/convert_snp_merlin.cpp	2013-11-19 22:48:17 UTC (rev 1407)
+++ pkg/GenABEL/src/GAlib/convert_snp_merlin.cpp	2013-11-20 03:07:02 UTC (rev 1408)
@@ -55,6 +55,8 @@
 	long int linecount=0;
 	string data;
 	string token;
+				
+	char gdata;
 
 	vector<string> iid; string tmp_iid;
 	vector<string> chrom; string tmp_chrom;
@@ -159,9 +161,9 @@
 
 			istringstream datas (data);
 
-			char gdata;
 
 			if (datas >> token >> tmp_iid >> token >> token >> token) {
+				//char gdata;
 				for (int i=0;i<traits;i++) {datas >> token;}
 				iid.push_back(tmp_iid);
 				if (!(chgt[2*(linecount-1)] = new char [2*nsnps])) error ("ran out of memory ...\n");
@@ -194,7 +196,7 @@
 
 			istringstream datas (data);
 
-			char gdata;
+			//char gdata;
 
 			if (datas >> token >> tmp_iid >> token) {
 				iid.push_back(tmp_iid);
@@ -236,7 +238,7 @@
 	int nbytes = (int)ceil((double)nids/4.);
 
 	int idx;
-	char gdata;
+//	char gdata;
 	int* gnum = new int [nids*2];
 
 	int byte;
@@ -249,14 +251,6 @@
 
 		char allele1 = 0;
 		char allele2 = 0;
-		/**
-	if (strandid==3) {
-	  char at[10];
-	  sprintf(at,"%s",coding[snp].c_str());
-	  allele1 = at[0];
-	  allele2 = at[1];
-	}
-		 **/
 
 
 		unsigned long int ca1 = 0;
@@ -273,12 +267,6 @@
 			} else if (gdata == '0') {
 				gnum[idx] = 0;
 			} else {
-				/**
-	      if (strandid==3) {
-		error ("Annotation ('%s') and pedigree ('%c%c') coding contradicts in snp '%s' file '%s' line %li !",
-		       coding[snp].c_str(),allele1,allele2,snpnm[snp].c_str(),pedfilename[0],linecount);
-	      } else {
-				 **/
 				if (allele1 == 0) {
 					allele1 = gdata;
 					gnum[idx] = 1;
@@ -296,7 +284,6 @@
 
 		}
 
-		//    if (strandid!=3) {
 		if (!allele1 && !allele2) tmp_coding="12"; // all genotypes missing
 		else if (!allele1 && allele2) sprintf(tmp_chcoding,"%c%c",allele2,allele2); // only one allele present
 		else if (allele1 && !allele2) sprintf(tmp_chcoding,"%c%c",allele1,allele1); // only one allele present

Modified: pkg/GenABEL/src/GAlib/gwaa.c
===================================================================
--- pkg/GenABEL/src/GAlib/gwaa.c	2013-11-19 22:48:17 UTC (rev 1407)
+++ pkg/GenABEL/src/GAlib/gwaa.c	2013-11-20 03:07:02 UTC (rev 1408)
@@ -2097,7 +2097,7 @@
 	//	char chgt[nbytes];
 
 	for (igt=0;igt<nsnps;igt++) {
-		static double det;
+		//static double det;
 		get_snps_many(gdata+nbytes*igt,Nids,&i1,gt);
 		for (j=0;j<nstra;j++) {
 			totg[j] = 0.;
@@ -2185,7 +2185,7 @@
 					chi2[igt+3*nsnps]=u/(Tsg1+4.*Tsg2-Ttotg*((Tsg1+2.*Tsg2)/Ttotg)*((Tsg1+2.*Tsg2)/Ttotg));
 				}
 			}
-			det = v11*v22 - v12*v12;
+			//det = v11*v22 - v12*v12;
 			//			double rho2 = v12*v12/(v11*v22);
 			//			if (v00 <= 0. || v11<=0. || v22<=0. || rho2<1.e-16 || abs(det)<1.e-16) {
 			chi2[igt+nsnps] = -999.99;



More information about the Genabel-commits mailing list