[Genabel-commits] r2035 - pkg/GenABEL/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Jan 11 21:26:02 CET 2016


Author: lckarssen
Date: 2016-01-11 21:26:01 +0100 (Mon, 11 Jan 2016)
New Revision: 2035

Modified:
   pkg/GenABEL/R/convert.snp.affymetrix.R
Log:
Summary: Bring GenABEL's convert.snp.affymetrix() up to coding standards

- Fixed white space
- fixed use of {}
- Removed useless lines from the header comments.


Modified: pkg/GenABEL/R/convert.snp.affymetrix.R
===================================================================
--- pkg/GenABEL/R/convert.snp.affymetrix.R	2015-12-15 23:14:41 UTC (rev 2034)
+++ pkg/GenABEL/R/convert.snp.affymetrix.R	2016-01-11 20:26:01 UTC (rev 2035)
@@ -6,8 +6,6 @@
 #
 #        Version:  1.0
 #        Created:  16-Apr-2008
-#       Revision:  none
-#				last modification: 16-Apr-2008
 #
 #         Author:  Maksim V. Struchalin, Yurii S. Aulchenko
 #        Company:  ErasmusMC, Epidemiology & Biostatistics Department, The Netherlands.
@@ -16,56 +14,45 @@
 #=====================================================================================
 
 
-"convert.snp.affymetrix" <-
-function(dir, map, outfile, skipaffym) {
+"convert.snp.affymetrix" <- function(dir, map, outfile, skipaffym) {
+    if (!is(dir, "character"))
+    {
+        stop("Wrong data class: the first argument should be character")
+    }
 
-if (!is(dir,"character"))
-	{
-	stop("Wrong data class: the first argument should be character")
-	}
 
+    if (!is(map, "character"))
+    {
+        stop("Wrong data class: the second argument should be character")
+    }
 
-if (!is(map,"character"))
-	{
-	stop("Wrong data class: the second argument should be character")
-	}
 
+    if (!is(outfile, "character"))
+    {
+        stop("Wrong data class: the third argument should be character")
+    }
 
-if (!is(outfile,"character"))
-	{
-	stop("Wrong data class: the third argument should be character")
-	}
+    command <- paste("ls ", dir, sep="")
+    fileslist <- system(command, intern = TRUE)
+    files_amount <- length(fileslist)
 
+    if (files_amount == 0) {
+        stop("\ndirectory ", dir, " is empty or doesn't exsist\n")
+    }
 
+    alleleID_raw        <- alleleID.char2raw()
+    alleleID_names_char <- names(alleleID_raw)
+    names(alleleID_raw) <- NULL
+    alleleID_amount     <- length(alleleID_raw)
 
-
-
-
-command <- paste("ls ", dir,sep="")
-fileslist <- system(command, intern = T)
-
-
-files_amount <- length(fileslist)
-if(files_amount == 0) stop("\ndirectory ", dir, " is empty or doesn't exsist\n")
-
-
-
-
-alleleID_raw <- alleleID.char2raw()
-alleleID_names_char <- names(alleleID_raw)
-names(alleleID_raw) <- NULL
-alleleID_amount <- length(alleleID_raw)
-
-
-d <- .C("convert_snp_affymetrix_C", as.character(dir),
-				as.character(fileslist),
-			 	as.integer(files_amount),
-			 	as.character(map),
-			 	as.character(outfile),
-			 	as.integer(skipaffym),
-			 	as.character(alleleID_names_char),
-			 	as.raw(alleleID_raw),
-			 	as.integer(alleleID_amount))
-
-
+    d <- .C("convert_snp_affymetrix_C",
+            as.character(dir),
+            as.character(fileslist),
+            as.integer(files_amount),
+            as.character(map),
+            as.character(outfile),
+            as.integer(skipaffym),
+            as.character(alleleID_names_char),
+            as.raw(alleleID_raw),
+            as.integer(alleleID_amount))
 }



More information about the Genabel-commits mailing list