diff --git a/hs_err_pid31369.log b/hs_err_pid31369.log new file mode 100644 index 0000000..d13c8cf --- /dev/null +++ b/hs_err_pid31369.log @@ -0,0 +1,1114 @@ +# +# A fatal error has been detected by the Java Runtime Environment: +# +# SIGSEGV (0xb) at pc=0x00007fa89dc8b935, pid=31369, tid=0x00007fa8675f5700 +# +# JRE version: OpenJDK Runtime Environment (8.0_141-b15) (build 1.8.0_141-8u141-b15-1~deb9u1-b15) +# Java VM: OpenJDK 64-Bit Server VM (25.141-b15 mixed mode linux-amd64 compressed oops) +# Problematic frame: +# V [libjvm.so+0x924935] PSParallelCompact::IsAliveClosure::do_object_b(oopDesc*)+0x35 +# +# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again +# +# If you would like to submit a bug report, please visit: +# http://bugreport.java.com/bugreport/crash.jsp +# + +--------------- T H R E A D --------------- + +Current thread (0x00007fa898082000): VMThread [stack: 0x00007fa8674f5000,0x00007fa8675f6000] [id=31382] + +siginfo: si_signo: 11 (SIGSEGV), si_code: 128 (SI_KERNEL), si_addr: 0x0000000000000000 + +Registers: +RAX=0x0000002000000000, RBX=0x00007fa8858066d8, RCX=0x0000000000000025, RDX=0x00007fa854000000 +RSP=0x00007fa8675f44d8, RBP=0x00007fa8675f4630, RSI=0x000009dbdbf58195, RDI=0x00007fa89e28e260 +R8 =0x0000000000000000, R9 =0x0000000000001000, R10=0x00007fa85000be00, R11=0x00007fa85000be00 +R12=0x00007fa885806748, R13=0x0000000000000000, R14=0x00007fa8675f44f0, R15=0x00007fa89e1c5dc0 +RIP=0x00007fa89dc8b935, EFLAGS=0x0000000000010206, CSGSFS=0x002b000000000033, ERR=0x0000000000000000 + TRAPNO=0x000000000000000d + +Top of Stack: (sp=0x00007fa8675f44d8) +0x00007fa8675f44d8: 00007fa89dbcb539 00007fa8675f4560 +0x00007fa8675f44e8: 00007fa89e28e260 00007fa8675f4510 +0x00007fa8675f44f8: 00007fa89d8cd471 00007fa8675f4520 +0x00007fa8675f4508: a87a5e793840da00 00007fa850000070 +0x00007fa8675f4518: 00007fa898081600 0000000000000010 +0x00007fa8675f4528: a87a5e793840da00 00007fa89e28e260 +0x00007fa8675f4538: 00007fa898081600 0000000000000010 +0x00007fa8675f4548: 00007fa7dc0a2340 00007fa7dc0aa310 +0x00007fa8675f4558: 0000000000000000 00007fa8675f45e0 +0x00007fa8675f4568: 00007fa89d6205c9 00007fa8675f45b0 +0x00007fa8675f4578: 00007fa89e28e260 00007fa8675f45c0 +0x00007fa8675f4588: a87a5e793840da00 00007fa8675f45e0 +0x00007fa8675f4598: 00007fa89dbbf613 00007fa80f00bbd8 +0x00007fa8675f45a8: 00007fa89e28e260 00007fa885806198 +0x00007fa8675f45b8: 00007fa8858066a8 00007fa885806198 +0x00007fa8675f45c8: 00007fa885806098 00007fa81838c2c0 +0x00007fa8675f45d8: 00007fa89de4648c 00007fa8675f4630 +0x00007fa8675f45e8: 00007fa89dbcb920 0000000000000005 +0x00007fa8675f45f8: a87a5e793840da00 00007fa8675f47d0 +0x00007fa8675f4608: 0000000000000026 00000007c001b1e8 +0x00007fa8675f4618: 00007fa89e28e260 00007fa89e28e260 +0x00007fa8675f4628: 00000007c001b1e8 00007fa8675f4660 +0x00007fa8675f4638: 00007fa89d985ae9 00007fa898030050 +0x00007fa8675f4648: 00000007c0018800 0000000000000101 +0x00007fa8675f4658: 00007fa85001d270 00007fa8675f4700 +0x00007fa8675f4668: 00007fa89dac4f61 00007fa89e1ce6b8 +0x00007fa8675f4678: 00007fa8675f46a0 0000000000000000 +0x00007fa8675f4688: 0000000000000000 01007fa8675f46e0 +0x00007fa8675f4698: 00000000000007f8 0000000000000000 +0x00007fa8675f46a8: 0000000000000000 0000000000000000 +0x00007fa8675f46b8: 0000000000000000 0000000000000000 +0x00007fa8675f46c8: a87a5e793840da00 00007fa8675f4700 + +Instructions: (pc=0x00007fa89dc8b935) +0x00007fa89dc8b915: 00 8b 08 b8 01 00 00 00 48 89 e5 48 c1 ee 03 5d +0x00007fa89dc8b925: 48 d3 ee 48 89 f1 48 c1 ee 06 83 e1 3f 48 d3 e0 +0x00007fa89dc8b935: 48 85 04 f2 0f 95 c0 c3 90 66 90 48 89 f0 55 48 +0x00007fa89dc8b945: 8b 77 10 48 8b 10 48 89 c7 48 89 e5 5d 48 8b 92 + +Register to memory mapping: + +RAX=0x0000002000000000 is an unknown value +RBX=0x00007fa8858066d8 is pointing into metadata +RCX=0x0000000000000025 is an unknown value +RDX=0x00007fa854000000 is an unknown value +RSP=0x00007fa8675f44d8 is an unknown value +RBP=0x00007fa8675f4630 is an unknown value +RSI=0x000009dbdbf58195 is an unknown value +RDI=0x00007fa89e28e260: in /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so at 0x00007fa89d367000 +R8 =0x0000000000000000 is an unknown value +R9 =0x0000000000001000 is an unknown value +R10=0x00007fa85000be00 is an unknown value +R11=0x00007fa85000be00 is an unknown value +R12=0x00007fa885806748 is pointing into metadata +R13=0x0000000000000000 is an unknown value +R14=0x00007fa8675f44f0 is an unknown value +R15=0x00007fa89e1c5dc0: in /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so at 0x00007fa89d367000 + + +Stack: [0x00007fa8674f5000,0x00007fa8675f6000], sp=0x00007fa8675f44d8, free space=1021k +Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) +V [libjvm.so+0x924935] PSParallelCompact::IsAliveClosure::do_object_b(oopDesc*)+0x35 +V [libjvm.so+0x61eae9] InstanceKlass::clean_weak_instanceklass_links(BoolObjectClosure*)+0x49 +V [libjvm.so+0x75df61] Klass::clean_weak_klass_links(BoolObjectClosure*, bool)+0x211 +V [libjvm.so+0x928349] PSParallelCompact::marking_phase(ParCompactionManager*, bool, ParallelOldTracer*)+0x4c9 +V [libjvm.so+0x9296e9] PSParallelCompact::invoke_no_policy(bool) [clone .part.119]+0x439 +V [libjvm.so+0x9317bd] PSScavenge::invoke()+0x1fd +V [libjvm.so+0x8e2f33] ParallelScavengeHeap::failed_mem_allocate(unsigned long)+0x63 +V [libjvm.so+0xa716e2] VM_ParallelGCFailedAllocation::doit()+0x92 +V [libjvm.so+0xa76857] VM_Operation::evaluate()+0x47 +V [libjvm.so+0xa73fe7] VMThread::evaluate_operation(VM_Operation*) [clone .constprop.30]+0xe7 +V [libjvm.so+0xa75466] VMThread::loop()+0x246 +V [libjvm.so+0xa75961] VMThread::run()+0x81 +V [libjvm.so+0x8bbd12] java_start(Thread*)+0xf2 + +VM_Operation (0x00007fa80e4ea240): ParallelGCFailedAllocation, mode: safepoint, requested by thread 0x00007fa80435a800 + + +--------------- P R O C E S S --------------- + +Java Threads: ( => current thread ) + 0x00007fa8140f5000 JavaThread "*** Profiler Agent Special Execution Thread 3" daemon [_thread_blocked, id=1544, stack(0x00007fa80e8f0000,0x00007fa80e9f1000)] + 0x00007fa80435a800 JavaThread "Thread-9" [_thread_blocked, id=31485, stack(0x00007fa80e3eb000,0x00007fa80e4ec000)] + 0x00007fa80449f000 JavaThread "Timer-2" daemon [_thread_blocked, id=31420, stack(0x00007fa80ebf1000,0x00007fa80ecf2000)] + 0x00007fa80441b800 JavaThread "Timer-1" daemon [_thread_blocked, id=31419, stack(0x00007fa80ecf2000,0x00007fa80edf3000)] + 0x00007fa804211800 JavaThread "TimerQueue" daemon [_thread_blocked, id=31418, stack(0x00007fa80f2ea000,0x00007fa80f3eb000)] + 0x00007fa80409b800 JavaThread "Timer-0" daemon [_thread_blocked, id=31417, stack(0x00007fa80f3eb000,0x00007fa80f4ec000)] + 0x00007fa89800c000 JavaThread "DestroyJavaVM" [_thread_blocked, id=31373, stack(0x00007fa89ef5f000,0x00007fa89f060000)] + 0x00007fa898acb000 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=31414, stack(0x00007fa80f4ec000,0x00007fa80f5ed000)] + 0x00007fa898ac9800 JavaThread "AWT-Shutdown" [_thread_blocked, id=31413, stack(0x00007fa80f5ed000,0x00007fa80f6ee000)] + 0x00007fa898806800 JavaThread "AWT-XAWT" daemon [_thread_blocked, id=31411, stack(0x00007fa80f8ee000,0x00007fa80f9ef000)] + 0x00007fa8987c5000 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=31410, stack(0x00007fa865e47000,0x00007fa865f48000)] + 0x00007fa8984a0000 JavaThread "Service Thread" daemon [_thread_blocked, id=31398, stack(0x00007fa8657d1000,0x00007fa8658d2000)] + 0x00007fa89849d800 JavaThread "C1 CompilerThread3" daemon [_thread_blocked, id=31397, stack(0x00007fa8658d2000,0x00007fa8659d3000)] + 0x00007fa89849b800 JavaThread "C2 CompilerThread2" daemon [_thread_blocked, id=31396, stack(0x00007fa8659d3000,0x00007fa865ad4000)] + 0x00007fa898499800 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=31395, stack(0x00007fa865ad4000,0x00007fa865bd5000)] + 0x00007fa898497800 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=31394, stack(0x00007fa865bd5000,0x00007fa865cd6000)] + 0x00007fa8982d8800 JavaThread "*** Profiler Agent Special Execution Thread 6" daemon [_thread_blocked, id=31389, stack(0x00007fa866365000,0x00007fa866466000)] + 0x00007fa8982d6000 JavaThread "*** JFluid Monitor thread ***" daemon [_thread_blocked, id=31388, stack(0x00007fa866466000,0x00007fa866567000)] + 0x00007fa8982cd800 JavaThread "*** Profiler Agent Communication Thread" daemon [_thread_blocked, id=31386, stack(0x00007fa86677f000,0x00007fa866880000)] + 0x00007fa898178000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=31385, stack(0x00007fa866880000,0x00007fa866981000)] + 0x00007fa8980c3000 JavaThread "Finalizer" daemon [_thread_blocked, id=31384, stack(0x00007fa8672f3000,0x00007fa8673f4000)] + 0x00007fa8980b1000 JavaThread "Reference Handler" daemon [_thread_blocked, id=31383, stack(0x00007fa8673f4000,0x00007fa8674f5000)] + +Other Threads: +=>0x00007fa898082000 VMThread [stack: 0x00007fa8674f5000,0x00007fa8675f6000] [id=31382] + 0x00007fa8984b2800 WatcherThread [stack: 0x00007fa8656d0000,0x00007fa8657d1000] [id=31399] + +VM state:at safepoint (normal execution) + +VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event]) +[0x00007fa8980087e0] Threads_lock - owner thread: 0x00007fa898082000 +[0x00007fa898008ce0] Heap_lock - owner thread: 0x00007fa80435a800 + +Heap: + PSYoungGen total 1398272K, used 187920K [0x0000000740000000, 0x00000007c0000000, 0x00000007c0000000) + eden space 699392K, 0% used [0x0000000740000000,0x0000000740000000,0x000000076ab00000) + from space 698880K, 26% used [0x000000076ab00000,0x0000000776284080,0x0000000795580000) + to space 698880K, 0% used [0x0000000795580000,0x0000000795580000,0x00000007c0000000) + ParOldGen total 891392K, used 833623K [0x0000000640000000, 0x0000000676680000, 0x0000000740000000) + object space 891392K, 93% used [0x0000000640000000,0x0000000672e15ce0,0x0000000676680000) + Metaspace used 31265K, capacity 31546K, committed 32000K, reserved 1079296K + class space used 2866K, capacity 2953K, committed 3072K, reserved 1048576K + +Card table byte_map: [0x00007fa887800000,0x00007fa888401000] byte_map_base: 0x00007fa884600000 + +Marking Bits: (ParMarkBitMap*) 0x00007fa89e28e2c0 + Begin Bits: [0x00007fa854000000, 0x00007fa85a000000) + End Bits: [0x00007fa85a000000, 0x00007fa860000000) + +Polling page: 0x00007fa89f0b3000 + +CodeCache: size=245760Kb used=9768Kb max_used=15635Kb free=235991Kb + bounds [0x00007fa8887c1000, 0x00007fa889721000, 0x00007fa8977c1000] + total_blobs=3612 nmethods=2954 adapters=570 + compilation: enabled + +Compilation events (10 events): +Event: 551.306 Thread 0x00007fa89849d800 6049 3 javax.swing.plaf.nimbus.NimbusStyle::getNextState (263 bytes) +Event: 551.306 Thread 0x00007fa89849d800 nmethod 6049 0x00007fa888d5fa10 code [0x00007fa888d5fbe0, 0x00007fa888d603b0] +Event: 551.974 Thread 0x00007fa89849d800 6050 ! 3 org.netbeans.lib.profiler.server.ProfilerServer::handleClientCommand (1298 bytes) +Event: 551.982 Thread 0x00007fa89849d800 nmethod 6050 0x00007fa88925c4d0 code [0x00007fa88925d960, 0x00007fa88926b858] +Event: 552.306 Thread 0x00007fa89849d800 6051 3 javax.swing.RepaintManager$3:: (15 bytes) +Event: 552.306 Thread 0x00007fa89849d800 nmethod 6051 0x00007fa888f23e10 code [0x00007fa888f23f80, 0x00007fa888f241a8] +Event: 552.925 Thread 0x00007fa898499800 6052 4 org.netbeans.lib.profiler.server.Monitors$SurvGenAndThreadsMonitor::updateSurvGenData (104 bytes) +Event: 552.929 Thread 0x00007fa898499800 nmethod 6052 0x00007fa88950ded0 code [0x00007fa88950e080, 0x00007fa88950e9c0] +Event: 553.306 Thread 0x00007fa89849d800 6053 3 javax.swing.plaf.synth.SynthLookAndFeel::paintRegion (118 bytes) +Event: 553.307 Thread 0x00007fa89849d800 nmethod 6053 0x00007fa888e64b10 code [0x00007fa888e64d00, 0x00007fa888e656a8] + +GC Heap History (10 events): +Event: 510.803 GC heap after +Heap after GC invocations=37 (full 4): + PSYoungGen total 1398272K, used 300702K [0x0000000740000000, 0x00000007c0000000, 0x00000007c0000000) + eden space 699392K, 0% used [0x0000000740000000,0x0000000740000000,0x000000076ab00000) + from space 698880K, 43% used [0x000000076ab00000,0x000000077d0a7b98,0x0000000795580000) + to space 698880K, 0% used [0x0000000795580000,0x0000000795580000,0x00000007c0000000) + ParOldGen total 891392K, used 531247K [0x0000000640000000, 0x0000000676680000, 0x0000000740000000) + object space 891392K, 59% used [0x0000000640000000,0x00000006606cbce0,0x0000000676680000) + Metaspace used 24525K, capacity 24858K, committed 25088K, reserved 1071104K + class space used 2673K, capacity 2793K, committed 2816K, reserved 1048576K +} +Event: 515.307 GC heap before +{Heap before GC invocations=38 (full 4): + PSYoungGen total 1398272K, used 1000094K [0x0000000740000000, 0x00000007c0000000, 0x00000007c0000000) + eden space 699392K, 100% used [0x0000000740000000,0x000000076ab00000,0x000000076ab00000) + from space 698880K, 43% used [0x000000076ab00000,0x000000077d0a7b98,0x0000000795580000) + to space 698880K, 0% used [0x0000000795580000,0x0000000795580000,0x00000007c0000000) + ParOldGen total 891392K, used 531247K [0x0000000640000000, 0x0000000676680000, 0x0000000740000000) + object space 891392K, 59% used [0x0000000640000000,0x00000006606cbce0,0x0000000676680000) + Metaspace used 31079K, capacity 31354K, committed 31744K, reserved 1077248K + class space used 2866K, capacity 2953K, committed 3072K, reserved 1048576K +Event: 515.612 GC heap after +Heap after GC invocations=38 (full 4): + PSYoungGen total 1398272K, used 294856K [0x0000000740000000, 0x00000007c0000000, 0x00000007c0000000) + eden space 699392K, 0% used [0x0000000740000000,0x0000000740000000,0x000000076ab00000) + from space 698880K, 42% used [0x0000000795580000,0x00000007a7572080,0x00000007c0000000) + to space 698880K, 0% used [0x000000076ab00000,0x000000076ab00000,0x0000000795580000) + ParOldGen total 891392K, used 574775K [0x0000000640000000, 0x0000000676680000, 0x0000000740000000) + object space 891392K, 64% used [0x0000000640000000,0x000000066314dce0,0x0000000676680000) + Metaspace used 31079K, capacity 31354K, committed 31744K, reserved 1077248K + class space used 2866K, capacity 2953K, committed 3072K, reserved 1048576K +} +Event: 523.813 GC heap before +{Heap before GC invocations=39 (full 4): + PSYoungGen total 1398272K, used 994248K [0x0000000740000000, 0x00000007c0000000, 0x00000007c0000000) + eden space 699392K, 100% used [0x0000000740000000,0x000000076ab00000,0x000000076ab00000) + from space 698880K, 42% used [0x0000000795580000,0x00000007a7572080,0x00000007c0000000) + to space 698880K, 0% used [0x000000076ab00000,0x000000076ab00000,0x0000000795580000) + ParOldGen total 891392K, used 574775K [0x0000000640000000, 0x0000000676680000, 0x0000000740000000) + object space 891392K, 64% used [0x0000000640000000,0x000000066314dce0,0x0000000676680000) + Metaspace used 31135K, capacity 31418K, committed 31744K, reserved 1077248K + class space used 2866K, capacity 2953K, committed 3072K, reserved 1048576K +Event: 524.178 GC heap after +Heap after GC invocations=39 (full 4): + PSYoungGen total 1398272K, used 347376K [0x0000000740000000, 0x00000007c0000000, 0x00000007c0000000) + eden space 699392K, 0% used [0x0000000740000000,0x0000000740000000,0x000000076ab00000) + from space 698880K, 49% used [0x000000076ab00000,0x000000077fe3c080,0x0000000795580000) + to space 698880K, 0% used [0x0000000795580000,0x0000000795580000,0x00000007c0000000) + ParOldGen total 891392K, used 637055K [0x0000000640000000, 0x0000000676680000, 0x0000000740000000) + object space 891392K, 71% used [0x0000000640000000,0x0000000666e1fce0,0x0000000676680000) + Metaspace used 31135K, capacity 31418K, committed 31744K, reserved 1077248K + class space used 2866K, capacity 2953K, committed 3072K, reserved 1048576K +} +Event: 538.127 GC heap before +{Heap before GC invocations=40 (full 4): + PSYoungGen total 1398272K, used 1046768K [0x0000000740000000, 0x00000007c0000000, 0x00000007c0000000) + eden space 699392K, 100% used [0x0000000740000000,0x000000076ab00000,0x000000076ab00000) + from space 698880K, 49% used [0x000000076ab00000,0x000000077fe3c080,0x0000000795580000) + to space 698880K, 0% used [0x0000000795580000,0x0000000795580000,0x00000007c0000000) + ParOldGen total 891392K, used 637055K [0x0000000640000000, 0x0000000676680000, 0x0000000740000000) + object space 891392K, 71% used [0x0000000640000000,0x0000000666e1fce0,0x0000000676680000) + Metaspace used 31209K, capacity 31482K, committed 32000K, reserved 1079296K + class space used 2866K, capacity 2953K, committed 3072K, reserved 1048576K +Event: 538.508 GC heap after +Heap after GC invocations=40 (full 4): + PSYoungGen total 1398272K, used 306884K [0x0000000740000000, 0x00000007c0000000, 0x00000007c0000000) + eden space 699392K, 0% used [0x0000000740000000,0x0000000740000000,0x000000076ab00000) + from space 698880K, 43% used [0x0000000795580000,0x00000007a81310d0,0x00000007c0000000) + to space 698880K, 0% used [0x000000076ab00000,0x000000076ab00000,0x0000000795580000) + ParOldGen total 891392K, used 698111K [0x0000000640000000, 0x0000000676680000, 0x0000000740000000) + object space 891392K, 78% used [0x0000000640000000,0x000000066a9bfce0,0x0000000676680000) + Metaspace used 31209K, capacity 31482K, committed 32000K, reserved 1079296K + class space used 2866K, capacity 2953K, committed 3072K, reserved 1048576K +} +Event: 553.588 GC heap before +{Heap before GC invocations=41 (full 4): + PSYoungGen total 1398272K, used 1006276K [0x0000000740000000, 0x00000007c0000000, 0x00000007c0000000) + eden space 699392K, 100% used [0x0000000740000000,0x000000076ab00000,0x000000076ab00000) + from space 698880K, 43% used [0x0000000795580000,0x00000007a81310d0,0x00000007c0000000) + to space 698880K, 0% used [0x000000076ab00000,0x000000076ab00000,0x0000000795580000) + ParOldGen total 891392K, used 698111K [0x0000000640000000, 0x0000000676680000, 0x0000000740000000) + object space 891392K, 78% used [0x0000000640000000,0x000000066a9bfce0,0x0000000676680000) + Metaspace used 31265K, capacity 31546K, committed 32000K, reserved 1079296K + class space used 2866K, capacity 2953K, committed 3072K, reserved 1048576K +Event: 554.045 GC heap after +Heap after GC invocations=41 (full 4): + PSYoungGen total 1398272K, used 187920K [0x0000000740000000, 0x00000007c0000000, 0x00000007c0000000) + eden space 699392K, 0% used [0x0000000740000000,0x0000000740000000,0x000000076ab00000) + from space 698880K, 26% used [0x000000076ab00000,0x0000000776284080,0x0000000795580000) + to space 698880K, 0% used [0x0000000795580000,0x0000000795580000,0x00000007c0000000) + ParOldGen total 891392K, used 833623K [0x0000000640000000, 0x0000000676680000, 0x0000000740000000) + object space 891392K, 93% used [0x0000000640000000,0x0000000672e15ce0,0x0000000676680000) + Metaspace used 31265K, capacity 31546K, committed 32000K, reserved 1079296K + class space used 2866K, capacity 2953K, committed 3072K, reserved 1048576K +} +Event: 554.045 GC heap before +{Heap before GC invocations=42 (full 5): + PSYoungGen total 1398272K, used 187920K [0x0000000740000000, 0x00000007c0000000, 0x00000007c0000000) + eden space 699392K, 0% used [0x0000000740000000,0x0000000740000000,0x000000076ab00000) + from space 698880K, 26% used [0x000000076ab00000,0x0000000776284080,0x0000000795580000) + to space 698880K, 0% used [0x0000000795580000,0x0000000795580000,0x00000007c0000000) + ParOldGen total 891392K, used 833623K [0x0000000640000000, 0x0000000676680000, 0x0000000740000000) + object space 891392K, 93% used [0x0000000640000000,0x0000000672e15ce0,0x0000000676680000) + Metaspace used 31265K, capacity 31546K, committed 32000K, reserved 1079296K + class space used 2866K, capacity 2953K, committed 3072K, reserved 1048576K + +Deoptimization events (10 events): +Event: 513.990 Thread 0x00007fa80435a800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007fa88915f140 method=org.netbeans.lib.profiler.server.ProfilerRuntimeMemory.writeObjLivenessStackTraceEvent(ICIJ)V @ 24 +Event: 514.022 Thread 0x00007fa80435a800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007fa888e08a98 method=java.lang.Class.getClassLoader()Ljava/lang/ClassLoader; @ 6 +Event: 514.250 Thread 0x00007fa80435a800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007fa888a09538 method=org.netbeans.lib.profiler.server.ProfilerRuntimeMemory.writeObjLivenessStackTraceEvent(ICIJ)V @ 53 +Event: 514.306 Thread 0x00007fa80449f000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007fa88918b848 method=org.netbeans.lib.profiler.server.ThreadInfo.isProfilerServerMonitor(Ljava/lang/Object;)Z @ 11 +Event: 514.306 Thread 0x00007fa80449f000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007fa88896f7d0 method=org.netbeans.lib.profiler.server.ThreadInfo.isProfilerServerMonitor(Ljava/lang/Object;)Z @ 11 +Event: 516.227 Thread 0x00007fa80435a800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007fa888a2eb5c method=java.lang.String.indexOf(II)I @ 17 +Event: 523.803 Thread 0x00007fa80435a800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007fa8889a18a8 method=org.rappsilber.fdr.entities.Peptide.compare(Lorg/rappsilber/fdr/entities/Peptide;)I @ 5 +Event: 530.914 Thread 0x00007fa80435a800 Uncommon trap: reason=null_check action=make_not_entrant pc=0x00007fa8891f46dc method=org.rappsilber.fdr.OfflineFDR.registerRun(Ljava/lang/String;)Ljava/lang/String; @ 8 +Event: 534.974 Thread 0x00007fa898806800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007fa8888dfe68 method=java.lang.String.startsWith(Ljava/lang/String;I)Z @ 37 +Event: 538.517 Thread 0x00007fa8980b1000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007fa888cde204 method=org.netbeans.lib.profiler.server.ProfilerRuntimeMemory.isInternalClass(Ljava/lang/Class;)Z @ 22 + +Internal exceptions (10 events): +Event: 2.386 Thread 0x00007fa898acb000 Implicit null exception at 0x00007fa888c9c406 to 0x00007fa888c9ff89 +Event: 2.855 Thread 0x00007fa898acb000 Exception (0x0000000740ffba58) thrown at [/build/openjdk-8-8u141-b15/src/hotspot/src/share/vm/prims/jni.cpp, line 735] +Event: 3.326 Thread 0x00007fa898acb000 Exception (0x00000007413271e0) thrown at [/build/openjdk-8-8u141-b15/src/hotspot/src/share/vm/prims/jni.cpp, line 735] +Event: 9.087 Thread 0x00007fa898acb000 Implicit null exception at 0x00007fa88891a550 to 0x00007fa88891a5ac +Event: 9.401 Thread 0x00007fa898acb000 Exception (0x0000000741c80490) thrown at [/build/openjdk-8-8u141-b15/src/hotspot/src/share/vm/prims/jni.cpp, line 735] +Event: 63.555 Thread 0x00007fa80435a800 Implicit null exception at 0x00007fa8890b32cd to 0x00007fa8890b38c9 +Event: 63.637 Thread 0x00007fa80435a800 Implicit null exception at 0x00007fa888d138a9 to 0x00007fa888d1589d +Event: 218.308 Thread 0x00007fa898acb000 Implicit null exception at 0x00007fa8891c2c93 to 0x00007fa8891c3341 +Event: 510.803 Thread 0x00007fa8280fb800 Implicit null exception at 0x00007fa888b9f83b to 0x00007fa888ba0361 +Event: 530.914 Thread 0x00007fa80435a800 Implicit null exception at 0x00007fa8891f2972 to 0x00007fa8891f46c9 + +Events (10 events): +Event: 553.306 Executing VM operation: GetObjectMonitorUsage done +Event: 553.306 Executing VM operation: GetObjectMonitorUsage +Event: 553.306 Executing VM operation: GetObjectMonitorUsage done +Event: 553.306 Executing VM operation: GetObjectMonitorUsage +Event: 553.306 Executing VM operation: GetObjectMonitorUsage done +Event: 553.306 Executing VM operation: GetObjectMonitorUsage +Event: 553.306 Executing VM operation: GetObjectMonitorUsage done +Event: 553.306 Executing VM operation: GetObjectMonitorUsage +Event: 553.306 Executing VM operation: GetObjectMonitorUsage done +Event: 553.588 Executing VM operation: ParallelGCFailedAllocation + + +Dynamic libraries: +640000000-676680000 rw-p 00000000 00:00 0 +676680000-740000000 ---p 00000000 00:00 0 +740000000-7c0000000 rw-p 00000000 00:00 0 +7c0000000-7c0300000 rw-p 00000000 00:00 0 +7c0300000-800000000 ---p 00000000 00:00 0 +561cf1df6000-561cf1df7000 r-xp 00000000 fe:00 5636728 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java +561cf1ff6000-561cf1ff7000 r--p 00000000 fe:00 5636728 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java +561cf1ff7000-561cf1ff8000 rw-p 00001000 fe:00 5636728 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java +561cf3a4e000-561cf3a6f000 rw-p 00000000 00:00 0 [heap] +7fa7d8000000-7fa7d8021000 rw-p 00000000 00:00 0 +7fa7d8021000-7fa7dc000000 ---p 00000000 00:00 0 +7fa7dc000000-7fa7dde94000 rw-p 00000000 00:00 0 +7fa7dde94000-7fa7e0000000 ---p 00000000 00:00 0 +7fa7e0000000-7fa7e0021000 rw-p 00000000 00:00 0 +7fa7e0021000-7fa7e4000000 ---p 00000000 00:00 0 +7fa7e4000000-7fa7e4021000 rw-p 00000000 00:00 0 +7fa7e4021000-7fa7e8000000 ---p 00000000 00:00 0 +7fa7e8000000-7fa7e8021000 rw-p 00000000 00:00 0 +7fa7e8021000-7fa7ec000000 ---p 00000000 00:00 0 +7fa7ec000000-7fa7ec021000 rw-p 00000000 00:00 0 +7fa7ec021000-7fa7f0000000 ---p 00000000 00:00 0 +7fa7f0000000-7fa7f006a000 rw-p 00000000 00:00 0 +7fa7f006a000-7fa7f4000000 ---p 00000000 00:00 0 +7fa7f4000000-7fa7f40c6000 rw-p 00000000 00:00 0 +7fa7f40c6000-7fa7f8000000 ---p 00000000 00:00 0 +7fa7f8000000-7fa7f8021000 rw-p 00000000 00:00 0 +7fa7f8021000-7fa7fc000000 ---p 00000000 00:00 0 +7fa7fc000000-7fa7fc021000 rw-p 00000000 00:00 0 +7fa7fc021000-7fa800000000 ---p 00000000 00:00 0 +7fa800000000-7fa800021000 rw-p 00000000 00:00 0 +7fa800021000-7fa804000000 ---p 00000000 00:00 0 +7fa804000000-7fa8047ce000 rw-p 00000000 00:00 0 +7fa8047ce000-7fa808000000 ---p 00000000 00:00 0 +7fa808000000-7fa808047000 rw-p 00000000 00:00 0 +7fa808047000-7fa80c000000 ---p 00000000 00:00 0 +7fa80dbeb000-7fa80dc2b000 rw-p 00000000 00:00 0 +7fa80dc2b000-7fa80ddeb000 ---p 00000000 00:00 0 +7fa80ddeb000-7fa80dfeb000 rw-p 00000000 00:00 0 +7fa80dfeb000-7fa80e1eb000 rw-p 00000000 00:00 0 +7fa80e1eb000-7fa80e3eb000 rw-p 00000000 00:00 0 +7fa80e3eb000-7fa80e3ee000 ---p 00000000 00:00 0 +7fa80e3ee000-7fa80e4ec000 rw-p 00000000 00:00 0 +7fa80e4ec000-7fa80e4ef000 ---p 00000000 00:00 0 +7fa80e4ef000-7fa80e5ed000 rw-p 00000000 00:00 0 +7fa80e5ed000-7fa80e5f0000 ---p 00000000 00:00 0 +7fa80e5f0000-7fa80e6ee000 rw-p 00000000 00:00 0 +7fa80e6ee000-7fa80e6f1000 ---p 00000000 00:00 0 +7fa80e6f1000-7fa80e7ef000 rw-p 00000000 00:00 0 +7fa80e7ef000-7fa80e7f2000 ---p 00000000 00:00 0 +7fa80e7f2000-7fa80e8f0000 rw-p 00000000 00:00 0 +7fa80e8f0000-7fa80e8f3000 ---p 00000000 00:00 0 +7fa80e8f3000-7fa80ebf1000 rw-p 00000000 00:00 0 +7fa80ebf1000-7fa80ebf4000 ---p 00000000 00:00 0 +7fa80ebf4000-7fa80ecf2000 rw-p 00000000 00:00 0 +7fa80ecf2000-7fa80ecf5000 ---p 00000000 00:00 0 +7fa80ecf5000-7fa80eff3000 rw-p 00000000 00:00 0 +7fa80eff3000-7fa80f1f3000 rw-p 00000000 00:00 0 +7fa80f1f3000-7fa80f1fa000 r--s 00000000 fe:00 3948161 /var/cache/fontconfig/4be9850f182b35c1350b6bbf2e42601c-le64.cache-4 +7fa80f1fa000-7fa80f1fc000 r--s 00000000 fe:00 3949304 /var/cache/fontconfig/30a99c4256905863f7aa12b5e873c27c-le64.cache-4 +7fa80f1fc000-7fa80f1fd000 r--s 00000000 fe:00 3949299 /var/cache/fontconfig/087e1975ba9a574b140bb1df193bf770-le64.cache-4 +7fa80f1fd000-7fa80f1ff000 r--s 00000000 fe:00 3949280 /var/cache/fontconfig/4bb17da730f63117fed329ee42a5d05e-le64.cache-4 +7fa80f1ff000-7fa80f205000 r--s 00000000 fe:00 3943013 /var/cache/fontconfig/6fe8b0d39a161d19087fe931545dda13-le64.cache-4 +7fa80f205000-7fa80f209000 r--s 00000000 fe:00 3949275 /var/cache/fontconfig/6aa41aa22e18b8fa06a12da28ea9c28b-le64.cache-4 +7fa80f209000-7fa80f214000 r--s 00000000 fe:00 3956051 /var/cache/fontconfig/945677eb7aeaf62f1d50efc3fb3ec7d8-le64.cache-4 +7fa80f214000-7fa80f219000 r--s 00000000 fe:00 3964277 /var/cache/fontconfig/99e8ed0e538f840c565b6ed5dad60d56-le64.cache-4 +7fa80f219000-7fa80f21c000 r--s 00000000 fe:00 3949146 /var/cache/fontconfig/8abd9214ecbfa594f22f45cb5742dd09-le64.cache-4 +7fa80f21c000-7fa80f21f000 r--s 00000000 fe:00 3948704 /var/cache/fontconfig/f24b2111ab8703b4e963115a8cf14259-le64.cache-4 +7fa80f21f000-7fa80f226000 r--s 00000000 fe:00 3948685 /var/cache/fontconfig/63c7aca0c1b0a3f740ee470c2e28e675-le64.cache-4 +7fa80f226000-7fa80f22f000 r--s 00000000 fe:00 3948659 /var/cache/fontconfig/a6d8cf8e4ec09cdbc8633c31745a07dd-le64.cache-4 +7fa80f22f000-7fa80f230000 r--s 00000000 fe:00 3948635 /var/cache/fontconfig/6ab961c03ae23c8941a006873b54e00a-le64.cache-4 +7fa80f230000-7fa80f236000 r--s 00000000 fe:00 3948173 /var/cache/fontconfig/6eb3985aa4124903f6ff08ba781cd364-le64.cache-4 +7fa80f236000-7fa80f23a000 r--s 00000000 fe:00 3964275 /var/cache/fontconfig/6d41288fd70b0be22e8c3a91e032eec0-le64.cache-4 +7fa80f23a000-7fa80f23e000 r--s 00000000 fe:00 3964266 /var/cache/fontconfig/de156ccd2eddbdc19d37a45b8b2aac9c-le64.cache-4 +7fa80f23e000-7fa80f23f000 r--s 00000000 fe:00 3964264 /var/cache/fontconfig/b95bc8ffbebda2bbdae4265e45b8178d-le64.cache-4 +7fa80f23f000-7fa80f240000 r--s 00000000 fe:00 3949322 /var/cache/fontconfig/9c956a7723ca69a44b382d9179c9802f-le64.cache-4 +7fa80f240000-7fa80f241000 r--s 00000000 fe:00 3947860 /var/cache/fontconfig/5d1cca7074f29429a8d18692746c2426-le64.cache-4 +7fa80f241000-7fa80f243000 r--s 00000000 fe:00 3947834 /var/cache/fontconfig/767a8244fc0220cfb567a839d0392e0b-le64.cache-4 +7fa80f243000-7fa80f244000 r--s 00000000 fe:00 3964243 /var/cache/fontconfig/4794a0821666d79190d59a36cb4f44b5-le64.cache-4 +7fa80f244000-7fa80f286000 r--s 00000000 fe:00 3964241 /var/cache/fontconfig/0bd3dc0958fa2205aaaa8ebb13e2872b-le64.cache-4 +7fa80f2ea000-7fa80f2ed000 ---p 00000000 00:00 0 +7fa80f2ed000-7fa80f3eb000 rw-p 00000000 00:00 0 +7fa80f3eb000-7fa80f3ee000 ---p 00000000 00:00 0 +7fa80f3ee000-7fa80f4ec000 rw-p 00000000 00:00 0 +7fa80f4ec000-7fa80f4ef000 ---p 00000000 00:00 0 +7fa80f4ef000-7fa80f5ed000 rw-p 00000000 00:00 0 +7fa80f5ed000-7fa80f5f0000 ---p 00000000 00:00 0 +7fa80f5f0000-7fa80f8ee000 rw-p 00000000 00:00 0 +7fa80f8ee000-7fa80f8f1000 ---p 00000000 00:00 0 +7fa80f8f1000-7fa80f9ef000 rw-p 00000000 00:00 0 +7fa80f9ef000-7fa80f9f4000 r-xp 00000000 fe:00 4213597 /usr/lib/x86_64-linux-gnu/libXfixes.so.3.1.0 +7fa80f9f4000-7fa80fbf3000 ---p 00005000 fe:00 4213597 /usr/lib/x86_64-linux-gnu/libXfixes.so.3.1.0 +7fa80fbf3000-7fa80fbf4000 r--p 00004000 fe:00 4213597 /usr/lib/x86_64-linux-gnu/libXfixes.so.3.1.0 +7fa80fbf4000-7fa80fbf5000 rw-p 00005000 fe:00 4213597 /usr/lib/x86_64-linux-gnu/libXfixes.so.3.1.0 +7fa80fbf5000-7fa80fbff000 r-xp 00000000 fe:00 4201654 /usr/lib/x86_64-linux-gnu/libXcursor.so.1.0.2 +7fa80fbff000-7fa80fdfe000 ---p 0000a000 fe:00 4201654 /usr/lib/x86_64-linux-gnu/libXcursor.so.1.0.2 +7fa80fdfe000-7fa80fdff000 r--p 00009000 fe:00 4201654 /usr/lib/x86_64-linux-gnu/libXcursor.so.1.0.2 +7fa80fdff000-7fa80fe00000 rw-p 0000a000 fe:00 4201654 /usr/lib/x86_64-linux-gnu/libXcursor.so.1.0.2 +7fa80fe00000-7fa810000000 rw-p 00000000 00:00 0 +7fa810000000-7fa810021000 rw-p 00000000 00:00 0 +7fa810021000-7fa814000000 ---p 00000000 00:00 0 +7fa814000000-7fa8143a0000 rw-p 00000000 00:00 0 +7fa8143a0000-7fa818000000 ---p 00000000 00:00 0 +7fa818000000-7fa818aea000 rw-p 00000000 00:00 0 +7fa818aea000-7fa81c000000 ---p 00000000 00:00 0 +7fa81c000000-7fa81c021000 rw-p 00000000 00:00 0 +7fa81c021000-7fa820000000 ---p 00000000 00:00 0 +7fa820000000-7fa822649000 rw-p 00000000 00:00 0 +7fa822649000-7fa824000000 ---p 00000000 00:00 0 +7fa824000000-7fa82701e000 rw-p 00000000 00:00 0 +7fa82701e000-7fa828000000 ---p 00000000 00:00 0 +7fa828000000-7fa828150000 rw-p 00000000 00:00 0 +7fa828150000-7fa82c000000 ---p 00000000 00:00 0 +7fa82c000000-7fa82e749000 rw-p 00000000 00:00 0 +7fa82e749000-7fa830000000 ---p 00000000 00:00 0 +7fa830000000-7fa830021000 rw-p 00000000 00:00 0 +7fa830021000-7fa834000000 ---p 00000000 00:00 0 +7fa834000000-7fa83404f000 rw-p 00000000 00:00 0 +7fa83404f000-7fa838000000 ---p 00000000 00:00 0 +7fa838000000-7fa838021000 rw-p 00000000 00:00 0 +7fa838021000-7fa83c000000 ---p 00000000 00:00 0 +7fa83c000000-7fa83c001000 r--s 00000000 fe:00 3947794 /var/cache/fontconfig/9eae20f1ff8cc0a7d125749e875856bd-le64.cache-4 +7fa83c001000-7fa83c003000 r--s 00000000 fe:00 3964238 /var/cache/fontconfig/bf2c1853a9e9b00bb02fe2e9bcf1e201-le64.cache-4 +7fa83c003000-7fa83c03e000 r--s 00000000 fe:00 3964230 /var/cache/fontconfig/365b55f210c0a22e9a19e35191240f32-le64.cache-4 +7fa83c03e000-7fa83c041000 r--s 00000000 fe:00 3947576 /var/cache/fontconfig/e302478682accd753874ffa0d37e8e3c-le64.cache-4 +7fa83c041000-7fa83c045000 r--s 00000000 fe:00 3964225 /var/cache/fontconfig/c57959a16110560c8d0fcea73374aeeb-le64.cache-4 +7fa83c045000-7fa83c04b000 r--s 00000000 fe:00 3964217 /var/cache/fontconfig/3047814df9a2f067bd2d96a2b9c36e5a-le64.cache-4 +7fa83c04b000-7fa83c053000 r--s 00000000 fe:00 3964215 /var/cache/fontconfig/bf3b770c553c462765856025a94f1ce6-le64.cache-4 +7fa83c053000-7fa83c056000 r--s 00000000 fe:00 3964212 /var/cache/fontconfig/14d493b97896515cad3840ba4896e372-le64.cache-4 +7fa83c056000-7fa83c05e000 r--s 00000000 fe:00 3964187 /var/cache/fontconfig/ce677e824a231659fde4a3a246a10ea3-le64.cache-4 +7fa83c05e000-7fa83c05f000 r--s 00000000 fe:00 3947519 /var/cache/fontconfig/89034621ae2a8922916bb6bfa5799546-le64.cache-4 +7fa83c05f000-7fa83c061000 r--s 00000000 fe:00 3964178 /var/cache/fontconfig/a0107c79d978dfcc5e42cb1335b71036-le64.cache-4 +7fa83c061000-7fa83c064000 r--s 00000000 fe:00 3947514 /var/cache/fontconfig/e49e89034d371f0f9de17aab02136486-le64.cache-4 +7fa83c064000-7fa83c066000 r--s 00000000 fe:00 3964175 /var/cache/fontconfig/4b14b093aebc79c320de5e86ae1d3314-le64.cache-4 +7fa83c066000-7fa83c067000 r--s 00000000 fe:00 3947496 /var/cache/fontconfig/8aec10f4cc8391dcef22ca549f1e4354-le64.cache-4 +7fa83c067000-7fa83c07a000 r--s 00000000 fe:00 3947492 /var/cache/fontconfig/d52a8644073d54c13679302ca1180695-le64.cache-4 +7fa83c07a000-7fa83c07b000 r--s 00000000 fe:00 3947478 /var/cache/fontconfig/8a687c406b77f27d99abfeeba937fcce-le64.cache-4 +7fa83c07b000-7fa83c07d000 r--s 00000000 fe:00 3947468 /var/cache/fontconfig/ae26c1aac6606cb24499bf89ff8f20df-le64.cache-4 +7fa83c07d000-7fa83c083000 r--s 00000000 fe:00 3947424 /var/cache/fontconfig/75ad6aa2358a85f0de2c8ee4837e8227-le64.cache-4 +7fa83c083000-7fa83c084000 r--s 00000000 fe:00 3964173 /var/cache/fontconfig/3f7329c5293ffd510edef78f73874cfd-le64.cache-4 +7fa83c084000-7fa83c085000 r--s 00000000 fe:00 3964161 /var/cache/fontconfig/ac2cf712d852da827a87a9baf682f5b9-le64.cache-4 +7fa83c085000-7fa83c087000 r--s 00000000 fe:00 3947388 /var/cache/fontconfig/65f976e5259cbe6dc7697b8648396239-le64.cache-4 +7fa83c087000-7fa83c093000 r--s 00000000 fe:00 3964149 /var/cache/fontconfig/d589a48862398ed80a3d6066f4f56f4c-le64.cache-4 +7fa83c093000-7fa83c097000 r--s 00000000 fe:00 3947312 /var/cache/fontconfig/246184dc75a16901ca37d96895904249-le64.cache-4 +7fa83c097000-7fa83c09c000 r--s 00000000 fe:00 3964147 /var/cache/fontconfig/b25010134a2e462c779c1c1d5ccbff7b-le64.cache-4 +7fa83c09c000-7fa83c09d000 r--s 00000000 fe:00 3964093 /var/cache/fontconfig/94f7fe9bd33aadfac165873bd010d595-le64.cache-4 +7fa83c09d000-7fa83c09f000 r--s 00000000 fe:00 3964042 /var/cache/fontconfig/423767150eb258c59035de29db6fca84-le64.cache-4 +7fa83c09f000-7fa83c0a0000 r--s 00000000 fe:00 3964020 /var/cache/fontconfig/845c20fd2c4814bcec78e05d37a63ccc-le64.cache-4 +7fa83c0a0000-7fa83c0a1000 r--s 00000000 fe:00 3947297 /var/cache/fontconfig/e7de81b01590fb7e12b38e274e17d0db-le64.cache-4 +7fa83c0a1000-7fa83c0a5000 r--s 00000000 fe:00 3964009 /var/cache/fontconfig/6386b86020ecc1ef9690bb720a13964f-le64.cache-4 +7fa83c0a5000-7fa83c0a7000 r--s 00000000 fe:00 3946899 /var/cache/fontconfig/67709b7835c0f764c1135060c9575660-le64.cache-4 +7fa83c0a7000-7fa83c0a9000 r--s 00000000 fe:00 3946446 /var/cache/fontconfig/099525ddca5eae4f2477b69cf2d7f16d-le64.cache-4 +7fa83c0a9000-7fa83c0da000 r-xp 00000000 fe:00 4195657 /usr/lib/x86_64-linux-gnu/libpng16.so.16.28.0 +7fa83c0da000-7fa83c2da000 ---p 00031000 fe:00 4195657 /usr/lib/x86_64-linux-gnu/libpng16.so.16.28.0 +7fa83c2da000-7fa83c2db000 r--p 00031000 fe:00 4195657 /usr/lib/x86_64-linux-gnu/libpng16.so.16.28.0 +7fa83c2db000-7fa83c2dc000 rw-p 00032000 fe:00 4195657 /usr/lib/x86_64-linux-gnu/libpng16.so.16.28.0 +7fa83c2dc000-7fa83c384000 r-xp 00000000 fe:00 4195679 /usr/lib/x86_64-linux-gnu/libfreetype.so.6.12.3 +7fa83c384000-7fa83c584000 ---p 000a8000 fe:00 4195679 /usr/lib/x86_64-linux-gnu/libfreetype.so.6.12.3 +7fa83c584000-7fa83c58a000 r--p 000a8000 fe:00 4195679 /usr/lib/x86_64-linux-gnu/libfreetype.so.6.12.3 +7fa83c58a000-7fa83c58b000 rw-p 000ae000 fe:00 4195679 /usr/lib/x86_64-linux-gnu/libfreetype.so.6.12.3 +7fa83c58b000-7fa83c5dc000 r-xp 00000000 fe:00 5637288 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libfontmanager.so +7fa83c5dc000-7fa83c7dc000 ---p 00051000 fe:00 5637288 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libfontmanager.so +7fa83c7dc000-7fa83c7de000 r--p 00051000 fe:00 5637288 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libfontmanager.so +7fa83c7de000-7fa83c7df000 rw-p 00053000 fe:00 5637288 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libfontmanager.so +7fa83c7df000-7fa83c9df000 rw-p 00000000 00:00 0 +7fa83c9df000-7fa83c9f2000 r-xp 00000000 fe:00 13631580 /lib/x86_64-linux-gnu/libbsd.so.0.8.3 +7fa83c9f2000-7fa83cbf2000 ---p 00013000 fe:00 13631580 /lib/x86_64-linux-gnu/libbsd.so.0.8.3 +7fa83cbf2000-7fa83cbf3000 r--p 00013000 fe:00 13631580 /lib/x86_64-linux-gnu/libbsd.so.0.8.3 +7fa83cbf3000-7fa83cbf4000 rw-p 00014000 fe:00 13631580 /lib/x86_64-linux-gnu/libbsd.so.0.8.3 +7fa83cbf4000-7fa83cbf5000 rw-p 00000000 00:00 0 +7fa83cbf5000-7fa83cbfa000 r-xp 00000000 fe:00 4195459 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0 +7fa83cbfa000-7fa83cdf9000 ---p 00005000 fe:00 4195459 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0 +7fa83cdf9000-7fa83cdfa000 r--p 00004000 fe:00 4195459 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0 +7fa83cdfa000-7fa83cdfb000 rw-p 00005000 fe:00 4195459 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0 +7fa83cdfb000-7fa83cdfe000 r-xp 00000000 fe:00 4201545 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0 +7fa83cdfe000-7fa83cffd000 ---p 00003000 fe:00 4201545 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0 +7fa83cffd000-7fa83cffe000 r--p 00002000 fe:00 4201545 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0 +7fa83cffe000-7fa83cfff000 rw-p 00003000 fe:00 4201545 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0 +7fa83cfff000-7fa840000000 rw-p 00000000 00:00 0 +7fa840000000-7fa840021000 rw-p 00000000 00:00 0 +7fa840021000-7fa844000000 ---p 00000000 00:00 0 +7fa844000000-7fa8444b4000 rw-p 00000000 00:00 0 +7fa8444b4000-7fa848000000 ---p 00000000 00:00 0 +7fa848000000-7fa848021000 rw-p 00000000 00:00 0 +7fa848021000-7fa84c000000 ---p 00000000 00:00 0 +7fa84c000000-7fa84c021000 rw-p 00000000 00:00 0 +7fa84c021000-7fa850000000 ---p 00000000 00:00 0 +7fa850000000-7fa850290000 rw-p 00000000 00:00 0 +7fa850290000-7fa854000000 ---p 00000000 00:00 0 +7fa854000000-7fa860000000 rw-p 00000000 00:00 0 +7fa860000000-7fa8601bd000 rw-p 00000000 00:00 0 +7fa8601bd000-7fa864000000 ---p 00000000 00:00 0 +7fa864000000-7fa864001000 r--s 00000000 fe:00 3963969 /var/cache/fontconfig/406a1d2d2bf3ed7664fbadefac0b2f66-le64.cache-4 +7fa864001000-7fa864003000 r--s 00000000 fe:00 3945697 /var/cache/fontconfig/61092ac79d9058a69eda095afa0a78f1-le64.cache-4 +7fa864003000-7fa864005000 r--s 00000000 fe:00 3945417 /var/cache/fontconfig/a722efc6911bbe16667b1a77497ffd37-le64.cache-4 +7fa864005000-7fa864007000 r--s 00000000 fe:00 3960872 /var/cache/fontconfig/d63fdd8e0f42559533dd777c334fdfcc-le64.cache-4 +7fa864007000-7fa864009000 r--s 00000000 fe:00 3945408 /var/cache/fontconfig/cd63710f51234b393f53f897aee7cf76-le64.cache-4 +7fa864009000-7fa864017000 r--s 00000000 fe:00 3960307 /var/cache/fontconfig/30829fa25452a46451e813d634d7f916-le64.cache-4 +7fa864017000-7fa864024000 r--s 00000000 fe:00 3942829 /var/cache/fontconfig/198d8fcf01c96d0cf813f74fd759bdb7-le64.cache-4 +7fa864024000-7fa864027000 r--s 00000000 fe:00 3945129 /var/cache/fontconfig/75114ca45c98e8a441da0ff356701271-le64.cache-4 +7fa864027000-7fa864032000 r--s 00000000 fe:00 3945087 /var/cache/fontconfig/83bf95040141907cd45bb53cf7c1c148-le64.cache-4 +7fa864032000-7fa864044000 r--s 00000000 fe:00 3945072 /var/cache/fontconfig/9b89f8e3dae116d678bbf48e5f21f69b-le64.cache-4 +7fa864044000-7fa86404d000 r--s 00000000 fe:00 3956052 /var/cache/fontconfig/d0972c3d32f097851eb916381fc38920-le64.cache-4 +7fa86404d000-7fa86404f000 r--s 00000000 fe:00 3949346 /var/cache/fontconfig/6e6b34ae150a7ad95e82fb4a522f0bda-le64.cache-4 +7fa86404f000-7fa864056000 r--s 00000000 fe:00 3945005 /var/cache/fontconfig/53d14c92082a93e67d5078324eb314ca-le64.cache-4 +7fa864056000-7fa86405a000 r--s 00000000 fe:00 3944997 /var/cache/fontconfig/6c08beecf0dac481ec92e759e0c2e6d7-le64.cache-4 +7fa86405a000-7fa86406d000 r--s 00000000 fe:00 3949342 /var/cache/fontconfig/4ac51e5cfbc76fc3f983e470323a16d3-le64.cache-4 +7fa86406d000-7fa86409b000 r--s 00000000 fe:00 3966974 /var/cache/fontconfig/cabbd14511b9e8a55e92af97fb3a0461-le64.cache-4 +7fa86409b000-7fa8640bc000 r--s 00000000 fe:00 3945523 /var/cache/fontconfig/e13b20fdb08344e0e664864cc2ede53d-le64.cache-4 +7fa8640bc000-7fa8640e3000 r-xp 00000000 fe:00 4195465 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0 +7fa8640e3000-7fa8642e2000 ---p 00027000 fe:00 4195465 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0 +7fa8642e2000-7fa8642e3000 r--p 00026000 fe:00 4195465 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0 +7fa8642e3000-7fa8642e4000 rw-p 00027000 fe:00 4195465 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0 +7fa8642e4000-7fa8642f3000 r-xp 00000000 fe:00 4201652 /usr/lib/x86_64-linux-gnu/libXi.so.6.1.0 +7fa8642f3000-7fa8644f2000 ---p 0000f000 fe:00 4201652 /usr/lib/x86_64-linux-gnu/libXi.so.6.1.0 +7fa8644f2000-7fa8644f3000 r--p 0000e000 fe:00 4201652 /usr/lib/x86_64-linux-gnu/libXi.so.6.1.0 +7fa8644f3000-7fa8644f4000 rw-p 0000f000 fe:00 4201652 /usr/lib/x86_64-linux-gnu/libXi.so.6.1.0 +7fa8644f4000-7fa8644f9000 r-xp 00000000 fe:00 4202296 /usr/lib/x86_64-linux-gnu/libXtst.so.6.1.0 +7fa8644f9000-7fa8646f8000 ---p 00005000 fe:00 4202296 /usr/lib/x86_64-linux-gnu/libXtst.so.6.1.0 +7fa8646f8000-7fa8646f9000 r--p 00004000 fe:00 4202296 /usr/lib/x86_64-linux-gnu/libXtst.so.6.1.0 +7fa8646f9000-7fa8646fa000 rw-p 00005000 fe:00 4202296 /usr/lib/x86_64-linux-gnu/libXtst.so.6.1.0 +7fa8646fa000-7fa864703000 r-xp 00000000 fe:00 4213603 /usr/lib/x86_64-linux-gnu/libXrender.so.1.3.0 +7fa864703000-7fa864902000 ---p 00009000 fe:00 4213603 /usr/lib/x86_64-linux-gnu/libXrender.so.1.3.0 +7fa864902000-7fa864903000 r--p 00008000 fe:00 4213603 /usr/lib/x86_64-linux-gnu/libXrender.so.1.3.0 +7fa864903000-7fa864904000 rw-p 00009000 fe:00 4213603 /usr/lib/x86_64-linux-gnu/libXrender.so.1.3.0 +7fa864904000-7fa864a3e000 r-xp 00000000 fe:00 4213112 /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0 +7fa864a3e000-7fa864c3e000 ---p 0013a000 fe:00 4213112 /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0 +7fa864c3e000-7fa864c3f000 r--p 0013a000 fe:00 4213112 /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0 +7fa864c3f000-7fa864c44000 rw-p 0013b000 fe:00 4213112 /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0 +7fa864c44000-7fa864c55000 r-xp 00000000 fe:00 4213154 /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0 +7fa864c55000-7fa864e54000 ---p 00011000 fe:00 4213154 /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0 +7fa864e54000-7fa864e55000 r--p 00010000 fe:00 4213154 /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0 +7fa864e55000-7fa864e56000 rw-p 00011000 fe:00 4213154 /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0 +7fa864e56000-7fa864e57000 r--s 00000000 fe:00 3949345 /var/cache/fontconfig/3334a778d104e76d188e9df399bc24d2-le64.cache-4 +7fa864e57000-7fa864e5b000 r--s 00000000 fe:00 3944861 /var/cache/fontconfig/4d6aee6d44eccb37054d3216e945f618-le64.cache-4 +7fa864e5b000-7fa864e5f000 r--s 00000000 fe:00 3944403 /var/cache/fontconfig/d6c6df98c3df5faf9bd0f8ef4d91efe5-le64.cache-4 +7fa864e5f000-7fa864e63000 r--s 00000000 fe:00 3944228 /var/cache/fontconfig/9fb319ef52839f11ee26ab8b4cffa12b-le64.cache-4 +7fa864e63000-7fa864e65000 r--s 00000000 fe:00 3944223 /var/cache/fontconfig/43bfe21a9e1edebcf703d79ee2950b06-le64.cache-4 +7fa864e65000-7fa864e68000 r--s 00000000 fe:00 3944183 /var/cache/fontconfig/c19b55eb3b4c5b40ea175e31682068a5-le64.cache-4 +7fa864e68000-7fa864e69000 r--s 00000000 fe:00 3944127 /var/cache/fontconfig/c277e94e32b20404286a1ddafa5a80f0-le64.cache-4 +7fa864e69000-7fa864e6c000 r--s 00000000 fe:00 3944017 /var/cache/fontconfig/bf6ddb0059d58ea573e04b43f868001f-le64.cache-4 +7fa864e6c000-7fa864e72000 r--s 00000000 fe:00 3949336 /var/cache/fontconfig/3629f2adf904f9a612908891fae71ceb-le64.cache-4 +7fa864e72000-7fa864e73000 r--s 00000000 fe:00 3939294 /var/cache/fontconfig/847873b78f4863b92430446bba8d7407-le64.cache-4 +7fa864e73000-7fa864e76000 r--s 00000000 fe:00 3942508 /var/cache/fontconfig/de83a0a961185c8bd1f159015d56c039-le64.cache-4 +7fa864e76000-7fa864e7b000 r--s 00000000 fe:00 3945148 /var/cache/fontconfig/7ef2298fde41cc6eeb7af42e48b7d293-le64.cache-4 +7fa864e7b000-7fa864e88000 r--s 00000000 fe:00 3966981 /var/cache/fontconfig/8f02d4cb045bd6ce15663e43f347c9f8-le64.cache-4 +7fa864e88000-7fa864ea6000 r--s 00000000 fe:00 3949327 /var/cache/fontconfig/467c019e582ee353435ea5c21d137ef6-le64.cache-4 +7fa864ea6000-7fa864efa000 r-xp 00000000 fe:00 5637286 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libawt_xawt.so +7fa864efa000-7fa8650f9000 ---p 00054000 fe:00 5637286 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libawt_xawt.so +7fa8650f9000-7fa8650fa000 r--p 00053000 fe:00 5637286 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libawt_xawt.so +7fa8650fa000-7fa8650fd000 rw-p 00054000 fe:00 5637286 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libawt_xawt.so +7fa8650fd000-7fa8650fe000 rw-p 00000000 00:00 0 +7fa8650fe000-7fa86519e000 r-xp 00000000 fe:00 5637284 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libawt.so +7fa86519e000-7fa86539e000 ---p 000a0000 fe:00 5637284 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libawt.so +7fa86539e000-7fa86539f000 r--p 000a0000 fe:00 5637284 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libawt.so +7fa86539f000-7fa8653aa000 rw-p 000a1000 fe:00 5637284 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libawt.so +7fa8653aa000-7fa8653cf000 rw-p 00000000 00:00 0 +7fa8653cf000-7fa8653d2000 ---p 00000000 00:00 0 +7fa8653d2000-7fa8656d0000 rw-p 00000000 00:00 0 +7fa8656d0000-7fa8656d1000 ---p 00000000 00:00 0 +7fa8656d1000-7fa8657d1000 rw-p 00000000 00:00 0 +7fa8657d1000-7fa8657d4000 ---p 00000000 00:00 0 +7fa8657d4000-7fa8658d2000 rw-p 00000000 00:00 0 +7fa8658d2000-7fa8658d5000 ---p 00000000 00:00 0 +7fa8658d5000-7fa8659d3000 rw-p 00000000 00:00 0 +7fa8659d3000-7fa8659d6000 ---p 00000000 00:00 0 +7fa8659d6000-7fa865ad4000 rw-p 00000000 00:00 0 +7fa865ad4000-7fa865ad7000 ---p 00000000 00:00 0 +7fa865ad7000-7fa865bd5000 rw-p 00000000 00:00 0 +7fa865bd5000-7fa865bd8000 ---p 00000000 00:00 0 +7fa865bd8000-7fa865cd6000 rw-p 00000000 00:00 0 +7fa865cd6000-7fa865ce9000 r--s 00346000 fe:00 5637359 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/resources.jar +7fa865ce9000-7fa865e0e000 rw-s 00000000 00:26 80257965 /tmp/jfluidbuf7884679545644221388.tmp +7fa865e0e000-7fa865e11000 ---p 00000000 00:00 0 +7fa865e11000-7fa865e47000 rw-p 00000000 00:00 0 +7fa865e47000-7fa865e4a000 ---p 00000000 00:00 0 +7fa865e4a000-7fa865f48000 rw-p 00000000 00:00 0 +7fa865f48000-7fa865f59000 r-xp 00000000 fe:00 5637307 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libnio.so +7fa865f59000-7fa866159000 ---p 00011000 fe:00 5637307 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libnio.so +7fa866159000-7fa86615a000 r--p 00011000 fe:00 5637307 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libnio.so +7fa86615a000-7fa86615b000 rw-p 00012000 fe:00 5637307 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libnio.so +7fa86615b000-7fa866164000 r-xp 00000000 fe:00 5637304 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libmanagement.so +7fa866164000-7fa866363000 ---p 00009000 fe:00 5637304 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libmanagement.so +7fa866363000-7fa866364000 r--p 00008000 fe:00 5637304 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libmanagement.so +7fa866364000-7fa866365000 rw-p 00009000 fe:00 5637304 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libmanagement.so +7fa866365000-7fa866368000 ---p 00000000 00:00 0 +7fa866368000-7fa866466000 rw-p 00000000 00:00 0 +7fa866466000-7fa866469000 ---p 00000000 00:00 0 +7fa866469000-7fa866567000 rw-p 00000000 00:00 0 +7fa866567000-7fa86657e000 r-xp 00000000 fe:00 5637306 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libnet.so +7fa86657e000-7fa86677d000 ---p 00017000 fe:00 5637306 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libnet.so +7fa86677d000-7fa86677e000 r--p 00016000 fe:00 5637306 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libnet.so +7fa86677e000-7fa86677f000 rw-p 00017000 fe:00 5637306 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libnet.so +7fa86677f000-7fa866782000 ---p 00000000 00:00 0 +7fa866782000-7fa866880000 rw-p 00000000 00:00 0 +7fa866880000-7fa866883000 ---p 00000000 00:00 0 +7fa866883000-7fa866981000 rw-p 00000000 00:00 0 +7fa866981000-7fa8672f3000 r--p 00000000 fe:00 4197173 /usr/lib/locale/locale-archive +7fa8672f3000-7fa8672f6000 ---p 00000000 00:00 0 +7fa8672f6000-7fa8673f4000 rw-p 00000000 00:00 0 +7fa8673f4000-7fa8673f7000 ---p 00000000 00:00 0 +7fa8673f7000-7fa8674f5000 rw-p 00000000 00:00 0 +7fa8674f5000-7fa8674f6000 ---p 00000000 00:00 0 +7fa8674f6000-7fa868000000 rw-p 00000000 00:00 0 +7fa868000000-7fa868021000 rw-p 00000000 00:00 0 +7fa868021000-7fa86c000000 ---p 00000000 00:00 0 +7fa86c000000-7fa86ccb2000 rw-p 00000000 00:00 0 +7fa86ccb2000-7fa870000000 ---p 00000000 00:00 0 +7fa870000000-7fa87015c000 rw-p 00000000 00:00 0 +7fa87015c000-7fa874000000 ---p 00000000 00:00 0 +7fa874000000-7fa875188000 rw-p 00000000 00:00 0 +7fa875188000-7fa878000000 ---p 00000000 00:00 0 +7fa878000000-7fa878fd9000 rw-p 00000000 00:00 0 +7fa878fd9000-7fa87c000000 ---p 00000000 00:00 0 +7fa87c000000-7fa87c201000 rw-p 00000000 00:00 0 +7fa87c201000-7fa880000000 ---p 00000000 00:00 0 +7fa880000000-7fa880221000 rw-p 00000000 00:00 0 +7fa880221000-7fa884000000 ---p 00000000 00:00 0 +7fa884000000-7fa884002000 r--s 00000000 fe:00 3949333 /var/cache/fontconfig/62f91419b9ebdb6975e7e41ab6412357-le64.cache-4 +7fa884002000-7fa884005000 r--s 00000000 fe:00 3966983 /var/cache/fontconfig/16326683038b281783a0ef8c680e3a10-le64.cache-4 +7fa884005000-7fa88400a000 r--s 002f9000 fe:00 5637317 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/charsets.jar +7fa88400a000-7fa88400f000 r--s 0009a000 fe:00 5637349 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/jsse.jar +7fa88400f000-7fa884018000 r--s 0006f000 fe:01 44958046 /home/lfischer/.m2/repository/log4j/log4j/1.2.17/log4j-1.2.17.jar +7fa884018000-7fa884033000 r--s 00394000 fe:00 5637325 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/cldrdata.jar +7fa884033000-7fa88404e000 r--s 001d6000 fe:00 5637330 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/nashorn.jar +7fa88404e000-7fa8852b5000 rw-p 00000000 00:00 0 +7fa8852b5000-7fa885483000 r--s 03c15000 fe:00 5642133 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/rt.jar +7fa885483000-7fa8868f9000 rw-p 00000000 00:00 0 +7fa8868f9000-7fa8868fa000 ---p 00000000 00:00 0 +7fa8868fa000-7fa8869fa000 rw-p 00000000 00:00 0 +7fa8869fa000-7fa8869fb000 ---p 00000000 00:00 0 +7fa8869fb000-7fa886afb000 rw-p 00000000 00:00 0 +7fa886afb000-7fa886afc000 ---p 00000000 00:00 0 +7fa886afc000-7fa886bfc000 rw-p 00000000 00:00 0 +7fa886bfc000-7fa886bfd000 ---p 00000000 00:00 0 +7fa886bfd000-7fa886cfd000 rw-p 00000000 00:00 0 +7fa886cfd000-7fa886cfe000 ---p 00000000 00:00 0 +7fa886cfe000-7fa886dfe000 rw-p 00000000 00:00 0 +7fa886dfe000-7fa886dff000 ---p 00000000 00:00 0 +7fa886dff000-7fa886eff000 rw-p 00000000 00:00 0 +7fa886eff000-7fa886f00000 ---p 00000000 00:00 0 +7fa886f00000-7fa8871b4000 rw-p 00000000 00:00 0 +7fa8871b4000-7fa887800000 ---p 00000000 00:00 0 +7fa887800000-7fa8879b4000 rw-p 00000000 00:00 0 +7fa8879b4000-7fa888000000 ---p 00000000 00:00 0 +7fa888000000-7fa888400000 rw-p 00000000 00:00 0 +7fa888400000-7fa88843f000 rw-p 00000000 00:00 0 +7fa88843f000-7fa8887c1000 ---p 00000000 00:00 0 +7fa8887c1000-7fa889721000 rwxp 00000000 00:00 0 +7fa889721000-7fa8977c1000 ---p 00000000 00:00 0 +7fa8977c1000-7fa8977c9000 r-xp 00000000 fe:00 5637314 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libzip.so +7fa8977c9000-7fa8979c8000 ---p 00008000 fe:00 5637314 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libzip.so +7fa8979c8000-7fa8979c9000 r--p 00007000 fe:00 5637314 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libzip.so +7fa8979c9000-7fa8979ca000 rw-p 00008000 fe:00 5637314 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libzip.so +7fa8979ca000-7fa8979d4000 r-xp 00000000 fe:00 13632197 /lib/x86_64-linux-gnu/libnss_files-2.24.so +7fa8979d4000-7fa897bd4000 ---p 0000a000 fe:00 13632197 /lib/x86_64-linux-gnu/libnss_files-2.24.so +7fa897bd4000-7fa897bd5000 r--p 0000a000 fe:00 13632197 /lib/x86_64-linux-gnu/libnss_files-2.24.so +7fa897bd5000-7fa897bd6000 rw-p 0000b000 fe:00 13632197 /lib/x86_64-linux-gnu/libnss_files-2.24.so +7fa897bd6000-7fa897bdc000 rw-p 00000000 00:00 0 +7fa897bdc000-7fa897be7000 r-xp 00000000 fe:00 13632201 /lib/x86_64-linux-gnu/libnss_nis-2.24.so +7fa897be7000-7fa897de6000 ---p 0000b000 fe:00 13632201 /lib/x86_64-linux-gnu/libnss_nis-2.24.so +7fa897de6000-7fa897de7000 r--p 0000a000 fe:00 13632201 /lib/x86_64-linux-gnu/libnss_nis-2.24.so +7fa897de7000-7fa897de8000 rw-p 0000b000 fe:00 13632201 /lib/x86_64-linux-gnu/libnss_nis-2.24.so +7fa897de8000-7fa897dfc000 r-xp 00000000 fe:00 13632191 /lib/x86_64-linux-gnu/libnsl-2.24.so +7fa897dfc000-7fa897ffc000 ---p 00014000 fe:00 13632191 /lib/x86_64-linux-gnu/libnsl-2.24.so +7fa897ffc000-7fa897ffd000 r--p 00014000 fe:00 13632191 /lib/x86_64-linux-gnu/libnsl-2.24.so +7fa897ffd000-7fa897ffe000 rw-p 00015000 fe:00 13632191 /lib/x86_64-linux-gnu/libnsl-2.24.so +7fa897ffe000-7fa898000000 rw-p 00000000 00:00 0 +7fa898000000-7fa898acd000 rw-p 00000000 00:00 0 +7fa898acd000-7fa89c000000 ---p 00000000 00:00 0 +7fa89c000000-7fa89c001000 r--s 00000000 fe:00 3938605 /var/cache/fontconfig/573ec803664ed168555e0e8b6d0f0c7f-le64.cache-4 +7fa89c001000-7fa89c002000 r--s 00000000 fe:00 3966980 /var/cache/fontconfig/e0aa53bcfa504e64f87823c16bc01eb6-le64.cache-4 +7fa89c002000-7fa89c003000 r--p 00000000 fe:00 4200640 /usr/share/locale/en_GB/LC_MESSAGES/libc.mo +7fa89c003000-7fa89c007000 r--s 00066000 fe:00 12988314 /media/lfischer/exthome/Applications/netbeans-8.2/profiler/lib/jfluid-server.jar +7fa89c007000-7fa89c00f000 r--s 00085000 fe:01 44958086 /home/lfischer/.m2/repository/xxindex/xxindex/0.11/xxindex-0.11.jar +7fa89c00f000-7fa89c013000 r--s 0002a000 fe:01 44958045 /home/lfischer/.m2/repository/commons-io/commons-io/2.4/commons-io-2.4.jar +7fa89c013000-7fa89c06e000 rw-p 00000000 00:00 0 +7fa89c06e000-7fa89c06f000 ---p 00000000 00:00 0 +7fa89c06f000-7fa89c16f000 rw-p 00000000 00:00 0 +7fa89c16f000-7fa89c176000 r-xp 00000000 fe:00 13632193 /lib/x86_64-linux-gnu/libnss_compat-2.24.so +7fa89c176000-7fa89c375000 ---p 00007000 fe:00 13632193 /lib/x86_64-linux-gnu/libnss_compat-2.24.so +7fa89c375000-7fa89c376000 r--p 00006000 fe:00 13632193 /lib/x86_64-linux-gnu/libnss_compat-2.24.so +7fa89c376000-7fa89c377000 rw-p 00007000 fe:00 13632193 /lib/x86_64-linux-gnu/libnss_compat-2.24.so +7fa89c377000-7fa89c380000 r-xp 00000000 fe:00 12988261 /media/lfischer/exthome/Applications/netbeans-8.2/profiler/lib/deployed/jdk16/linux-amd64/libprofilerinterface.so +7fa89c380000-7fa89c480000 ---p 00009000 fe:00 12988261 /media/lfischer/exthome/Applications/netbeans-8.2/profiler/lib/deployed/jdk16/linux-amd64/libprofilerinterface.so +7fa89c480000-7fa89c481000 rw-p 00009000 fe:00 12988261 /media/lfischer/exthome/Applications/netbeans-8.2/profiler/lib/deployed/jdk16/linux-amd64/libprofilerinterface.so +7fa89c481000-7fa89c4ae000 r-xp 00000000 fe:00 5637295 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libjava.so +7fa89c4ae000-7fa89c6ad000 ---p 0002d000 fe:00 5637295 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libjava.so +7fa89c6ad000-7fa89c6ae000 r--p 0002c000 fe:00 5637295 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libjava.so +7fa89c6ae000-7fa89c6b0000 rw-p 0002d000 fe:00 5637295 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libjava.so +7fa89c6b0000-7fa89c6bf000 r-xp 00000000 fe:00 5637313 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libverify.so +7fa89c6bf000-7fa89c8bf000 ---p 0000f000 fe:00 5637313 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libverify.so +7fa89c8bf000-7fa89c8c1000 r--p 0000f000 fe:00 5637313 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libverify.so +7fa89c8c1000-7fa89c8c2000 rw-p 00011000 fe:00 5637313 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libverify.so +7fa89c8c2000-7fa89c8c9000 r-xp 00000000 fe:00 13632209 /lib/x86_64-linux-gnu/librt-2.24.so +7fa89c8c9000-7fa89cac8000 ---p 00007000 fe:00 13632209 /lib/x86_64-linux-gnu/librt-2.24.so +7fa89cac8000-7fa89cac9000 r--p 00006000 fe:00 13632209 /lib/x86_64-linux-gnu/librt-2.24.so +7fa89cac9000-7fa89caca000 rw-p 00007000 fe:00 13632209 /lib/x86_64-linux-gnu/librt-2.24.so +7fa89caca000-7fa89cae0000 r-xp 00000000 fe:00 13631493 /lib/x86_64-linux-gnu/libgcc_s.so.1 +7fa89cae0000-7fa89ccdf000 ---p 00016000 fe:00 13631493 /lib/x86_64-linux-gnu/libgcc_s.so.1 +7fa89ccdf000-7fa89cce0000 r--p 00015000 fe:00 13631493 /lib/x86_64-linux-gnu/libgcc_s.so.1 +7fa89cce0000-7fa89cce1000 rw-p 00016000 fe:00 13631493 /lib/x86_64-linux-gnu/libgcc_s.so.1 +7fa89cce1000-7fa89cde4000 r-xp 00000000 fe:00 13632186 /lib/x86_64-linux-gnu/libm-2.24.so +7fa89cde4000-7fa89cfe3000 ---p 00103000 fe:00 13632186 /lib/x86_64-linux-gnu/libm-2.24.so +7fa89cfe3000-7fa89cfe4000 r--p 00102000 fe:00 13632186 /lib/x86_64-linux-gnu/libm-2.24.so +7fa89cfe4000-7fa89cfe5000 rw-p 00103000 fe:00 13632186 /lib/x86_64-linux-gnu/libm-2.24.so +7fa89cfe5000-7fa89d157000 r-xp 00000000 fe:00 4218310 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22 +7fa89d157000-7fa89d357000 ---p 00172000 fe:00 4218310 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22 +7fa89d357000-7fa89d361000 r--p 00172000 fe:00 4218310 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22 +7fa89d361000-7fa89d363000 rw-p 0017c000 fe:00 4218310 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22 +7fa89d363000-7fa89d367000 rw-p 00000000 00:00 0 +7fa89d367000-7fa89dfbf000 r-xp 00000000 fe:00 5637316 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so +7fa89dfbf000-7fa89e1bf000 ---p 00c58000 fe:00 5637316 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so +7fa89e1bf000-7fa89e252000 r--p 00c58000 fe:00 5637316 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so +7fa89e252000-7fa89e27b000 rw-p 00ceb000 fe:00 5637316 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so +7fa89e27b000-7fa89e2ab000 rw-p 00000000 00:00 0 +7fa89e2ab000-7fa89e440000 r-xp 00000000 fe:00 13632178 /lib/x86_64-linux-gnu/libc-2.24.so +7fa89e440000-7fa89e640000 ---p 00195000 fe:00 13632178 /lib/x86_64-linux-gnu/libc-2.24.so +7fa89e640000-7fa89e644000 r--p 00195000 fe:00 13632178 /lib/x86_64-linux-gnu/libc-2.24.so +7fa89e644000-7fa89e646000 rw-p 00199000 fe:00 13632178 /lib/x86_64-linux-gnu/libc-2.24.so +7fa89e646000-7fa89e64a000 rw-p 00000000 00:00 0 +7fa89e64a000-7fa89e64d000 r-xp 00000000 fe:00 13632184 /lib/x86_64-linux-gnu/libdl-2.24.so +7fa89e64d000-7fa89e84c000 ---p 00003000 fe:00 13632184 /lib/x86_64-linux-gnu/libdl-2.24.so +7fa89e84c000-7fa89e84d000 r--p 00002000 fe:00 13632184 /lib/x86_64-linux-gnu/libdl-2.24.so +7fa89e84d000-7fa89e84e000 rw-p 00003000 fe:00 13632184 /lib/x86_64-linux-gnu/libdl-2.24.so +7fa89e84e000-7fa89e85b000 r-xp 00000000 fe:00 5637280 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/jli/libjli.so +7fa89e85b000-7fa89ea5b000 ---p 0000d000 fe:00 5637280 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/jli/libjli.so +7fa89ea5b000-7fa89ea5c000 r--p 0000d000 fe:00 5637280 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/jli/libjli.so +7fa89ea5c000-7fa89ea5d000 rw-p 0000e000 fe:00 5637280 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/jli/libjli.so +7fa89ea5d000-7fa89ea76000 r-xp 00000000 fe:00 13631537 /lib/x86_64-linux-gnu/libz.so.1.2.8 +7fa89ea76000-7fa89ec75000 ---p 00019000 fe:00 13631537 /lib/x86_64-linux-gnu/libz.so.1.2.8 +7fa89ec75000-7fa89ec76000 r--p 00018000 fe:00 13631537 /lib/x86_64-linux-gnu/libz.so.1.2.8 +7fa89ec76000-7fa89ec77000 rw-p 00019000 fe:00 13631537 /lib/x86_64-linux-gnu/libz.so.1.2.8 +7fa89ec77000-7fa89ec8f000 r-xp 00000000 fe:00 13632206 /lib/x86_64-linux-gnu/libpthread-2.24.so +7fa89ec8f000-7fa89ee8e000 ---p 00018000 fe:00 13632206 /lib/x86_64-linux-gnu/libpthread-2.24.so +7fa89ee8e000-7fa89ee8f000 r--p 00017000 fe:00 13632206 /lib/x86_64-linux-gnu/libpthread-2.24.so +7fa89ee8f000-7fa89ee90000 rw-p 00018000 fe:00 13632206 /lib/x86_64-linux-gnu/libpthread-2.24.so +7fa89ee90000-7fa89ee94000 rw-p 00000000 00:00 0 +7fa89ee94000-7fa89eeb7000 r-xp 00000000 fe:00 13631570 /lib/x86_64-linux-gnu/ld-2.24.so +7fa89eeb7000-7fa89eeb9000 r--s 0000e000 fe:01 44958047 /home/lfischer/.m2/repository/commons-logging/commons-logging/1.2/commons-logging-1.2.jar +7fa89eeb9000-7fa89eec0000 r--s 0003d000 fe:01 44958065 /home/lfischer/.m2/repository/mzidentml/jmzidentml/1.1.3/jmzidentml-1.1.3.jar +7fa89eec0000-7fa89eec1000 r--s 00006000 fe:00 12988313 /media/lfischer/exthome/Applications/netbeans-8.2/profiler/lib/jfluid-server-15.jar +7fa89eec1000-7fa89eec6000 r--s 0003b000 fe:00 5637332 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/sunjce_provider.jar +7fa89eec6000-7fa89ef5f000 rw-p 00000000 00:00 0 +7fa89ef5f000-7fa89ef62000 ---p 00000000 00:00 0 +7fa89ef62000-7fa89f064000 rw-p 00000000 00:00 0 +7fa89f064000-7fa89f066000 r--s 00001000 fe:00 5637326 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/dnsns.jar +7fa89f066000-7fa89f069000 r--s 0000f000 fe:00 5637327 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/icedtea-sound.jar +7fa89f069000-7fa89f06b000 r--s 00007000 fe:00 4589502 /usr/share/java/java-atk-wrapper.jar +7fa89f06b000-7fa89f06c000 r--s 0000a000 fe:00 5637328 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/jaccess.jar +7fa89f06c000-7fa89f076000 r--s 00116000 fe:00 5637329 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/localedata.jar +7fa89f076000-7fa89f077000 r--s 00010000 fe:00 5637334 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/zipfs.jar +7fa89f077000-7fa89f079000 r--s 00008000 fe:00 5637331 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/sunec.jar +7fa89f079000-7fa89f07d000 r--s 00037000 fe:00 5637333 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/sunpkcs11.jar +7fa89f07d000-7fa89f07e000 r--s 00006000 fe:00 12988313 /media/lfischer/exthome/Applications/netbeans-8.2/profiler/lib/jfluid-server-15.jar +7fa89f07e000-7fa89f082000 r--s 00066000 fe:00 12988314 /media/lfischer/exthome/Applications/netbeans-8.2/profiler/lib/jfluid-server.jar +7fa89f082000-7fa89f0aa000 rw-p 00000000 00:00 0 +7fa89f0aa000-7fa89f0b2000 rw-s 00000000 00:26 80270648 /tmp/hsperfdata_lfischer/31369 +7fa89f0b2000-7fa89f0b3000 rw-p 00000000 00:00 0 +7fa89f0b3000-7fa89f0b4000 ---p 00000000 00:00 0 +7fa89f0b4000-7fa89f0b7000 rw-p 00000000 00:00 0 +7fa89f0b7000-7fa89f0b8000 r--p 00023000 fe:00 13631570 /lib/x86_64-linux-gnu/ld-2.24.so +7fa89f0b8000-7fa89f0b9000 rw-p 00024000 fe:00 13631570 /lib/x86_64-linux-gnu/ld-2.24.so +7fa89f0b9000-7fa89f0ba000 rw-p 00000000 00:00 0 +7ffea4b4e000-7ffea4b6f000 rw-p 00000000 00:00 0 [stack] +7ffea4b79000-7ffea4b7b000 r--p 00000000 00:00 0 [vvar] +7ffea4b7b000-7ffea4b7d000 r-xp 00000000 00:00 0 [vdso] +ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall] + +VM Arguments: +jvm_args: -agentpath:/home/lfischer/Applications/netbeans-8.2/profiler/lib/deployed/jdk16/linux-amd64/libprofilerinterface.so=/home/lfischer/Applications/netbeans-8.2/profiler/lib,5140,10 -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/home/lfischer/.cache/netbeans/8.2/mavencachedirs/896928920/org-netbeans-modules-profiler -Xmx6g +java_command: org.rappsilber.fdr.gui.FDRGUI +java_class_path (initial): /home/lfischer/Dropbox/xiFDR/target/classes:/home/lfischer/.m2/repository/mzidentml/jmzidentml/1.1.3/jmzidentml-1.1.3.jar:/home/lfischer/.m2/repository/commons-io/commons-io/2.4/commons-io-2.4.jar:/home/lfischer/.m2/repository/commons-logging/commons-logging/1.2/commons-logging-1.2.jar:/home/lfischer/.m2/repository/xxindex/xxindex/0.11/xxindex-0.11.jar:/home/lfischer/.m2/repository/log4j/log4j/1.2.17/log4j-1.2.17.jar:/home/lfischer/NetBeansProjects/RUtils/target/classes:/home/lfischer/NetBeansProjects/CSVParser/target/classes +Launcher Type: SUN_STANDARD + +Environment Variables: +JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 +PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/lfischer/bin +LD_LIBRARY_PATH=/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/i386: +SHELL=/bin/bash +DISPLAY=:0 + +Signal Handlers: +SIGSEGV: [libjvm.so+0xa70500], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO +SIGBUS: [libjvm.so+0xa70500], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO +SIGFPE: [libjvm.so+0x8b9fa0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO +SIGPIPE: [libjvm.so+0x8b9fa0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO +SIGXFSZ: [libjvm.so+0x8b9fa0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO +SIGILL: [libjvm.so+0x8b9fa0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO +SIGUSR1: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none +SIGUSR2: [libjvm.so+0x8b9e50], sa_mask[0]=00100000000000000000000000000000, sa_flags=SA_RESTART|SA_SIGINFO +SIGHUP: [libjvm.so+0x8ba300], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO +SIGINT: SIG_IGN, sa_mask[0]=00000000000000000000000000000000, sa_flags=none +SIGTERM: [libjvm.so+0x8ba300], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO +SIGQUIT: [libjvm.so+0x8ba300], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO + + +--------------- S Y S T E M --------------- + +OS:PRETTY_NAME="Debian GNU/Linux 9 (stretch)" +NAME="Debian GNU/Linux" +VERSION_ID="9" +VERSION="9 (stretch)" +ID=debian +HOME_URL="https://www.debian.org/" +SUPPORT_URL="https://www.debian.org/support" +BUG_REPORT_URL="https://bugs.debian.org/" + +uname:Linux 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u3 (2017-08-06) x86_64 +libc:glibc 2.24 NPTL 2.24 +rlimit: STACK 8192k, CORE 0k, NPROC 63662, NOFILE 1048576, AS infinity +load average:2.31 2.27 1.87 + +/proc/meminfo: +MemTotal: 16327984 kB +MemFree: 3083848 kB +MemAvailable: 4477068 kB +Buffers: 234364 kB +Cached: 1979652 kB +SwapCached: 17044 kB +Active: 9978340 kB +Inactive: 2672728 kB +Active(anon): 9287856 kB +Inactive(anon): 1827220 kB +Active(file): 690484 kB +Inactive(file): 845508 kB +Unevictable: 336 kB +Mlocked: 336 kB +SwapTotal: 15624180 kB +SwapFree: 14927520 kB +Dirty: 1164 kB +Writeback: 0 kB +AnonPages: 10430996 kB +Mapped: 677652 kB +Shmem: 677984 kB +Slab: 303280 kB +SReclaimable: 194904 kB +SUnreclaim: 108376 kB +KernelStack: 26656 kB +PageTables: 110716 kB +NFS_Unstable: 0 kB +Bounce: 0 kB +WritebackTmp: 0 kB +CommitLimit: 23788172 kB +Committed_AS: 24671728 kB +VmallocTotal: 34359738367 kB +VmallocUsed: 0 kB +VmallocChunk: 0 kB +HardwareCorrupted: 0 kB +AnonHugePages: 0 kB +ShmemHugePages: 0 kB +ShmemPmdMapped: 0 kB +HugePages_Total: 0 +HugePages_Free: 0 +HugePages_Rsvd: 0 +HugePages_Surp: 0 +Hugepagesize: 2048 kB +DirectMap4k: 532536 kB +DirectMap2M: 16136192 kB +DirectMap1G: 0 kB + + +CPU:total 8 (initial active 8) (4 cores per cpu, 2 threads per core) family 6 model 94 stepping 3, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, avx2, aes, clmul, erms, rtm, 3dnowpref, lzcnt, ht, tsc, tscinvbit, bmi1, bmi2, adx + +/proc/cpuinfo: +processor : 0 +vendor_id : GenuineIntel +cpu family : 6 +model : 94 +model name : Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz +stepping : 3 +microcode : 0xba +cpu MHz : 3506.457 +cache size : 8192 KB +physical id : 0 +siblings : 8 +core id : 0 +cpu cores : 4 +apicid : 0 +initial apicid : 0 +fpu : yes +fpu_exception : yes +cpuid level : 22 +wp : yes +flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch intel_pt tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp +bugs : +bogomips : 6816.00 +clflush size : 64 +cache_alignment : 64 +address sizes : 39 bits physical, 48 bits virtual +power management: + +processor : 1 +vendor_id : GenuineIntel +cpu family : 6 +model : 94 +model name : Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz +stepping : 3 +microcode : 0xba +cpu MHz : 3305.163 +cache size : 8192 KB +physical id : 0 +siblings : 8 +core id : 1 +cpu cores : 4 +apicid : 2 +initial apicid : 2 +fpu : yes +fpu_exception : yes +cpuid level : 22 +wp : yes +flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch intel_pt tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp +bugs : +bogomips : 6816.95 +clflush size : 64 +cache_alignment : 64 +address sizes : 39 bits physical, 48 bits virtual +power management: + +processor : 2 +vendor_id : GenuineIntel +cpu family : 6 +model : 94 +model name : Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz +stepping : 3 +microcode : 0xba +cpu MHz : 2952.795 +cache size : 8192 KB +physical id : 0 +siblings : 8 +core id : 2 +cpu cores : 4 +apicid : 4 +initial apicid : 4 +fpu : yes +fpu_exception : yes +cpuid level : 22 +wp : yes +flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch intel_pt tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp +bugs : +bogomips : 6817.03 +clflush size : 64 +cache_alignment : 64 +address sizes : 39 bits physical, 48 bits virtual +power management: + +processor : 3 +vendor_id : GenuineIntel +cpu family : 6 +model : 94 +model name : Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz +stepping : 3 +microcode : 0xba +cpu MHz : 3345.837 +cache size : 8192 KB +physical id : 0 +siblings : 8 +core id : 3 +cpu cores : 4 +apicid : 6 +initial apicid : 6 +fpu : yes +fpu_exception : yes +cpuid level : 22 +wp : yes +flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch intel_pt tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp +bugs : +bogomips : 6817.01 +clflush size : 64 +cache_alignment : 64 +address sizes : 39 bits physical, 48 bits virtual +power management: + +processor : 4 +vendor_id : GenuineIntel +cpu family : 6 +model : 94 +model name : Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz +stepping : 3 +microcode : 0xba +cpu MHz : 3400.415 +cache size : 8192 KB +physical id : 0 +siblings : 8 +core id : 0 +cpu cores : 4 +apicid : 1 +initial apicid : 1 +fpu : yes +fpu_exception : yes +cpuid level : 22 +wp : yes +flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch intel_pt tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp +bugs : +bogomips : 6817.23 +clflush size : 64 +cache_alignment : 64 +address sizes : 39 bits physical, 48 bits virtual +power management: + +processor : 5 +vendor_id : GenuineIntel +cpu family : 6 +model : 94 +model name : Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz +stepping : 3 +microcode : 0xba +cpu MHz : 3111.962 +cache size : 8192 KB +physical id : 0 +siblings : 8 +core id : 1 +cpu cores : 4 +apicid : 3 +initial apicid : 3 +fpu : yes +fpu_exception : yes +cpuid level : 22 +wp : yes +flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch intel_pt tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp +bugs : +bogomips : 6817.01 +clflush size : 64 +cache_alignment : 64 +address sizes : 39 bits physical, 48 bits virtual +power management: + +processor : 6 +vendor_id : GenuineIntel +cpu family : 6 +model : 94 +model name : Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz +stepping : 3 +microcode : 0xba +cpu MHz : 3322.802 +cache size : 8192 KB +physical id : 0 +siblings : 8 +core id : 2 +cpu cores : 4 +apicid : 5 +initial apicid : 5 +fpu : yes +fpu_exception : yes +cpuid level : 22 +wp : yes +flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch intel_pt tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp +bugs : +bogomips : 6817.00 +clflush size : 64 +cache_alignment : 64 +address sizes : 39 bits physical, 48 bits virtual +power management: + +processor : 7 +vendor_id : GenuineIntel +cpu family : 6 +model : 94 +model name : Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz +stepping : 3 +microcode : 0xba +cpu MHz : 2699.414 +cache size : 8192 KB +physical id : 0 +siblings : 8 +core id : 3 +cpu cores : 4 +apicid : 7 +initial apicid : 7 +fpu : yes +fpu_exception : yes +cpuid level : 22 +wp : yes +flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch intel_pt tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp +bugs : +bogomips : 6816.98 +clflush size : 64 +cache_alignment : 64 +address sizes : 39 bits physical, 48 bits virtual +power management: + + + +Memory: 4k page, physical 16327984k(3083848k free), swap 15624180k(14927520k free) + +vm_info: OpenJDK 64-Bit Server VM (25.141-b15) for linux-amd64 JRE (1.8.0_141-8u141-b15-1~deb9u1-b15), built on Jul 23 2017 12:12:42 by "pbuilder" with gcc 6.3.0 20170516 + +time: Fri Nov 3 10:24:36 2017 +elapsed time: 554 seconds (0d 0h 9m 14s) + diff --git a/nb-configuration.xml b/nb-configuration.xml index eecaa13..66defc5 100644 --- a/nb-configuration.xml +++ b/nb-configuration.xml @@ -21,4 +21,7 @@ Any value defined here will override the pom.xml file value but is only applicab apache20 false + + psms + diff --git a/nbactions.xml b/nbactions.xml index a45e196..1247738 100644 --- a/nbactions.xml +++ b/nbactions.xml @@ -1,46 +1,49 @@ - - - - run - - jar - - - process-classes - org.codehaus.mojo:exec-maven-plugin:1.2.1:exec - - - -Xms1g -classpath %classpath org.rappsilber.fdr.gui.FDRGUI - java - - - - debug - - jar - - - process-classes - org.codehaus.mojo:exec-maven-plugin:1.2.1:exec - - - -Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -Xms1g -classpath %classpath org.rappsilber.fdr.gui.FDRGUI - java - true - - - - profile - - jar - - - process-classes - org.codehaus.mojo:exec-maven-plugin:1.2.1:exec - - - -Xms1g -classpath %classpath org.rappsilber.fdr.gui.FDRGUI - java - - - + + + + run + + jar + + + process-classes + org.codehaus.mojo:exec-maven-plugin:1.2.1:exec + + + -Xmx11g -XX:+HeapDumpOnOutOfMemoryError -classpath %classpath org.rappsilber.fdr.gui.FDRGUI + java + /home/lfischer + + + + debug + + jar + + + process-classes + org.codehaus.mojo:exec-maven-plugin:1.2.1:exec + + + -Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -Xmx11g -XX:+HeapDumpOnOutOfMemoryError -classpath %classpath org.rappsilber.fdr.gui.FDRGUI + java + true + /home/lfischer + + + + profile + + jar + + + process-classes + org.codehaus.mojo:exec-maven-plugin:1.2.1:exec + + + -Xmx11g -XX:+HeapDumpOnOutOfMemoryError -classpath %classpath org.rappsilber.fdr.gui.FDRGUI + java + /home/lfischer + + + diff --git a/pom.xml b/pom.xml index e5ed555..61dbd89 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.rappsilberlab xiFDR - 1.0.20 + 1.0.21 jar diff --git a/src/main/java/org/rappsilber/fdr/CSVinFDR.java b/src/main/java/org/rappsilber/fdr/CSVinFDR.java index 7481d99..a3e5e54 100644 --- a/src/main/java/org/rappsilber/fdr/CSVinFDR.java +++ b/src/main/java/org/rappsilber/fdr/CSVinFDR.java @@ -21,11 +21,16 @@ import java.sql.SQLException; import java.text.ParseException; import java.util.ArrayList; +import java.util.Collection; import java.util.logging.Level; import java.util.logging.Logger; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import org.rappsilber.data.csv.CsvParser; +import org.rappsilber.data.csv.condition.CsvCondition; import org.rappsilber.fdr.entities.PSM; import org.rappsilber.utils.AutoIncrementValueMap; +import org.rappsilber.utils.RArrayUtils; import static org.rappsilber.utils.StringUtils.sixDigits; import org.rappsilber.utils.UpdatableChar; @@ -34,11 +39,12 @@ * @author lfischer */ public class CSVinFDR extends OfflineFDR { - private String m_source = null; + private ArrayList m_source = new ArrayList<>(); + private ArrayList m_filter = new ArrayList<>(); private ArrayList commandLineColumnMapping; private Character delimiter; private Character quote; - private String[][] defaultcolumnmapping=new String[][]{ + public static String[][] DEFAULT_COLUMN_MAPPING=new String[][]{ new String[]{"peptide1","Peptide1"}, new String[]{"peptide2","Peptide2"}, new String[]{"peptide length 1","LengthPeptide1"}, @@ -94,7 +100,7 @@ protected ArrayList getPSMOutputLine(PSM pp) { ArrayList ret = super.getPSMOutputLine(pp); double mz = pp.getExperimentalMZ(); - int charge = pp.getCharge(); + int charge = pp.getExpCharge(); double mass = (mz-1.00727646677)*charge; double fraction = mass-Math.floor(mass); double calcfraction = pp.getCalcMass()-Math.floor(pp.getCalcMass()); @@ -104,7 +110,7 @@ protected ArrayList getPSMOutputLine(PSM pp) { ret.add(3, sixDigits.format(mz)); ret.add(4, sixDigits.format(mass)); ret.add(5, sixDigits.format(fraction)); - ret.add(6,""+ pp.getMatchedCharge()); + ret.add(6,""+ pp.getCharge()); ret.add(7, sixDigits.format(pp.getCalcMass())); ret.add(8, sixDigits.format(calcfraction)); @@ -112,63 +118,79 @@ protected ArrayList getPSMOutputLine(PSM pp) { return ret; } - + protected Integer getColumn(CsvParser csv,String column,boolean optional) throws ParseException { + Integer c = csv.getColumn(column); + if (c== null && !optional) { + throw new ParseException("Column " + column + " not found", 0); + } + return c; + } + public void readCSV(File f) throws FileNotFoundException, IOException, ParseException { - readCSV(CsvParser.guessCsv(f, 50)); + readCSV(CsvParser.guessCsv(f, 50), null); } - public void readCSV(CsvParser csv) throws FileNotFoundException, IOException, ParseException { - if (csv.getInputFile()!= null) - m_source = csv.getInputFile().getAbsolutePath(); + public void readCSV(CsvParser csv, CsvCondition filter) throws FileNotFoundException, IOException, ParseException { + if (csv.getInputFile()!= null) { + m_source.add(csv.getInputFile().getAbsolutePath()); + } else { + m_source.add(null); + } + m_filter.add(filter); - Integer crun = csv.getColumn("run"); - Integer cscan = csv.getColumn("scan"); - Integer cpsmID = csv.getColumn("psmid"); - int cpep1 = csv.getColumn("peptide1"); - int cpep2 = csv.getColumn("peptide2"); - Integer cpep1len = csv.getColumn("peptide length 1"); - Integer cpep2len = csv.getColumn("peptide length 2"); - int cpep1site = csv.getColumn("peptide link 1"); - int cpep2site = csv.getColumn("peptide link 2"); - int cpep1decoy = csv.getColumn("is decoy 1"); - Integer cpep2decoy = csv.getColumn("is decoy 2"); - int cprecZ = csv.getColumn("precursor charge"); - int cscore = csv.getColumn("score"); - int caccession1 = csv.getColumn("accession1"); - int caccession2 = csv.getColumn("accession2"); - Integer cdescription1 = csv.getColumn("description1"); - Integer cdescription2 = csv.getColumn("description2"); - Integer cpeptide_position1 = csv.getColumn("peptide position 1"); - Integer cpeptide_position2 = csv.getColumn("peptide position 2"); - Integer cscoreratio = csv.getColumn("score ratio"); - Integer cPepScore1 = csv.getColumn("peptide1 score"); - Integer cPepScore2 = csv.getColumn("peptide2 score"); - Integer cCrosslinker = csv.getColumn("crosslinker"); - Integer cExpMZ = csv.getColumn("experimental mz"); - Integer cCalcMass = csv.getColumn("calculated mass"); - Integer cInfo = csv.getColumn("info"); + Integer crun = getColumn(csv,"run",true); + Integer cscan = getColumn(csv,"scan",true); + Integer cpsmID = getColumn(csv,"psmid",true); + int cpep1 = getColumn(csv,"peptide1",false); + int cpep2 = getColumn(csv,"peptide2",false); + Integer cpep1len = getColumn(csv,"peptide length 1",true); + Integer cpep2len = getColumn(csv,"peptide length 2",true); + int cpep1site = getColumn(csv,"peptide link 1",false); + int cpep2site = getColumn(csv,"peptide link 2",false); + int cpep1decoy = getColumn(csv,"is decoy 1",false); + Integer cpep2decoy = getColumn(csv,"is decoy 2",true); + int cprecZ = getColumn(csv,"precursor charge",false); + int cscore = getColumn(csv,"score",false); + int caccession1 = getColumn(csv,"accession1",false); + int caccession2 = getColumn(csv,"accession2",false); + Integer cdescription1 = getColumn(csv,"description1",true); + Integer cdescription2 = getColumn(csv,"description2",true); + Integer cpeptide_position1 = getColumn(csv,"peptide position 1",true); + Integer cpeptide_position2 = getColumn(csv,"peptide position 2",true); + Integer cscoreratio = getColumn(csv,"score ratio",true); + Integer cPepScore1 = getColumn(csv,"peptide1 score",true); + Integer cPepScore2 = getColumn(csv,"peptide2 score",true); + Integer cCrosslinker = getColumn(csv,"crosslinker",true); + Integer cExpMZ = getColumn(csv,"experimental mz",true); + Integer cCalcMass = getColumn(csv,"calculated mass",true); + Integer cInfo = getColumn(csv,"info",true); int noID = 0; AutoIncrementValueMap PSMIDs = new AutoIncrementValueMap(); int lineNumber =0; + String terminalAminoAcids = "(?:[A-Z\\-][a-z]*|\\[(?:[A-Z\\-][a-z]*)+\\])"; + Pattern hasTerminalAminoAcids = Pattern.compile("^" +terminalAminoAcids+"\\.(.*)\\."+terminalAminoAcids + "$"); + Pattern nterminalAminoAcids = Pattern.compile("^" + terminalAminoAcids +"\\."); + Pattern cterminalAminoAcids = Pattern.compile("\\."+terminalAminoAcids +"$"); int noPSMID =0; while (csv.next()) { lineNumber++; + if (filter != null && !filter.fits(csv)) + continue; String psmID; String pepSeq1 = csv.getValue(cpep1); String pepSeq2 = csv.getValue(cpep2); - String terminalAminoAcids = "([A-Z\\--][a-z]*|(\\[[A-Z\\--][a-z]*\\])+)"; // if the sequence looks like K.PEPTIDEK.A assume that the first and // last aminoacid are leading and trailing aminoacids and not really part of the peptide - if (pepSeq1.matches(terminalAminoAcids+"\\..*"+terminalAminoAcids)) { - pepSeq1 = pepSeq1.replaceAll("^" + terminalAminoAcids +"\\.", "").replaceAll("\\."+terminalAminoAcids +"$", ""); - } - if (pepSeq2.matches(terminalAminoAcids+"\\..*"+terminalAminoAcids)) { - pepSeq2 = pepSeq2.replaceAll("^" + terminalAminoAcids +"\\.", "").replaceAll("\\."+terminalAminoAcids +"$", ""); + Matcher m1=hasTerminalAminoAcids.matcher(pepSeq1); + Matcher m2=hasTerminalAminoAcids.matcher(pepSeq2); + if (m1.matches() && m2.matches()) { + pepSeq1 = m1.replaceAll("$1"); + pepSeq2 = m2.replaceAll("$1"); } @@ -218,7 +240,7 @@ public void readCSV(CsvParser csv) throws FileNotFoundException, IOException, Pa String saccession1 = csv.getValue(caccession1); String sdescription1 = csv.getValue(cdescription1); String saccession2 = csv.getValue(caccession2); - String sdescription2 = csv.getValue(caccession2); + String sdescription2 = csv.getValue(cdescription2); String spepPosition1 = csv.getValue(cpeptide_position1); String spepPosition2= csv.getValue(cpeptide_position2); if (spepPosition2 == null || spepPosition2.trim().isEmpty()) @@ -323,14 +345,27 @@ public void readCSV(CsvParser csv) throws FileNotFoundException, IOException, Pa accessions1[p1], descriptions1[p1], accessions2[p2], descriptions2[p2], ipeppos1[p1], ipeppos2[p2], scoreRatio, false,crosslinker,run,scan); + + Double expMZ = null; + if (cExpMZ != null) { + expMZ=csv.getDouble(cExpMZ); + psm.setExperimentalMZ(expMZ); + } // read exp- and calc-mass if (cCalcMass != null) { - psm.setCalcMass(csv.getDouble(cCalcMass)); - } - if (cExpMZ != null) { - psm.setExperimentalMZ(csv.getDouble(cExpMZ)); + Double calcMass=csv.getDouble(cCalcMass); + + psm.setCalcMass(calcMass); + + if (expMZ != null) { + psm.setExpCharge((byte)Math.round(calcMass/expMZ)); + + } } + + + if (cInfo != null) { psm.setInfo(csv.getValue(cInfo)); @@ -345,11 +380,74 @@ public void readCSV(CsvParser csv) throws FileNotFoundException, IOException, Pa @Override public String getSource() { + boolean filterFound = false; + boolean filterSame = true; + String filter =""; + String ret = ""; + if (m_filter.get(0) != null) { + filter = m_filter.get(0).toString(); + } + // do we have any filter and are they all the same? + for (CsvCondition c : m_filter) { + if (c != null) { + filterFound = true; + if (!filter.equals(c.toString())) { + filterSame = false; + break; + } + } + } + + if (filterFound) { + if (filterSame) { + StringBuilder sb = new StringBuilder(RArrayUtils.toString(m_source, "\n")); + sb.append("\nfilter:").append(filter); + ret = sb.toString(); + } else { + StringBuilder sb = new StringBuilder(); + for (int s = 0; s(); + m_source.add(source); + } + + public void addSource(String source) { + m_source.add(source); + m_filter.add(null); + } + + public void addSource(String source,CsvCondition filter) { + m_source.add(source); + m_filter.add(filter); + } + public void addSource(ArrayList source,ArrayList filter) { + m_source.addAll(source); + m_filter.addAll(filter); + } public String execClass() { return this.getClass().getName(); @@ -405,6 +503,7 @@ public String argDescription() { } + @Override public String[] parseArgs(String[] argv) { ArrayList unknown = new ArrayList(); @@ -494,7 +593,7 @@ public static void main (String[] argv) throws SQLException, FileNotFoundExcepti } } } else { - for (String[] map : ofdr.defaultcolumnmapping) { + for (String[] map : ofdr.DEFAULT_COLUMN_MAPPING) { for (int i = 1; i getCommandLineColumnMapping() { + return commandLineColumnMapping; + } + + /** + * @param commandLineColumnMapping the commandLineColumnMapping to set + */ + public void setCommandLineColumnMapping(ArrayList commandLineColumnMapping) { + this.commandLineColumnMapping = commandLineColumnMapping; + } + + /** + * @return the delimiter + */ + public Character getDelimiter() { + return delimiter; + } + + /** + * @param delimiter the delimiter to set + */ + public void setDelimiter(Character delimiter) { + this.delimiter = delimiter; + } + + /** + * @return the quote + */ + public Character getQuote() { + return quote; + } + + /** + * @param quote the quote to set + */ + public void setQuote(Character quote) { + this.quote = quote; + } + + public CsvCondition getFilter() { + return m_filter.get(0); + } + + public Collection getFilters() { + return m_filter; + } } diff --git a/src/main/java/org/rappsilber/fdr/FDRSettings.java b/src/main/java/org/rappsilber/fdr/FDRSettings.java index 8ef73ab..7a9fcc3 100644 --- a/src/main/java/org/rappsilber/fdr/FDRSettings.java +++ b/src/main/java/org/rappsilber/fdr/FDRSettings.java @@ -120,5 +120,6 @@ public interface FDRSettings { public void boostPeptidePairs(boolean boost); public boolean boostLinks(); public void boostLinks(boolean boost); - + public boolean isGroupByPSMCount(); + public void setGroupByPSMCount(boolean groupByPPI); } diff --git a/src/main/java/org/rappsilber/fdr/FDRSettingsImpl.java b/src/main/java/org/rappsilber/fdr/FDRSettingsImpl.java index ff06f03..70fea6e 100644 --- a/src/main/java/org/rappsilber/fdr/FDRSettingsImpl.java +++ b/src/main/java/org/rappsilber/fdr/FDRSettingsImpl.java @@ -44,6 +44,7 @@ public class FDRSettingsImpl implements FDRSettings { protected boolean boostPeptidePairs = true; protected boolean boostProteins = true; protected boolean boostLinks = true; + protected boolean groupByPPI = false; @Override public void addCalcListener(ActionListener al) { @@ -317,4 +318,14 @@ public boolean boostLinks() { public void boostLinks(boolean boost) { boostLinks = boost; } + + @Override + public boolean isGroupByPSMCount() { + return groupByPPI; + } + + @Override + public void setGroupByPSMCount(boolean groupByPPI) { + this.groupByPPI=groupByPPI; + } } diff --git a/src/main/java/org/rappsilber/fdr/OfflineFDR.java b/src/main/java/org/rappsilber/fdr/OfflineFDR.java index 8b9399a..eb5ddd5 100644 --- a/src/main/java/org/rappsilber/fdr/OfflineFDR.java +++ b/src/main/java/org/rappsilber/fdr/OfflineFDR.java @@ -24,6 +24,7 @@ import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; +import java.util.Map; import java.util.RandomAccess; import java.util.logging.Level; import java.util.logging.Logger; @@ -38,7 +39,6 @@ import org.rappsilber.fdr.entities.ProteinGroupLink; import org.rappsilber.fdr.entities.ProteinGroupPair; import org.rappsilber.fdr.entities.Site; -import org.rappsilber.fdr.entities.UniquePSM; import org.rappsilber.fdr.groups.ProteinGroup; import org.rappsilber.fdr.result.FDRResult; import org.rappsilber.fdr.result.FDRResultLevel; @@ -82,7 +82,15 @@ public abstract class OfflineFDR { * turn protein-accession into unique integer ids */ AutoIncrementValueMap m_protIDs = new AutoIncrementValueMap(); - + + /** + * size of the decoy independent protein pairs in terms of psms + */ + HashMap protpairToSize = new HashMap<>(); + /** + * id of a protein pair independent of target or decoy + */ + HashMap protpairToID = new HashMap<>(); private boolean psm_directional = false; @@ -165,6 +173,16 @@ public abstract class OfflineFDR { *
0 indicates no limit */ protected int m_maximumProteinPairAmbiguity = 0; + + /** + * group matches by protein pairs + */ + private boolean groupByProteinPair=false; + + /** + * how many decoys does a fdr group need to have to be reported as result + */ + private Integer minDecoys=0; /** @@ -285,17 +303,22 @@ public void addNormalisedPsmList(SelfAddHashSet psms, double offset) { if (offsetdiff<0) { for (PSM p : allPSMs) { p.setScore(p.getScore()-offsetdiff); + } + this.psmNormOffset-=offsetdiff; + for (PSM p : psms) { p.setRun(registerRun(p.getRun())); if (p.getCrosslinker() != null) { registerCrossLinker(p.getCrosslinker(), p); } allPSMs.add(p); } - this.psmNormOffset-=offsetdiff; } else if (offsetdiff >0) { for (PSM p : psms) { p.setScore(p.getScore()+offsetdiff); - registerRun(p.getRun()); + p.setRun(registerRun(p.getRun())); + if (p.getCrosslinker() != null) { + registerCrossLinker(p.getCrosslinker(), p); + } allPSMs.add(p); } } @@ -313,16 +336,40 @@ protected void levelSummary(PrintWriter summaryOut, String pepheader, FDRResultL ArrayList fdrGroups = new ArrayList(level.getGroupIDs()); java.util.Collections.sort(fdrGroups); for (Integer fg : fdrGroups) { - summaryOut.print(seperator + "\"" + groups.get(fg) + "\""); + summaryOut.print(seperator + "\"(" +fg +")"+ groups.get(fg) + "\""); } summaryOut.print("\n\"Input\""); for (Integer fg : fdrGroups) { summaryOut.print(seperator + (((SubGroupFdrInfo)level.getGroup(fg)).inputCount)); } + summaryOut.print("\n\"TT\""); + for (Integer fg : fdrGroups) { + summaryOut.print(seperator + ((SubGroupFdrInfo)level.getGroup(fg)).TT); + } + summaryOut.print("\n\"TD\""); + for (Integer fg : fdrGroups) { + summaryOut.print(seperator + ((SubGroupFdrInfo)level.getGroup(fg)).TD); + } + summaryOut.print("\n\"DD\""); + for (Integer fg : fdrGroups) { + summaryOut.print(seperator + ((SubGroupFdrInfo)level.getGroup(fg)).DD); + } summaryOut.print("\n\"passing fdr (" + target_fdr + ")\""); for (Integer fg : fdrGroups) { summaryOut.print(seperator + ((SubGroupFdrInfo)level.getGroup(fg)).results.size()); } + summaryOut.print("\n\"TT\""); + for (Integer fg : fdrGroups) { + summaryOut.print(seperator + ((SubGroupFdrInfo)level.getGroup(fg)).resultTT); + } + summaryOut.print("\n\"TD\""); + for (Integer fg : fdrGroups) { + summaryOut.print(seperator + ((SubGroupFdrInfo)level.getGroup(fg)).resultTD); + } + summaryOut.print("\n\"DD\""); + for (Integer fg : fdrGroups) { + summaryOut.print(seperator + ((SubGroupFdrInfo)level.getGroup(fg)).resultDD); + } summaryOut.print("\n\"last fdr > " + target_fdr + "\""); for (Integer fg : fdrGroups) { summaryOut.print(seperator + ((SubGroupFdrInfo)level.getGroup(fg)).firstPassingFDR); @@ -512,7 +559,7 @@ public PSM addMatch(String psmID, Peptide peptide1, Peptide peptide2, int peplen } - PSM psm = new PSM(psmID, npepid1, npepid2, nsite1, nsite2, proteinId1.isDecoy(), proteinId2.isDecoy(), charge, score, nScoreRatio); + PSM psm = new PSM(psmID, npepid1, npepid2, (byte)nsite1, (byte)nsite2, proteinId1.isDecoy(), proteinId2.isDecoy(), (byte)charge, score, nScoreRatio); psm.setSpecialcase(isSpecialCase); @@ -635,6 +682,8 @@ public void calculatePSMFDR(double fdr, double safetyFactor, boolean ignoreGroup reset(); result.uniquePSMs = filterUnique; + protpairToID = new HashMap<>(); + protpairToSize = new HashMap<>(); Collection inputPSM; if (m_maximumProteinAmbiguity >0 && m_minPepLength ==0) { @@ -678,13 +727,62 @@ public void calculatePSMFDR(double fdr, double safetyFactor, boolean ignoreGroup } } - if (filterUnique) { - SelfAddHashSet uniquePSM = new SelfAddHashSet(); - for (PSM psm : inputPSM) - uniquePSM.add(new UniquePSM(psm)); - inputPSM = new ArrayList(uniquePSM); +// if (filterUnique) { +// SelfAddHashSet uniquePSM = new SelfAddHashSet(); +// for (PSM psm : inputPSM) +// uniquePSM.add(new UniquePSM(psm)); +// inputPSM = new ArrayList(uniquePSM); +// } + + // filter to unique PSMs + if (filterUnique) { + HashMap uniquePSM = new HashMap(); + for (PSM psm : inputPSM) { + String key = psm.getPeptide1().getSequence() + "_!xl!_" + + psm.getPeptide2().getSequence() + "_!xl!_" + + psm.getPeptideLinkSite1() + "_!xl!_" + + psm.getPeptideLinkSite2() + "_!xl!_" + + psm.getCharge(); + // do we have already something under this key? + PSM stored = uniquePSM.get(key); + if (stored != null) { + // yes + if (stored.getScore()< psm.getScore()) { + // new psm has higher score -> it will be the reprentative one + uniquePSM.put(key, psm); + // register the previous psm + psm.represents(stored); + } else { + // lower score so it will be represented by the stored one + stored.represents(psm); + } + } else if (!isPsm_directional()) { + // we need to check the inverse key as well + key = psm.getPeptide2().getSequence() + "_!xl!_" + + psm.getPeptide1().getSequence() + "_!xl!_" + + psm.getPeptideLinkSite2() + "_!xl!_" + + psm.getPeptideLinkSite1() + "_!xl!_" + + psm.getCharge(); + stored = uniquePSM.get(key); + if (stored != null) { + if (stored.getScore()< psm.getScore()){ + // new psm has higher score -> it will be the reprentative one + uniquePSM.put(key, psm); + // register the previous psm + psm.represents(stored); + } else { + // lower score so it will be represented by the stored one + stored.represents(psm); + } + } else + uniquePSM.put(key, psm); + } else { + uniquePSM.put(key, psm); + } + } + inputPSM = new ArrayList(uniquePSM.values()); } - + result.input = inputPSM; result.minPeptideLength = m_minPepLength; @@ -693,7 +791,7 @@ public void calculatePSMFDR(double fdr, double safetyFactor, boolean ignoreGroup // fdrPSM = fdr(fdr, safetyFactor, inputPSM, nextFdrPSM, psmFDRGroupsInput, countFdrPSM, targetPepDBSize, decoyPepDBSize, 1, ignoreGroups,setElementFDR); - fdr(fdr, safetyFactor, inputPSM, GroupedFDRs, targetPepDBSize, decoyPepDBSize, 1, ignoreGroups, setElementFDR, directional); + fdr(fdr, safetyFactor, inputPSM, GroupedFDRs, targetPepDBSize, decoyPepDBSize, 1, ignoreGroups, setElementFDR, directional,isGroupByProteinPair()); for (SubGroupFdrInfo sg : GroupedFDRs.getGroups()) sg.fdrGroupName = PSM.getFDRGroupName(sg.fdrGroup); @@ -706,6 +804,34 @@ public void calculatePSMFDR(double fdr, double safetyFactor, boolean ignoreGroup public void calculatePeptidePairFDR(double fdr, double safetyFactor, boolean ignoreGroups, boolean setElementFDR, FDRResult result, boolean directional) { + if (result.psmFDR != null) { + for (PSM pp : result.psmFDR) { + pp.setFdrPeptidePair(null); + pp.setFdrProteinGroup(null); + } + } + + if (result.peptidePairFDR != null) { + for (PeptidePair pp : result.peptidePairFDR) { + pp.setFdrLink(null); + pp.setFdrProteinGroup(null); + } + result.peptidePairFDR.clear(); + } + + if (result.proteinGroupLinkFDR != null) { + for (ProteinGroupLink l: result.proteinGroupLinkFDR) { + l.setFdrPPI(null); + } + result.proteinGroupLinkFDR.clear(); + } + if (result.proteinGroupFDR != null) { + result.proteinGroupFDR.clear(); + } + if (result.proteinGroupPairFDR != null) { + result.proteinGroupPairFDR.clear(); + } + FDRResultLevel psms = result.psmFDR; FDRResultLevel GroupedFDRs = new FDRResultLevel(); GroupedFDRs.isDirectional = directional; @@ -713,7 +839,7 @@ public void calculatePeptidePairFDR(double fdr, double safetyFactor, boolean ign SelfAddHashSet psmPeps = new SelfAddHashSet(); if (!directional) { for (PSM psm : psms) { - psmPeps.register(psm.getPeptidePair()); + PeptidePair pp =psmPeps.register(psm.getPeptidePair()); } } else { for (PSM psm : psms) { @@ -722,7 +848,7 @@ public void calculatePeptidePairFDR(double fdr, double safetyFactor, boolean ign } } - fdr(fdr, safetyFactor, psmPeps, GroupedFDRs, targetPepDBSize, decoyPepDBSize, 1, ignoreGroups, setElementFDR, directional); + fdr(fdr, safetyFactor, psmPeps, GroupedFDRs, targetPepDBSize, decoyPepDBSize, 1, ignoreGroups, setElementFDR, directional,isGroupByProteinPair()); for (SubGroupFdrInfo sg : GroupedFDRs.getGroups()) sg.fdrGroupName = PeptidePair.getFDRGroupName(sg.fdrGroup); @@ -800,7 +926,7 @@ public void calculateProteinGroupFDR(double fdr, double safetyFactor, boolean ig return; } //Logger.getLogger(this.getClass().getName()).log(Level.INFO, "ProteinGroup fdr " + pepProteinGroups.size() + " Groups as Input."); - fdr(fdr, safetyFactor, pepProteinGroups, GroupedFDRs, targetProtDBSize, decoyProtDBSize, minPepCount, ignoreGroups, setElementFDR, false); + fdr(fdr, safetyFactor, pepProteinGroups, GroupedFDRs, targetProtDBSize, decoyProtDBSize, minPepCount, ignoreGroups, setElementFDR, false,false); for (SubGroupFdrInfo sg : GroupedFDRs.getGroups()) sg.fdrGroupName = ProteinGroup.getFDRGroupName(sg.fdrGroup); @@ -811,6 +937,15 @@ public void calculateProteinGroupFDR(double fdr, double safetyFactor, boolean ig public void calculateLinkFDR(double fdr, double safetyFactor, boolean ignoreGroups, int minPepCount, int maxAmbiguity,boolean setElementFDR, FDRResult result, boolean directional) { + if (result.proteinGroupLinkFDR != null) { + for (ProteinGroupLink l: result.proteinGroupLinkFDR) { + l.setFdrPPI(null); + } + result.proteinGroupLinkFDR.clear(); + } + if (result.proteinGroupPairFDR != null) { + result.proteinGroupPairFDR.clear(); + } // linkFDRGroupsInput = new HashMap(); // nextFdrLink = new HashMap(); // countFdrLink = new HashMap(); @@ -824,7 +959,7 @@ public void calculateLinkFDR(double fdr, double safetyFactor, boolean ignoreGrou if (!pp.isLinear() || pp.isLoop() ) { ProteinGroupDirectionalLink dl = new ProteinGroupDirectionalLink(pp); - pepLinks.register(dl); + pp.setFdrLink(pepLinks.register(dl)); } } @@ -835,7 +970,7 @@ public void calculateLinkFDR(double fdr, double safetyFactor, boolean ignoreGrou if (!pp.isLinear() || pp.isLoop()) { ProteinGroupDirectionalLink dl = new ProteinGroupDirectionalLink(pp); if (dl.getAmbiguity() <= maxAmbiguity) { - pepLinks.register(dl); + pp.setFdrLink(pepLinks.register(dl)); } } @@ -848,7 +983,7 @@ public void calculateLinkFDR(double fdr, double safetyFactor, boolean ignoreGrou for (PeptidePair pp : result.peptidePairFDR) { if (!pp.isLinear()) { - pepLinks.register(pp.getLink()); + pp.setFdrLink(pepLinks.register(pp.getLink())); } } @@ -859,7 +994,7 @@ public void calculateLinkFDR(double fdr, double safetyFactor, boolean ignoreGrou if (!pp.isLinear() || pp.isLoop()) { ProteinGroupLink l = pp.getLink(); if (l.getAmbiguity() <= maxAmbiguity) { - pepLinks.register(pp.getLink()); + pp.setFdrLink(pepLinks.register(pp.getLink())); } } @@ -869,7 +1004,7 @@ public void calculateLinkFDR(double fdr, double safetyFactor, boolean ignoreGrou } // fdr(fdr, safetyFactor, pepLinks, GroupedFDRs, targetLinkDBSize, decoyLinkDBSize, minPepCount, true, setElementFDR, directional,result.scaleByLinkedNess); - fdr(fdr, safetyFactor, pepLinks, GroupedFDRs, targetLinkDBSize, decoyLinkDBSize, minPepCount, ignoreGroups, setElementFDR, directional); + fdr(fdr, safetyFactor, pepLinks, GroupedFDRs, targetLinkDBSize, decoyLinkDBSize, minPepCount, ignoreGroups, setElementFDR, directional,isGroupByProteinPair()); for (SubGroupFdrInfo sg : GroupedFDRs.getGroups()) sg.fdrGroupName = ProteinGroupLink.getFDRGroupName(sg.fdrGroup); @@ -894,11 +1029,11 @@ public void calculateProteinGroupPairFDR(double fdr, double safetyFactor, boolea if (directional) { for (ProteinGroupLink l : result.proteinGroupLinkFDR) { ProteinGroupDirectionalPair dpp = new ProteinGroupDirectionalPair(l); - linkPPIs.register(dpp); + l.setFdrPPI(linkPPIs.register(dpp)); } } else { for (ProteinGroupLink l : result.proteinGroupLinkFDR) { - linkPPIs.register(l.getProteinGroupPair()); + l.setFdrPPI(linkPPIs.register(l.getProteinGroupPair())); } } @@ -928,7 +1063,7 @@ public void calculateProteinGroupPairFDR(double fdr, double safetyFactor, boolea // fdrProtainGroupPair = fdr(fdr, safetyFactor, linkPPIs, nextFdrPPI, ppiFDRGroupsInput, countFdrPPI, targetProtDBSize, decoyProtDBSize, minPepCount, ignoreGroups, setElementFDR); - fdr(fdr, safetyFactor, linkPPIs, GroupedFDRs, targetProtDBSize, decoyProtDBSize, minPepCount, ignoreGroups, setElementFDR, directional); + fdr(fdr, safetyFactor, linkPPIs, GroupedFDRs, targetProtDBSize, decoyProtDBSize, minPepCount, ignoreGroups, setElementFDR, directional,false); for (SubGroupFdrInfo sg : GroupedFDRs.getGroups()) sg.fdrGroupName = ProteinGroupPair.getFDRGroupName(sg.fdrGroup); @@ -940,35 +1075,36 @@ public void filterFDRLinksByFDRProteinGroupPairs(FDRResult result) { // SubGroupFdrInfo pgl = joinSubFDRInfos(result.proteinGroupLinkFDR, true) ; HashedArrayList keep = new HashedArrayList(); - - for (ProteinGroupLink l : result.proteinGroupLinkFDR) { - if (result.proteinGroupPairFDR.filteredContains(l.getProteinGroupPair())) { - keep.add(l); - } + for (ProteinGroupPair pp : result.proteinGroupPairFDR.filteredResults()) { + keep.addAll(pp.getLinks()); } - result.proteinGroupLinkFDR.retainAll(keep); + } public void filterFDRPeptidePairsByFDRProteinGroupLinks(FDRResult result) { // SubGroupFdrInfo pgl = joinSubFDRInfos(result.proteinGroupLinkFDR, true) ; // SubGroupFdrInfo pps = joinSubFDRInfos(result.peptidePairFDR, true) ; - + long start = System.currentTimeMillis(); HashedArrayList keep = new HashedArrayList(); - for (PeptidePair pp : result.peptidePairFDR) { - if (!pp.isLinear()) { - // crosslinks can be filtered by links - ProteinGroupLink l = result.proteinGroupLinkFDR.filteredGet(pp.getLink()); - if (l!=null) { - keep.add(pp); - pp.setFdrLink(l); - } - } else - // linears can't so are keeped + int count=0; + int total= result.proteinGroupLinkFDR.size(); + for (ProteinGroupLink l : result.proteinGroupLinkFDR.filteredResults()) { + count++; + if (count% 10000 == 0 && System.currentTimeMillis() - start > 5000) { + System.err.println((count*100f/total) +"% filterFDRPeptidePairsByFDRProteinGroupLinks" ); + start=System.currentTimeMillis(); + } + keep.addAll(l.getPeptidePairs()); + } + for (PeptidePair pp : result.peptidePairFDR) { + if (pp.isLinear()) { keep.add(pp); + } } + result.peptidePairFDR.retainAll(keep); } @@ -978,33 +1114,37 @@ public void filterFDRPeptidePairsByFDRProteinGroups(FDRResult result) { HashedArrayList keep = new HashedArrayList(); - for (PeptidePair pp : result.peptidePairFDR) { - Peptide pep1 = pp.getPeptide1(); - ProteinGroup pg1 = result.proteinGroupFDR.filteredGet(pep1.getProteinGroup()); - // don't throw out decoys peptides where the target protein was found - if (pg1==null && pep1.isDecoy()) { - pg1 = result.proteinGroupFDR.filteredGet(pep1.getProteinGroup().decoyComplement()); - } - Peptide pep2 = pp.getPeptide1(); - ProteinGroup pg2 = result.proteinGroupFDR.filteredGet(pep2.getProteinGroup()); - // don't throw out decoys peptides where the target protein was found - if (pg2==null && pep2.isDecoy()) { - pg2 = result.proteinGroupFDR.filteredGet(pep2.getProteinGroup().decoyComplement()); - } - - int fc = 0; - if (pg1 != null) { - pp.setFdrProteinGroup(pg1); - fc=1; - } - if (pg2 != null) { - pp.setFdrProteinGroup(pg2); - fc++; - } - if (fc == 2 || (fc == 1 && pp.isLinear())) - keep.add(pp); - + for (ProteinGroup pg : result.proteinGroupFDR.filteredResults()) { + keep.addAll(pg.getPeptidePairs()); } +// for (PeptidePair pp : result.peptidePairFDR.filteredResults()) { +// +// Peptide pep1 = pp.getPeptide1(); +// ProteinGroup pg1 = result.proteinGroupFDR.filteredGet(pep1.getProteinGroup()); +// // don't throw out decoys peptides where the target protein was found +// if (pg1==null && pep1.isDecoy()) { +// pg1 = result.proteinGroupFDR.filteredGet(pep1.getProteinGroup().decoyComplement()); +// } +// Peptide pep2 = pp.getPeptide1(); +// ProteinGroup pg2 = result.proteinGroupFDR.filteredGet(pep2.getProteinGroup()); +// // don't throw out decoys peptides where the target protein was found +// if (pg2==null && pep2.isDecoy()) { +// pg2 = result.proteinGroupFDR.filteredGet(pep2.getProteinGroup().decoyComplement()); +// } +// +// int fc = 0; +// if (pg1 != null) { +// pp.setFdrProteinGroup(pg1); +// fc=1; +// } +// if (pg2 != null) { +// pp.setFdrProteinGroup(pg2); +// fc++; +// } +// if (fc == 2 || (fc == 1 && pp.isLinear())) +// keep.add(pp); +// +// } result.peptidePairFDR.retainAll(keep); } @@ -1012,16 +1152,22 @@ public void filterFDRProteinGroupsByFDRPeptidePairs(FDRResult result) { // SubGroupFdrInfo pgs = joinSubFDRInfos(result.proteinGroupFDR, true) ; // SubGroupFdrInfo pps = joinSubFDRInfos(result.peptidePairFDR, true) ; HashedArrayList keep = new HashedArrayList(); - - for (ProteinGroup pg : result.proteinGroupFDR) { - for (PeptidePair pp : pg.getPeptidePairs()) { - if (result.peptidePairFDR.filteredContains(pp)) { - keep.add(pg); - break; - } - } + + for (PeptidePair pp : result.peptidePairFDR.filteredResults()) { + keep.add(pp.getProteinGroup1()); + keep.add(pp.getProteinGroup2()); } + +// for (ProteinGroup pg : result.proteinGroupFDR) { +// for (PeptidePair pp : pg.getPeptidePairs()) { +// if (result.peptidePairFDR.filteredContains(pp)) { +// keep.add(pg); +// break; +// } +// } +// } + result.proteinGroupFDR.retainAll(keep); } @@ -1030,12 +1176,16 @@ public void filterFDRPSMByFDRPeptidePairs(FDRResult result) { // SubGroupFdrInfo pps = joinSubFDRInfos(result.peptidePairFDR, true) ; HashedArrayList keep = new HashedArrayList(); - for (PSM psm : result.psmFDR) { - - if (result.peptidePairFDR.filteredContains(psm.getPeptidePair())) { - keep.add(psm); - } + for (PeptidePair pp : result.peptidePairFDR.filteredResults()) { + keep.addAll(pp.getAllPSMs()); } + +// for (PSM psm : result.psmFDR) { +// +// if (result.peptidePairFDR.filteredContains(psm.getPeptidePair())) { +// keep.add(psm); +// } +// } result.psmFDR.retainAll(keep); } @@ -1084,147 +1234,85 @@ public FDRResult calculateFDR(double psmFDR, double peptidePairFDR, double Prote filterFDRProteinGroupsByFDRPeptidePairs(result); Logger.getLogger(this.getClass().getName()).log(Level.INFO,"fdr protein groups :" + result.proteinGroupFDR.getResultCount()); - /* - * I know one should not do this but I have some trouble with some variables not apearing - * with the right values... - */ - System.gc(); - + return result; -// // reset the lists -// psmFDRGroupsInput = new HashMap(); -// pepFDRGroupsInput = new HashMap(); -// linkFDRGroupsInput = new HashMap(); -// ppiFDRGroupsInput = new HashMap(); -// protFDRGroupsInput = new HashMap(); -// -// nextFdrPSM = new HashMap(); -// nextFdrPep = new HashMap(); -// nextFdrProteinGroup = new HashMap(); -// nextFdrLink = new HashMap(); -// nextFdrPPI = new HashMap(); -// -// countFdrPSM = new HashMap(); -// countFdrPep = new HashMap(); -// countFdrProteinGroup = new HashMap(); -// countFdrLink = new HashMap(); -// countFdrPPI = new HashMap(); -// -// fdrLinkGroupCounts = new CountOccurence(); -// -// -// SelfAddHashSet psmPeps = new SelfAddHashSet(); -// ArrayList forwardPeps = new ArrayList(); -// SelfAddHashSet pepProteinGroups = new SelfAddHashSet(); -// HashSet fdrProteinGroupHS = new HashSet(); -// SelfAddHashSet pepProteinGroupLinks = new SelfAddHashSet(); -// ArrayList forwardLinks = new ArrayList(); -// SelfAddHashSet linkPPI = new SelfAddHashSet(); -// ArrayList fdrPPI = new ArrayList(); -// -// -// -// //HashSet forwardPeps = new ArrayList(); -// ArrayList forwardPSM; -// -// target_psm_fdr = psmFDR; -// target_pep_fdr = peptidePairFDR; -// target_link_fdr = linkFDR; -// target_ppi_fdr = ppiFDR; -// target_prot_fdr = ProteinGroupFDR; -// target_safety_factor = safetyFactor; -// -// Logger.getLogger(this.getClass().getName()).log(Level.INFO, "psm fdr. " + allPSMs.size() + " PSMs input"); -// -// forwardPSM = fdr(psmFDR, safetyFactor, allPSMs, nextFdrPSM, psmFDRGroupsInput, countFdrPSM, targetPepDBSize, decoyPepDBSize, 1, ignoreGroups); -// -// -// Logger.getLogger(this.getClass().getName()).log(Level.INFO, "transfer " + forwardPSM.size() + " PSM to peptide pairs."); -// -// // psm-> peptide pairs -// for (PSM psm : forwardPSM) { -// psmPeps.register(psm.getPeptidePair()); -// } -// Logger.getLogger(this.getClass().getName()).log(Level.INFO, "peptidepair fdr. " + psmPeps.size() + " peptidepairs as input."); -// -// forwardPeps = fdr(peptidePairFDR, safetyFactor, psmPeps, nextFdrPep, pepFDRGroupsInput, countFdrPep, targetPepDBSize, decoyPepDBSize, 1, ignoreGroups); -// -// Logger.getLogger(this.getClass().getName()).log(Level.INFO, "transfer " + forwardPeps.size() + " PeptidePairs to ProteinGroups."); -// peptidePairsToProteinGroups(forwardPeps, pepProteinGroups); -// -// -// forwardPeps = proteinGroupFDR(ProteinGroupFDR, pepProteinGroups, safetyFactor, fdrProteinGroupHS, forwardPeps, getMinPepPerProteinGroup(), ignoreGroups); -// -// Logger.getLogger(this.getClass().getName()).log(Level.INFO, "turn peptidepairs to links (" + forwardPeps.size() + " input). "); -// -// fdrLinearPeptidePairs = new ArrayList(); -// PeptidePairsToGroupLinks(forwardPeps, pepProteinGroupLinks, fdrLinearPeptidePairs); -// -// fdrLinearPSM = new ArrayList(); -// for (PeptidePair pp : fdrLinearPeptidePairs) { -// fdrLinearPSM.addAll(pp.getTopPSMs()); -// } -// -// Logger.getLogger(this.getClass().getName()).log(Level.INFO, "link fdr (" + pepProteinGroupLinks.size() + " input )"); -// // link fdr -// // normalisation factors for links are not straight forward to define - as we have only peptides and proteins -// // so we just assume it's somewhere between pep and protein -// double lTarget = (targetPepDBSize * 10 + targetProtDBSize) / 11; -// double lDecoy = (decoyPepDBSize * 10 + decoyProtDBSize) / 11; -// forwardLinks = fdr(linkFDR, safetyFactor, pepProteinGroupLinks, nextFdrLink, linkFDRGroupsInput, countFdrLink, lTarget, lDecoy, getMinPepPerProteinGroupLink(), ignoreGroups); -// -// Logger.getLogger(this.getClass().getName()).log(Level.INFO, forwardLinks.size() + " links passed fdr"); -// -// // ppi fdr -// // turn links to interactions -// for (ProteinGroupLink l : forwardLinks) { -// linkPPI.register(l.getProteinGroupPair()); -// } -// -// Logger.getLogger(this.getClass().getName()).log(Level.INFO, "ppi fdr (" + linkPPI.size() + " input )"); -// // protein group pair fdr -// fdrProtainGroupPair = fdr(ppiFDR, safetyFactor, linkPPI, nextFdrPPI, ppiFDRGroupsInput, countFdrPPI, targetProtDBSize, decoyProtDBSize, getMinPepPerProteinGroupPair(), ignoreGroups); -// -// Logger.getLogger(this.getClass().getName()).log(Level.INFO, "ppi fdr resulted in " + fdrProtainGroupPair.size() + " PPIs"); -// -// //filter down Protein to links -// HashSet PPIback = new HashSet(fdrProtainGroupPair); -// fdrProtainGroupLinks = new ArrayList(); -// for (ProteinGroupLink pgl : forwardLinks) { -// if (PPIback.contains(pgl.getProteinGroupPair())) { -// fdrProtainGroupLinks.add(pgl); -// fdrLinkGroupCounts.add(pgl.getFDRGroup()); -// } -// } -// -// Logger.getLogger(this.getClass().getName()).log(Level.INFO, "the ppis represent " + fdrProtainGroupLinks.size() + " links"); -// // Links to peptides -// HashSet linkBack = new HashSet(fdrProtainGroupLinks); -// fdrPeptidePairs = new ArrayList(); -// for (PeptidePair pp : forwardPeps) { -// if (linkBack.contains(pp.getLink())) { -// fdrPeptidePairs.add(pp); -// } -// } -// Logger.getLogger(this.getClass().getName()).log(Level.INFO, "the ppis+links represent " + fdrPeptidePairs.size() + " peptidepairs"); -// -// // peptides to psm -// HashSet ppBack = new HashSet(fdrPeptidePairs); -// fdrPSM = new ArrayList(); -// for (PSM psm : forwardPSM) { -// if (ppBack.contains(psm.getPeptidePair())) { -// fdrPSM.add(psm); -// } -// } -// Logger.getLogger(this.getClass().getName()).log(Level.INFO, "the ppis+links+peptidepairs represent " + fdrPSM.size() + " PSMs"); } + public FDRResult calculateFDRProteinPairGrouped(double psmFDR, double peptidePairFDR, double ProteinGroupFDR, double linkFDR, double ppiFDR, double safetyFactor, boolean ignoreGroups,boolean setElementFDR, boolean filterToUniquePSM) { + FDRResult result = new FDRResult(); + result.reportFactor = safetyFactor; + reset(); + + + Logger.getLogger(this.getClass().getName()).log(Level.INFO,"Input PSM :" + getAllPSMs().size() + "\n calculation psm-fdr"); + calculatePSMFDR(100, safetyFactor, ignoreGroups,setElementFDR,result, isPsm_directional(), filterToUniquePSM); + + + Logger.getLogger(this.getClass().getName()).log(Level.INFO,"fdr PSM :" + result.psmFDR.getResultCount() + "\n calculation peptidepair-fdr"); + calculatePeptidePairFDR(100, safetyFactor, ignoreGroups,setElementFDR,result, isPeptides_directional()); + + + Logger.getLogger(this.getClass().getName()).log(Level.INFO,"fdr peptide-pairs :" + result.peptidePairFDR.getResultCount() + "\n calculation protein-group-fdr"); + calculateProteinGroupFDR(100, safetyFactor, ignoreGroups, getMinPepPerProteinGroup(), getMaximumProteinAmbiguity(),setElementFDR,result); + + + + Logger.getLogger(this.getClass().getName()).log(Level.INFO,"fdr peptide-pairs :" + result.peptidePairFDR.getResultCount() + "\n calculation link-fdr"); + calculateLinkFDR(100, safetyFactor, ignoreGroups, getMinPepPerProteinGroupLink(), getMaximumProteinAmbiguity(),setElementFDR,result, isLinks_directional()); + + + Logger.getLogger(this.getClass().getName()).log(Level.INFO,"fdr links :" + result.proteinGroupLinkFDR.getResultCount() + "\n calculation protein-group-pair-fdr"); + calculateProteinGroupPairFDR(100, safetyFactor, ignoreGroups, getMinPepPerProteinGroupPair(), getMaximumProteinPairAmbiguity(),setElementFDR,result, isPpi_directional()); + + this.setGroupByProteinPair(true); + + Logger.getLogger(this.getClass().getName()).log(Level.INFO,"Input PSM :" + getAllPSMs().size() + "\n calculation psm-fdr"); + calculatePSMFDR(psmFDR, safetyFactor, ignoreGroups,setElementFDR,result, isPsm_directional(), filterToUniquePSM); + + + Logger.getLogger(this.getClass().getName()).log(Level.INFO,"fdr PSM :" + result.psmFDR.getResultCount() + "\n calculation peptidepair-fdr"); + calculatePeptidePairFDR(peptidePairFDR, safetyFactor, ignoreGroups,setElementFDR,result, isPeptides_directional()); + + + Logger.getLogger(this.getClass().getName()).log(Level.INFO,"fdr peptide-pairs :" + result.peptidePairFDR.getResultCount() + "\n calculation protein-group-fdr"); + calculateProteinGroupFDR(ProteinGroupFDR, safetyFactor, ignoreGroups, getMinPepPerProteinGroup(), getMaximumProteinAmbiguity(),setElementFDR,result); + + + + Logger.getLogger(this.getClass().getName()).log(Level.INFO,"fdr protein groups :" + result.proteinGroupFDR.getResultCount() + "\n filtering peptide pairs by protein groups"); + filterFDRPeptidePairsByFDRProteinGroups(result); + + + Logger.getLogger(this.getClass().getName()).log(Level.INFO,"fdr peptide-pairs :" + result.peptidePairFDR.getResultCount() + "\n calculation link-fdr"); + calculateLinkFDR(linkFDR, safetyFactor, ignoreGroups, getMinPepPerProteinGroupLink(), getMaximumProteinAmbiguity(),setElementFDR,result, isLinks_directional()); + + + Logger.getLogger(this.getClass().getName()).log(Level.INFO,"fdr links :" + result.proteinGroupLinkFDR.getResultCount() + "\n calculation protein-group-pair-fdr"); + calculateProteinGroupPairFDR(ppiFDR, safetyFactor, ignoreGroups, getMinPepPerProteinGroupPair(), getMaximumProteinPairAmbiguity(),setElementFDR,result, isPpi_directional()); + + + Logger.getLogger(this.getClass().getName()).log(Level.INFO,"fdr protein-group-pairs :" + result.proteinGroupPairFDR.getResultCount() + "\n filtering links by protein-group-pairs"); + filterFDRLinksByFDRProteinGroupPairs(result); + + + Logger.getLogger(this.getClass().getName()).log(Level.INFO,"fdr links :" + result.proteinGroupLinkFDR.getResultCount() + "\n filtering peptide pairs by links"); + filterFDRPeptidePairsByFDRProteinGroupLinks(result); + + Logger.getLogger(this.getClass().getName()).log(Level.INFO,"fdr peptide-pairs :" + result.peptidePairFDR.getResultCount() + "\n filtering psm by peptide pairs"); + filterFDRPSMByFDRPeptidePairs(result); + + Logger.getLogger(this.getClass().getName()).log(Level.INFO,"fdr psms :" + result.psmFDR.getResultCount() + "\n filtering ProteinGroups by peptide pairs"); + filterFDRProteinGroupsByFDRPeptidePairs(result); + Logger.getLogger(this.getClass().getName()).log(Level.INFO,"fdr protein groups :" + result.proteinGroupFDR.getResultCount()); + + + + this.setGroupByProteinPair(false); + return result; + + } -// public FDRResult boost(FDRLevel what, int steps,, int between, double[] psmFDR, double[] peptidePairFDR, double[] ProteinGroupFDR, double[] linkFDR, double[] ppiFDR, double safetyFactor, boolean ignoreGroups,boolean setElementFDR, boolean filterToUniquePSM) { -// -// -// } @@ -1298,9 +1386,6 @@ public int compare(PSM o1, PSM o2) { for (PSM pp : psms) { - if (pp instanceof UniquePSM) { - pp = ((UniquePSM)pp).getTopPSM(); - } fdrPSMGroupCounts.add(pp.getFDRGroup()); String line = csvFormater.valuesToString(getPSMOutputLine(pp)); if (!csvSummaryOnly) { @@ -1640,7 +1725,7 @@ public int compare(ProteinGroup o1, ProteinGroup o2) { } summaryOut.println("xiFDR Version:" + seperator + OfflineFDR.xiFDRVersion); - summaryOut.println("Source:" + seperator + getSource()); + summaryOut.println("Source:" + seperator + csvFormater.quoteValue(getSource())); summaryOut.println("\"Target FDRs:\"" + seperator + "Minimum supporting peptides" + seperator + "Directional"); summaryOut.println("psm" + seperator + " " + result.psmFDR.getTargetFDR() + seperator + seperator + isPsm_directional() ); summaryOut.println("\"peptide pair\"" + seperator + " " + result.peptidePairFDR.getTargetFDR() + seperator + seperator + isPeptides_directional()); @@ -2106,7 +2191,7 @@ private > void defineConnectedness(Collection * @param ignoreGroups should we ignore groups cmpletely and just calculate a joined FDR? * @param setElementFDR should each element be flaged up with the FDR that it group has at the given score? - is used to speed up the maximation (by not setting these) */ - private > void fdr(double fdr, double safetyfactor, Collection fdrInput, FDRResultLevel groupInfo, double tCount, double dCount, int minPepCount, boolean ignoreGroups,boolean setElementFDR, boolean directional) { + private > void fdr(double fdr, double safetyfactor, Collection fdrInput, FDRResultLevel groupInfo, double tCount, double dCount, int minPepCount, boolean ignoreGroups,boolean setElementFDR, boolean directional, boolean groupByProteinPair) { HashMap> groupedList = new HashMap>(4); HashMap gTT = new HashMap(8); HashMap gTD = new HashMap(8); @@ -2114,6 +2199,14 @@ private > void fdr(double fdr, double safetyfact int resultcount =0; // HashedArrayList ret = new HashedArrayList(c.size()); + T firstinput = null; + boolean countmatches=false; + if (!fdrInput.isEmpty()) { + firstinput = fdrInput.iterator().next(); + if (firstinput instanceof PSM) { + countmatches=true; + } + } if (fdrInput.isEmpty()) { @@ -2124,24 +2217,57 @@ private > void fdr(double fdr, double safetyfact fdr = 1000; safetyfactor = 1000; } - + //HashMap protpairToID = new HashMap<>(); + int maxID =2; // split the data up into fdr-groups for (T e : fdrInput) { if (e.getPeptidePairCount() >= minPepCount) { - Integer fdrgroup = e.getFDRGroup(); - if (ignoreGroups) { + Integer fdrgroup = null; + if (ignoreGroups) { // don't do any grouping fdrgroup = -1; } else { - fdrgroup = e.getFDRGroup(); + if (groupByProteinPair) { + // do group by protein pairs to begin with + ProteinGroup pg1 = e.getProteinGroup1(); + ProteinGroup pg2 = e.getProteinGroup2(); + // make sure we always get the same key + String pgs1 =pg1.accessionsNoDecoy(); + String pgs2 =pg2.accessionsNoDecoy(); + + String k1 = pgs1 + "_xl_" + pgs2; + String k2 = pgs2 + "_xl_" + pgs1; + Integer id = protpairToID.get(k1); + if (id == null) // not found with key 1 -> try reversed key + id = protpairToID.get(k2); + // new protein pair + if (id == null) { + // assign id + id = maxID++; +// if (pgs1.contentEquals(pgs2)) { +// id=-id; +// } + protpairToID.put(k1,id); + protpairToID.put(k2,id); + protpairToSize.put(id,new UpdateableInteger(1)); + } else if(countmatches) { + protpairToSize.get(id).value++; + } + // set the id as fdr group + fdrgroup = id; + // and write it to the + e.setFDRGroup(id); + } else { + fdrgroup = e.getFDRGroup(); + } } - UpdateableInteger cTT; - UpdateableInteger cTD; - UpdateableInteger cDD; + // get the right list of matches ArrayList gl = groupedList.get(fdrgroup); if (gl == null) { + // does not exist yet - so make a new one gl = new ArrayList(); groupedList.put(fdrgroup, gl); + // start counting the types if (e.isTT()) { gTT.put(fdrgroup, new UpdateableInteger(1)); gTD.put(fdrgroup, new UpdateableInteger(0)); @@ -2167,10 +2293,57 @@ private > void fdr(double fdr, double safetyfact gl.add(e); } } - + + // join groups with similare number of PSMs + if (groupByProteinPair) { + UpdateableInteger max = RArrayUtils.max(protpairToSize.values()); + HashMap> groupedListNew = new HashMap>(4); + HashMap gTTNew = new HashMap(8); + HashMap gTDNew = new HashMap(8); + HashMap gDDNew = new HashMap(8); + for (Map.Entry> glOldE : groupedList.entrySet()) { + ArrayList glOld = glOldE.getValue(); + int oldgroup = glOldE.getKey(); + UpdateableInteger protpairsize =protpairToSize.get(oldgroup); + int sizekey = glOld.size() +100; + if (protpairsize != null) + sizekey = protpairsize.value; + if (oldgroup<0) { + sizekey = -sizekey; + } + int oldTT = gTT.get(oldgroup).value; + int oldTD = gTD.get(oldgroup).value; + int oldDD = gDD.get(oldgroup).value; + ArrayList glNew = groupedListNew.get(sizekey); + if (glNew== null) { + groupedListNew.put(sizekey, glOld); + + gTTNew.put(sizekey,new UpdateableInteger(oldTT) ); + gTDNew.put(sizekey,new UpdateableInteger(oldTD) ); + gDDNew.put(sizekey,new UpdateableInteger(oldDD) ); + } else { + glNew.addAll(glOld); + gTTNew.get(sizekey).value+=gTT.get(oldgroup).value; + gTDNew.get(sizekey).value+=gTD.get(oldgroup).value; + gDDNew.get(sizekey).value+=gDD.get(oldgroup).value; + } + } + groupedList = groupedListNew; + gTT=gTTNew; + gTD=gTDNew; + gDD=gDDNew; + } + + // collect all subgroups that have to small number of results + ArrayList toosmall = new ArrayList<>(); + int toosmallsum = 0; + SubGroupFdrInfo collectedToSmall = new SubGroupFdrInfo(); + SubGroupFdrInfo collectedToSmallWithin = new SubGroupFdrInfo(); + ArrayList tooSmallGroup = new ArrayList<>(); + ArrayList tooSmallGroupWithin = new ArrayList<>(); + for (Integer fdrgroup : groupedList.keySet()) { SubGroupFdrInfo info = new SubGroupFdrInfo(); - groupInfo.addGroup(fdrgroup, info); info.TT = gTT.get(fdrgroup).value; info.TD = gTD.get(fdrgroup).value; info.DD = gDD.get(fdrgroup).value; @@ -2179,7 +2352,6 @@ private > void fdr(double fdr, double safetyfact info.DCount = dCount; info.TCount = tCount; - info.inputCount=group.size(); ArrayList groupResult = new ArrayList(); info.inputCount = group.size(); @@ -2187,17 +2359,83 @@ private > void fdr(double fdr, double safetyfact info.saftyfactor = safetyfactor; info.fdrGroup=fdrgroup; subFDR(group, groupResult, setElementFDR, info, directional); + if (groupResult.size()*fdr{1}({2})", new Object[]{group.get(0).getClass(), fdrgroup, group.get(0).getFDRGroupName()}); + //between + if (fdrgroup>=0) { + toosmallsum+=groupResult.size(); + toosmall.add(fdrgroup); + collectedToSmall.TT += info.TT; + collectedToSmall.TD += info.TD; + collectedToSmall.DD += info.DD; + collectedToSmall.DCount += info.DCount; + collectedToSmall.TCount += info.TCount; + collectedToSmall.inputCount += info.inputCount; + tooSmallGroup.addAll(group); + groupResult.clear(); + } else { + // within group + toosmallsum+=groupResult.size(); + toosmall.add(fdrgroup); + collectedToSmallWithin.TT += info.TT; + collectedToSmallWithin.TD += info.TD; + collectedToSmallWithin.DD += info.DD; + collectedToSmallWithin.DCount += info.DCount; + collectedToSmallWithin.TCount += info.TCount; + collectedToSmallWithin.inputCount += info.inputCount; + tooSmallGroupWithin.addAll(group); + groupResult.clear(); + + } + } else { + groupInfo.addGroup(fdrgroup, info); + // group, fdr, safetyfactor, groupResult, tCount, dCount,setElementFDR); + // nextFDR.put(fdrgroup, prevFDR); + // ret.addAll(groupResult); + resultcount+=groupResult.size(); + groupInfo.setLinear(groupInfo.getLinear()+info.linear); + groupInfo.setWithin(groupInfo.getWithin()+info.within); + groupInfo.setBetween(groupInfo.getBetween()+info.between); + // resultCounts.put(fdrgroup, groupResult.size()); + } + + } + + // did we collect some subgroups with to small numbers? + if (toosmallsum >getMinDecoys()/fdr) { + Logger.getLogger(this.getClass().getName()).log(Level.FINE, "Join up discarded groups to try and get some more results"); + ArrayList groupResult = new ArrayList(); + collectedToSmall.targteFDR = fdr; + collectedToSmall.saftyfactor = safetyfactor; + collectedToSmall.fdrGroup=-1; + subFDR(tooSmallGroup, groupResult, setElementFDR, collectedToSmall, directional); + groupInfo.addGroup(-1, collectedToSmall); // group, fdr, safetyfactor, groupResult, tCount, dCount,setElementFDR); // nextFDR.put(fdrgroup, prevFDR); // ret.addAll(groupResult); resultcount+=groupResult.size(); - groupInfo.setLinear(groupInfo.getLinear()+info.linear); - groupInfo.setWithin(groupInfo.getWithin()+info.within); - groupInfo.setBetween(groupInfo.getBetween()+info.between); -// resultCounts.put(fdrgroup, groupResult.size()); - + groupInfo.setLinear(groupInfo.getLinear()+collectedToSmall.linear); + groupInfo.setWithin(groupInfo.getWithin()+collectedToSmall.within); + groupInfo.setBetween(groupInfo.getBetween()+collectedToSmall.between); + + ArrayList groupResultwithin = new ArrayList(); + + collectedToSmallWithin.targteFDR = fdr; + collectedToSmallWithin.saftyfactor = safetyfactor; + collectedToSmallWithin.fdrGroup=-2; + subFDR(tooSmallGroupWithin, groupResultwithin, setElementFDR, collectedToSmallWithin, directional); + groupInfo.addGroup(-1, collectedToSmallWithin); +// group, fdr, safetyfactor, groupResult, tCount, dCount,setElementFDR); +// nextFDR.put(fdrgroup, prevFDR); +// ret.addAll(groupResult); + resultcount+=groupResult.size(); + groupInfo.setLinear(groupInfo.getLinear()+collectedToSmallWithin.linear); + groupInfo.setWithin(groupInfo.getWithin()+collectedToSmallWithin.within); + groupInfo.setBetween(groupInfo.getBetween()+collectedToSmallWithin.between); } + + if (resultcount == 0 && fdrInput.size() > 100) { @@ -2217,6 +2455,9 @@ private > void fdr(double fdr, double safetyfact ArrayList all = new ArrayList(fdrInput); double prevFDR = subFDR(all, allResult, setElementFDR, info, directional); + if (allResult.size()*fdr= 0; i--) { @@ -2652,19 +2896,27 @@ public int compare(T o1, T o2) { if (e.isTT()) { TT--; + if (e.isLinear()) + info.linear++; + + if (e.isInternal()) + info.within++; + else if (e.isBetween()) + info.between++; + } else if (e.isTD()) { TD--; + info.resultTD++; } else if (e.isDD()) { DD--; + info.resultDD++; } - if (e.isLinear()) - info.linear++; - - if (e.isInternal()) - info.within++; - if (e.isBetween()) - info.between++; +// if (e.isInternal()) +// info.within++; +// +// if (e.isBetween()) +// info.between++; // normTT = TT * TTfactor; // normTD = TD * TDfactor; @@ -2695,6 +2947,15 @@ public int compare(T o1, T o2) { } else { for (; i >= 0; i--) { e = group.get(i); + if (e.isTT()) { + if (e.isLinear()) + info.linear++; + + if (e.isInternal()) + info.within++; + else if (e.isBetween()) + info.between++; + } ret.add(e); } } @@ -3465,7 +3726,7 @@ protected ArrayList getPSMOutputLine(PSM pp) { , Boolean.toString(pp.isTT()) ,Boolean.toString(pp.isTD()) ,Boolean.toString(pp.isDD() ) - , pp.getFDRGroupName() + ,(groupByProteinPair?"PG"+pp.getFDRGroup():pp.getFDRGroupName()) ,Double.toString(pp.getFDR()) ,"", (pep == null ? "" : Double.toString(pep.getFDR()) ) ,(pp.getFdrProteinGroup1() == null ? "" : Double.toString(pp.getFdrProteinGroup1().getFDR())) @@ -3575,14 +3836,18 @@ protected ArrayList getLinearPepeptideOutputLine(PeptidePair pp) { // "ID" + "PSMIDs" + "Protein" + "Decoy" + "Peptide" + "psmID" + "Score" + "isDecoy" + "fdrGroup" + "fdr" + + "ProteinFDR"); ret.add(Integer.toString(pp.getPeptidePairID())); ret.add( RArrayUtils.toString(psmids, ";")); - ret.add( pg1.acessions() ); + ret.add( pg1.accessions() ); ret.add( pg1.descriptions()); ret.add( Boolean.toString(pp.getPeptide1().isDecoy())); ret.add( getPeptideSequence(pp.getPeptide1())); ret.add( pp.getTopPSMIDs()); ret.add( Double.toString(pp.getScore())); ret.add( Boolean.toString(pp.isDecoy())); - ret.add( pp.getFDRGroupName()); + if (groupByProteinPair) { + ret.add( "PG"+pp.getFDRGroup() ); + }else { + ret.add( pp.getFDRGroupName() ); + } ret.add( Double.toString(pp.getFDR())); ret.add( ""); ret.add( (pp.getFdrProteinGroup1() == null ? "" : Double.toString(pp.getFdrProteinGroup1().getFDR()))); @@ -3591,12 +3856,8 @@ protected ArrayList getLinearPepeptideOutputLine(PeptidePair pp) { HashMap runScore = new HashMap<>(); for (PSM psm : pp.getAllPSMs()) { - if (psm instanceof UniquePSM) { - for (PSM upsm : (UniquePSM) psm) - psmToRun(upsm, linkRuns, runScore); - } else { - psmToRun(psm, linkRuns, runScore); - } + for (PSM upsm : psm.getRepresented()) + psmToRun(upsm, linkRuns, runScore); } for (String r : runs) { @@ -3624,10 +3885,10 @@ protected ArrayList getXlPepeptideOutputLine(PeptidePair pp) { // try { ret.add(Integer.toString(pp.getPeptidePairID())); ret.add( RArrayUtils.toString(psmids, ";") ); - ret.add( pg1.acessions() ); + ret.add( pg1.accessions() ); ret.add( pg1.descriptions() ); ret.add( ""+pp.getPeptide1().isDecoy() ); - ret.add( pg2.acessions() ); + ret.add( pg2.accessions() ); ret.add( pg2.descriptions()); ret.add( ""+pp.getPeptide2().isDecoy() ); ret.add(getPeptideSequence(pp.getPeptide1()) ); @@ -3643,7 +3904,11 @@ protected ArrayList getXlPepeptideOutputLine(PeptidePair pp) { ret.add( ""+pp.isTT() ); ret.add( ""+pp.isTD() ); ret.add( ""+pp.isDD() ); - ret.add( pp.getFDRGroupName() ); + if (groupByProteinPair) { + ret.add( "PG"+pp.getFDRGroup() ); + }else { + ret.add( pp.getFDRGroupName() ); + } ret.add( ""+pp.getFDR() ); ret.add(""); ret.add((pp.getFdrProteinGroup1()==null ? "" : ""+pp.getFdrProteinGroup1().getFDR()) ); @@ -3657,12 +3922,8 @@ protected ArrayList getXlPepeptideOutputLine(PeptidePair pp) { HashMap runScore = new HashMap<>(); for (PSM psm : pp.getAllPSMs()) { - if (psm instanceof UniquePSM) { - for (PSM upsm : (UniquePSM) psm) - psmToRun(upsm, linkRuns, runScore); - } else { - psmToRun(psm, linkRuns, runScore); - } + for (PSM upsm : psm.getRepresented()) + psmToRun(upsm, linkRuns, runScore); } for (String r : runs) { @@ -3703,12 +3964,8 @@ protected ArrayList getLinkOutputLine(ProteinGroupLink l) { } } for (PSM psm : pp.getAllPSMs()) { - if (psm instanceof UniquePSM) { - for (PSM upsm : (UniquePSM) psm) - psmToRun(upsm, linkRuns, runScore); - } else { - psmToRun(psm, linkRuns, runScore); - } + for (PSM upsm : psm.getRepresented()) + psmToRun(upsm, linkRuns, runScore); } } ProteinGroup pg1 = l.getProteinGroup1(); @@ -3734,7 +3991,11 @@ protected ArrayList getLinkOutputLine(ProteinGroupLink l) { ret.add("" + l.isDD() ); ret.add("" + psmids.length ); ret.add("" + pepids.length ); - ret.add( l.getFDRGroupName() ); + if (groupByProteinPair) { + ret.add( "PG"+l.getFDRGroup() ); + }else { + ret.add( l.getFDRGroupName() ); + } ret.add("" + l.getFDR() ); for (String r : runs) { Double d=runScore.get(r); @@ -3878,10 +4139,10 @@ protected ArrayList getPPIOutputLine(ProteinGroupPair pgp) { ret.add(RArrayUtils.toString(linkids, ";") ); ret.add(RArrayUtils.toString(pepids, ";") ); ret.add(RArrayUtils.toString(psmids, ";") ); - ret.add(pgp.getProtein1().acessions() ); + ret.add(pgp.getProtein1().accessions() ); ret.add( pgp.getProtein1().descriptions() ); ret.add("" + pgp.getProtein1().isDecoy() ); - ret.add( pgp.getProtein2().acessions() ); + ret.add( pgp.getProtein2().accessions() ); ret.add( pgp.getProtein2().descriptions() ); ret.add("" +pgp.getProtein2().isDecoy() ); ret.add( RArrayUtils.toString(xl, ";")); @@ -3946,14 +4207,9 @@ protected ArrayList getProteinGroupOutput(ProteinGroup pg) { } } for (PSM psm : pp.getAllPSMs()) { - if (psm instanceof UniquePSM) { - for (PSM upsm : (UniquePSM) psm) { - psmToRun(upsm, linkRuns, runScore); - psmids.add(upsm.getPsmID()); - } - } else { - psmToRun(psm, linkRuns, runScore); - psmids.add(psm.getPsmID()); + for (PSM upsm : psm.getRepresented()) { + psmToRun(upsm, linkRuns, runScore); + psmids.add(upsm.getPsmID()); } } } @@ -3962,7 +4218,8 @@ protected ArrayList getProteinGroupOutput(ProteinGroup pg) { sequences.add(p.getSequence()); } ArrayListret = new ArrayList(); - ret.add( pg.acessions() ); + ret.add( pg.ids() ); + ret.add( pg.accessions() ); ret.add( pg.descriptions() ); ret.add( RArrayUtils.toString(sequences, ";")); ret.add( RArrayUtils.toString(crosslinker, ";")); @@ -4100,4 +4357,40 @@ public static Version getXiFDRVersion() { public static void setXiFDRVersion(Version aXiFDRVersion) { xiFDRVersion = aXiFDRVersion; } + + /** + * group matches by protein pairs + * @return the groupByProteinPair + */ + public boolean isGroupByProteinPair() { + return groupByProteinPair; + } + + /** + * group matches by protein pairs + * @param groupByProteinPair the groupByProteinPair to set + */ + public void setGroupByProteinPair(boolean groupByProteinPair) { + this.groupByProteinPair = groupByProteinPair; + if (groupByProteinPair) { + setMinDecoys(1); + } + } + + /** + * how many decoys does a fdr group need to have to be reported as result + * @return the minDecoys + */ + public Integer getMinDecoys() { + return minDecoys; + } + + /** + * how many decoys does a fdr group need to have to be reported as result + * @param minDecoys the minDecoys to set + */ + public void setMinDecoys(Integer minDecoys) { + this.minDecoys = minDecoys; + } + } diff --git a/src/main/java/org/rappsilber/fdr/entities/PSM.java b/src/main/java/org/rappsilber/fdr/entities/PSM.java index b2b3d2c..da941f2 100644 --- a/src/main/java/org/rappsilber/fdr/entities/PSM.java +++ b/src/main/java/org/rappsilber/fdr/entities/PSM.java @@ -45,23 +45,11 @@ public class PSM extends AbstractFDRElement { */ private PeptidePair m_peppair; - /** - * the link represented by this PSM - */ - private ProteinGroupLink m_link; - /** - * the protein pair represented by this PSM - */ - private ProteinGroupPair m_ppi; /** link-site in peptide1 */ - private int pepsite1; + private byte pepsite1; /** link-site in peptide2 */ - private int pepsite2; - /** length of peptide1 */ - private int peplen1; - /** length of peptide2 */ - private int peplen2; + private byte pepsite2; /** positions of peptide1 */ Peptide peptide1; /** positions of peptide2 */ @@ -69,7 +57,7 @@ public class PSM extends AbstractFDRElement { /** overall score of this pair */ private double score; /** top-score per charge state */ - private int charge = 0; + private byte charge = 0; /** * M/Z value of the spectrum */ @@ -81,7 +69,7 @@ public class PSM extends AbstractFDRElement { /** * Charge value of the matched peptide(pair) */ - private int match_charge; + private byte exp_charge; /** * @@ -93,18 +81,20 @@ public class PSM extends AbstractFDRElement { private boolean isDecoy1; /** second peptide comes from a decoy sequence */ private boolean isDecoy2; + /** short cut for testing of tt (0) td(1) or dd(2) matches */ + private byte isTT_TD_DD; /** it could be a protein internal link */ private boolean isInternal = false; /** is this a linear "peptide pair" - meaning only one peptide */ private boolean isLinear = false; /** is this a loop-linked peptide */ private boolean isLoop = false; - /** are all peptides from the target database */ - private boolean isTT = false; - /** is one peptide from the decoy database */ - private boolean isTD = false; - /** are all peptides from the decoy database */ - private boolean isDD = false; +// /** are all peptides from the target database */ +// private boolean isTT = false; +// /** is one peptide from the decoy database */ +// private boolean isTD = false; +// /** are all peptides from the decoy database */ +// private boolean isDD = false; /** an id for the fdr-group of this PSM */ private int fdrGroup; /** what is the calculated FDR for the score of this PSM */ @@ -124,14 +114,14 @@ public class PSM extends AbstractFDRElement { */ private boolean specialcase = false; - private UniquePSM partOfUniquePSM; + private PSM partOfUniquePSM; - private final static String nolinker = ""; + private final static String NOLINKER = ""; /** * The cross-linker for this match */ - public String crosslinker = nolinker; + public String crosslinker = NOLINKER; /** * I filter all cross-linker names through this HashMap. @@ -143,7 +133,19 @@ public class PSM extends AbstractFDRElement { */ private static HashMap allLinker = new HashMap(); + /** + * what was the score prior normalisation + */ private double preNormalisedScore; + + /** + * If we filter to unique PSMs then the top-scoring will represent a set of + * psms. As we don't want to lose the info which ones are represented we + * list them here. + */ + private ArrayList represents; + + /** * creates a new instance of a PSM. @@ -163,8 +165,8 @@ public class PSM extends AbstractFDRElement { * @param scoreRatio how to split the score between the peptides - this is * only used, if a protein FDR (each single protein) is to be calculated. */ - public PSM(String psmID, String run, String scan, Peptide peptide1, Peptide peptide2, int site1, int site2, boolean isDecoy1, boolean isDecoy2, int charge, double score, double scoreRatio) { - this(psmID, peptide1, peptide2, site1, site2, isDecoy1, isDecoy2, charge, score, scoreRatio); + public PSM(String psmID, String run, String scan, Peptide peptide1, Peptide peptide2, byte site1, byte site2, boolean isDecoy1, boolean isDecoy2, byte charge, double score, double scoreRatio) { + this(psmID, peptide1, peptide2, (byte)site1, (byte)site2, isDecoy1, isDecoy2, (byte)charge, score, scoreRatio); this.run = run; this.scan = scan; } @@ -186,7 +188,7 @@ public PSM(String psmID, String run, String scan, Peptide peptide1, Peptide pept * @param scoreRatio how to split the score between the peptides - this is * only used, if a protein FDR (each single protein) is to be calculated. */ - public PSM(String psmID, Peptide peptide1, Peptide peptide2, int site1, int site2, boolean isDecoy1, boolean isDecoy2, int charge, double score, double scoreRatio) { + public PSM(String psmID, Peptide peptide1, Peptide peptide2, byte site1, byte site2, boolean isDecoy1, boolean isDecoy2, byte charge, double score, double scoreRatio) { this.psmID = psmID; // this.id1 = id1; // this.id2 = id2; @@ -196,15 +198,10 @@ public PSM(String psmID, Peptide peptide1, Peptide peptide2, int site1, int site this.isDecoy1 = isDecoy1; this.isDecoy2 = isDecoy2; if (isDecoy1) { - if (isDecoy2) { - isDD = true; - } else { - isTD = true; - } - } else if (isDecoy2) { - isTD = true; - } else { - isTT = true; + isTT_TD_DD++; + } + if (isDecoy2) { + isTT_TD_DD++; } this.charge = charge; this.score = score; @@ -219,6 +216,8 @@ public PSM(String psmID, Peptide peptide1, Peptide peptide2, int site1, int site this.isLinear = peptide1 == Peptide.NOPEPTIDE || peptide2 == Peptide.NOPEPTIDE; this.isLoop = this.isLinear && site1 >= 0 && site2 >= 0; this.isInternal = peptide1.sameProtein(peptide2); + represents = new ArrayList(); + represents.add(this); // setFDRGroup(); @@ -366,18 +365,21 @@ public Peptide getPeptide1() { public Peptide getPeptide2() { return peptide2; } + + + /** * @return the link site of the first peptide */ - public int getPeptideLinkSite1() { + public byte getPeptideLinkSite1() { return pepsite1; } /** * @return the link site of the second peptide */ - public int getPeptideLinkSite2() { + public byte getPeptideLinkSite2() { return pepsite2; } @@ -385,7 +387,7 @@ public int getPeptideLinkSite2() { * @param peptide * @return the link site of the given peptide */ - public int getPeptideLinkSite(int peptide) { + public byte getPeptideLinkSite(int peptide) { return peptide == 0 ? pepsite1 : pepsite2; } @@ -408,7 +410,7 @@ public void setScore(double score) { /** * @return the precursor charge state of the PSM */ - public int getCharge() { + public byte getCharge() { return charge; } @@ -452,7 +454,7 @@ public boolean isInternal() { */ @Override public boolean isTT() { - return isTT; + return isTT_TD_DD==0; } /** @@ -461,7 +463,7 @@ public boolean isTT() { */ @Override public boolean isTD() { - return isTD; + return isTT_TD_DD==1; } /** @@ -470,7 +472,7 @@ public boolean isTD() { */ @Override public boolean isDD() { - return isDD; + return isTT_TD_DD==2; } /** @@ -558,7 +560,16 @@ public void setFDRGroup() { fdrGroup = PeptidePair.getFDRGroup(peptide1, peptide2, isLinear(), isInternal, isSpecialcase()); } - + + /** + * set the FDR group according to the information on this PSM + */ + public void setFDRGroup(int fdrGroup) { + + this.fdrGroup = fdrGroup; + + } + /** * store the FDR assigned to the score of this PSM * @param fdr @@ -628,6 +639,9 @@ public void reset() { resetFdrProteinGroup(); setFdrPeptidePair(null); setLinkedSupport(1); + setPartOfUniquePSM(null); + represents.clear(); + represents.add(this); } /** @@ -645,10 +659,15 @@ public void resetFdrProteinGroup() { * @param pg */ public void setFdrProteinGroup(ProteinGroup pg) { - if (pg.equals(peptide1.getProteinGroup())) - this.fdrProteinGroup1 = pg; - if (pg.equals(peptide2.getProteinGroup())) - this.fdrProteinGroup2 = pg; + if (pg == null) { + this.fdrProteinGroup1 = null; + this.fdrProteinGroup2 = null; + } else { + if (pg.equals(peptide1.getProteinGroup())) + this.fdrProteinGroup1 = pg; + if (pg.equals(peptide2.getProteinGroup())) + this.fdrProteinGroup2 = pg; + } } /** @@ -833,16 +852,16 @@ public void setCalcMass(double calcMass) { * Charge value of the matched peptide(pair) * @return the match_charge */ - public int getMatchedCharge() { - return match_charge; + public int getExpCharge() { + return exp_charge; } /** * Charge value of the matched peptide(pair) * @param match_charge the match_charge to set */ - public void setMatchedCharge(int match_charge) { - this.match_charge = match_charge; + public void setExpCharge(byte match_charge) { + this.exp_charge = match_charge; } /** @@ -899,15 +918,36 @@ public void setNonnormalizedScore(double score) { /** * @return the partOfUniquePSM */ - public UniquePSM getPartOfUniquePSM() { + public PSM getPartOfUniquePSM() { return partOfUniquePSM; } /** * @param partOfUniquePSM the partOfUniquePSM to set */ - public void setPartOfUniquePSM(UniquePSM partOfUniquePSM) { + public void setPartOfUniquePSM(PSM partOfUniquePSM) { this.partOfUniquePSM = partOfUniquePSM; } + + public void represents(PSM psm) { + this.represents.add(psm); + if (psm.represents.size() >0) { + this.represents.addAll(psm.represents); + } + } + + public ArrayList getRepresented() { + return represents; + } + + @Override + public ProteinGroup getProteinGroup1() { + return getPeptide1().getProteinGroup(); + } + + @Override + public ProteinGroup getProteinGroup2() { + return getPeptide2().getProteinGroup(); + } } diff --git a/src/main/java/org/rappsilber/fdr/entities/Peptide.java b/src/main/java/org/rappsilber/fdr/entities/Peptide.java index 9ea268f..c876dc2 100644 --- a/src/main/java/org/rappsilber/fdr/entities/Peptide.java +++ b/src/main/java/org/rappsilber/fdr/entities/Peptide.java @@ -389,7 +389,7 @@ public double getFDR() { */ public void resetFDR() { m_fdr= Double.MAX_VALUE; - m_peppairs = new HashSet(); + m_peppairs.clear(); //m_positions = new HashMap(); setLinkedSupport(1); } @@ -564,4 +564,19 @@ public void setMass(double mass) { public double getMass() { return this.mass; } + + @Override + public ProteinGroup getProteinGroup1() { + return getProteinGroup(); + } + + @Override + public ProteinGroup getProteinGroup2() { + return ProteinGroup.NOPROTEINGROUP; + } + + @Override + public void setFDRGroup(int fdrGroup) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } } diff --git a/src/main/java/org/rappsilber/fdr/entities/PeptidePair.java b/src/main/java/org/rappsilber/fdr/entities/PeptidePair.java index 21cf010..cecb553 100644 --- a/src/main/java/org/rappsilber/fdr/entities/PeptidePair.java +++ b/src/main/java/org/rappsilber/fdr/entities/PeptidePair.java @@ -61,11 +61,11 @@ public class PeptidePair extends AbstractFDRElement {//implements C /** * link-site in peptide1 */ - private int pepsite1; + private byte pepsite1; /** * link-site in peptide2 */ - private int pepsite2; + private byte pepsite2; /** * overall score of this pair @@ -82,7 +82,8 @@ public class PeptidePair extends AbstractFDRElement {//implements C /** * top match per chare state */ - private HashMap chargeTopScoresPSM = new HashMap(); + //private HashMap chargeTopScoresPSM = new HashMap(); + private PSM[] chargeTopScoresPSM; /** * PSMs supporting this peptide pair */ @@ -156,7 +157,8 @@ public PeptidePair(PSM psm) { // this.chargeTopScores.set(psm.getCharge(), psm.getScore()); // this.chargeTopScoresPSMId.set(psm.getCharge(), psm.getPsmID()); this.psms.add(psm); - this.chargeTopScoresPSM.put(psm.getCharge(), psm); + this.chargeTopScoresPSM = new PSM[psm.getCharge()+1]; + this.chargeTopScoresPSM[psm.getCharge()] = psm; this.chargeTopScoresRatios.set(psm.getCharge(), psm.getScoreRatio()); this.hashcode = (peptide1.hashCode() + peptide2.hashCode()) % 100000 * 10 + (pepsite1 + pepsite2) % 10; @@ -197,28 +199,45 @@ public void add(PeptidePair p) { this.psms.addAll(p.psms); boolean invertScoreRatio = false; // transfer topScores and match-ids - for (int i : p.chargeTopScoresPSM.keySet()) { - PSM ppsm = p.chargeTopScoresPSM.get(i); - - PSM cpsm = chargeTopScoresPSM.get(i); + if (p.chargeTopScoresPSM.length > chargeTopScoresPSM.length) { + PSM[] dummy = chargeTopScoresPSM; + chargeTopScoresPSM = new PSM[p.chargeTopScoresPSM.length]; + System.arraycopy(dummy, 0, chargeTopScoresPSM, 0, dummy.length); + } + for (int i = 0 ; i< p.chargeTopScoresPSM.length;i++) { + PSM ppsm = p.chargeTopScoresPSM[i]; + if (ppsm == null) + continue; + + PSM cpsm =null; + if (chargeTopScoresPSM.length>i) + cpsm= chargeTopScoresPSM[i]; + if (cpsm == null || ppsm.getScore() > cpsm.getScore()) { - chargeTopScoresPSM.put(i, ppsm); + chargeTopScoresPSM[i]= ppsm; if (invertScoreRatio) { chargeTopScoresRatios.set(i, 1 - p.chargeTopScoresRatios.get(i)); } else { chargeTopScoresRatios.set(i, p.chargeTopScoresRatios.get(i)); } + } + } + if (p.isInternal && !isInternal) { + isInternal = true; if (specialcase && !p.isSpecialcase()) specialcase = false; setFDRGroup(); + } else if (specialcase && !p.isSpecialcase()) { + specialcase = false; setFDRGroup(); + } } @@ -229,8 +248,9 @@ public void add(PeptidePair p) { */ public void setScore() { score = 0; - for (PSM psm : chargeTopScoresPSM.values()) { - score += psm.getScore() * psm.getScore(); + for (PSM psm : chargeTopScoresPSM) { + if (psm!=null) + score += psm.getScore() * psm.getScore(); } score = Math.sqrt(score); } @@ -306,8 +326,10 @@ public double getProteinScore(Protein prot) { int prot1size = prot1.size(); for (Protein p : prot1) { if (p.equals(prot)) { - for (int c : chargeTopScoresPSM.keySet()) { - double cscore = chargeTopScoresPSM.get(c).getScore() * chargeTopScoresRatios.get(c, 0) / prot1size; + for (int c =0; c getPeptides() { * @return */ public String getTopPSMIDs() { - return RArrayUtils.toString(chargeTopScoresPSM.values(), ";"); - + return RArrayUtils.toStringNoNull(chargeTopScoresPSM, ";"); } /** @@ -551,7 +578,11 @@ public String getTopPSMIDs() { * @return */ public Collection getTopPSMs() { - return chargeTopScoresPSM.values(); + ArrayList psms = new ArrayList<>(); + for (PSM p : chargeTopScoresPSM) + if (p!=null) + psms.add(p); + return psms; } /** @@ -727,6 +758,12 @@ public void setFDRGroup() { fdrGroup = getFDRGroup(peptide1, peptide2, isLinear, isInternal, specialcase); } + /** + * define the fdr-group for this match + */ + public void setFDRGroup(int fdrGroup) { + this.fdrGroup = fdrGroup; + } /** * is this actually a single peptide @@ -751,8 +788,9 @@ public void setLinear(boolean isLinear) { */ public void setFDR(double fdr) { m_fdr = fdr; - for (PSM psm : chargeTopScoresPSM.values()) { - psm.setFdrPeptidePair(this); + for (PSM psm : chargeTopScoresPSM) { + if (psm != null) + psm.setFdrPeptidePair(this); } } @@ -770,8 +808,11 @@ public double getFDR() { */ public void setFdrLink(ProteinGroupLink l) { this.m_link = l; - for (PSM psm : chargeTopScoresPSM.values()) { - psm.setFdrPeptidePair(this); + if (l != null) { + for (PSM psm : chargeTopScoresPSM) { + if (psm != null) + psm.setFdrPeptidePair(this); + } } } @@ -782,18 +823,28 @@ public void setFdrLink(ProteinGroupLink l) { */ public void setFdrProteinGroup(ProteinGroup pg) { - if (pg.equals(peptide1.getProteinGroup())) { - this.fdrProteinGroup1 = pg; - } + if (pg == null) { + this.fdrProteinGroup1 = null; + this.fdrProteinGroup2 = null; + for (PSM psm : chargeTopScoresPSM) { + if (psm != null) + psm.setFdrProteinGroup(null); + } + } else { + if (pg.equals(peptide1.getProteinGroup())) { + this.fdrProteinGroup1 = pg; + } - if (pg.equals(peptide2.getProteinGroup())) { - this.fdrProteinGroup2 = pg; - } + if (pg.equals(peptide2.getProteinGroup())) { + this.fdrProteinGroup2 = pg; + } - for (PSM psm : chargeTopScoresPSM.values()) { - psm.setFdrProteinGroup(pg); + for (PSM psm : chargeTopScoresPSM) { + if (psm != null) + psm.setFdrProteinGroup(pg); + } } - + } /** @@ -817,13 +868,17 @@ public ProteinGroup getFdrProteinGroup2() { * @return */ public String[] getPSMids() { - String[] ret = new String[chargeTopScoresPSM.size()]; + //String[] ret = new String[chargeTopScoresPSM.size()]; + ArrayList ret = new ArrayList<>(chargeTopScoresPSM.length); + int c = 0; - for (PSM psm : chargeTopScoresPSM.values()) { - ret[c++] = psm.getPsmID(); + for (PSM psm : chargeTopScoresPSM) { + if (psm!=null) { + ret.add(psm.getPsmID()); + } } - return ret; + return ret.toArray(new String[ret.size()]); } /** @@ -931,4 +986,14 @@ public ArrayList getAllPSMs() { public String getCrosslinker() { return crosslinker; } + + @Override + public ProteinGroup getProteinGroup1() { + return peptide1.getProteinGroup(); + } + + @Override + public ProteinGroup getProteinGroup2() { + return peptide2.getProteinGroup(); + } } diff --git a/src/main/java/org/rappsilber/fdr/entities/Protein.java b/src/main/java/org/rappsilber/fdr/entities/Protein.java index a88f0cc..e58f5f8 100644 --- a/src/main/java/org/rappsilber/fdr/entities/Protein.java +++ b/src/main/java/org/rappsilber/fdr/entities/Protein.java @@ -18,6 +18,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; +import org.rappsilber.fdr.groups.ProteinGroup; import org.rappsilber.fdr.utils.AbstractFDRElement; /** @@ -394,6 +395,23 @@ public Site getLinkSite1() { public Site getLinkSite2() { return null; } + + @Override + public ProteinGroup getProteinGroup1() { + ArrayList pg = new ArrayList<>(1); + pg.add(this); + return new ProteinGroup(pg, peppairs); + } + + @Override + public ProteinGroup getProteinGroup2() { + return ProteinGroup.NOPROTEINGROUP; + } + + @Override + public void setFDRGroup(int fdrGroup) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } } diff --git a/src/main/java/org/rappsilber/fdr/entities/ProteinGroupLink.java b/src/main/java/org/rappsilber/fdr/entities/ProteinGroupLink.java index b8c2c0d..3ff3c08 100644 --- a/src/main/java/org/rappsilber/fdr/entities/ProteinGroupLink.java +++ b/src/main/java/org/rappsilber/fdr/entities/ProteinGroupLink.java @@ -50,6 +50,7 @@ public class ProteinGroupLink extends AbstractFDRElement { //i protected boolean m_linkssorted = false; private boolean m_specialOnly = true; private HashMap> runtoScan = null; + private Integer fdrGroup = null; public static int MIN_DISTANCE_FOR_LONG = 0; @@ -228,17 +229,20 @@ public void add(ProteinGroupLink o) { public int getFDRGroup() { - int group = (isInternal?1:0) + (m_specialOnly?2:0); - if (MIN_DISTANCE_FOR_LONG > 0 && isInternal && getProteinGroup1().size() + getProteinGroup1().size() ==2) { - for (int f : getPosition1().values().iterator().next()) { - for (int t : getPosition2().values().iterator().next()) { - if (Math.abs(f-t) > MIN_DISTANCE_FOR_LONG) { - group+=4; + if (fdrGroup == null) { + int group = (isInternal?1:0) + (m_specialOnly?2:0); + if (MIN_DISTANCE_FOR_LONG > 0 && isInternal && getProteinGroup1().size() + getProteinGroup1().size() ==2) { + for (int f : getPosition1().values().iterator().next()) { + for (int t : getPosition2().values().iterator().next()) { + if (Math.abs(f-t) > MIN_DISTANCE_FOR_LONG) { + group+=4; + } } } } + fdrGroup = group; } - return group; + return fdrGroup; } public String getFDRGroupName() { @@ -439,6 +443,10 @@ public void setFDR(double fdr) { public double getFDR() { return m_fdr; } + + public void setFDRGroup(int fdrGroup) { + this.fdrGroup = fdrGroup; + } // /** // * @return the m_PPIfdr @@ -463,9 +471,11 @@ public double getFDR() { */ public void setFdrPPI(ProteinGroupPair ppi) { this.m_ppi = ppi; - // flag up the peptide pairs - for (PeptidePair pp : support) { - pp.setFdrLink(this); + if (ppi != null) { + // flag up the peptide pairs + for (PeptidePair pp : support) { + pp.setFdrLink(this); + } } } diff --git a/src/main/java/org/rappsilber/fdr/entities/ProteinGroupPair.java b/src/main/java/org/rappsilber/fdr/entities/ProteinGroupPair.java index c2a155c..f3e0a61 100644 --- a/src/main/java/org/rappsilber/fdr/entities/ProteinGroupPair.java +++ b/src/main/java/org/rappsilber/fdr/entities/ProteinGroupPair.java @@ -356,5 +356,22 @@ public boolean isLinear() { public boolean isBetween() { return !isInternal; } + + @Override + public ProteinGroup getProteinGroup1() { + return protein1; + } + + @Override + public ProteinGroup getProteinGroup2() { + return protein2; + } + + /** + * @param fdrGroup the fdrGroup to set + */ + public void setFDRGroup(int fdrGroup) { + this.fdrGroup = fdrGroup; + } } diff --git a/src/main/java/org/rappsilber/fdr/groups/ProteinGroup.java b/src/main/java/org/rappsilber/fdr/groups/ProteinGroup.java index 3ed7ee6..3048481 100644 --- a/src/main/java/org/rappsilber/fdr/groups/ProteinGroup.java +++ b/src/main/java/org/rappsilber/fdr/groups/ProteinGroup.java @@ -262,6 +262,12 @@ public int getFDRGroup() { return fdrgroup; } + @Override + public void setFDRGroup(int fdrGroup) { + this.fdrgroup = fdrGroup; + } + + public boolean isTT() { // if (!fdrgroupSet) // setFDRGroup(); @@ -315,7 +321,7 @@ public void addPeptidePair(PeptidePair pp) { } - public String acessions() { + public String accessions() { StringBuffer sb = new StringBuffer(); if (isDecoy()) { @@ -329,6 +335,15 @@ public String acessions() { return sb.substring(0,sb.length() - 1); } + public String accessionsNoDecoy() { + StringBuffer sb = new StringBuffer(); + + for (Protein p : groupproteins) { + sb.append(p.getAccession()); + sb.append(";"); + } + return sb.substring(0,sb.length() - 1); + } public String descriptions() { StringBuffer sb = new StringBuffer(); @@ -364,9 +379,9 @@ public boolean containsProtein(Protein p) { public String toString() { if (isTD()) { - return "D - " + acessions(); + return "D - " + accessions(); } - return "T - " + acessions(); + return "T - " + accessions(); } public boolean isDecoy() { @@ -495,5 +510,15 @@ public boolean isInternal() { public boolean isBetween() { return false; } + + @Override + public ProteinGroup getProteinGroup1() { + return this; + } + + @Override + public ProteinGroup getProteinGroup2() { + return NOPROTEINGROUP; + } } diff --git a/src/main/java/org/rappsilber/fdr/gui/FDRGUI.form b/src/main/java/org/rappsilber/fdr/gui/FDRGUI.form index d19ce28..b0c3e31 100644 --- a/src/main/java/org/rappsilber/fdr/gui/FDRGUI.form +++ b/src/main/java/org/rappsilber/fdr/gui/FDRGUI.form @@ -53,8 +53,8 @@ - + @@ -71,27 +71,21 @@ - - + + - - - + + + - - - - - - @@ -161,7 +155,7 @@ - + @@ -172,6 +166,9 @@ + + + @@ -206,7 +203,7 @@ - + @@ -236,7 +233,7 @@ - + @@ -415,7 +412,7 @@ - + @@ -591,7 +588,7 @@ - + @@ -725,7 +722,7 @@ - + @@ -768,7 +765,7 @@ - + @@ -1201,7 +1198,7 @@ - + @@ -1227,7 +1224,7 @@ - + @@ -1331,7 +1328,7 @@ - + @@ -1366,7 +1363,7 @@ - + @@ -1482,7 +1479,8 @@ - + + @@ -1493,8 +1491,10 @@ - - + + + + @@ -1515,6 +1515,19 @@ + + + + + + + + + + + + + @@ -1564,7 +1577,7 @@ - + @@ -1576,7 +1589,7 @@ - + @@ -1650,5 +1663,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/org/rappsilber/fdr/gui/FDRGUI.java b/src/main/java/org/rappsilber/fdr/gui/FDRGUI.java index 700eb3a..3018b52 100644 --- a/src/main/java/org/rappsilber/fdr/gui/FDRGUI.java +++ b/src/main/java/org/rappsilber/fdr/gui/FDRGUI.java @@ -15,6 +15,7 @@ */ package org.rappsilber.fdr.gui; +import java.awt.Color; import java.awt.Component; import java.awt.Container; import java.awt.event.ActionEvent; @@ -22,12 +23,17 @@ import java.awt.event.MouseEvent; import java.io.File; import java.io.FileNotFoundException; +import java.io.IOException; import java.lang.reflect.InvocationTargetException; +import java.text.ParseException; import java.util.ArrayList; import java.util.EventObject; +import java.util.HashMap; import java.util.HashSet; +import java.util.Iterator; import java.util.Set; import java.util.logging.Filter; +import java.util.logging.Handler; import java.util.logging.Level; import java.util.logging.LogRecord; import java.util.logging.Logger; @@ -39,9 +45,14 @@ import javax.swing.JSpinner; import javax.swing.JTable; import javax.swing.JTextField; +import javax.swing.SwingUtilities; +import javax.swing.Timer; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; import javax.swing.table.TableModel; import org.rappsilber.config.LocalProperties; import org.rappsilber.data.csv.CsvParser; +import org.rappsilber.data.csv.condition.CsvCondition; import org.rappsilber.fdr.CSVinFDR; import org.rappsilber.fdr.FDRSettingsImpl; import org.rappsilber.fdr.result.FDRResult; @@ -60,7 +71,6 @@ import org.rappsilber.gui.components.JoinedThreadedTextOuput; import org.rappsilber.utils.RArrayUtils; import org.rappsilber.gui.logging.JTextAreaHandle; - /** * @@ -69,16 +79,15 @@ public class FDRGUI extends javax.swing.JFrame { private boolean stopMaximizing = false; - + private JoinedThreadedTextOuput m_status = new JoinedThreadedTextOuput(); - + private JTextAreaHandle loggingOutput; - - + private FDRResult m_result; - + private FDRSettingsPanel fdrSettings; - + private OfflineFDR m_fdr; // /** denotes required fields in the CSV */ // public String missingColumn = "!! !MISSING! !!"; @@ -86,12 +95,13 @@ public class FDRGUI extends javax.swing.JFrame { // public String[] csvColumns = new String[]{missingColumn}; // public String[] csvColumnsOptional = new String[]{optionalColumn}; - /** * Creates new form */ public FDRGUI() { initComponents(); + + // setup the logging to the text-field loggingOutput = new JTextAreaHandle(txtLog); @@ -103,38 +113,90 @@ public boolean isLoggable(LogRecord record) { }); loggingOutput.setLevel(Level.ALL); + // add a hanlder that shows the log - tab when evver a warning or a an error happens + java.util.logging.Handler tabRiser = new java.util.logging.Handler() { + + { + this.setFilter(new Filter() { + + public boolean isLoggable(LogRecord record) { + return true; + } + }); + } + + @Override + public void publish(LogRecord record) { + if (record.getLevel().intValue() >= Level.WARNING.intValue()) { + // find the log tab + for (int i = 0; i < jTabbedPane1.getTabCount(); i++) { + if (jTabbedPane1.getTitleAt(i).contentEquals("Log")) { + final int tabID = i; + // warnings are yellow + Color pc = Color.YELLOW; + // severe is red + if (record.getLevel().intValue() >= Level.SEVERE.intValue()) { + pc = Color.RED; + } + final Color c = pc; + SwingUtilities.invokeLater(new Runnable() { + public void run() { + jTabbedPane1.setBackgroundAt(tabID, c); + // if severe raise the log tab + if (c == Color.RED) { + jTabbedPane1.setSelectedIndex(tabID); + } + jTabbedPane1.addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + jTabbedPane1.removeChangeListener(this); + jTabbedPane1.setBackgroundAt(tabID, null); + } + }); + } + }); + break; + } + } + } + } + + @Override + public void flush() { + + } + + @Override + public void close() throws SecurityException { + + } + }; + // make sure we display one of the possible fdrsettings-panel changeFDRSettings(null); - //Logger.getLogger("rappsilber").addHandler(loggingOutput); Logger.getLogger("org.rappsilber").setLevel(Level.ALL); Logger.getLogger("org.rappsilber").addHandler(loggingOutput); - - - this.setTitle(""); + Logger.getLogger("org.rappsilber").addHandler(tabRiser); + + this.setTitle(""); txtXiFDRVersion.setText(OfflineFDR.getXiFDRVersion().toString()); //tpInput.removeTabAt(0); tblPepLength.getModel().addTableModelListener(new AutoAddTableModelListener()); - // setup a context-menu with copy past-functions for all test-fields GenericTextPopUpMenu gtpm = new GenericTextPopUpMenu(); gtpm.installContextMenu(this); gtpm.installContextMenu(fdrSettingsComplete); this.toFront(); - + // register, where we want to have status messages printed m_status.addLoggerOutput(Logger.getLogger(this.getClass().getName())); m_status.addTextOutput(txtStatus); - - // fdrSettings=fdrSettingsSimple; - - - // make spinners select all test on gaining the focus // it's a bit of a dirty hack - but the best I could find ArrayList con = new ArrayList(); @@ -144,29 +206,29 @@ public boolean isLoggable(LogRecord record) { con.add(fdrSettingsComplete); con.add(fdrSettingsSimple); // get all the spinners in all containers recursivly - for (int i =0 ; i< con.size(); i++) { + for (int i = 0; i < con.size(); i++) { for (Component c : con.get(i).getComponents()) { - if (c instanceof JSpinner){ + if (c instanceof JSpinner) { if (!spinSet.contains(c)) { spins.add((Container) c); spinSet.add((Container) c); } } else if (c instanceof Container) { - con.add((Container) c); + con.add((Container) c); } } } // now install the a handler on all text-fields within all spinners that selects all - for (int i = 0; i< spins.size(); i++) { + for (int i = 0; i < spins.size(); i++) { Container spin = spins.get(i); for (Component c : spin.getComponents()) { - if (c instanceof JTextField){ + if (c instanceof JTextField) { ((JTextField) c).addFocusListener(new java.awt.event.FocusAdapter() { public void focusGained(final java.awt.event.FocusEvent evt) { javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { // on focus gain select all text - ((JTextField)evt.getSource()).selectAll(); + ((JTextField) evt.getSource()).selectAll(); } }); } @@ -179,106 +241,110 @@ public void run() { } } } - + // hide the DB-sizes panel ckDBSizeActionPerformed(null); // hide the FDR-groups panel ckDefineGroupsActionPerformed(null); - + // preset minimum peptide-length fdrSettingsComplete.setMinPeptideLength(6); fdrSettingsSimple.setMinPeptideLength(6); - + ActionListener stopMaximizingAl = new ActionListener() { public void actionPerformed(ActionEvent e) { stopMaximizing = true; } }; - + fdrSettingsComplete.addStopMaximizingListener(stopMaximizingAl); fdrSettingsSimple.addStopMaximizingListener(stopMaximizingAl); - + fdrSettingsComplete.setMinPeptideLength(6); fdrSettingsSimple.setMinPeptideLength(6); fdrSettingsComplete.setReportFactor(100000); fdrSettingsSimple.setReportFactor(100000); - - + ActionListener calcListener = new ActionListener() { public void actionPerformed(ActionEvent e) { basicCalc(); } }; - + fdrSettingsSimple.addCalcListener(calcListener); fdrSettingsComplete.addCalcListener(calcListener); - - - spDistanceGroup.setSpecialValueText("No distance group"); - spDistanceGroup.setValue((Integer)0); - - txtmzIdentOwnerFirst.setText(LocalProperties.getProperty("mzIdenMLOwnerFirst",txtmzIdentOwnerFirst.getText())); - txtmzIdentOwnerLast.setText(LocalProperties.getProperty("mzIdenMLOwnerLast",txtmzIdentOwnerLast.getText())); - txtmzIdentOwnerEmail.setText(LocalProperties.getProperty("mzIdenMLOwnerEmail",txtmzIdentOwnerEmail.getText())); - txtmzIdentAdress.setText(LocalProperties.getProperty("mzIdenMLOwnerAddress",txtmzIdentAdress.getText())); - txtmzIdentOwnerOrg.setText(LocalProperties.getProperty("mzIdenMLOwnerOrg",txtmzIdentOwnerOrg.getText())); + spDistanceGroup.setSpecialValueText("No distance group"); + spDistanceGroup.setValue((Integer) 0); + txtmzIdentOwnerFirst.setText(LocalProperties.getProperty("mzIdenMLOwnerFirst", txtmzIdentOwnerFirst.getText())); + txtmzIdentOwnerLast.setText(LocalProperties.getProperty("mzIdenMLOwnerLast", txtmzIdentOwnerLast.getText())); + txtmzIdentOwnerEmail.setText(LocalProperties.getProperty("mzIdenMLOwnerEmail", txtmzIdentOwnerEmail.getText())); + txtmzIdentAdress.setText(LocalProperties.getProperty("mzIdenMLOwnerAddress", txtmzIdentAdress.getText())); + txtmzIdentOwnerOrg.setText(LocalProperties.getProperty("mzIdenMLOwnerOrg", txtmzIdentOwnerOrg.getText())); csvSelect.addAddListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { csvSelectAddActionPerformed(evt); } }); - + fbFolder.addActionListener(new ActionListener() { public boolean setting = false; + @Override public void actionPerformed(ActionEvent e) { - if (setting) + if (setting) { return; - setting =true; + } + setting = true; String filename = fbFolder.getText(); File file = new File(filename); String name = file.getName(); - String extension=""; + String extension = ""; if (name.contains(".")) { - if (name.toLowerCase().endsWith(".tsv") || - name.toLowerCase().endsWith(".txt")) { + if (name.toLowerCase().endsWith(".tsv") + || name.toLowerCase().endsWith(".txt")) { rbTSV.setSelected(true); } else if (name.toLowerCase().endsWith(".csv")) { rbCSV.setSelected(true); } - extension=name.substring(name.lastIndexOf(".")); + extension = name.substring(name.lastIndexOf(".")); } String folder = file.getParent(); String basename = name.replaceAll("\\.[^\\.]*$", ""); if (basename.matches("^.*_[^_]*_xiFDR.*$")) { basename = basename.substring(0, basename.indexOf("_xiFDR")); - if (basename.contains("_Linear_")) + if (basename.contains("_Linear_")) { basename = basename.substring(0, basename.lastIndexOf("_Linear_")); - else + } else { basename = basename.substring(0, basename.lastIndexOf("_")); - - fbFolder.setFile(file.getParent()+File.separator+basename+extension); + } + + fbFolder.setFile(file.getParent() + File.separator + basename + extension); } - setting =false; - + setting = false; + } }); + fbFolder.setLocalPropertyKey("XiFDR_LAST_CSV_OUT_FOLDER"); + cbLevel.setSelectedItem(Level.INFO); + cbLevelActionPerformed(new ActionEvent(cbLevel, 0, "")); + + } - + public void setTitle(String title) { super.setTitle("xiFDR (" + OfflineFDR.getXiFDRVersion() + ")" + title); - + } - + public void prepareFDRCalculation() throws NumberFormatException { - ProteinGroupLink.MIN_DISTANCE_FOR_LONG = ((Number)spDistanceGroup.getValue()).intValue(); + ProteinGroupLink.MIN_DISTANCE_FOR_LONG = ((Number) spDistanceGroup.getValue()).intValue(); getFdr().setMaximumLinkAmbiguity(fdrSettings.getMaxLinkAmbiguity()); getFdr().setMaximumProteinAmbiguity(fdrSettings.getMaxProteinAmbiguity()); getFdr().setMinimumPeptideLength(fdrSettings.getMinPeptideLength()); @@ -295,13 +361,11 @@ public void prepareFDRCalculation() throws NumberFormatException { getFdr().setTargetProtDBSize(999999999); getFdr().setDecoyProtDBSize(999999999); } - + getFdr().setPsm_directional(fdrSettings.isPSMDirectional()); getFdr().setPeptides_directional(fdrSettings.isPeptidePairDirectional()); getFdr().setLinks_directional(fdrSettings.isLinkDirectional()); getFdr().setPpi_directional(fdrSettings.isPPIDirectional()); - - getFdr().setMinPepPerProteinGroup(fdrSettings.getMinProteinPepCount()); getFdr().setMinPepPerProteinGroupLink(fdrSettings.getMinLinkPepCount()); @@ -319,16 +383,16 @@ public void prepareFDRCalculation() throws NumberFormatException { protected String fdrLevelSummary(FDRResultLevel fdrl) { StringBuilder sbSummary = new StringBuilder(); Set ids = fdrl.getGroupIDs(); - for (Integer fg: ids) { + for (Integer fg : ids) { SubGroupFdrInfo sg = (SubGroupFdrInfo) fdrl.getGroup(fg); String gn = sg.fdrGroupName; sbSummary.append(gn); sbSummary.append(" : "); - sbSummary.append(String.format("%6d",sg.results.size())); + sbSummary.append(String.format("%6d", sg.results.size())); sbSummary.append("["); - sbSummary.append(String.format("%6.2f",sg.higherFDR*100)); + sbSummary.append(String.format("%6.2f", sg.higherFDR * 100)); sbSummary.append(","); - sbSummary.append(String.format("%6.2f",sg.lowerFDR*100)); + sbSummary.append(String.format("%6.2f", sg.lowerFDR * 100)); sbSummary.append("]"); sbSummary.append(sg.filteredResult.size()); sbSummary.append(" \n"); @@ -421,7 +485,7 @@ public Component getTableCellEditorComponent(JTable table, Object value, return super.getTableCellEditorComponent(table, value, isSelected, row, column); } } - + protected File getMzIdentMLOutput() { return fbMzIdentMLOut.getFile(); } @@ -433,7 +497,7 @@ protected String getMzIdentMLOwnerLast() { protected String getMzIdentMLOwnerFirst() { return txtmzIdentOwnerFirst.getText(); } - + protected String getMzIdentMLOwnerEmail() { return txtmzIdentOwnerEmail.getText(); } @@ -445,13 +509,12 @@ protected String getMzIdentMLOwnerOrg() { protected String getMzIdentMLOwnerAdress() { return txtmzIdentAdress.getText(); } - - + protected void writeMZIdentML() { try { File f = getMzIdentMLOutput(); // if (f.canWrite()) - if ( getFdr() instanceof MZIdentXLFDR) { + if (getFdr() instanceof MZIdentXLFDR) { ((MZIdentXLFDR) getFdr()).writeMZIdentML(f.getAbsolutePath(), getResult()); } else { JOptionPane.showMessageDialog(this, "mzIdentML export currently only supported with mzIdentML source files"); @@ -460,8 +523,7 @@ protected void writeMZIdentML() { JOptionPane.showMessageDialog(this, "Error while writing the xml-file:" + ex + "\n" + RArrayUtils.toString(ex.getStackTrace(), "\n")); Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, "Error while writing the xml-file", ex); setStatus("error:" + ex); - - + } } @@ -487,10 +549,11 @@ public void run() { String basename = file.getName().replaceAll("\\.[^\\.]*$", ""); if (basename.matches("^.*_[^_]*_xiFDR.*$")) { basename = basename.substring(0, basename.indexOf("_xiFDR")); - if (basename.contains("_Linear_")) + if (basename.contains("_Linear_")) { basename = basename.substring(0, basename.lastIndexOf("_Linear_")); - else + } else { basename = basename.substring(0, basename.lastIndexOf("_")); + } } ofdr.writeFiles(folder, basename, sep, getResult()); setStatus("finished: " + ofdr.summaryString(getResult())); @@ -510,81 +573,127 @@ public void run() { new Thread(runnable).start(); } +// public void readCSV() { +// try { +// +// if (csvSelect.getFile() == null) { +// JOptionPane.showMessageDialog(this, "No file selected", "no File Selected", JOptionPane.ERROR_MESSAGE); +// return; +// } +// +// setStatus("Start"); +// final CSVinFDR ofdr = new CSVinFDR(); +// +// +// +// setFdr(ofdr); +// +// addCSV(ofdr,null); +// } catch (Exception ex) { +// Logger.getLogger(FDRGUI.class.getName()).log(Level.SEVERE, null, ex); +// setStatus("error:" + ex); +// setEnableRead(true); +// } +// +// } + public void readAllCSV() { - public void readCSV() { - try { - + if (csvSelect.getFile() == null) { + JOptionPane.showMessageDialog(this, "No file selected", "no File Selected", JOptionPane.ERROR_MESSAGE); + return; + } + final CsvCondition filter = csvSelect.getFilter(); + setEnableRead(false); + setEnableCalc(false); + setEnableWrite(false); - setStatus("Start"); - final CSVinFDR ofdr = new CSVinFDR(); + Runnable runnable = new Runnable() { + public void run() { + try { + setStatus("Start"); + Iterator csvs = csvSelect.iterator(); + CsvParser csv = csvs.next(); + final CSVinFDR ofdr = new CSVinFDR(); + setFdr(ofdr); + addCSV(ofdr, null, csv,filter); - setFdr(ofdr); + while (csvs.hasNext()) { + csv = csvs.next(); + CSVinFDR nextfdr = new CSVinFDR(); + addCSV(nextfdr, ofdr, csv,filter); + } + setEnableCalc(true); + setStatus("finished reading"); + } catch (Exception ex) { + Logger.getLogger(FDRGUI.class.getName()).log(Level.SEVERE, null, ex); + setStatus("error:" + ex); + } + setEnableRead(true); + // setEnableWrite(true); + } - addCSV(ofdr,null); - } catch (Exception ex) { - Logger.getLogger(FDRGUI.class.getName()).log(Level.SEVERE, null, ex); - setStatus("error:" + ex); - setEnableRead(true); - } + }; + new Thread(runnable).start(); } public void readAdditionalCSV() { - try { - - - setStatus("Start"); - final CSVinFDR ofdr = new CSVinFDR(); - - addCSV(ofdr, (CSVinFDR) getFdr()); - - } catch (Exception ex) { - Logger.getLogger(FDRGUI.class.getName()).log(Level.SEVERE, null, ex); - setStatus("error:" + ex); - setEnableRead(true); + if (csvSelect.getFile() == null) { + JOptionPane.showMessageDialog(this, "No file selected", "no File Selected", JOptionPane.ERROR_MESSAGE); + return; } - } - - private void addCSV(final CSVinFDR ofdr, final CSVinFDR addto) { - getFdr().setPSMScoreHighBetter(csvSelect.higherIsBetter()); - setEnableRead(false); setEnableCalc(false); setEnableWrite(false); - + final CsvCondition filter = csvSelect.getFilter(); + Runnable runnable = new Runnable() { public void run() { try { - setStatus("Read from " + csvSelect.getFile().getName()); - CsvParser csv = csvSelect.getCsv(); - Logger.getLogger(this.getClass().getName()).log(Level.INFO, "read from " + csvSelect.getFile().getAbsolutePath()); - ofdr.readCSV(csv); - if(addto != null) { - Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Normalize new data!"); - ofdr.normalizePSMs(); - if (!addto.isNormalized()) { - Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Normalize previous data!"); - addto.normalizePSMs(); - } - Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Join with previous data!"); - addto.addNormalisedPsmList(ofdr.getAllPSMs(), ofdr.getPsmNormalizationOffset()); + + setStatus("Start"); + + for (CsvParser csv : csvSelect) { + CSVinFDR nextfdr = new CSVinFDR(); + addCSV(nextfdr, (CSVinFDR) getFdr(), csv,filter); } setEnableCalc(true); setStatus("finished reading"); + } catch (Exception ex) { Logger.getLogger(FDRGUI.class.getName()).log(Level.SEVERE, null, ex); setStatus("error:" + ex); + setEnableRead(true); } setEnableRead(true); // setEnableWrite(true); } - - + }; new Thread(runnable).start(); + + } + + protected void addCSV(final CSVinFDR ofdr, final CSVinFDR addto, final CsvParser csv, CsvCondition filter) throws IOException, ParseException { + ofdr.setPSMScoreHighBetter(csvSelect.higherIsBetter()); + + setStatus("Read from " + csv.getInputFile().getName()); + Logger.getLogger(this.getClass().getName()).log(Level.INFO, "read from " + csv.getInputFile().getAbsolutePath()); + ofdr.readCSV(csv, filter); + if (addto != null) { + Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Normalize new data!"); + ofdr.normalizePSMs(); + if (!addto.isNormalized()) { + Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Normalize previous data!"); + addto.normalizePSMs(); + } + Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Join with previous data!"); + addto.addNormalisedPsmList(ofdr.getAllPSMs(), ofdr.getPsmNormalizationOffset()); + addto.addSource(ofdr.getSources(), ofdr.getFilter()); + } } public void readMZIdentML() { @@ -608,7 +717,6 @@ public void readMZIdentML() { setStatus("Start"); final MZIdentXLFDR ofdr = new MZIdentXLFDR(); - setFdr(ofdr); getFdr().setPSMScoreHighBetter(rbMZHighBetter.isSelected()); @@ -617,7 +725,6 @@ public void readMZIdentML() { // ofdr.setCrosslinkedSIIAcc(txtCrossLinkedPepCvParam.getText()); ofdr.setPSMScore(cbMZMatchScoreName.getSelectedItem().toString()); - Runnable runnable = new Runnable() { public void run() { try { @@ -652,18 +759,17 @@ protected void calculateFDR() { prepareFDRCalculation(); - Runnable runnable = new Runnable() { - final Double psmfdr = (Double) fdrSettings.getPSMFDR() ; - final Double pepfdr = (Double) fdrSettings.getPeptidePairFDR() ; - final Double protfdr = (Double) fdrSettings.getProteinGroupFDR() ; + final Double psmfdr = (Double) fdrSettings.getPSMFDR(); + final Double pepfdr = (Double) fdrSettings.getPeptidePairFDR(); + final Double protfdr = (Double) fdrSettings.getProteinGroupFDR(); final Double linkfdr = (Double) fdrSettings.getProteinGroupLinkFDR(); final Double ppifdr = (Double) fdrSettings.getProteinGroupPairFDR(); final boolean filterToUniquePSM = fdrSettings.filterToUniquePSM(); public void run() { try { - innerFDRCalculation(psmfdr, pepfdr, protfdr, linkfdr, ppifdr, ofdr, saftyfactor,filterToUniquePSM); + innerFDRCalculation(psmfdr, pepfdr, protfdr, linkfdr, ppifdr, ofdr, saftyfactor, filterToUniquePSM); } catch (Exception e) { Logger.getLogger(FDRGUI.class.getName()).log(Level.SEVERE, null, e); @@ -681,6 +787,18 @@ protected void innerFDRCalculation(Double psmfdr, Double pepfdr, Double protfdr, setStatus("Start"); setStatus("Calculating fdr"); Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Calculating fdr"); + + double fm = Runtime.getRuntime().freeMemory(); + double mm = Runtime.getRuntime().maxMemory(); + double tm = Runtime.getRuntime().totalMemory(); + double um = tm-fm; + if (um/tm>0.5) { + // not enough memory - will have to give up on the old result already now + if (getResult()!=null) + getResult().clear(); + //setResult(null); + } + FDRResult result = ofdr.calculateFDR(psmfdr, pepfdr, protfdr, linkfdr, ppifdr, saftyfactor, ckIgnoreGroups1.isSelected(), true, filterToUniquePSM); setResult(result); setStatus("finished"); @@ -689,7 +807,6 @@ protected void innerFDRCalculation(Double psmfdr, Double pepfdr, Double protfdr, // HashMap summary = ofdr.summaryString(m_result); txtSumInput.setText(Integer.toString(ofdr.getInputPSMs().size())); - int sumXLPSM = 0; int sumLinearPSM = 0; @@ -713,7 +830,6 @@ protected void innerFDRCalculation(Double psmfdr, Double pepfdr, Double protfdr, } int sumPSM = sumXLPSM + sumLinearPSM; - int sumXLPepPairs = 0; int sumLinearPepPairs = 0; @@ -737,8 +853,6 @@ protected void innerFDRCalculation(Double psmfdr, Double pepfdr, Double protfdr, } int sumPepPairs = sumXLPepPairs + sumLinearPepPairs; - - int sumLinksBetweenDecoy = 0; int sumLinksInternalDecoy = 0; int sumLinksInternalTarget = 0; @@ -759,7 +873,6 @@ protected void innerFDRCalculation(Double psmfdr, Double pepfdr, Double protfdr, } - int sumProteinGroupPairs = getResult().proteinGroupPairFDR.getResultCount(); int sumProteinGroupPairsBetweenDecoy = 0; int sumProteinGroupPairsInternalDecoy = 0; @@ -780,31 +893,31 @@ protected void innerFDRCalculation(Double psmfdr, Double pepfdr, Double protfdr, } // Integer sumLinksProtGroups = ofdr.getFDRProteinGroups().size(); - - String[] nice = MiscUtils.arrayToStringWithDifferenceOrientedFormat(new double[] {result.psmFDR.getHigherFDR()*100, result.psmFDR.getLowerFDR()*100},1); + + String[] nice = MiscUtils.arrayToStringWithDifferenceOrientedFormat(new double[]{result.psmFDR.getHigherFDR() * 100, result.psmFDR.getLowerFDR() * 100}, 1); txtSumPSM.setText(sumPSM + " [" + nice[0] + "%," + nice[1] + "%]"); txtSumPSM.setToolTipText(fdrLevelSummary(result.psmFDR)); txtSumPSMXL.setText(sumXLPSM + " (" + (targetXLPSM) + " Target)"); txtSumPSMLinear.setText(sumLinearPSM + " (" + (targetLinearPSM) + " Target)"); - - nice = MiscUtils.arrayToStringWithDifferenceOrientedFormat(new double[] {result.peptidePairFDR.getHigherFDR()*100, result.peptidePairFDR.getLowerFDR()*100},1); + + nice = MiscUtils.arrayToStringWithDifferenceOrientedFormat(new double[]{result.peptidePairFDR.getHigherFDR() * 100, result.peptidePairFDR.getLowerFDR() * 100}, 1); txtSumPepPairs.setText(sumPepPairs + " [" + nice[0] + "%," + nice[1] + "%]"); txtSumPepPairs.setToolTipText(fdrLevelSummary(result.peptidePairFDR)); txtSumPepPairsXL.setText(sumXLPepPairs + " (" + targetXLPepPairs + " Target)"); txtSumPepPairsLinear.setText(sumLinearPepPairs + " (" + targetLinearPepPairs + " Target)"); - - nice = MiscUtils.arrayToStringWithDifferenceOrientedFormat(new double[] {result.proteinGroupLinkFDR.getHigherFDR()*100, result.proteinGroupLinkFDR.getLowerFDR()*100},1); - txtSumLinks.setText(sumLinks + " [" + nice[0] + "%," + nice[1] + "%]"); + + nice = MiscUtils.arrayToStringWithDifferenceOrientedFormat(new double[]{result.proteinGroupLinkFDR.getHigherFDR() * 100, result.proteinGroupLinkFDR.getLowerFDR() * 100}, 1); + txtSumLinks.setText(sumLinks + " [" + nice[0] + "%," + nice[1] + "%]"); txtSumLinks.setToolTipText(fdrLevelSummary(result.proteinGroupLinkFDR)); txtSumLinksBetween.setText((sumLinksBetweenTarget + sumLinksBetweenDecoy) + " (" + sumLinksBetweenTarget + " Target)"); txtSumLinksInternal.setText((sumLinksInternalDecoy + sumLinksInternalTarget) + " (" + sumLinksInternalTarget + ")"); - - nice = MiscUtils.arrayToStringWithDifferenceOrientedFormat(new double[] {result.proteinGroupFDR.getHigherFDR()*100, result.proteinGroupFDR.getLowerFDR()*100},1); - txtSumProtGroups.setText(Integer.toString(getResult().proteinGroupFDR.getResultCount()) + " [" + nice[0] + "%," + nice[1] + "%]"); + + nice = MiscUtils.arrayToStringWithDifferenceOrientedFormat(new double[]{result.proteinGroupFDR.getHigherFDR() * 100, result.proteinGroupFDR.getLowerFDR() * 100}, 1); + txtSumProtGroups.setText(Integer.toString(getResult().proteinGroupFDR.getResultCount()) + " [" + nice[0] + "%," + nice[1] + "%]"); txtSumProtGroups.setToolTipText(fdrLevelSummary(result.proteinGroupFDR)); - - nice = MiscUtils.arrayToStringWithDifferenceOrientedFormat(new double[] {result.proteinGroupPairFDR.getHigherFDR()*100, result.proteinGroupPairFDR.getLowerFDR()*100},1); - txtSumProtGroupPairs.setText(sumProteinGroupPairs + " [" + nice[0] + "%," + nice[1] + "%]"); + + nice = MiscUtils.arrayToStringWithDifferenceOrientedFormat(new double[]{result.proteinGroupPairFDR.getHigherFDR() * 100, result.proteinGroupPairFDR.getLowerFDR() * 100}, 1); + txtSumProtGroupPairs.setText(sumProteinGroupPairs + " [" + nice[0] + "%," + nice[1] + "%]"); txtSumProtGroupPairs.setToolTipText(fdrLevelSummary(result.proteinGroupPairFDR)); txtSumProtGroupPairsBetween.setText((sumProteinGroupPairsBetweenTarget + sumProteinGroupPairsBetweenDecoy) + " (" + sumProteinGroupPairsBetweenTarget + " Target)"); txtSumProtGroupPairsInternal.setText((sumProteinGroupPairsInternalDecoy + sumProteinGroupPairsInternalTarget) + " (" + sumProteinGroupPairsInternalTarget + " Target)"); @@ -812,12 +925,8 @@ protected void innerFDRCalculation(Double psmfdr, Double pepfdr, Double protfdr, // Logger.getLogger(this.getClass().getName()).log(Level.INFO, "finished writing"); } - - - - private void basicCalc() { - if (getFdr() !=null) { + if (getFdr() != null) { fdrSettingsComplete.setPSMDirectional(fdrSettings.isPSMDirectional()); fdrSettingsComplete.setPeptidePairDirectional(fdrSettings.isPeptidePairDirectional()); fdrSettingsComplete.setLinkDirectional(fdrSettings.isLinkDirectional()); @@ -853,36 +962,49 @@ private void basicCalc() { fdrSettingsSimple.setMinPPIPepCount(fdrSettings.getMinPPIPepCount()); fdrSettingsSimple.setMinPeptideLength(fdrSettings.getMinPeptideLength()); fdrSettingsSimple.setMinProteinPepCount(fdrSettings.getMinProteinPepCount()); - + + getFdr().setGroupByProteinPair(fdrSettings.isGroupByPSMCount()); if (fdrSettings.doOptimize() != null) { - switch (fdrSettings.doOptimize()) { - case PROTEINGROUPLINK: - Thread ml = new Thread() { - public void run() { - maximiseLink(fdrSettings.getBoostBetween()); - } - }; - ml.start(); - return; - - case PROTEINGROUPPAIR: - Thread mp = new Thread() { - public void run() { - maximisePPI(fdrSettings.getBoostBetween()); - } - }; - mp.start(); - return; + final OfflineFDR.FDRLevel l = fdrSettings.doOptimize(); + if (l == OfflineFDR.FDRLevel.PSM) + JOptionPane.showMessageDialog(this, "Boosting of that Level currently not supported!"); + else { + Thread ml = new Thread() { + public void run() { + maximise(l, fdrSettings.getBoostBetween()); + } + }; + ml.start(); } - JOptionPane.showMessageDialog(this, "Boosting of that Level currently not supported!"); + + +// switch (fdrSettings.doOptimize()) { +// case PROTEINGROUPLINK: +// Thread ml = new Thread() { +// public void run() { +// maximiseLink(fdrSettings.getBoostBetween()); +// } +// }; +// ml.start(); +// return; +// +// case PROTEINGROUPPAIR: +// Thread mp = new Thread() { +// public void run() { +// maximisePPI(fdrSettings.getBoostBetween()); +// } +// }; +// mp.start(); +// return; +// } +// JOptionPane.showMessageDialog(this, "Boosting of that Level currently not supported!"); } else { calculateFDR(); } } } - public void setStatus(final String status) { m_status.write(status); // m_statusmessages.put(Thread.currentThread(),status); @@ -914,7 +1036,7 @@ public void run() { }; javax.swing.SwingUtilities.invokeLater(setModel); } - + public void setEnableCalc(final boolean enable) { Runnable setModel = new Runnable() { public void run() { @@ -1161,7 +1283,6 @@ public void clearResults() { // // // } - public void maximisePPI(boolean between) { clearResults(); double steps = fdrSettings.getBoostingSteps(); @@ -1181,9 +1302,8 @@ public void maximisePPI(boolean between) { int maxProteinAmbiguity = fdrSettings.getMaxProteinAmbiguity(); double reportFactor = fdrSettings.getReportFactor(); - - boolean filterToUniquePSM = fdrSettings.filterToUniquePSM(); + boolean filterToUniquePSM = fdrSettings.filterToUniquePSM(); // get the maximum fdr values, that we can play with double maxpsmfdr = fdrSettings.getPSMFDR() / 100.0; @@ -1211,7 +1331,6 @@ public void maximisePPI(boolean between) { double protfdr = 1; double linkfdr = 1; - boolean optimizing = true; int maxPPICount = 0; @@ -1219,7 +1338,6 @@ public void maximisePPI(boolean between) { int maxLinkCount = 0; int maxLinkCountBetween = 0; - double maxPPIPsmfdr = 0; double maxPPIPepfdr = 0; double maxPPIProtfdr = 0; @@ -1237,24 +1355,23 @@ public void maximisePPI(boolean between) { int countDown = 5; prepareFDRCalculation(); - - int optimizingRound=1; + int optimizingRound = 1; while (optimizing) { FDRResult result = new FDRResult(); int lastMaxPPICount = maxPPICount; Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Round {0}", optimizingRound++); - + Logger.getLogger(this.getClass().getName()).log(Level.INFO, "PSM fdr from : {0} to {1}\nPeptide pair fdr from {2} to {3}\nProtein-groupfdr from {4} to {5}\nLink fdr from {6} to {7}\nSteps : {8}", new Object[]{minpsmfdr, maxpsmfdr, minpepfdr, maxpepfdr, minprotfdr, maxprotfdr, minlinkfdr, maxlinkfdr, steps}); // find the combinations with the maximum number of ppis psmloop: for (psmfdr = maxpsmfdr; psmfdr > minpsmfdr - psmfdrStep / 2; psmfdr -= psmfdrStep) { // we only need to calculate the link fdr ones for each - getFdr().calculatePSMFDR(psmfdr, reportFactor, ignoreGroups, false, result, getFdr().isPsm_directional(),filterToUniquePSM); + getFdr().calculatePSMFDR(psmfdr, reportFactor, ignoreGroups, false, result, getFdr().isPsm_directional(), filterToUniquePSM); Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Round {0}", optimizingRound++); if (stopMaximizing) { break psmloop; - } + } // if we don't get PSM - stop looking at later stages if (result.psmFDR.getResultCount() == 0) { break psmloop; @@ -1267,20 +1384,19 @@ public void maximisePPI(boolean between) { for (protfdr = maxprotfdr; protfdr > minprotfdr - protfdrStep / 2; protfdr -= protfdrStep) { // calculate peptide level fdr - getFdr().calculatePeptidePairFDR(pepfdr, reportFactor, ignoreGroups, false,result,getFdr().isPeptides_directional()); + getFdr().calculatePeptidePairFDR(pepfdr, reportFactor, ignoreGroups, false, result, getFdr().isPeptides_directional()); if (stopMaximizing) { break psmloop; - } + } // if we don't get peptide pairs - stop looking at later stages if (result.peptidePairFDR.getResultCount() == 0) { break peploop; } - // calculate protein level fdr if (protfdr < 1) { - getFdr().calculateProteinGroupFDR(protfdr, reportFactor, ignoreGroups, minProteinPeptide, maxProteinAmbiguity, false,result); - + getFdr().calculateProteinGroupFDR(protfdr, reportFactor, ignoreGroups, minProteinPeptide, maxProteinAmbiguity, false, result); + if (result.proteinGroupFDR.getResultCount() == 0) { break protloop; } @@ -1290,15 +1406,15 @@ public void maximisePPI(boolean between) { if (stopMaximizing) { break psmloop; - } - + } + linkloop: for (linkfdr = maxlinkfdr; linkfdr > minlinkfdr - linkfdrStep / 2; linkfdr -= linkfdrStep) { if (stopMaximizing) { break psmloop; - } - + } + // calculate links getFdr().calculateLinkFDR(linkfdr, reportFactor, ignoreGroups, minLinkPeptide, maxLinkAmbiguity, false, result, getFdr().isLinks_directional()); @@ -1308,7 +1424,7 @@ public void maximisePPI(boolean between) { if (stopMaximizing) { break psmloop; - } + } getFdr().calculateProteinGroupPairFDR(maxppifdr, reportFactor, ignoreGroups, minProteinPairPeptide, 0, false, result, getFdr().isPpi_directional()); getFdr().filterFDRLinksByFDRProteinGroupPairs(result); @@ -1318,14 +1434,17 @@ public void maximisePPI(boolean between) { final int linkCount = result.proteinGroupPairFDR.getResultCount(); final int linkCountBetween = result.proteinGroupPairFDR.getBetween(); - if ((between && ppiCountBetween > maxPPICountBetween) || // boost between and more between than before - ((ppiCountBetween == maxPPICountBetween || !between) && ppiCount > maxPPICount) || // not between or same between but more overal - ((linkCountBetween == maxLinkCountBetween || !between) && ppiCount == maxPPICount && linkCountBetween > maxLinkCountBetween) || // - ((!between || (ppiCountBetween == maxPPICountBetween && linkCountBetween == maxLinkCountBetween)) && linkCount > maxLinkCount)) { + if ((between && ppiCountBetween > maxPPICountBetween) + || // boost between and more between than before + ((ppiCountBetween == maxPPICountBetween || !between) && ppiCount > maxPPICount) + || // not between or same between but more overal + ((linkCountBetween == maxLinkCountBetween || !between) && ppiCount == maxPPICount && linkCountBetween > maxLinkCountBetween) + || // + ((!between || (ppiCountBetween == maxPPICountBetween && linkCountBetween == maxLinkCountBetween)) && linkCount > maxLinkCount)) { maxLinkCountBetween = linkCountBetween; maxPPICountBetween = ppiCountBetween; - // is it a new best? + // is it a new best? // if (ppiCount > maxPPICount) { // store the values for this fdr @@ -1364,7 +1483,7 @@ public void maximisePPI(boolean between) { fdrSettingsSimple.setPeptidePairFDR(schowPepFDR); fdrSettingsSimple.setProteinGroupFDR(schowProtFDR); fdrSettingsSimple.setProteinGroupLinkFDR(schowLinkFDR); - + javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { txtSumProtGroupPairs.setText(ppiCount + ""); @@ -1387,13 +1506,10 @@ public void run() { } } - } - - } - + setStatus("Max Protein-Pairs Round: " + optimizingRound + " - " + maxPPICount + " pairs"); // no improvement for the last few rounds? if ((maxPPICount == lastMaxPPICount && --countDown == 0) || stopMaximizing) { @@ -1420,7 +1536,7 @@ public void run() { fdrSettingsSimple.setPeptidePairFDR(setPepfdr); fdrSettingsSimple.setProteinGroupFDR(setProtfdr); fdrSettingsSimple.setProteinGroupLinkFDR(setLinkfdr); - + // spPsmFDR.setValue(setPsmfdr*100); // spPepFDR.setValue(setPepfdr*100); // spProteinFDR.setValue(setProtfdr*100); @@ -1439,10 +1555,10 @@ public void run() { } if (trySet < 0) { JOptionPane.showMessageDialog(this, "Could not set the values for fdr-calculation\n" - + "\nPSM fdr: " + setPsmfdr*100 + "%" - + "\nPeptide fdr:" + setPepfdr*100 + "%" - + "\nProtein FDR:" + setProtfdr*100 + "%" - + "\nLink FDR:" + setLinkfdr *100 +"%", "Failed to set Parameters", JOptionPane.ERROR_MESSAGE); + + "\nPSM fdr: " + setPsmfdr * 100 + "%" + + "\nPeptide fdr:" + setPepfdr * 100 + "%" + + "\nProtein FDR:" + setProtfdr * 100 + "%" + + "\nLink FDR:" + setLinkfdr * 100 + "%", "Failed to set Parameters", JOptionPane.ERROR_MESSAGE); setEnableRead(true); setEnableCalc(true); setEnableWrite(true); @@ -1453,10 +1569,10 @@ public void run() { javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { JOptionPane.showMessageDialog(rootPane, "found " + foundPPICount + " protein group pairs for following settings \n" - + "\nPSM fdr: " + setPsmfdr*100 + "%" - + "\nPeptide fdr:" + setPepfdr*100 + "%" - + "\nProtein FDR:" + setProtfdr*100 + "%" - + "\nLink FDR:" + setLinkfdr*100 +"%", "best parameters found for max protein group pairs", JOptionPane.INFORMATION_MESSAGE); + + "\nPSM fdr: " + setPsmfdr * 100 + "%" + + "\nPeptide fdr:" + setPepfdr * 100 + "%" + + "\nProtein FDR:" + setProtfdr * 100 + "%" + + "\nLink FDR:" + setLinkfdr * 100 + "%", "best parameters found for max protein group pairs", JOptionPane.INFORMATION_MESSAGE); } }); @@ -1473,7 +1589,7 @@ public void run() { // yes we improved countDown = 5; } else { - setStatus("Max Protein-Pairs Round: " + optimizingRound + " - " + maxPPICount + " pairs - count down:" + countDown ); + setStatus("Max Protein-Pairs Round: " + optimizingRound + " - " + maxPPICount + " pairs - count down:" + countDown); } // so see if we make the resoltuion finer @@ -1486,17 +1602,14 @@ public void run() { minpepfdr = Math.max(maxPPIminPepfdr - pepfdrStep / 2.0, 0); minprotfdr = Math.max(maxPPIminProtfdr - protfdrStep / 2.0, 0); - psmfdrStep = (maxpsmfdr - minpsmfdr) / steps; pepfdrStep = (maxpepfdr - minpepfdr) / steps; protfdrStep = (maxprotfdr - minprotfdr) / steps; } - } - } // // public void maximise(int maxWhat, boolean fixedPSM, boolean fixedPep, boolean fixedProt, boolean fixedLink, boolean fixedPPI) { @@ -1837,13 +1950,13 @@ public void run() { // // } // - + public void maximiseLink(boolean between) { clearResults(); - + final FDRSettingsImpl settings = new FDRSettingsImpl(); settings.setAll(fdrSettings); - + try { double steps = settings.getBoostingSteps(); setEnableRead(false); @@ -1863,7 +1976,6 @@ public void maximiseLink(boolean between) { double reportFactor = settings.getReportFactor(); - // get the maximum fdr values, that we can play with double maxpsmfdr = settings.getPSMFDR(); double maxpepfdr = settings.getPeptidePairFDR(); @@ -1873,46 +1985,42 @@ public void maximiseLink(boolean between) { // the fixed fdr values double maxppifdr = settings.getProteinGroupPairFDR(); boolean filterToUniquePSM = settings.filterToUniquePSM(); - // int minLinkPeptide = (Integer) spMinLinkPepCount.getValue(); - // int minProteinPeptide = (Integer) spMinProteinPepCount.getValue(); - // int minProteinPairPeptide = (Integer) spMinPPIPepCount.getValue(); - // - // int maxLinkAmbiguity = (Integer) spMaxLinkAmbiguity.getValue(); - // int maxProteinAmbiguity = (Integer) spMaxProteinAmbiguity.getValue(); - // - // double reportFactor = (Double) spReportFactor.getValue(); - // - // - // // get the maximum fdr values, that we can play with - // double maxpsmfdr = (Double) spPsmFDR.getValue() / 100.0; - // double maxpepfdr = (Double) spPepFDR.getValue() / 100.0; - // double maxprotfdr = (Double) spProteinFDR.getValue() / 100.0; + // int minLinkPeptide = (Integer) spMinLinkPepCount.getValue(); + // int minProteinPeptide = (Integer) spMinProteinPepCount.getValue(); + // int minProteinPairPeptide = (Integer) spMinPPIPepCount.getValue(); + // + // int maxLinkAmbiguity = (Integer) spMaxLinkAmbiguity.getValue(); + // int maxProteinAmbiguity = (Integer) spMaxProteinAmbiguity.getValue(); + // + // double reportFactor = (Double) spReportFactor.getValue(); + // + // + // // get the maximum fdr values, that we can play with + // double maxpsmfdr = (Double) spPsmFDR.getValue() / 100.0; + // double maxpepfdr = (Double) spPepFDR.getValue() / 100.0; + // double maxprotfdr = (Double) spProteinFDR.getValue() / 100.0; double maxpsmfdrabs = maxpsmfdr; double maxpepfdrabs = maxpepfdr; double maxprotfdrabs = maxprotfdr; - - // // the fixed fdr values - // double maxppifdr = (Double) spPPIFdr.getValue() / 100.0; - // double maxlinkfdr = (Double) spLinkFDR.getValue() / 100.0; - + // // the fixed fdr values + // double maxppifdr = (Double) spPPIFdr.getValue() / 100.0; + // double maxlinkfdr = (Double) spLinkFDR.getValue() / 100.0; // in the first round we start looking on these values to the maximum values - double minpsmfdr = settings.boostPSMs()?Math.min(0.005, maxpsmfdr / steps):maxpsmfdr; - double minpepfdr = settings.boostPeptidePairs()?Math.min(0.005, maxpepfdr / steps):maxpepfdr; - double minprotfdr = settings.boostProteins()?Math.min(0.005, maxprotfdr / steps): maxprotfdr; + double minpsmfdr = settings.boostPSMs() ? Math.min(0.005, maxpsmfdr / steps) : maxpsmfdr; + double minpepfdr = settings.boostPeptidePairs() ? Math.min(0.005, maxpepfdr / steps) : maxpepfdr; + double minprotfdr = settings.boostProteins() ? Math.min(0.005, maxprotfdr / steps) : maxprotfdr; // and we run through with these steps - double psmfdrStep = settings.boostPSMs()?(maxpsmfdr - minpsmfdr) / steps:100; - double pepfdrStep = settings.boostPeptidePairs()?(maxpepfdr - minpepfdr) / steps:100; - double protfdrStep = settings.boostProteins()?(maxprotfdr - minprotfdr) / steps:100; - + double psmfdrStep = settings.boostPSMs() ? (maxpsmfdr - minpsmfdr) / steps : 100; + double pepfdrStep = settings.boostPeptidePairs() ? (maxpepfdr - minpepfdr) / steps : 100; + double protfdrStep = settings.boostProteins() ? (maxprotfdr - minprotfdr) / steps : 100; double psmfdr = 1; double pepfdr = 1; double protfdr = 1; - boolean optimizing = true; int maxLinkCount = 0; @@ -1920,7 +2028,6 @@ public void maximiseLink(boolean between) { int maxPPICount = 0; int maxPPICountBetween = 0; - double maxLinkPsmfdr = 0; double maxLinkPepfdr = 0; double maxLinkProtfdr = 0; @@ -1936,25 +2043,35 @@ public void maximiseLink(boolean between) { prepareFDRCalculation(); - int optimizingRound=1; + int optimizingRound = 1; while (optimizing) { int lastMaxLinkCount = maxLinkCount; int lastMaxPPICount = maxPPICount; - Logger.getLogger(this.getClass().getName()).log(Level.INFO,"Round " +optimizingRound++); + Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Round " + optimizingRound++); - Logger.getLogger(this.getClass().getName()).log(Level.INFO,"PSM fdr from : " + minpsmfdr +" to " + maxpsmfdr + - "\nPeptide pair fdr from " + minpepfdr +" to " + maxpepfdr + - "\nProtein-groupfdr from " + minprotfdr +" to " + maxprotfdr + - "\nSteps : " + steps); + Logger.getLogger(this.getClass().getName()).log(Level.INFO, "PSM fdr from : " + minpsmfdr + " to " + maxpsmfdr + + "\nPeptide pair fdr from " + minpepfdr + " to " + maxpepfdr + + "\nProtein-groupfdr from " + minprotfdr + " to " + maxprotfdr + + "\nSteps : " + steps); FDRResult result = new FDRResult(); // find the combinations with the maximum number of ppis psmloop: for (psmfdr = maxpsmfdr; psmfdr > minpsmfdr - psmfdrStep / 2; psmfdr -= psmfdrStep) { +// if (result.psmFDR !=null) +// result.psmFDR.clear(); +// if (result.peptidePairFDR !=null) +// result.peptidePairFDR.clear(); +// if (result.proteinGroupLinkFDR !=null) +// result.proteinGroupLinkFDR.clear(); +// if (result.proteinGroupFDR !=null) +// result.proteinGroupFDR.clear(); +// if (result.proteinGroupPairFDR !=null) +// result.proteinGroupPairFDR.clear(); // we only need to calculate the link fdr ones for each - getFdr().calculatePSMFDR(psmfdr, reportFactor, ignoreGroups, false,result, getFdr().isPsm_directional(),filterToUniquePSM); + getFdr().calculatePSMFDR(psmfdr, reportFactor, ignoreGroups, false, result, getFdr().isPsm_directional(), filterToUniquePSM); if (stopMaximizing) { break psmloop; - } + } // if we don't get PSM - stop looking at later stages if (result.psmFDR.getResultCount() == 0) { break psmloop; @@ -1965,10 +2082,17 @@ public void maximiseLink(boolean between) { protloop: for (protfdr = maxprotfdr; protfdr > minprotfdr - protfdrStep; protfdr -= protfdrStep) { - +// if (result.peptidePairFDR !=null) +// result.peptidePairFDR.clear(); +// if (result.proteinGroupLinkFDR !=null) +// result.proteinGroupLinkFDR.clear(); +// if (result.proteinGroupFDR !=null) +// result.proteinGroupFDR.clear(); +// if (result.proteinGroupPairFDR !=null) +// result.proteinGroupPairFDR.clear(); // calculate peptide level fdr - getFdr().calculatePeptidePairFDR(pepfdr, reportFactor, ignoreGroups, false,result, getFdr().isPeptides_directional() ); + getFdr().calculatePeptidePairFDR(pepfdr, reportFactor, ignoreGroups, false, result, getFdr().isPeptides_directional()); // if we don't get peptide pairs - stop looking at later stages if (result.peptidePairFDR.getResultCount() == 0) { break peploop; @@ -1980,6 +2104,12 @@ public void maximiseLink(boolean between) { // calculate protein level fdr if (protfdr < 1) { +// if (result.proteinGroupLinkFDR !=null) +// result.proteinGroupLinkFDR.clear(); +// if (result.proteinGroupFDR !=null) +// result.proteinGroupFDR.clear(); +// if (result.proteinGroupPairFDR !=null) +// result.proteinGroupPairFDR.clear(); getFdr().calculateProteinGroupFDR(protfdr, reportFactor, ignoreGroups, minProteinPeptide, maxProteinAmbiguity, false, result); if (result.proteinGroupFDR.getResultCount() == 0) { @@ -1991,24 +2121,27 @@ public void maximiseLink(boolean between) { if (stopMaximizing) { break psmloop; - } + } } - // calculate links - getFdr().calculateLinkFDR(maxlinkfdr, reportFactor, ignoreGroups, minLinkPeptide, maxLinkAmbiguity, between,result, getFdr().isLinks_directional()); - +// if (result.proteinGroupLinkFDR !=null) +// result.proteinGroupLinkFDR.clear(); +// if (result.proteinGroupPairFDR !=null) +// result.proteinGroupPairFDR.clear(); + // calculate links + getFdr().calculateLinkFDR(maxlinkfdr, reportFactor, ignoreGroups, minLinkPeptide, maxLinkAmbiguity, between, result, getFdr().isLinks_directional()); if (result.proteinGroupLinkFDR.getResultCount() == 0) { break protloop; } // do we need to calculate protein pairs? - if (maxppifdr < 1) { + if (maxppifdr < 1 || minProteinPairPeptide >1) { if (stopMaximizing) { break psmloop; - } - getFdr().calculateProteinGroupPairFDR(maxppifdr, reportFactor, ignoreGroups, minProteinPairPeptide, 0, between,result, getFdr().isPpi_directional()); + } + getFdr().calculateProteinGroupPairFDR(maxppifdr, reportFactor, ignoreGroups, minProteinPairPeptide, 0, between, result, getFdr().isPpi_directional()); if (result.proteinGroupPairFDR.getResultCount() == 0) { break protloop; @@ -2016,21 +2149,22 @@ public void maximiseLink(boolean between) { getFdr().filterFDRLinksByFDRProteinGroupPairs(result); - } - // how many links do we now have? final int linkCount = result.proteinGroupLinkFDR.getResultCount(); final int linkCountBetween = result.proteinGroupLinkFDR.getBetween(); - final int ppiCount = result.proteinGroupPairFDR ==null ? 0 : result.proteinGroupPairFDR.getResultCount(); - final int ppiCountBetween = result.proteinGroupPairFDR ==null ? 0 : result.proteinGroupPairFDR.getBetween(); + final int ppiCount = result.proteinGroupPairFDR == null ? 0 : result.proteinGroupPairFDR.getResultCount(); + final int ppiCountBetween = result.proteinGroupPairFDR == null ? 0 : result.proteinGroupPairFDR.getBetween(); // is it a new best? - if ((between && linkCountBetween > maxLinkCountBetween) || // boost between and more between than before - ((linkCountBetween == maxLinkCountBetween || !between) && linkCount > maxLinkCount) || // not between or same between but more overal - ((ppiCountBetween == maxPPICountBetween || !between) && linkCount == maxLinkCount && ppiCountBetween > maxPPICountBetween) || // - ((!between || (linkCountBetween == maxLinkCountBetween && ppiCountBetween == maxPPICountBetween)) && ppiCount > maxPPICount)) { + if ((between && linkCountBetween > maxLinkCountBetween) + || // boost between and more between than before + ((linkCountBetween == maxLinkCountBetween || !between) && linkCount > maxLinkCount) + || // not between or same between but more overal + ((ppiCountBetween == maxPPICountBetween || !between) && linkCount == maxLinkCount && ppiCountBetween > maxPPICountBetween) + || // + ((!between || (linkCountBetween == maxLinkCountBetween && ppiCountBetween == maxPPICountBetween)) && ppiCount > maxPPICount)) { maxLinkCountBetween = linkCountBetween; maxPPICountBetween = ppiCountBetween; @@ -2051,9 +2185,10 @@ public void maximiseLink(boolean between) { maxLinkCount = linkCount; maxPPICount = ppiCount; // record that we found a new top - String message = "psmfdr, " + psmfdr + " ,pepfdr, " + pepfdr + " ,protfdr, " + protfdr + ", link count, " + linkCount + (between ? "("+maxLinkCountBetween+" between)" :""); - if (ppiCount > 0 ) - message += ", Protein Pairs, " + ppiCount + (between ? "("+maxPPICountBetween+" between)" :""); + String message = "psmfdr, " + psmfdr + " ,pepfdr, " + pepfdr + " ,protfdr, " + protfdr + ", link count, " + linkCount + (between ? "(" + maxLinkCountBetween + " between)" : ""); + if (ppiCount > 0) { + message += ", Protein Pairs, " + ppiCount + (between ? "(" + maxPPICountBetween + " between)" : ""); + } sb.append(message + "\n"); Logger.getLogger(this.getClass().getName()).log(Level.INFO, sb.toString()); @@ -2074,8 +2209,9 @@ public void run() { txtSumLinks.setText(linkCount + ""); - if (ppiCount > 0) + if (ppiCount > 0) { txtSumProtGroupPairs.setText(ppiCount + ""); + } } }); @@ -2095,11 +2231,8 @@ public void run() { } - } - - } setStatus("Max Link Round: " + optimizingRound + " - " + maxLinkCount + " links"); @@ -2193,35 +2326,444 @@ public void run() { protfdrStep = (maxprotfdr - minprotfdr) / steps; } + } + + } + } catch (Exception ex) { + Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, "Error maximizing links", ex); + setEnableRead(true); + setEnableCalc(true); + } + + } + + class MaximizeLevelInfo { + double firstFDR; + double maximumFDR=0; + double fromFDR; + double toFDR; + double steps; + double stepWidth; + double smallestEqualFDR=0; + double largestEqualFDR=0; + boolean boost; + double currentFDR; + + int count=0; + int countBetween=0; + + int countPreFilter=0; + int countBetweenPreFilter=0; + + public MaximizeLevelInfo(double maximumFDR, boolean boost, int steps) { + this.maximumFDR = maximumFDR; + this.firstFDR = maximumFDR; + this.currentFDR = maximumFDR; + this.steps=steps; + this.toFDR = maximumFDR; + this.boost = boost; + if (boost) { + fromFDR = Math.min(0.005, toFDR / steps); + stepWidth = (toFDR - fromFDR) / steps; + } else { + fromFDR = toFDR; + stepWidth =100; + } + } + + public void firstStep() { + currentFDR=toFDR; + } + + public boolean doThisStep() { + return currentFDR>=fromFDR; + } + + public void nextStep() { + currentFDR-=stepWidth; + } + + public void setCounts(FDRResultLevel l) { + count=l.getBetween()+l.getWithin(); + countBetween=l.getBetween(); + } + + public void setCountsPrefilter(FDRResultLevel l) { + countPreFilter=l.getBetween()+l.getWithin(); + countBetweenPreFilter=l.getBetween(); + } + + public void setNewMaxFDR() { + maximumFDR = currentFDR; + smallestEqualFDR = currentFDR; + largestEqualFDR = currentFDR; + } + + public void setEqualFDR() { + smallestEqualFDR = Math.min(smallestEqualFDR,currentFDR); + largestEqualFDR = Math.max(largestEqualFDR,currentFDR); + } + + public void calcNextFDRRange(){ + if (boost) { + toFDR = Math.min(largestEqualFDR + (stepWidth*3/4), firstFDR); + fromFDR = Math.max(smallestEqualFDR - (stepWidth*3/4), 0); + stepWidth = (toFDR - fromFDR) / steps; + } + } + } + + public void maximise(OfflineFDR.FDRLevel level, boolean between) { + clearResults(); + + final FDRSettingsImpl settings = new FDRSettingsImpl(); + settings.setAll(fdrSettings); + + try { + int steps = settings.getBoostingSteps(); + setEnableRead(false); + setEnableCalc(false); + setEnableWrite(false); + StringBuffer sb = new StringBuffer(); + + + // get some settings, that are constant for all calculations + boolean ignoreGroups = ckIgnoreGroups1.isSelected(); + + int minLinkPeptide = settings.getMinLinkPepCount(); + int minProteinPeptide = settings.getMinProteinPepCount(); + int minProteinPairPeptide = settings.getMinPPIPepCount(); + + int maxLinkAmbiguity = settings.getMaxLinkAmbiguity(); + int maxProteinAmbiguity = settings.getMaxProteinAmbiguity(); + + double reportFactor = settings.getReportFactor(); + + final MaximizeLevelInfo psmFDRInfo = new MaximizeLevelInfo(settings.getPSMFDR(), settings.boostPSMs(), steps); + final MaximizeLevelInfo pepFDRInfo = new MaximizeLevelInfo(settings.getPeptidePairFDR(), settings.boostPeptidePairs()&& level.compareTo(OfflineFDR.FDRLevel.PEPTIDE_PAIR)>0, steps); + final MaximizeLevelInfo protFDRInfo = new MaximizeLevelInfo(settings.getProteinGroupFDR(), settings.boostProteins()&& level.compareTo(OfflineFDR.FDRLevel.PROTEINGROUP)>0, steps); + final MaximizeLevelInfo linkFDRInfo = new MaximizeLevelInfo(settings.getProteinGroupLinkFDR(), settings.boostLinks()&& level.compareTo(OfflineFDR.FDRLevel.PROTEINGROUPLINK)>0 , steps); + final MaximizeLevelInfo ppiFDRInfo = new MaximizeLevelInfo(settings.getProteinGroupPairFDR(), false, steps); + final MaximizeLevelInfo targetInfo; + switch (level) { + case PEPTIDE_PAIR: + targetInfo=pepFDRInfo; + break; + case PROTEINGROUP: + targetInfo=protFDRInfo; + break; + case PROTEINGROUPLINK: + targetInfo=linkFDRInfo; + break; + case PROTEINGROUPPAIR: + targetInfo=ppiFDRInfo; + break; + default: + targetInfo=null; + break; + } + + boolean filterToUniquePSM = settings.filterToUniquePSM(); + + + double linkfdr; + + boolean optimizing = true; + + int maxCount = 0; + int maxCountBetween = 0; + + + int countDown = 5; + + prepareFDRCalculation(); + + int optimizingRound = 1; + while (optimizing) { + int lastMaxCount = maxCount; + Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Round " + optimizingRound++); + + Logger.getLogger(this.getClass().getName()).log(Level.INFO, "PSM fdr from : " + psmFDRInfo.fromFDR + " to " + psmFDRInfo.toFDR + + "\nPeptide pair fdr from " + pepFDRInfo.fromFDR + " to " + pepFDRInfo.toFDR + + "\nProtein-groupfdr from " + protFDRInfo.fromFDR + " to " + protFDRInfo.toFDR + + "\nlinkfdr from " + linkFDRInfo.fromFDR + " to " + linkFDRInfo.toFDR + + "\nSteps : " + steps); + FDRResult result = new FDRResult(); + // find the combinations with the maximum number of ppis + psmloop: + for (psmFDRInfo.firstStep(); psmFDRInfo.doThisStep(); psmFDRInfo.nextStep()) { + getFdr().calculatePSMFDR(psmFDRInfo.currentFDR, reportFactor, ignoreGroups, false, result, getFdr().isPsm_directional(), filterToUniquePSM); + psmFDRInfo.setCountsPrefilter(result.psmFDR); + if (stopMaximizing) { + break psmloop; + } + // if we don't get PSM - stop looking at later stages + if (result.psmFDR.getResultCount() == 0) { + break psmloop; + } + + peploop: + for (pepFDRInfo.firstStep(); pepFDRInfo.doThisStep(); pepFDRInfo.nextStep()) { + + protloop: + for (protFDRInfo.firstStep(); protFDRInfo.doThisStep(); protFDRInfo.nextStep()) { + + // calculate peptide level fdr + getFdr().calculatePeptidePairFDR(pepFDRInfo.currentFDR, reportFactor, ignoreGroups, false, result, getFdr().isPeptides_directional()); + // if we don't get peptide pairs - stop looking at later stages + if (result.peptidePairFDR.getResultCount() == 0) { + break peploop; + } + pepFDRInfo.setCountsPrefilter(result.peptidePairFDR); + + if (stopMaximizing) { + break psmloop; + } + + // calculate protein level fdr + getFdr().calculateProteinGroupFDR(protFDRInfo.currentFDR, reportFactor, ignoreGroups, minProteinPeptide, maxProteinAmbiguity, false, result); + + if (result.proteinGroupFDR.getResultCount() == 0) { + break protloop; + } + protFDRInfo.setCountsPrefilter(result.proteinGroupFDR); + + // cut down the peptides by proteins + getFdr().filterFDRPeptidePairsByFDRProteinGroups(result); + + if (stopMaximizing) { + break psmloop; + } + + + linkloop: + for (linkFDRInfo.firstStep(); linkFDRInfo.doThisStep(); linkFDRInfo.nextStep()) { + // calculate links + getFdr().calculateLinkFDR(linkFDRInfo.currentFDR, reportFactor, ignoreGroups, minLinkPeptide, maxLinkAmbiguity, false, result, getFdr().isLinks_directional()); + linkFDRInfo.setCountsPrefilter(result.proteinGroupLinkFDR); + + if (result.proteinGroupLinkFDR.getResultCount() == 0) { + break linkloop; + } + + if (stopMaximizing) { + break psmloop; + } + + getFdr().calculateProteinGroupPairFDR(ppiFDRInfo.currentFDR, reportFactor, ignoreGroups, minProteinPairPeptide, 0, false, result, getFdr().isPpi_directional()); + + if (result.proteinGroupPairFDR.getResultCount() == 0) { + break protloop; + } + // now we need to filter down to the required level +// if (level.compareTo(level.PROTEINGROUPPAIR)!=0) { + getFdr().filterFDRLinksByFDRProteinGroupPairs(result); +// } +// if (level.compareTo(level.PROTEINGROUPLINK)!=0){ + getFdr().filterFDRPeptidePairsByFDRProteinGroupLinks(result); +// } + +// if (level.compareTo(level.PROTEINGROUP)==0){ + getFdr().filterFDRProteinGroupsByFDRPeptidePairs(result); +// } + + // how many links do we now have? + psmFDRInfo.setCounts(result.psmFDR); + pepFDRInfo.setCounts(result.peptidePairFDR); + protFDRInfo.setCounts(result.proteinGroupFDR); + linkFDRInfo.setCounts(result.proteinGroupLinkFDR); + ppiFDRInfo.setCounts(result.proteinGroupPairFDR); + + int count=targetInfo.count; + int countBetween =targetInfo.countBetween; + if (count == 0 && maxCount <= targetInfo.countPreFilter) + count = targetInfo.countPreFilter; + if (countBetween == 0 && maxCountBetween <= targetInfo.countBetweenPreFilter) + countBetween = targetInfo.countBetweenPreFilter; + + // is it a new best? + if (((between && (countBetween > maxCountBetween|| (countBetween == maxCountBetween && count>maxCount))) || + (!between && count>maxCount)) + ){ + maxCount = count; + maxCountBetween = countBetween; + + psmFDRInfo.setNewMaxFDR(); + pepFDRInfo.setNewMaxFDR(); + protFDRInfo.setNewMaxFDR(); + linkFDRInfo.setNewMaxFDR(); + protFDRInfo.setNewMaxFDR(); + + + // record that we found a new top + String message = "psmfdr, " + psmFDRInfo.currentFDR + " ,pepfdr, " + pepFDRInfo.currentFDR + " ,protfdr, " + protFDRInfo.currentFDR + ", link count, " + linkFDRInfo.count + "(" + linkFDRInfo.countBetween + " between), Protein Pairs, " + ppiFDRInfo.count + "(" + ppiFDRInfo.countBetween + " between)"; + sb.append(message + "\n"); + Logger.getLogger(this.getClass().getName()).log(Level.INFO, sb.toString()); + + // forward the values to the gui + final double showPSMFDR = psmFDRInfo.currentFDR; + final double showPepFDR = pepFDRInfo.currentFDR; + final double showProtFDR = protFDRInfo.currentFDR; + final double showLinkFDR = linkFDRInfo.currentFDR; + final double showPSMCount = psmFDRInfo.count; + final double showPepCount = pepFDRInfo.count; + final double showProtCount= protFDRInfo.count; + final double showLinkCount = linkFDRInfo.count; + final double showPPICount = ppiFDRInfo.count; + final double showLinkCountBetween = linkFDRInfo.countBetween; + final double showPPICountBetween = ppiFDRInfo.countBetween; + final double showLinkCountBetweenPreFilter = linkFDRInfo.countBetweenPreFilter; + final double showLinkCountPreFilter = linkFDRInfo.countPreFilter; + + javax.swing.SwingUtilities.invokeLater(new Runnable() { + public void run() { + fdrSettingsComplete.setPSMFDR(showPSMFDR); + fdrSettingsComplete.setPeptidePairFDR(showPepFDR); + fdrSettingsComplete.setProteinGroupFDR(showProtFDR); + fdrSettingsComplete.setProteinGroupLinkFDR(showLinkFDR); + + + txtSumPSM.setText(showPSMCount + ""); + txtSumPepPairs.setText(showPepCount + ""); + txtSumProtGroups.setText(showProtCount + ""); + txtSumLinks.setText(showLinkCount + ""); + txtSumLinks.setText(showLinkCount + (showLinkCount==0?"(before PPI:"+showLinkCountPreFilter+")":"")); + txtSumProtGroupPairs.setText(showPPICount + ""); + + txtSumLinksBetween.setText(showLinkCountBetween + (showLinkCountBetween==0?"(before PPI:"+showLinkCountBetweenPreFilter+")":"")); + + txtSumProtGroupPairs.setText(showPPICount + ""); + txtSumProtGroupPairsBetween.setText(showPPICountBetween + ""); + + + } + }); + + } else if (count == maxCount || (between && countBetween == maxCountBetween)) { + psmFDRInfo.setEqualFDR(); + pepFDRInfo.setEqualFDR(); + protFDRInfo.setEqualFDR(); + linkFDRInfo.setEqualFDR(); + ppiFDRInfo.setEqualFDR(); + } + + if (stopMaximizing) { + break psmloop; + } + } + + } + + } } + setStatus("Max Round: " + optimizingRound + " - " + maxCount + " matches"); + + // no improvement for the last few rounds? + if ((maxCount == lastMaxCount && --countDown == 0) || stopMaximizing) { + optimizing = false; + Logger.getLogger(this.getClass().getName()).log(Level.INFO, sb.toString()); + + final int foundCount = maxCount; + boolean isSet = false; + int trySet = 10; + while (!isSet && trySet > 0) { + try { + javax.swing.SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + fdrSettingsComplete.setPSMFDR(psmFDRInfo.maximumFDR); + fdrSettingsComplete.setPeptidePairFDR(pepFDRInfo.maximumFDR); + fdrSettingsComplete.setProteinGroupFDR(protFDRInfo.maximumFDR); + fdrSettingsComplete.setProteinGroupLinkFDR(linkFDRInfo.maximumFDR); + + fdrSettingsSimple.setPSMFDR(psmFDRInfo.maximumFDR); + fdrSettingsSimple.setPeptidePairFDR(pepFDRInfo.maximumFDR); + fdrSettingsSimple.setProteinGroupFDR(protFDRInfo.maximumFDR); + fdrSettingsSimple.setProteinGroupLinkFDR(linkFDRInfo.maximumFDR); + } + }); + isSet = true; + } catch (InterruptedException ex) { + trySet--; + Logger.getLogger(FDRGUI.class.getName()).log(Level.SEVERE, null, ex); + } catch (InvocationTargetException ex) { + trySet--; + Logger.getLogger(FDRGUI.class.getName()).log(Level.SEVERE, null, ex); + } + } + if (trySet < 0) { + JOptionPane.showMessageDialog(this, "Could not set the values for fdr-calculation", "Error", JOptionPane.ERROR_MESSAGE); + setEnableRead(true); + setEnableCalc(true); + setEnableWrite(true); + stopMaximizing = false; + return; + } + + javax.swing.SwingUtilities.invokeLater(new Runnable() { + public void run() { + JOptionPane.showMessageDialog(rootPane, "found " + foundCount + " matches for following settings \n" + + "\nPSM fdr: " + psmFDRInfo.maximumFDR + + "\nPeptide fdr:" + pepFDRInfo.maximumFDR + + "\nProtein FDR:" + protFDRInfo.maximumFDR + + "\nLink FDR:" + linkFDRInfo.maximumFDR, "best parameters found for max protein group pairs", JOptionPane.INFORMATION_MESSAGE); + } + }); + + innerFDRCalculation(psmFDRInfo.maximumFDR, pepFDRInfo.maximumFDR, protFDRInfo.maximumFDR, linkFDRInfo.maximumFDR, ppiFDRInfo.maximumFDR, getFdr(), reportFactor, filterToUniquePSM); + + setEnableRead(true); + setEnableCalc(true); + setEnableWrite(true); + + stopMaximizing = false; + + } else { + if (maxCount > lastMaxCount) { + // yes we improved + countDown = 5; + } else { + setStatus("Max Link Round: " + optimizingRound + " - " + maxCount + " links - count down: " + countDown); + + } + + // so see if we make the resoltuion finer + // can we get a better result? + psmFDRInfo.calcNextFDRRange(); + pepFDRInfo.calcNextFDRRange(); + linkFDRInfo.calcNextFDRRange(); + protFDRInfo.calcNextFDRRange(); + ppiFDRInfo.calcNextFDRRange(); + + } } } catch (Exception ex) { - Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, "Error maximizing links" , ex); + Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, "Error maximizing links", ex); setEnableRead(true); setEnableCalc(true); - - } + } } - - private void changeFDRSettings(java.awt.event.ActionEvent evt) { + + private void changeFDRSettings(java.awt.event.ActionEvent evt) { if (rbFDRSimple.isSelected()) { - if (fdrSettings != null) + if (fdrSettings != null) { fdrSettingsSimple.setAll(fdrSettings); + } if (spFDRSettingsWrapper.getComponentCount() > 3) { spFDRSettingsWrapper.remove(spFDRSettingsWrapper.getComponent(3)); } spFDRSettingsWrapper.setViewportView(fdrSettingsSimple); fdrSettings = fdrSettingsSimple; } else if (rbFDRComplete.isSelected()) { - if (fdrSettings != null) + if (fdrSettings != null) { fdrSettingsComplete.setAll(fdrSettings); + } if (spFDRSettingsWrapper.getComponentCount() > 3) { spFDRSettingsWrapper.remove(spFDRSettingsWrapper.getComponent(3)); } @@ -2229,8 +2771,7 @@ private void changeFDRSettings(java.awt.event.ActionEvent evt) { fdrSettings = fdrSettingsComplete; } // TODO add your handling code here: - } - + } /** * This method is called from within the constructor to initialize the form. @@ -2248,7 +2789,6 @@ private void initComponents() { bgFDRSettingType = new javax.swing.ButtonGroup(); fdrSettingsComplete = new org.rappsilber.fdr.gui.components.FDRSettingsComplete(); fdrSettingsSimple = new org.rappsilber.fdr.gui.components.FDRSettingsSimple(); - txtStatus = new javax.swing.JTextField(); jScrollPane6 = new javax.swing.JScrollPane(); jTabbedPane1 = new javax.swing.JTabbedPane(); jPanel2 = new javax.swing.JPanel(); @@ -2357,6 +2897,7 @@ private void initComponents() { spLog = new javax.swing.JScrollPane(); txtLog = new javax.swing.JTextArea(); memory2 = new org.rappsilber.gui.components.memory.Memory(); + cbLevel = new javax.swing.JComboBox<>(); pAbout = new javax.swing.JPanel(); jTabbedPane4 = new javax.swing.JTabbedPane(); pVersion = new javax.swing.JPanel(); @@ -2368,6 +2909,9 @@ private void initComponents() { editAboutCSV = new javax.swing.JEditorPane(); jScrollPane4 = new javax.swing.JScrollPane(); editAboutMzIdentML = new javax.swing.JEditorPane(); + jSplitPane1 = new javax.swing.JSplitPane(); + txtStatus = new javax.swing.JTextField(); + memory3 = new org.rappsilber.gui.components.memory.Memory(); cbCSVHeaders.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); @@ -2377,19 +2921,16 @@ private void initComponents() { setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Cross-Link FDR"); - addMouseListener(new java.awt.event.MouseAdapter() { - public void mouseClicked(java.awt.event.MouseEvent evt) { - formMouseClicked(evt); - } - }); addFocusListener(new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { formFocusGained(evt); } }); - - txtStatus.setEditable(false); - txtStatus.setText("status"); + addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + formMouseClicked(evt); + } + }); jTabbedPane1.setPreferredSize(new java.awt.Dimension(700, 400)); @@ -2412,7 +2953,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel6Layout.createSequentialGroup() .addContainerGap() - .addComponent(csvSelect, javax.swing.GroupLayout.DEFAULT_SIZE, 391, Short.MAX_VALUE) + .addComponent(csvSelect, javax.swing.GroupLayout.DEFAULT_SIZE, 388, Short.MAX_VALUE) .addContainerGap()) ); @@ -2478,7 +3019,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(rbMZLowBetter) .addComponent(rbMZHighBetter)) - .addGap(88, 270, Short.MAX_VALUE)) + .addGap(88, 357, Short.MAX_VALUE)) .addComponent(cbMZMatchScoreName, javax.swing.GroupLayout.Alignment.TRAILING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) .addContainerGap()) ); @@ -2499,7 +3040,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addComponent(btnReadMZIdent) .addComponent(jLabel19)) .addComponent(fbMZIdentMLIn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addContainerGap(289, Short.MAX_VALUE)) + .addContainerGap(286, Short.MAX_VALUE)) ); tpInput.addTab("mzIdentML", jPanel11); @@ -2580,7 +3121,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addComponent(spDecoyDBProt, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(spTargetDBProt, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lblProtein, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addContainerGap(209, Short.MAX_VALUE)) + .addContainerGap(296, Short.MAX_VALUE)) ); pDatabseSizeLayout.setVerticalGroup( pDatabseSizeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -2686,7 +3227,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addGroup(pFDRGroupsLayout.createSequentialGroup() .addComponent(ckIgnoreGroups1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(spPepLength, javax.swing.GroupLayout.DEFAULT_SIZE, 226, Short.MAX_VALUE) + .addComponent(spPepLength, javax.swing.GroupLayout.DEFAULT_SIZE, 222, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) @@ -2931,7 +3472,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel9Layout.createSequentialGroup() .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jPanel18, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jPanel20, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 523, Short.MAX_VALUE) + .addComponent(jPanel20, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 610, Short.MAX_VALUE) .addComponent(jPanel16, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel15, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) @@ -2994,7 +3535,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(txtSumInput, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addContainerGap(133, Short.MAX_VALUE)) + .addContainerGap(129, Short.MAX_VALUE)) ); tpResult.addTab("Summary", jPanel8); @@ -3050,7 +3591,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addGap(0, 0, Short.MAX_VALUE)) .addGroup(jPanel10Layout.createSequentialGroup() .addComponent(rbCSV) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 354, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 441, Short.MAX_VALUE) .addComponent(btnWrite))) .addGap(23, 23, 23)) ); @@ -3069,7 +3610,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(rbCSV) .addComponent(btnWrite)) - .addContainerGap(283, Short.MAX_VALUE)) + .addContainerGap(280, Short.MAX_VALUE)) ); tpResult.addTab("CSV/TSV", jPanel10); @@ -3149,7 +3690,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addComponent(txtmzIdentOwnerLast, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(txtmzIdentOwnerEmail) .addComponent(txtmzIdentOwnerOrg)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 254, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 341, Short.MAX_VALUE) .addComponent(btnWriteMzIdentML))) .addContainerGap()) ); @@ -3176,7 +3717,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel4)) - .addContainerGap(210, Short.MAX_VALUE)) + .addContainerGap(207, Short.MAX_VALUE)) ); tpResult.addTab("mzIdentML", jPanel14); @@ -3201,6 +3742,13 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { txtLog.setRows(5); spLog.setViewportView(txtLog); + cbLevel.setModel(new javax.swing.DefaultComboBoxModel(new Level[] { Level.ALL,Level.FINEST,Level.FINER,Level.FINE,Level.INFO,Level.WARNING,Level.SEVERE,Level.OFF})); + cbLevel.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + cbLevelActionPerformed(evt); + } + }); + javax.swing.GroupLayout pLogLayout = new javax.swing.GroupLayout(pLog); pLog.setLayout(pLogLayout); pLogLayout.setHorizontalGroup( @@ -3209,7 +3757,8 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addContainerGap() .addGroup(pLogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(spLog) - .addComponent(memory2, javax.swing.GroupLayout.DEFAULT_SIZE, 695, Short.MAX_VALUE)) + .addComponent(memory2, javax.swing.GroupLayout.DEFAULT_SIZE, 782, Short.MAX_VALUE) + .addComponent(cbLevel, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap()) ); pLogLayout.setVerticalGroup( @@ -3217,8 +3766,10 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pLogLayout.createSequentialGroup() .addContainerGap() .addComponent(memory2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(spLog, javax.swing.GroupLayout.DEFAULT_SIZE, 417, Short.MAX_VALUE) + .addGap(9, 9, 9) + .addComponent(cbLevel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(spLog, javax.swing.GroupLayout.DEFAULT_SIZE, 375, Short.MAX_VALUE) .addContainerGap()) ); @@ -3237,7 +3788,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addComponent(jLabel29) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(txtXiFDRVersion, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(517, Short.MAX_VALUE)) + .addContainerGap(604, Short.MAX_VALUE)) ); pVersionLayout.setVerticalGroup( pVersionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -3246,7 +3797,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addGroup(pVersionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel29) .addComponent(txtXiFDRVersion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addContainerGap(384, Short.MAX_VALUE)) + .addContainerGap(381, Short.MAX_VALUE)) ); jTabbedPane4.addTab("Version", pVersion); @@ -3282,19 +3833,28 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { jScrollPane6.setViewportView(jTabbedPane1); + jSplitPane1.setDividerLocation(400); + jSplitPane1.setDividerSize(5); + + txtStatus.setEditable(false); + txtStatus.setText("status"); + txtStatus.setPreferredSize(new java.awt.Dimension(200, 19)); + jSplitPane1.setLeftComponent(txtStatus); + jSplitPane1.setRightComponent(memory3); + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 727, Short.MAX_VALUE) - .addComponent(txtStatus) + .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 814, Short.MAX_VALUE) + .addComponent(jSplitPane1) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() - .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 496, Short.MAX_VALUE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(txtStatus, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 493, Short.MAX_VALUE) + .addGap(7, 7, 7) + .addComponent(jSplitPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) ); pack(); @@ -3310,7 +3870,7 @@ private void txtSumPSMActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIR private void btnReadMZIdentActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnReadMZIdentActionPerformed readMZIdentML(); ckPrePostAA.setVisible(false); - + }//GEN-LAST:event_btnReadMZIdentActionPerformed private void cbMZMatchScoreNameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbMZMatchScoreNameActionPerformed @@ -3334,11 +3894,11 @@ private void rbMZLowBetterActionPerformed(java.awt.event.ActionEvent evt) {//GEN private void btnWriteMzIdentMLActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnWriteMzIdentMLActionPerformed writeMZIdentML(); - LocalProperties.setProperty("mzIdenMLOwnerFirst",txtmzIdentOwnerFirst.getText()); - LocalProperties.setProperty("mzIdenMLOwnerLast",txtmzIdentOwnerLast.getText()); - LocalProperties.setProperty("mzIdenMLOwnerEmail",txtmzIdentOwnerEmail.getText()); - LocalProperties.setProperty("mzIdenMLOwnerAddress",txtmzIdentAdress.getText()); - LocalProperties.setProperty("mzIdenMLOwnerOrg",txtmzIdentOwnerOrg.getText()); + LocalProperties.setProperty("mzIdenMLOwnerFirst", txtmzIdentOwnerFirst.getText()); + LocalProperties.setProperty("mzIdenMLOwnerLast", txtmzIdentOwnerLast.getText()); + LocalProperties.setProperty("mzIdenMLOwnerEmail", txtmzIdentOwnerEmail.getText()); + LocalProperties.setProperty("mzIdenMLOwnerAddress", txtmzIdentAdress.getText()); + LocalProperties.setProperty("mzIdenMLOwnerOrg", txtmzIdentOwnerOrg.getText()); }//GEN-LAST:event_btnWriteMzIdentMLActionPerformed @@ -3362,9 +3922,8 @@ private void ckDefineGroupsActionPerformed(java.awt.event.ActionEvent evt) {//GE }//GEN-LAST:event_ckDefineGroupsActionPerformed private void formFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_formFocusGained - - - + + }//GEN-LAST:event_formFocusGained private void formMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMouseClicked @@ -3373,39 +3932,39 @@ private void formMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ }//GEN-LAST:event_formMouseClicked private void btnPSMInfoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPSMInfoActionPerformed - if (getResult()!= null) { + if (getResult() != null) { new FDRLevelInformations(getResult().psmFDR, "PSM FDR").setVisible(true); - } + } }//GEN-LAST:event_btnPSMInfoActionPerformed private void btnPepInfoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPepInfoActionPerformed - if (getResult()!= null) { + if (getResult() != null) { new FDRLevelInformations(getResult().peptidePairFDR, "Peptide-Pair FDR").setVisible(true); } }//GEN-LAST:event_btnPepInfoActionPerformed private void btnProtInfoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnProtInfoActionPerformed - if (getResult()!= null) { + if (getResult() != null) { new FDRLevelInformations(getResult().proteinGroupFDR, "Protein Group FDR").setVisible(true); } }//GEN-LAST:event_btnProtInfoActionPerformed private void btnLinkInfoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLinkInfoActionPerformed - if (getResult()!= null) { + if (getResult() != null) { new FDRLevelInformations(getResult().proteinGroupLinkFDR, "Protein Group Link FDR").setVisible(true); } }//GEN-LAST:event_btnLinkInfoActionPerformed private void btnPPIInfoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPPIInfoActionPerformed - if (getResult()!= null) { + if (getResult() != null) { new FDRLevelInformations(getResult().proteinGroupPairFDR, "Protein Group Pairs FDR").setVisible(true); } }//GEN-LAST:event_btnPPIInfoActionPerformed private void ckDBSizeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ckDBSizeActionPerformed - + pDatabseSize.setVisible(ckDBSize.isSelected()); - + spTargetDB.setEnabled(ckDBSize.isSelected()); spDecoyDB.setEnabled(ckDBSize.isSelected()); spTargetDBLinks.setEnabled(ckDBSize.isSelected()); @@ -3429,13 +3988,13 @@ private void ckDBSizeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRS lblLinkDB.setVisible(ckDBSize.isSelected()); lblPeptide.setVisible(ckDBSize.isSelected()); lblProtein.setVisible(ckDBSize.isSelected()); - + }//GEN-LAST:event_ckDBSizeActionPerformed private void changFDRSettingsInterface(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_changFDRSettingsInterface changeFDRSettings(evt); - + }//GEN-LAST:event_changFDRSettingsInterface private void rbFDRCompleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbFDRCompleteActionPerformed @@ -3446,12 +4005,12 @@ private void ckIgnoreGroups1ActionPerformed(java.awt.event.ActionEvent evt) {//G // TODO add your handling code here: }//GEN-LAST:event_ckIgnoreGroups1ActionPerformed - private void csvSelectAddActionPerformed(java.awt.event.ActionEvent evt) { + private void csvSelectAddActionPerformed(java.awt.event.ActionEvent evt) { readAdditionalCSV(); - } - + } + private void csvSelectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_csvSelectActionPerformed - readCSV(); + readAllCSV(); }//GEN-LAST:event_csvSelectActionPerformed private void txtmzIdentOwnerFirstActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtmzIdentOwnerFirstActionPerformed @@ -3471,25 +4030,32 @@ private void txtmzIdentOwnerOrgActionPerformed(java.awt.event.ActionEvent evt) { }//GEN-LAST:event_txtmzIdentOwnerOrgActionPerformed private void rbTSVActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbTSVActionPerformed - if (rbTSV.isSelected()) + if (rbTSV.isSelected()) { fbFolder.setAutoAddDefaultExtension("txt"); + } }//GEN-LAST:event_rbTSVActionPerformed private void rbCSVActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbCSVActionPerformed - if (rbCSV.isSelected()) + if (rbCSV.isSelected()) { fbFolder.setAutoAddDefaultExtension("csv"); + } }//GEN-LAST:event_rbCSVActionPerformed - - + private void cbLevelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbLevelActionPerformed + Handler[] handlers = + Logger.getLogger( "" ).getHandlers(); + for ( int index = 0; index < handlers.length; index++ ) { + handlers[index].setLevel((Level) cbLevel.getSelectedItem()); + } + loggingOutput.setLevel((Level) cbLevel.getSelectedItem()); + }//GEN-LAST:event_cbLevelActionPerformed + // private void fdrSpinnerMaximumCheck(JSpinner sp, double max) { // SpinnerModel sm = sp.getModel(); // Double fdr = (Double) sm.getValue(); // if (fdr > max) // sm.setValue(max); // } - - /** * @param args the command line arguments */ @@ -3539,12 +4105,13 @@ public void run() { protected javax.swing.JButton btnWriteMzIdentML; private javax.swing.JComboBox cbCSVHeaderOptional; private javax.swing.JComboBox cbCSVHeaders; + private javax.swing.JComboBox cbLevel; private javax.swing.JComboBox cbMZMatchScoreName; private javax.swing.JCheckBox ckDBSize; private javax.swing.JCheckBox ckDefineGroups; private javax.swing.JCheckBox ckIgnoreGroups1; public javax.swing.JCheckBox ckPrePostAA; - private org.rappsilber.fdr.gui.components.CSVSelection csvSelect; + protected org.rappsilber.fdr.gui.components.CSVSelection csvSelect; private javax.swing.JEditorPane editAbout; private javax.swing.JEditorPane editAboutCSV; private javax.swing.JEditorPane editAboutMzIdentML; @@ -3593,6 +4160,7 @@ public void run() { private javax.swing.JScrollPane jScrollPane4; private javax.swing.JScrollPane jScrollPane5; private javax.swing.JScrollPane jScrollPane6; + private javax.swing.JSplitPane jSplitPane1; private javax.swing.JTabbedPane jTabbedPane1; private javax.swing.JTabbedPane jTabbedPane4; private javax.swing.JLabel lblDecoyDB; @@ -3605,6 +4173,7 @@ public void run() { private javax.swing.JLabel lblSumInternal1; private javax.swing.JLabel lblTargetDB; private org.rappsilber.gui.components.memory.Memory memory2; + private org.rappsilber.gui.components.memory.Memory memory3; private javax.swing.JPanel pAbout; private javax.swing.JPanel pDatabseSize; private javax.swing.JPanel pFDRGroups; diff --git a/src/main/java/org/rappsilber/fdr/gui/components/CSVSelection.form b/src/main/java/org/rappsilber/fdr/gui/components/CSVSelection.form index 127ae65..15499f7 100644 --- a/src/main/java/org/rappsilber/fdr/gui/components/CSVSelection.form +++ b/src/main/java/org/rappsilber/fdr/gui/components/CSVSelection.form @@ -28,6 +28,8 @@ + + @@ -44,9 +46,9 @@ - - - + + + @@ -56,10 +58,16 @@ + + + + + + - + @@ -75,27 +83,27 @@ - - + + + + + + + - - - - - - - - + - - + - + + + + - + @@ -114,30 +122,28 @@ - - - - - + + - - - - - - - - - - - + + + + + + + + + + + + @@ -350,5 +356,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/org/rappsilber/fdr/gui/components/CSVSelection.java b/src/main/java/org/rappsilber/fdr/gui/components/CSVSelection.java index 5de29e5..5c2a7d0 100644 --- a/src/main/java/org/rappsilber/fdr/gui/components/CSVSelection.java +++ b/src/main/java/org/rappsilber/fdr/gui/components/CSVSelection.java @@ -15,7 +15,9 @@ */ package org.rappsilber.fdr.gui.components; +import java.awt.BorderLayout; import java.awt.Component; +import java.awt.Dimension; import java.awt.HeadlessException; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -27,25 +29,31 @@ import java.util.Calendar; import java.util.EventObject; import java.util.HashMap; +import java.util.Iterator; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.DefaultCellEditor; import javax.swing.DefaultComboBoxModel; +import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JComponent; +import javax.swing.JFrame; import javax.swing.JOptionPane; import javax.swing.JTable; +import javax.swing.UIManager; import javax.swing.table.TableColumn; import javax.swing.table.TableModel; import org.rappsilber.data.csv.CsvParser; import org.rappsilber.gui.components.JoinedThreadedTextOuput; import org.rappsilber.data.csv.ColumnAlternatives; +import org.rappsilber.data.csv.condition.CsvCondition; +import org.rappsilber.data.csv.gui.filter.ConditionList; /** * * @author lfischer */ -public class CSVSelection extends javax.swing.JPanel { +public class CSVSelection extends javax.swing.JPanel implements Iterable{ private ArrayList m_actionlisteners = new ArrayList(); @@ -56,6 +64,7 @@ public class CSVSelection extends javax.swing.JPanel { public String[] csvColumns = new String[]{missingColumn}; public String[] csvColumnsOptional = new String[]{optionalColumn}; + private JoinedThreadedTextOuput m_status = null; public static String[][] COLUMN_ALIASES = new String[][]{ @@ -74,8 +83,8 @@ public class CSVSelection extends javax.swing.JPanel { {"pep2 link pos", "link2", "peptide2 link pos", "peptide link2", "peptide link 2" , "to site","LinkPos2"}, {"lengthpeptide1", "peptide1 length", "peptide1 length", "peptide length 1", "length1"}, {"lengthpeptide2", "peptide2 length", "peptide2 length", "peptide length 2", "length2"}, - {"peptide1", "peptide 1", "peptide", "modified sequence"}, - {"peptide2" , "peptide 2"}, + {"peptide1", "peptide 1", "pepseq1", "peptide", "modified sequence"}, + {"peptide2" , "peptide 2", "pepseq2"}, {"precursermz", "precursor mz", "experimental mz", "exp mz"}, {"precursor charge", "precoursorcharge", "charge"}, {"calculated mass", "calc mass", "theoretical mass"}, @@ -83,6 +92,7 @@ public class CSVSelection extends javax.swing.JPanel { {"description2", "fasta2"}, {"protein1", "display protein1", "accession1"}, {"protein2", "display protein2", "accession2"},}; + private class NeededOptionalComboBoxCellEditor extends DefaultCellEditor { @@ -148,12 +158,15 @@ public Component getTableCellEditorComponent(JTable table, Object value, */ public CSVSelection() { initComponents(); + fbCsvIn.setMultipleFiles(true); fbCsvIn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { setUpCsvHeaders(); + ckFilter.setEnabled(true); } }); + fbCsvIn.setLocalPropertyKey("xiFDR_CSV_IN_LAST_FOLDER"); ckCSVHasHeader.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { @@ -168,7 +181,7 @@ public void actionPerformed(ActionEvent e) { TableColumn columnNamesColumn = tblCSVColumns.getColumnModel().getColumn(2); columnNamesColumn.setCellEditor(new NeededOptionalComboBoxCellEditor(cbCSVHeaders, cbCSVHeaderOptional)); resetColumnMappings(); - + spAdditional.setVisible(false); } protected void resetColumnMappings() { @@ -233,6 +246,10 @@ public void setUpCsvHeaders() { cbCSVHeaders.setModel(new DefaultComboBoxModel(csvColumns)); cbCSVHeaderOptional.setModel(new DefaultComboBoxModel(csvColumnsOptional)); csv.close(); + if (filter.setCsvParser(csv) >0) { + btnFilter.setIcon(UIManager.getIcon("OptionPane.errorIcon")); + btnFilter.setToolTipText("Filter no longer match to file"); + } } catch (FileNotFoundException ex) { Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, null, ex); @@ -258,7 +275,11 @@ public void setStatusInterface(final JoinedThreadedTextOuput status ) { public File getFile() { return fbCsvIn.getFile(); } - + + public File[] getFiles() { + return fbCsvIn.getFiles(); + } + protected void doActionPerformed() { ActionEvent ae = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, "file selected",Calendar.getInstance().getTimeInMillis(), 0); for (java.awt.event.ActionListener al : m_actionlisteners) @@ -332,6 +353,88 @@ public CsvParser getCsv() throws IOException { return csv; } + public Iterator iterator() { + final File[] inputs = getFiles(); + final TableModel tm = tblCSVColumns.getModel(); + String preDelimiter = getDelimiter(); + if (preDelimiter.contentEquals("Comma")) { + preDelimiter = ","; + } else if (preDelimiter.contentEquals("Tab")) { + preDelimiter = "\t"; + } else if (preDelimiter.contentEquals("Space")) { + preDelimiter = " "; + } + final char delimiter = preDelimiter.charAt(0); + final char quote = getQuote(); + final boolean hasHeader =hasHeader(); + return new Iterator() { + int n=0; + + @Override + public boolean hasNext() { + return n//GEN-END:initComponents @@ -619,7 +757,7 @@ protected boolean testInput() throws HeadlessException { for (int r = 0; r < tm.getRowCount(); r++) { if ((!Boolean.TRUE.equals(tm.getValueAt(r, 1))) && tm.getValueAt(r, 2) == missingColumn) { JOptionPane.showMessageDialog(this, "No column for " + tm.getValueAt(r, 0) + " selected", "Missing Column", JOptionPane.WARNING_MESSAGE); - return true; + return false; } if (tm.getValueAt(r, 0).toString().contentEquals("Peptide1 Score") && tm.getValueAt(r, 2) != optionalColumn) { peptide1ScoreSelected = true; @@ -664,23 +802,42 @@ private void ckCSVHasHeaderActionPerformed(java.awt.event.ActionEvent evt) {//GE ckSmartMatch.setEnabled(ckCSVHasHeader.isSelected()); }//GEN-LAST:event_ckCSVHasHeaderActionPerformed + private void ckFilterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ckFilterActionPerformed + btnFilter.setEnabled(ckFilter.isSelected()); + if (ckFilter.isSelected()) { + showFilter(); + } + }//GEN-LAST:event_ckFilterActionPerformed + + private void btnFilterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFilterActionPerformed + showFilter(); + btnFilter.setIcon(null); + btnFilter.setToolTipText("open filter dialog"); + + }//GEN-LAST:event_btnFilterActionPerformed + // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.ButtonGroup bgScoreDirectionCSV; private javax.swing.JButton btnAddCSV; + private javax.swing.JButton btnFilter; private javax.swing.JButton btnReadCsv; private javax.swing.JComboBox cbCSVDElimiter; private javax.swing.JComboBox cbCSVHeaderOptional; private javax.swing.JComboBox cbCSVHeaders; private javax.swing.JComboBox cbCSVQuote; private javax.swing.JCheckBox ckCSVHasHeader; + private javax.swing.JCheckBox ckFilter; private javax.swing.JCheckBox ckSmartMatch; private org.rappsilber.gui.components.FileBrowser fbCsvIn; + private org.rappsilber.data.csv.gui.filter.ConditionList filter; private javax.swing.JLabel jLabel11; private javax.swing.JLabel jLabel26; private javax.swing.JLabel jLabel27; private javax.swing.JScrollPane jScrollPane2; + private javax.swing.JPanel pAdditional; private javax.swing.JRadioButton rbCSVHighBetter; private javax.swing.JRadioButton rbCSVLowBetter; + public javax.swing.JScrollPane spAdditional; private javax.swing.JTable tblCSVColumns; // End of variables declaration//GEN-END:variables } diff --git a/src/main/java/org/rappsilber/fdr/gui/components/FDRSettingsComplete.form b/src/main/java/org/rappsilber/fdr/gui/components/FDRSettingsComplete.form index 078f71c..e002c6c 100644 --- a/src/main/java/org/rappsilber/fdr/gui/components/FDRSettingsComplete.form +++ b/src/main/java/org/rappsilber/fdr/gui/components/FDRSettingsComplete.form @@ -54,6 +54,12 @@ + + + + + + @@ -69,19 +75,16 @@ + - - + + + + + - - - - - - - @@ -137,7 +140,10 @@ - + + + + @@ -148,9 +154,9 @@ - + - + @@ -395,6 +401,7 @@ + @@ -405,5 +412,14 @@ + + + + + + + + + diff --git a/src/main/java/org/rappsilber/fdr/gui/components/FDRSettingsComplete.java b/src/main/java/org/rappsilber/fdr/gui/components/FDRSettingsComplete.java index fa3ab59..0550ccc 100644 --- a/src/main/java/org/rappsilber/fdr/gui/components/FDRSettingsComplete.java +++ b/src/main/java/org/rappsilber/fdr/gui/components/FDRSettingsComplete.java @@ -401,6 +401,7 @@ private void initComponents() { ckUniquePSM = new javax.swing.JCheckBox(); ckBoostBetween = new javax.swing.JCheckBox(); btnBoostIgnores = new javax.swing.JButton(); + ckGroupByPSMs = new javax.swing.JCheckBox(); jLabel5.setText("PSM"); @@ -500,6 +501,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { ckUniquePSM.setToolTipText("only use the top match for each combination of charge peptide1, peptide2 and charge state as a PSM"); ckBoostBetween.setText("Between"); + ckBoostBetween.setToolTipText("optimize settings for maximizing between matches"); btnBoostIgnores.setText("Boost Ignores"); btnBoostIgnores.addActionListener(new java.awt.event.ActionListener() { @@ -508,6 +510,14 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } }); + ckGroupByPSMs.setText("Group by PSMs"); + ckGroupByPSMs.setToolTipText("Groups matches baessed on how many psms support a given protein pair."); + ckGroupByPSMs.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + ckGroupByPSMsActionPerformed(evt); + } + }); + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( @@ -545,6 +555,11 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addComponent(btnStopBoost)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(70, 70, 70) + .addComponent(btnBoostIgnores) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 7, Short.MAX_VALUE) + .addComponent(btnCalc)) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(spMaximizeSteps) @@ -559,15 +574,12 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addComponent(jLabel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(spMinPeptideLength, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(spMaxProteinAmbiguity, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(ckBoostBetween, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() - .addComponent(ckUniquePSM) - .addGap(0, 55, Short.MAX_VALUE)) - .addComponent(ckBoostBetween, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) - .addGroup(layout.createSequentialGroup() - .addGap(70, 70, 70) - .addComponent(btnBoostIgnores) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 7, Short.MAX_VALUE) - .addComponent(btnCalc)))) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(ckGroupByPSMs) + .addComponent(ckUniquePSM)) + .addGap(0, 0, Short.MAX_VALUE)))))) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -610,7 +622,9 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addComponent(jLabel3))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(spMinPPIPepCount, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(spMinPPIPepCount, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(ckUniquePSM)) .addComponent(ckDirectionalPPI, javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(spPPIFdr, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) @@ -619,8 +633,8 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(spReportFactor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lblReportFactor) - .addComponent(ckUniquePSM)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 6, Short.MAX_VALUE) + .addComponent(ckGroupByPSMs)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(ckMaximize) .addComponent(cbBoostWhat, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) @@ -654,6 +668,10 @@ private void btnBoostIgnoresActionPerformed(java.awt.event.ActionEvent evt) {//G setBoostIgnores(); }//GEN-LAST:event_btnBoostIgnoresActionPerformed + private void ckGroupByPSMsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ckGroupByPSMsActionPerformed + setGroupByPSMCount(ckGroupByPSMs.isSelected()); + }//GEN-LAST:event_ckGroupByPSMsActionPerformed + // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton btnBoostIgnores; private javax.swing.JButton btnCalc; @@ -664,6 +682,7 @@ private void btnBoostIgnoresActionPerformed(java.awt.event.ActionEvent evt) {//G private javax.swing.JCheckBox ckDirectionalPPI; private javax.swing.JCheckBox ckDirectionalPSM; private javax.swing.JCheckBox ckDirectionalPeptidePair; + private javax.swing.JCheckBox ckGroupByPSMs; private javax.swing.JCheckBox ckMaximize; private javax.swing.JCheckBox ckUniquePSM; private javax.swing.JLabel jLabel1; diff --git a/src/main/java/org/rappsilber/fdr/gui/components/FDRSettingsPanel.java b/src/main/java/org/rappsilber/fdr/gui/components/FDRSettingsPanel.java index d5975a0..6945a34 100644 --- a/src/main/java/org/rappsilber/fdr/gui/components/FDRSettingsPanel.java +++ b/src/main/java/org/rappsilber/fdr/gui/components/FDRSettingsPanel.java @@ -30,6 +30,8 @@ */ public abstract class FDRSettingsPanel extends javax.swing.JPanel implements FDRSettings { + + protected ArrayList m_StopMaximizingListener = new ArrayList(); protected ArrayList m_calc_listener = new ArrayList(); @@ -39,6 +41,7 @@ public abstract class FDRSettingsPanel extends javax.swing.JPanel implements FDR protected boolean boostPeptidePairs = true; protected boolean boostProteins = true; protected boolean boostLinks = true; + protected boolean groupByPSMCount = false; /** * Creates new form FDRSettingsPanel @@ -155,7 +158,19 @@ public void actionPerformed(ActionEvent e) { fi.setVisible(true); } } - + /** + * @return the groupByPPI + */ + public boolean isGroupByPSMCount() { + return groupByPSMCount; + } + + /** + * @param groupByPPI the groupByPPI to set + */ + public void setGroupByPSMCount(boolean groupBySMCount) { + this.groupByPSMCount = groupBySMCount; + } public void setAll(FDRSettings settings) { this.setBoostingSteps(settings.getBoostingSteps()); @@ -182,6 +197,7 @@ public void setAll(FDRSettings settings) { this.boostPSMs(settings.boostPSMs()); this.boostPeptidePairs(settings.boostPeptidePairs()); this.boostProteins(settings.boostProteins()); + this.setGroupByPSMCount(settings.isGroupByPSMCount()); } // public abstract void setEnabled(boolean e); diff --git a/src/main/java/org/rappsilber/fdr/result/FDRResult.java b/src/main/java/org/rappsilber/fdr/result/FDRResult.java index c040991..6639cb1 100644 --- a/src/main/java/org/rappsilber/fdr/result/FDRResult.java +++ b/src/main/java/org/rappsilber/fdr/result/FDRResult.java @@ -16,6 +16,7 @@ package org.rappsilber.fdr.result; import java.util.Collection; +import java.util.HashMap; import org.rappsilber.fdr.entities.PSM; import org.rappsilber.fdr.entities.PeptidePair; import org.rappsilber.fdr.entities.ProteinGroupLink; @@ -39,6 +40,19 @@ public class FDRResult { public int maximumLinkAmbiguity = 0; public double reportFactor = 0; public boolean uniquePSMs = false; + + public void clear() { + if (psmFDR != null) + psmFDR.clear(); + if (peptidePairFDR != null) + peptidePairFDR.clear(); + if (proteinGroupFDR != null) + proteinGroupFDR.clear(); + if (proteinGroupLinkFDR != null) + proteinGroupLinkFDR.clear(); + if (proteinGroupPairFDR != null) + proteinGroupPairFDR.clear(); + } diff --git a/src/main/java/org/rappsilber/fdr/result/FDRResultLevel.java b/src/main/java/org/rappsilber/fdr/result/FDRResultLevel.java index de30e43..0be25e8 100644 --- a/src/main/java/org/rappsilber/fdr/result/FDRResultLevel.java +++ b/src/main/java/org/rappsilber/fdr/result/FDRResultLevel.java @@ -116,7 +116,7 @@ public void remove() { }; } - public Iterable filteredRsults() { + public Iterable filteredResults() { return new Iterable() { @Override @@ -176,10 +176,23 @@ public T filteredGet(T e) { } public void retainAll(Collection k) { - + between =0; + linear =0; + within = 0; for (SubGroupFdrInfo g: groups.values()) { g.filteredResult = new HashedArrayList(g.filteredResult); g.filteredResult.retainAll(k); + + for (T e : g.filteredResult) { + if (e.isTT()) { + if (e.isLinear()) + linear++; + if (e.isBetween()) + between++; + else if (e.isInternal()) + within++; + } + } } } @@ -249,4 +262,9 @@ public int size() { return ret; } + public void clear() { + for (SubGroupFdrInfo si : groups.values()) { + si.clear(); + } + } } diff --git a/src/main/java/org/rappsilber/fdr/result/SubGroupFdrInfo.java b/src/main/java/org/rappsilber/fdr/result/SubGroupFdrInfo.java index 61a9f38..ccb092b 100644 --- a/src/main/java/org/rappsilber/fdr/result/SubGroupFdrInfo.java +++ b/src/main/java/org/rappsilber/fdr/result/SubGroupFdrInfo.java @@ -32,6 +32,12 @@ public class SubGroupFdrInfo implements Iterable { public int DD; /** how many TT cases are there in total */ public int TT; + /** how many TD cases are there in total */ + public int resultTD; + /** how many DD cases are there in total */ + public int resultDD; + /** how many TT cases are there in total */ + public int resultTT; /** target fdr */ public double targteFDR; @@ -121,6 +127,11 @@ public void setLinear(int linear) { this.linear = linear; } + void clear() { + results.clear(); + filteredResult.clear(); + } + } diff --git a/src/main/java/org/rappsilber/fdr/utils/AbstractFDRElement.java b/src/main/java/org/rappsilber/fdr/utils/AbstractFDRElement.java index ccb3719..bb26613 100644 --- a/src/main/java/org/rappsilber/fdr/utils/AbstractFDRElement.java +++ b/src/main/java/org/rappsilber/fdr/utils/AbstractFDRElement.java @@ -16,6 +16,7 @@ package org.rappsilber.fdr.utils; import org.rappsilber.fdr.entities.Site; +import org.rappsilber.fdr.groups.ProteinGroup; import org.rappsilber.utils.SelfAdd; /** @@ -73,6 +74,8 @@ public void setLowerFDR(double lowerFDR) { this.m_lowerFDR = lowerFDR; } + public abstract ProteinGroup getProteinGroup1(); + public abstract ProteinGroup getProteinGroup2(); } diff --git a/src/main/java/org/rappsilber/fdr/utils/FDRSelfAdd.java b/src/main/java/org/rappsilber/fdr/utils/FDRSelfAdd.java index 1450f37..c22669d 100644 --- a/src/main/java/org/rappsilber/fdr/utils/FDRSelfAdd.java +++ b/src/main/java/org/rappsilber/fdr/utils/FDRSelfAdd.java @@ -32,6 +32,11 @@ public interface FDRSelfAdd extends SelfAdd { //, Comparable { * @return */ int getFDRGroup(); + + /** + * defines the fdr-group for a single entry + */ + void setFDRGroup(int fdrGroup); /** * Name of the FDR-group this match belongs to * @return diff --git a/src/main/java/org/rappsilber/fdr/utils/HashedArrayList.java b/src/main/java/org/rappsilber/fdr/utils/HashedArrayList.java index b3bab49..6a23612 100644 --- a/src/main/java/org/rappsilber/fdr/utils/HashedArrayList.java +++ b/src/main/java/org/rappsilber/fdr/utils/HashedArrayList.java @@ -103,4 +103,9 @@ public T get(T e) { return hash.get(e); } + + public void clear() { + super.clear(); + hash.clear(); + } }