Browse code

Merge branch 'trunk' into devel

mikejiang authored on 09/04/2018 17:47:23
Showing 2 changed files

... ...
@@ -1,7 +1,7 @@
1 1
 Package: flowWorkspace
2 2
 Type: Package
3 3
 Title: Infrastructure for representing and interacting with the gated cytometry
4
-Version: 3.27.23
4
+Version: 3.27.24
5 5
 Date: 2011-06-10
6 6
 Author: Greg Finak, Mike Jiang
7 7
 Maintainer: Greg Finak <gfinak@fhcrc.org>,Mike Jiang <wjiang2@fhcrc.org>
... ...
@@ -611,6 +611,8 @@ setMethod("GatingSet", c("GatingHierarchy", "character"), function(x, y, path=".
611 611
           ##################################
612 612
           #transforming and gating
613 613
           ##################################
614
+        gains <- numeric()#gain is no longer relevant
615
+        names(gains) <- character()
614 616
           if(execute)
615 617
           {
616 618
 
... ...
@@ -643,8 +645,7 @@ setMethod("GatingSet", c("GatingHierarchy", "character"), function(x, y, path=".
643 645
             # 
644 646
             # names(gains) <- this_pd$name
645 647
             # gains <- gains[gains != 1]#only pass the valid gains to save the unnecessary computing
646
-            gains <- numeric()#gain is no longer relevant
647
-            names(gains) <- character()
648
+        
648 649
             #update colnames in order for the gating to find right dims
649 650
             if(!is.null(prefixColNames)){
650 651
               dimnames(mat) <- list(NULL, prefixColNames)
... ...
@@ -704,32 +705,32 @@ setMethod("GatingSet", c("GatingHierarchy", "character"), function(x, y, path=".
704 705
           #once we have confirmed that ws is a reliable source of keyword
705 706
           #EDIT: Acutally we've already found one workspace from PROVIDE study
706 707
           #that does not contain the gain keyword for all channels. So the ws is not reliable source of keyword
707
-
708
-
709
-          gains <- rep(1,length(cnd))#init with default 1
710
-
711
-          #get gains from keywords
712
-          kw_gains <- grep("P[0-9]{1,}G", names(kw))
713
-
714
-          if(length(kw_gains) > 0){
715
-            key_names <- unique(names(kw[kw_gains]))
716
-            kw_gains <- kw[key_names]
717
-
718
-            # Sometimes the keywords where the gain is not set, the gain value is NULL.
719
-            # We replace these instances with the default of 1.
720
-            kw_gains[sapply(kw_gains, is.null)] <- 1
721
-
722
-            #update the default gain values
723
-            #extract numeric index from channels (Not every channel necessarily has its gain keyword stored in xml)
724
-            found_gain_chnl_ind <-  as.numeric(gsub('G$', "", gsub('^\\$P', "", key_names)))
725
-            gains[found_gain_chnl_ind] <- as.numeric(kw_gains)
726
-          }
727
-
728
-
729
-
730
-
731
-          names(gains) <- prefixColNames
732
-          gains <- gains[gains != 1]#only pass the valid gains to save the unnecessary computing
708
+          #EDIT: gain is no longer needed #213
709
+
710
+          # gains <- rep(1,length(cnd))#init with default 1
711
+          # 
712
+          # #get gains from keywords
713
+          # kw_gains <- grep("P[0-9]{1,}G", names(kw))
714
+          # 
715
+          # if(length(kw_gains) > 0){
716
+          #   key_names <- unique(names(kw[kw_gains]))
717
+          #   kw_gains <- kw[key_names]
718
+          # 
719
+          #   # Sometimes the keywords where the gain is not set, the gain value is NULL.
720
+          #   # We replace these instances with the default of 1.
721
+          #   kw_gains[sapply(kw_gains, is.null)] <- 1
722
+          # 
723
+          #   #update the default gain values
724
+          #   #extract numeric index from channels (Not every channel necessarily has its gain keyword stored in xml)
725
+          #   found_gain_chnl_ind <-  as.numeric(gsub('G$', "", gsub('^\\$P', "", key_names)))
726
+          #   gains[found_gain_chnl_ind] <- as.numeric(kw_gains)
727
+          # }
728
+          # 
729
+          # 
730
+          # 
731
+          # 
732
+          # names(gains) <- prefixColNames
733
+          # gains <- gains[gains != 1]#only pass the valid gains to save the unnecessary computing
733 734
           #transform and adjust the gates without gating
734 735
           if(transform)
735 736
             .cpp_computeGates(gs@pointer, guid, gains, extend_val, extend_to)