Changeset 4563
- Timestamp:
- Apr 10, 2015, 3:41:16 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugin/src/org/proteios/plugins/TabFeatureImporter.java
r4559 r4563 59 59 60 60 /** 61 * This plug-in reads a features.tsv file and imports it into the 62 * features table.61 * This plug-in reads a features.tsv file and imports it into the features 62 * table. 63 63 * 64 64 * @author fredrik … … 72 72 private static final org.apache.log4j.Logger log = org.apache.log4j.LogManager 73 73 .getLogger("org.proteios.io"); 74 74 75 75 76 76 public TabFeatureImporter() … … 89 89 { 90 90 return new AboutImpl("Tab feature importer", 91 "Import of tab separated features to database", "0.1", 92 "2010, Fredrik Levander", null, null, 93 "http://www.proteios.org"); 91 "Import of tab separated features to database", "0.2", 92 "2010-2015, Fredrik Levander", null, null, "http://www.proteios.org"); 94 93 } 95 94 … … 121 120 { 122 121 ItemQuery<Feature> featureQuery = qf.select(Feature.class); 123 featureQuery.restrict(Restrictions.eq( Hql124 .property("featureFile"), Hql.entity(featureFile)));122 featureQuery.restrict(Restrictions.eq( 123 Hql.property("featureFile"), Hql.entity(featureFile))); 125 124 if (featureQuery.count(dc) > 0) 126 125 { … … 162 161 index[6] = line.indexOf("intensity"); 163 162 index[7] = line.indexOf("intensity"); 164 if (line.indexOf("IntegratedIntensity") >1)163 if (line.indexOf("IntegratedIntensity") > 1) 165 164 { 166 165 index[7] = line.indexOf("IntegratedIntensity"); 167 166 } 167 // For Dinosaur feature format: 168 if (index[0] < 1) 169 index[0] = line.indexOf("rtApex"); 170 if (index[1] < 1) 171 index[1] = line.indexOf("monoisoMz"); 172 if (index[2] < 1) 173 index[2] = line.indexOf("rtStart"); 174 if (index[5] < 1) 175 index[5] = line.indexOf("rtEnd"); 176 if (index[6] < 1) 177 index[6] = line.indexOf("intensityApex"); 178 if (index[7] < 1) 179 index[7] = line.indexOf("intensitySum"); 168 180 featureStart = true; 169 181 } … … 187 199 feature.setApexIntensity(Float.valueOf(line 188 200 .get(index[6]))); 189 feature.setStartRetentionTimeInMinutes(Float.valueOf(line.get(index[2]))); 190 feature.setEndRetentionTimeInMinutes(Float.valueOf(line.get(index[5]))); 201 feature.setStartRetentionTimeInMinutes(Float 202 .valueOf(line.get(index[2]))); 203 feature.setEndRetentionTimeInMinutes(Float 204 .valueOf(line.get(index[5]))); 191 205 feature.setFeatureFile(featureFile); 192 206 feature.setMsFile(mzXMLFile); … … 204 218 { 205 219 throw new BaseException( 206 "Not a valid tab-separated feature file. First line should start with '# algorithm=F' or '# algorithm=M'");220 "Not a valid tab-separated feature file. First line should start with '# algorithm=F','# algorithm=M', 'monoisoMz' or 'mz'"); 207 221 } 208 222 } … … 270 284 else if (fileName.contains(".features")) 271 285 { 272 searchString = fileName.substring(0, fileName273 .lastIndexOf(".features")) + ".mzML";286 searchString = fileName.substring(0, 287 fileName.lastIndexOf(".features")) + ".mzML"; 274 288 } 275 289 if (searchString != null) … … 296 310 297 311 298 299 312 // ---------------------------------------------------------- 300 313 /* … … 317 330 if ((line = inreader.readLine()) != null) 318 331 { 319 ok = (line.startsWith("mz") || line.startsWith("# algorithm=M") || line.startsWith("# algorithm=F")); 332 ok = (line.startsWith("monoisoMz") || line.startsWith("mz") || line 333 .startsWith("# algorithm=M") || line 334 .startsWith("# algorithm=F")); 320 335 } 321 336 inreader.close();
Note: See TracChangeset
for help on using the changeset viewer.