Changeset 4506
- Timestamp:
- Aug 13, 2013, 2:20:17 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/api/core/conf/common-queries.xml
r4475 r4506 158 158 </description> 159 159 </query> 160 161 <query id="GET_UNIQUE_SCORE_TYPES_IN_HITS_FOR_PROJECT_WITH_FDR" type="HQL"> 162 <sql> 163 SELECT DISTINCT h.scoreType 164 FROM HitData h 165 WHERE h.project = :project 166 AND h.combinedFDR IS NOT NULL 167 ORDER by h.scoreType 168 </sql> 169 <description> 170 Load all distinct (unique) score types in the Hits table for a project 171 </description> 172 </query> 160 173 161 174 <query id="GET_UNIQUE_PLATEIDS_IN_HITS_FOR_PROJECT" type="HQL"> -
trunk/api/core/src/org/proteios/core/Hit.java
r4472 r4506 51 51 .getHibernateSession(), 52 52 "GET_UNIQUE_SCORE_TYPES_IN_HITS_FOR_PROJECT"); 53 query.setEntity("project", project.getData()); 54 return query.list(); 55 } 56 57 @SuppressWarnings("unchecked") 58 // Retrieve unique score types with combined FDR not null. 59 public static List<String> getUniqueScoreTypesWithCombinedFDR(Project project, DbControl dc) 60 { 61 org.hibernate.Query query = HibernateUtil.getPredefinedQuery(dc 62 .getHibernateSession(), 63 "GET_UNIQUE_SCORE_TYPES_IN_HITS_FOR_PROJECT_WITH_FDR"); 53 64 query.setEntity("project", project.getData()); 54 65 return query.list(); -
trunk/plugin/src/org/proteios/plugins/PrideExportPlugin.java
r4497 r4506 502 502 } 503 503 project = (Project) job.getValue("project"); 504 // Check if an alternative spectrum file in mzML format exists in directory 504 // Check if an alternative spectrum file in mzML format exists 505 // in directory 505 506 File mzMLFile = fetchAlternativeSpectrumFile(factory, 506 507 peakListFile, ".mzML"); … … 508 509 if (mzMLFile == null) 509 510 { 510 // Check if an alternative spectrum file in mzML format exists in project 511 // Check if an alternative spectrum file in mzML format 512 // exists in project 511 513 mzMLFile = fetchAlternativeSpectrumFileInProject(factory, 512 514 peakListFile, ".mzML"); … … 516 518 if (mzMLFile != null) 517 519 { 518 log.debug("mzMLFile path = " + mzMLFile.getPath().toString()); 520 log.debug("mzMLFile path = " + mzMLFile.getPath() 521 .toString()); 519 522 retrieveInstrumentFromMZML(mzMLFile); 520 523 } … … 606 609 * @param factory ItemFactory The ItemFactory to use. 607 610 * @param spectrumFile File The input spectrum file. 608 * @param alternativeFileExtension String File extension for alternative spectrum file. 611 * @param alternativeFileExtension String File extension for alternative 612 * spectrum file. 609 613 * @return File The alternative spectrum file, if found. 610 614 */ … … 650 654 651 655 /** 652 * Fetches an alternative spectrum file in project. The alternative 653 * spectrum file is assumed to already exist, and have the same base name654 * as the original spectrum file, but with specified file extension.655 * If several files with the same name exist in the project, the656 * first found isreturned. Returns null if no file can be found.656 * Fetches an alternative spectrum file in project. The alternative spectrum 657 * file is assumed to already exist, and have the same base name as the 658 * original spectrum file, but with specified file extension. If several 659 * files with the same name exist in the project, the first found is 660 * returned. Returns null if no file can be found. 657 661 * 658 662 * @param factory ItemFactory The ItemFactory to use. 659 663 * @param spectrumFile File The input spectrum file. 660 * @param alternativeFileExtension String File extension for alternative spectrum file. 664 * @param alternativeFileExtension String File extension for alternative 665 * spectrum file. 661 666 * @return File The alternative spectrum file, if found. 662 667 */ … … 678 683 { 679 684 // Remove part after and including last dot 680 spectrumFileBasename = spectrumFilename.substring(0, 681 lastDotIndex); 685 spectrumFileBasename = spectrumFilename.substring(0, lastDotIndex); 682 686 } 683 687 String alternativeSpectrumFilename = spectrumFileBasename + alternativeFileExtension; … … 690 694 fileQuery.include(Include.IN_PROJECT); 691 695 ItemResultList<File> alternativeSpectrumFileList = fileQuery.list(dc); 692 log.debug("alternativeSpectrumFileList.size() = " + alternativeSpectrumFileList.size()); 696 log.debug("alternativeSpectrumFileList.size() = " + alternativeSpectrumFileList 697 .size()); 693 698 // Get first file in project 694 699 File alternativeSpectrumFile = null; … … 1779 1784 List<String> usedScoreTypeList = fetchUsedScoreTypeList(dc); 1780 1785 log.debug("usedScoreTypeList = " + usedScoreTypeList); 1781 if (usedScoreTypeList != null && usedScoreTypeList.size() > 0) 1782 { 1783 scoreType = new String( 1784 "Proteios SE, combination of " + usedScoreTypeList 1785 .get(0)); 1786 for (int i = 1; i < usedScoreTypeList.size(); i++) 1786 if (usedScoreTypeList != null) 1787 { 1788 if (usedScoreTypeList.size() > 1) 1787 1789 { 1788 // Get separator for middle elements1789 String separator = new String(", ");1790 // Get separator for last element1791 if (i == (usedScoreTypeList.size() - 1))1790 scoreType = new String( 1791 "Proteios SE, combination of " + usedScoreTypeList 1792 .get(0)); 1793 for (int i = 1; i < usedScoreTypeList.size(); i++) 1792 1794 { 1793 separator = new String(" and "); 1795 // Get separator for middle elements 1796 String separator = new String(", "); 1797 // Get separator for last element 1798 if (i == (usedScoreTypeList.size() - 1)) 1799 { 1800 separator = new String(" and "); 1801 } 1802 scoreType = scoreType + separator + usedScoreTypeList 1803 .get(i); 1794 1804 } 1795 scoreType = scoreType + separator + usedScoreTypeList 1796 .get(i); 1805 } 1806 else if (usedScoreTypeList.size() == 1) 1807 { 1808 scoreType = usedScoreTypeList.get(0); 1797 1809 } 1798 1810 } … … 1873 1885 { 1874 1886 // Get score types from Hit query 1875 List<String> scoreTypeList = Hit.getUniqueScoreTypes (project, dc);1887 List<String> scoreTypeList = Hit.getUniqueScoreTypesWithCombinedFDR(project, dc); 1876 1888 log.debug("scoreTypeList = " + scoreTypeList); 1877 1889 List<String> usedScoreTypeList = new ArrayList<String>(); … … 1889 1901 // Skip "Proteios Protein" score types, as these hits are 1890 1902 // already combined 1891 if (scoreType. equals("Proteios Protein"))1903 if (scoreType.startsWith("Proteios")) 1892 1904 { 1893 1905 continue;
Note: See TracChangeset
for help on using the changeset viewer.