JSDoc: Class: TrajectoryOfSamples

# Class: TrajectoryOfSamples

## 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:
  - trajectory.js, line 30

##### 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:
  - trajectory.js, line 84

#### maxN :float

Maximum number of samples allowed per interpolation interval.

##### Type:

- float

Default Value:
  - 10
Source:
  - trajectory.js, line 71

#### metadataCategoryName :string

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

##### Type:

- string

Source:
  - trajectory.js, line 43

#### minimumDelta :float

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

##### Type:

- float

Source:
  - trajectory.js, line 56

#### sampleNames :Array.<string>

Sample identifiers

##### Type:

- Array.<string>

Source:
  - trajectory.js, line 37

#### 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:
  - trajectory.js, line 65

### 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:
  - trajectory.js, line 155

##### 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:
  - trajectory.js, line 174

##### Returns:

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

Type
  Array.<Array>