Browse code

add parameter to allow skipping priority calculation in eiInit. also fixed some spelling mistakes in man page

khoran authored on 27/07/2020 21:52:04
Showing 3 changed files

... ...
@@ -1,8 +1,8 @@
1 1
 Package: eiR
2 2
 Type: Package
3 3
 Title: Accelerated similarity searching of small molecules
4
-Version: 1.27.1
5
-Date: 2020-3-30
4
+Version: 1.27.2
5
+Date: 2020-7-27
6 6
 Author: Kevin Horan, Yiqun Cao and Tyler Backman
7 7
 Maintainer: Thomas Girke <thomas.girke@ucr.edu>
8 8
 Suggests:   BiocStyle, knitcitations, knitr, knitrBootstrap
... ...
@@ -76,7 +76,7 @@ annoySearchAll <- function(matrixFile,dimension,numNeighbors,searchK=-1)
76 76
 
77 77
 eiInit <- function(inputs,dir=".",format="sdf",descriptorType="ap",append=FALSE,
78 78
 						 conn=defaultConn(dir,create=TRUE),updateByName=FALSE,
79
-						 cl=NULL,connSource=NULL,priorityFn = forestSizePriorities)
79
+						 cl=NULL,connSource=NULL,priorityFn = forestSizePriorities,skipPriorities=FALSE)
80 80
 {
81 81
 
82 82
 	if(!file.exists(file.path(dir,DataDir)))
... ...
@@ -137,7 +137,7 @@ eiInit <- function(inputs,dir=".",format="sdf",descriptorType="ap",append=FALSE,
137 137
 	print(paste(length(compoundIds)," loaded by eiInit"))
138 138
 
139 139
 	writeIddb(conn,compoundIds,file.path(dir,Main),append=append)
140
-	if(length(compoundIds)!=0 ){
140
+	if(length(compoundIds)!=0 && ! skipPriorities ){
141 141
 		descIds = getDescriptorIds(conn,compoundIds,descriptorType)
142 142
 		setPriorities(conn,priorityFn,descIds,cl=cl,connSource=connSource)
143 143
 	}
... ...
@@ -10,7 +10,7 @@
10 10
 \usage{
11 11
 	eiInit(inputs,dir=".",format="sdf",descriptorType="ap",append=FALSE,
12 12
 	conn=defaultConn(dir,create=TRUE), updateByName = FALSE, cl = NULL, connSource = NULL,
13
-	priorityFn = forestSizePriorities)
13
+	priorityFn = forestSizePriorities,skipPriorities=FALSE)
14 14
 }
15 15
 %- maybe also 'usage' for other objects documented here.
16 16
 \arguments{
... ...
@@ -24,7 +24,7 @@
24 24
       current directory.
25 25
    }
26 26
 	\item{format}{
27
-		The format of the data in \code{inputs}. Currenly only "sdf" and "smiles" is 
27
+		The format of the data in \code{inputs}. Currently only "sdf" and "smiles" is 
28 28
 		supported.
29 29
 	}
30 30
 	\item{descriptorType}{
... ...
@@ -33,7 +33,7 @@
33 33
 	}
34 34
 	\item{append}{
35 35
 		If true the given compounds will be added to an existing database
36
-		and the <data-dir>/Main.iddb file will be udpated with the new
36
+		and the <data-dir>/Main.iddb file will be updated with the new
37 37
 		compound id numbers. This should not normally be used directly, use
38 38
 		\code{\link{eiAdd}} instead to add new compounds to a database.
39 39
 	}
... ...
@@ -54,16 +54,16 @@
54 54
 	}
55 55
   \item{cl}{
56 56
      A SNOW cluster can be given here to run this function in
57
-     parrallel.
57
+     parallel.
58 58
    }
59 59
 	\item{connSource}{
60
-		A function returning a new database connection. Note that it is not suffient to return a
60
+		A function returning a new database connection. Note that it is not sufficient to return a
61 61
 		reference to an existing connection, it must be a distinct, new connection.  
62 62
 		This is needed for cluster operations
63
-		that make use of the database as they will each need to craete a new connection.
64
-		If not given, certain parts of this function will not be parrallelized.
63
+		that make use of the database as they will each need to create a new connection.
64
+		If not given, certain parts of this function will not be parallelized.
65 65
 
66
-		This function can also be used to setup the envrionment on the cluster worker nodes. For
66
+		This function can also be used to setup the environment on the cluster worker nodes. For
67 67
 		example, you might need to re-load libraries like RSQLite and such.
68 68
 	}
69 69
 	\item{priorityFn}{
... ...
@@ -73,9 +73,13 @@
73 73
 		'randomPriorities', and 'forestSizePriorities' (default). 
74 74
 
75 75
 		When several compounds map to the same descriptor, then when some functions need to go
76
-		from a descriptor to a compound, there is ambiguity about which compount to select. In
76
+		from a descriptor to a compound, there is ambiguity about which compound to select. In
77 77
 		that case, it will pick the compound with the highest priority. 
78 78
 	}
79
+	\item{skipPriorities}{
80
+		If this is true, then no priority values will be computed. See option \code{priorityFn} 
81
+		for an explanation of priorities.
82
+	}
79 83
 
80 84
 }
81 85
 \details{