Skip to content

Commit f2d8955

Browse files
committed
allowed missing values in the generic enrichment file
1 parent 6d84bca commit f2d8955

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/parsers/ParseGenericEnrichmentResults.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ public void parseGenericFile(String [] lines){
135135
line = lines[i];
136136

137137
tokens = line.split("\t");
138+
139+
//update the length each time because some line might have missing values
140+
length = tokens.length;
138141

139142
double pvalue = 1.0;
140143
double FDRqvalue = 1.0;
@@ -159,15 +162,15 @@ public void parseGenericFile(String [] lines){
159162
String description = tokens[1].toUpperCase();
160163

161164
//The third column is the nominal p-value
162-
if(tokens[2].equalsIgnoreCase("")){
165+
if(tokens[2] == null || tokens[2].equalsIgnoreCase("")){
163166
//do nothing
164167
}else{
165168
pvalue = Double.parseDouble(tokens[2]);
166169
}
167170

168171
if(length > 3){
169172
//the fourth column is the FDR q-value
170-
if(tokens[3].equalsIgnoreCase("")){
173+
if(tokens[3] == null || tokens[3].equalsIgnoreCase("")){
171174
//do nothing
172175
}else{
173176
FDRqvalue = Double.parseDouble(tokens[3]);
@@ -179,7 +182,7 @@ public void parseGenericFile(String [] lines){
179182
// and if it is a number the only important part is the sign
180183
if(length > 4) {
181184

182-
if(tokens[4].equalsIgnoreCase("")){
185+
if(tokens[4] == null || tokens[4].equalsIgnoreCase("")){
183186

184187
}else{
185188

0 commit comments

Comments
 (0)