@@ -674,7 +674,7 @@ setMethod("analyze", signature(object="Vision"),
674674 object <- generateProjections(object )
675675
676676 # Populates @TrajectoryProjections
677- if (! is.null (object @ LatentTrajectory )) {
677+ if (hasTrajectory (object )) {
678678
679679 object @ TrajectoryProjections <- generateTrajectoryProjections(
680680 object @ LatentTrajectory
@@ -688,7 +688,7 @@ setMethod("analyze", signature(object="Vision"),
688688 object <- analyzeLocalCorrelations(object )
689689
690690 # Populates @TrajectoryAutocorrelation
691- if (! is.null (object @ LatentTrajectory )) {
691+ if (hasTrajectory (object )) {
692692 object <- analyzeTrajectoryCorrelations(object )
693693 }
694694
@@ -1032,10 +1032,10 @@ setMethod("getSignatureScores", signature(object = "Vision"),
10321032setMethod ("getSignatureAutocorrelation ", signature(object = "Vision"),
10331033 function (object ) {
10341034
1035- if (is.null(object @ TrajectoryAutocorrelation )){
1036- out <- object @ LocalAutocorrelation $ Signatures
1037- } else {
1035+ if (hasTrajectory(object )){
10381036 out <- object @ TrajectoryAutocorrelation $ Signatures
1037+ } else {
1038+ out <- object @ LocalAutocorrelation $ Signatures
10391039 }
10401040
10411041 out <- out [order(out $ pValue , out $ C * - 1 ), ]
@@ -1060,10 +1060,10 @@ setMethod("getSignatureAutocorrelation", signature(object = "Vision"),
10601060setMethod ("getMetaAutocorrelation ", signature(object = "Vision"),
10611061 function (object ) {
10621062
1063- if (is.null(object @ TrajectoryAutocorrelation )){
1064- out <- object @ LocalAutocorrelation $ Meta
1065- } else {
1063+ if (hasTrajectory(object )){
10661064 out <- object @ TrajectoryAutocorrelation $ Meta
1065+ } else {
1066+ out <- object @ LocalAutocorrelation $ Meta
10671067 }
10681068
10691069 out <- out [order(out $ pValue , out $ C * - 1 ), ]
@@ -1158,3 +1158,9 @@ setMethod("hasProteinData", "Vision",
11581158 return (! all(dim(object @ proteinData ) == 1 ))
11591159 }
11601160)
1161+
1162+ setMethod ("hasTrajectory ", "Vision",
1163+ function (object ) {
1164+ return (! is.null(object @ LatentTrajectory ))
1165+ }
1166+ )
0 commit comments