You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add calculator function for Arithmetic Mean Interval characteristic for given intervals array using formula: $$\Delta_a=\displaystyle \frac{1}{n} * \sum_{j=1}^{m} \sum_{i=1}^{n_j} \Delta_{ij}$$
Where $\Delta_{ij}$ is an interval and $n$ is a number of intervals in the sequence.
Examples
X = [2, 4, 2, 2, 4]
x_intervals = intervals(X, 'Start', 'Normal')
result = arithmetic_mean(x_intervals)
print(result)
> 1.8
X = ['B','B','A','A','C','B','A','C','C','B']
x_intervals = intervals(X, 'Start', 'Lossy')
result = arithmetic_mean(x_intervals)
print(result)
> 2.4286
X = ['B','B','A','A','C','B','A','C','C','B']
x_intervals = intervals(X, 'Start', 'Normal')
result = arithmetic_mean(x_intervals)
print(result)
> 2.6
X = ['B','B','A','A','C','B','A','C','C','B']
x_intervals = intervals(X, 'End', 'Normal')
result = arithmetic_mean(x_intervals)
print(result)
> 2.4
X = ['B','B','A','A','C','B','A','C','C','B']
x_intervals = intervals(X, 'Start', 'Redundant')
result = arithmetic_mean(x_intervals)
print(result)
> 2.5385
X = ['B','B','A','A','C','B','A','C','C','B']
x_intervals = intervals(X, 'Start', 'Cycle')
result = arithmetic_mean(x_intervals)
print(result)
> 3
X = ['C','C','A','C','G','C','T','T','A','C']
x_intervals = intervals(X, 'Start', 'Lossy')
result = arithmetic_mean(x_intervals)
print(result)
> 2.666666666666667
X = ['C','C','A','C','G','C','T','T','A','C']
x_intervals = intervals(X, 'Start', 'Normal')
result = arithmetic_mean(x_intervals)
print(result)
> 3.2
X = ['C','C','A','C','G','C','T','T','A','C']
x_intervals = intervals(X, 'End', 'Normal')
result = arithmetic_mean(x_intervals)
print(result)
> 2.8
X = ['C','C','A','C','G','C','T','T','A','C']
x_intervals = intervals(X, 'End', 'Redundant')
result = arithmetic_mean(x_intervals)
print(result)
> 3.142857142857
X = ['C','C','A','C','G','C','T','T','A','C']
x_intervals = intervals(X, 'End', 'Cycle')
result = arithmetic_mean(x_intervals)
print(result)
> 4
X = ['C','C','C','C']
x_intervals = intervals(X, 'Start', 'Lossy')
result = arithmetic_mean(x_intervals)
print(result)
> 1
X =['C','C','C','C']
x_intervals = intervals(X, 'Start', 'Normal')
result = arithmetic_mean(x_intervals)
print(result)
> 1
X = ['C','C','C','C']
x_intervals = intervals(X, 'End', 'Normal')
result = arithmetic_mean(x_intervals)
print(result)
> 1
X = ['C','C','C','C']
x_intervals = intervals(X, 'End', 'Redundant')
result = arithmetic_mean(x_intervals)
print(result)
> 1
X = ['C','C','C','C']
x_intervals = intervals(X, 'End', 'Cycle')
result = arithmetic_mean(x_intervals)
print(result)
> 1
No intervals
X = ['C','G']
x_intervals = intervals(X, 'End', 'Lossy')
result = arithmetic_mean(x_intervals)
print(result)
> 0
X = ['A','C','G','T']
x_intervals = intervals(X, 'End', 'Lossy')
result = arithmetic_mean(x_intervals)
print(result)
> 0
X = [2, 1]
x_intervals = intervals(X, 'End', 'Lossy')
result = arithmetic_mean(x_intervals)
print(result)
> 0
The text was updated successfully, but these errors were encountered:
Add calculator function for Arithmetic Mean Interval characteristic for given intervals array using formula:
$$\Delta_a=\displaystyle \frac{1}{n} * \sum_{j=1}^{m} \sum_{i=1}^{n_j} \Delta_{ij}$$ $\Delta_{ij}$ is an interval and $n$ is a number of intervals in the sequence.
Where
Examples
No intervals
The text was updated successfully, but these errors were encountered: