Browse code

updates

Tom Sherman authored on 09/08/2018 20:06:04
Showing3 changed files

... ...
@@ -1,5 +1,5 @@
1 1
 Package: CoGAPS
2
-Version: 3.3.8
2
+Version: 3.3.9
3 3
 Date: 2018-04-24
4 4
 Title: Coordinated Gene Activity in Pattern Sets
5 5
 Author: Thomas Sherman, Wai-shing Lee, Conor Kelton, Ondrej Maxian, Jacob Carey,
... ...
@@ -1,4 +1,4 @@
1
-# CoGAPS Version: 3.3.8
1
+# CoGAPS Version: 3.3.9
2 2
 
3 3
 [![Bioc](https://bioconductor.org/images/logo_bioconductor.gif)](https://bioconductor.org/packages/CoGAPS)
4 4
 [![downloads](https://bioconductor.org/shields/downloads/CancerInSilico.svg)](https://bioconductor.org/packages/CoGAPS)
... ...
@@ -522,22 +522,19 @@ float m2, unsigned r1, unsigned c1, unsigned r2, unsigned c2)
522 522
 {
523 523
     if (r1 != r2 || c1 != c2) // automatically reject if change in same bin
524 524
     {
525
-        float pUpper = gaps::random::p_gamma(m1 + m2, 2.f, 1.f / mLambda);
526
-        float newMass = gaps::random::inverseGammaSample(0.f, pUpper, 2.f, 1.f / mLambda);
527
-
528 525
         if (impl()->canUseGibbs(r1, c1, r2, c2))
529 526
         {
530 527
             // swapping only effects alpha parameters - only effects gibbs
531 528
             // flips the sign of alpha parameters (only su)
532 529
             // flips sign in gibbs mass
533 530
             // can we swap after gibbsMass calculation?
534
-            if ((m1 > m2 && m1 > newMass) || (m2 > m1 && m2 < newMass))
531
+            /*if ((m1 > m2 && m1 > newMass) || (m2 > m1 && m2 < newMass))
535 532
             {
536 533
                 std::swap(r1, r2);
537 534
                 std::swap(c1, c2);
538 535
                 std::swap(p1, p2);
539 536
                 std::swap(m1, m2);
540
-            }
537
+            }*/
541 538
 
542 539
             AlphaParameters alpha = impl()->alphaParameters(r1, c1, r2, c2);
543 540
             std::pair<float, bool> gMass = gibbsMass(alpha, m1, m2);
... ...
@@ -549,6 +546,9 @@ float m2, unsigned r1, unsigned c1, unsigned r2, unsigned c2)
549 546
             }
550 547
         }
551 548
 
549
+        float pUpper = gaps::random::p_gamma(m1 + m2, 2.f, 1.f / mLambda);
550
+        float newMass = gaps::random::inverseGammaSample(0.f, pUpper, 2.f, 1.f / mLambda);
551
+
552 552
         float delta = m1 > m2 ? newMass - m1 : m2 - newMass; // change larger mass
553 553
         float pOldMass = 2.f * newMass > m1 + m2 ? gaps::max(m1, m2) : gaps::min(m1, m2);
554 554