Class: TrajectoryOfSamples

TrajectoryOfSamples(sampleNames, metadataCategoryName, gradientPoints, coordinates, minimumDelta, suppliedNopt, maxNopt) → {TrajectoryOfSamples}

TrajectoryOfSamples

Represents an ordered set of samples and their position in PCoA space.

Constructor

new TrajectoryOfSamples(sampleNames, metadataCategoryName, gradientPoints, coordinates, minimumDelta, suppliedNopt, maxNopt) → {TrajectoryOfSamples}

Parameters:
Name Type Attributes Default Description
sampleNames Array.<string>

Array of sample identifiers.

metadataCategoryName string

The name of the category in the mapping file used to generate this trajectory.

gradientPoints Array.<float>

The position of the samples in the gradient.

coordinates Array.<Object>

Array of objects with x, y and z properties where each corresponds to the position of a sample in PCoA space.

minimumDelta float

Minimum differential between the ordered gradientPoints this value must be non-zero. Note that this value should be computed taking into account all the other trajectories that will be animated together, usually by an AnimationDirector object.

suppliedN integer <optional>
5

Determines how many points should be found in the the trajectory.

maxN integer <optional>
10

Maximum number of samples allowed per interpolation interval.

Source:
Returns:

An instance of TrajectoryOfSamples

Type
TrajectoryOfSamples

Members

interpolatedCoordinates :Array.<Object>

Array of objects with the corresponding interpolated x, y and z values. The interpolation operation takes place between subsequent samples.

Type:
  • Array.<Object>
Source:

maxN :float

Maximum number of samples allowed per interpolation interval.

Type:
  • float
Default Value:
  • 10
Source:

metadataCategoryName :string

The name of the category in the mapping file used to generate this trajectory.

Type:
  • string
Source:

minimumDelta :float

Minimum differential between samples in the trajectory; the value is computed using the gradientPoints array.

Type:
  • float
Source:

sampleNames :Array.<string>

Sample identifiers

Type:
  • Array.<string>
Source:

suppliedN :float

Minimum number of frames a distance will have in the gradient. This value determines how fast the animation will run. For now we use 5 as a good default value; 60 was way too slow.

Type:
  • float
Default Value:
  • 5
Source:

Methods

calculateNumberOfPointsForDelta(delta) → {integer}

Helper method to calculate the number of points that there should be for a differential.

Parameters:
Name Type Description
delta float

Value for which to determine the required number of points.

Source:
Returns:

The number of suggested frames for the differential

Type
integer

representativeCoordinatesAtIndex(idx) → {Array.<Array>}

Retrieve the representative coordinates needed for a trajectory to be drawn.

  • Note that this implementation is naive and will return points that lay on a rect line if these were part of the original set of coordinates.
Parameters:
Name Type Description
idx integer

Value for which to determine the required number of points.

Source:
Returns:

Array containing the representative float x, y, z coordinates needed to draw a trajectory at the given index.

Type
Array.<Array>

representativeInterpolatedCoordinatesAtIndex(idx) → {Array.<Array>}

Grab only the interpolated portion of representativeCoordinatesAtIndex.

Parameters:
Name Type Description
idx integer

Value for which to determine the required number of points.

Source:
Returns:

Array containing the representative float x, y, z coordinates needed to draw the interpolated portion of a trajectory at the given index.

Type
Array.<Array>