Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Average Remoteness characteristic calculator #52

Open
ChainsManipulator opened this issue Oct 15, 2024 · 0 comments
Open

Add Average Remoteness characteristic calculator #52

ChainsManipulator opened this issue Oct 15, 2024 · 0 comments
Assignees

Comments

@ChainsManipulator
Copy link
Member

ChainsManipulator commented Oct 15, 2024

Add calculator function for Average Remoteness characteristic for given intervals array using formula:
$$g=\displaystyle \log_2 \Delta_g = \frac{G}{n} = \frac{1}{n} * \sum_{j=1}^{m} \sum_{i=1}^{n_j} \log_2 \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 = average_remoteness(x_intervals)
print(result)
> 0.7169925
X = ['B','B','A','A','C','B','A','C','C','B']
x_intervals = intervals(X, 'Start', 'Lossy')
result = average_remoteness(x_intervals)
print(result)
> 1.0242
X = ['B','B','A','A','C','B','A','C','C','B']
x_intervals = intervals(X, 'Start', 'Normal')
result = average_remoteness(x_intervals)
print(result)
> 1.1077
X = ['B','B','A','A','C','B','A','C','C','B']
x_intervals = intervals(X, 'End', 'Normal')
result = average_remoteness(x_intervals)
print(result)
> 1.017
X = ['B','B','A','A','C','B','A','C','C','B']
x_intervals = intervals(X, 'Start', 'Redundant')
result = average_remoteness(x_intervals)
print(result)
> 1.0828
X = ['B','B','A','A','C','B','A','C','C','B']
x_intervals = intervals(X, 'Start', 'Cycle')
result = average_remoteness(x_intervals)
print(result)
> 1.234

X = ['A','C','T','T','G','A','T','A','C','G']  
x_intervals = intervals(X, 'Start', 'Lossy')
result = average_remoteness(x_intervals)
print(result)
> 1.6726956021
X = ['A','C','T','T','G','A','T','A','C','G'] 
x_intervals = intervals(X, 'Start', 'Normal')
result = average_remoteness(x_intervals)
print(result)
> 1.4943064208
X = ['A','C','T','T','G','A','T','A','C','G'] 
x_intervals = intervals(X, 'End', 'Normal')
result = average_remoteness(x_intervals)
print(result)
> 1.4621136113
X = ['A','C','T','T','G','A','T','A','C','G'] 
x_intervals = intervals(X, 'End', 'Redundant')
result = average_remoteness(x_intervals)
print(result)
> 1.3948590506
X = ['A','C','T','T','G','A','T','A','C','G'] 
x_intervals = intervals(X, 'End', 'Cycle')
result = average_remoteness(x_intervals)
print(result)
> 1.8112989210

X = ['C','C','A','C','G','C','T','T','A','C']
x_intervals = intervals(X, 'Start', 'Lossy')
result = average_remoteness(x_intervals)
print(result)
> 1.09749375
X = ['C','C','A','C','G','C','T','T','A','C']
x_intervals = intervals(X, 'Start', 'Normal')
result = average_remoteness(x_intervals)
print(result)
> 1.3299208
X = ['C','C','A','C','G','C','T','T','A','C']
x_intervals = intervals(X, 'End', 'Normal')
result = average_remoteness(x_intervals)
print(result)
> 1.17548874963
X = ['C','C','A','C','G','C','T','T','A','C']
x_intervals = intervals(X, 'End', 'Redundant')
result = average_remoteness(x_intervals)
print(result)
> 1.31922378713
X = ['C','C','A','C','G','C','T','T','A','C'] 
x_intervals = intervals(X, 'End', 'Cycle')
result = average_remoteness(x_intervals)
print(result)
> 1.5076815597

X = ['C','G'] 
x_intervals = intervals(X, 'Start', 'Normal')
result = average_remoteness(x_intervals)
print(result)
> 0.5
X = ['C','G'] 
x_intervals = intervals(X, 'End', 'Normal')
result = average_remoteness(x_intervals)
print(result)
> 0.5
X = ['C','G'] 
x_intervals = intervals(X, 'End', 'Redundant')
result = average_remoteness(x_intervals)
print(result)
>0.5
X = ['C','G'] 
x_intervals = intervals(X, 'End', 'Cycle')
result = average_remoteness(x_intervals)
print(result)
> 1

X = ['C','C','C','C'] 
x_intervals = intervals(X, 'Start', 'Lossy')
result = average_remoteness(x_intervals)
print(result)
> 0
X =['C','C','C','C']  
x_intervals = intervals(X, 'Start', 'Normal')
result = average_remoteness(x_intervals)
print(result)
> 0
X = ['C','C','C','C'] 
x_intervals = intervals(X, 'End', 'Normal')
result = average_remoteness(x_intervals)
print(result)
> 0
X = ['C','C','C','C'] 
x_intervals = intervals(X, 'End', 'Redundant')
result = average_remoteness(x_intervals)
print(result)
> 0
X = ['C','C','C','C'] 
x_intervals = intervals(X, 'End', 'Cycle')
result = average_remoteness(x_intervals)
print(result)
> 0

X =  ['A','C','G','T'] 
x_intervals = intervals(X, 'Start', 'Normal')
result = average_remoteness(x_intervals)
print(result)
> 1.1462406252
X = ['A','C','G','T'] 
x_intervals = intervals(X, 'End', 'Normal')
result = average_remoteness(x_intervals)
print(result)
> 1.1462406252
X = ['A','C','G','T'] 
x_intervals = intervals(X, 'End', 'Redundant')
result = average_remoteness(x_intervals)
print(result)
> 1.1462406252
X = ['A','C','G','T'] 
x_intervals = intervals(X, 'End', 'Cycle')
result = average_remoteness(x_intervals)
print(result)
> 2

X = ['A','A','A','A','C','G','T'] 
x_intervals = intervals(X, 'Start', 'Lossy')
result = average_remoteness(x_intervals)
print(result)
> 0
X = ['A','A','A','A','C','G','T'] 
x_intervals = intervals(X, 'Start', 'Normal')
result = average_remoteness(x_intervals)
print(result)
> 1.102035074
X = ['A','A','A','A','C','G','T'] 
x_intervals = intervals(X, 'End', 'Normal')
result = average_remoteness(x_intervals)
print(result)
> 0.654994643
X = ['A','A','A','A','C','G','T'] 
x_intervals = intervals(X, 'End', 'Redundant')
result = average_remoteness(x_intervals)
print(result)
> 1.1181098199
X = ['A','A','A','A','C','G','T'] 
x_intervals = intervals(X, 'End', 'Cycle')
result = average_remoteness(x_intervals)
print(result)
> 1.4888663952

No intervals

X = ['C','G'] 
x_intervals = intervals(X, 'End', 'Lossy')
result = average_remoteness(x_intervals)
print(result)
> 0
X = ['A','C','G','T'] 
x_intervals = intervals(X, 'End', 'Lossy')
result = average_remoteness(x_intervals)
print(result)
> 0
X = [2, 1] 
x_intervals = intervals(X, 'End', 'Lossy')
result = average_remoteness(x_intervals)
print(result)
> 0

Inequalities with identifying informations

X = [10, 87, 10, 87, 10, 87] 
x_intervals = intervals(X, 'Start', 'Lossy')
g = average_remoteness(x_intervals)
H = identifying_information(x_intervals)
print(g  <= H)
> true
X = [10, 87, 10, 87, 10, 87] 
x_intervals = intervals(X, 'End', 'Lossy')
g = average_remoteness(x_intervals)
H = identifying_information(x_intervals)
print(g  <= H)
> true
X = [10, 87, 10, 87, 10, 87] 
x_intervals = intervals(X, 'Start', 'Normal')
g = average_remoteness(x_intervals)
H = identifying_information(x_intervals)
print(g  <= H)
> true
X = [10, 87, 10, 87, 10, 87] 
x_intervals = intervals(X, 'End', 'Normal')
g = average_remoteness(x_intervals)
H = identifying_information(x_intervals)
print(g  <= H)
> true
X = [10, 87, 10, 87, 10, 87] 
x_intervals = intervals(X, 'Start', 'Redundant')
g = average_remoteness(x_intervals)
H = identifying_information(x_intervals)
print(g  <= H)
> true
X = [10, 87, 10, 87, 10, 87] 
x_intervals = intervals(X, 'End', 'Redundant')
g = average_remoteness(x_intervals)
H = identifying_information(x_intervals)
print(g  <= H)
> true
X = [10, 87, 10, 87, 10, 87] 
x_intervals = intervals(X, 'Start', 'Cycle')
g = average_remoteness(x_intervals)
H = identifying_information(x_intervals)
print(g  <= H)
> true
X = [10, 87, 10, 87, 10, 87] 
x_intervals = intervals(X, 'End', 'Cycle')
g = average_remoteness(x_intervals)
H = identifying_information(x_intervals)
print(g  <= H)
> true

X = [1, 1, 3, 1, 1] 
x_intervals = intervals(X, 'Start', 'Lossy')
g = average_remoteness(x_intervals)
H = identifying_information(x_intervals)
print(g  <= H)
> true
X = [1, 1, 3, 1, 1] 
x_intervals = intervals(X, 'End', 'Lossy')
g = average_remoteness(x_intervals)
H = identifying_information(x_intervals)
print(g  <= H)
> true
X = [1, 1, 3, 1, 1] 
x_intervals = intervals(X, 'Start', 'Normal')
g = average_remoteness(x_intervals)
H = identifying_information(x_intervals)
print(g  <= H)
> true
X = [1, 1, 3, 1, 1] 
x_intervals = intervals(X, 'End', 'Normal')
g = average_remoteness(x_intervals)
H = identifying_information(x_intervals)
print(g  <= H)
> true
X = [1, 1, 3, 1, 1] 
x_intervals = intervals(X, 'Start', 'Redundant')
g = average_remoteness(x_intervals)
H = identifying_information(x_intervals)
print(g  <= H)
> true
X = [1, 1, 3, 1, 1] 
x_intervals = intervals(X, 'End', 'Redundant')
g = average_remoteness(x_intervals)
H = identifying_information(x_intervals)
print(g  <= H)
> true
X = [1, 1, 3, 1, 1] 
x_intervals = intervals(X, 'Start', 'Cycle')
g = average_remoteness(x_intervals)
H = identifying_information(x_intervals)
print(g  <= H)
> true
X = [1, 1, 3, 1, 1] 
x_intervals = intervals(X, 'End', 'Cycle')
g = average_remoteness(x_intervals)
H = identifying_information(x_intervals)
print(g  <= H)
> true

X = [13, 13, 13, 13] 
x_intervals = intervals(X, 'Start', 'Lossy')
g = average_remoteness(x_intervals)
H = identifying_information(x_intervals)
print(g  <= H)
> true
X = [13, 13, 13, 13] 
x_intervals = intervals(X, 'End', 'Lossy')
g = average_remoteness(x_intervals)
H = identifying_information(x_intervals)
print(g  <= H)
> true
X = [13, 13, 13, 13] 
x_intervals = intervals(X, 'Start', 'Normal')
g = average_remoteness(x_intervals)
H = identifying_information(x_intervals)
print(g  <= H)
> true
X = [13, 13, 13, 13] 
x_intervals = intervals(X, 'End', 'Normal')
g = average_remoteness(x_intervals)
H = identifying_information(x_intervals)
print(g  <= H)
> true
X = [13, 13, 13, 13] 
x_intervals = intervals(X, 'Start', 'Redundant')
g = average_remoteness(x_intervals)
H = identifying_information(x_intervals)
print(g  <= H)
> true
X = [13, 13, 13, 13] 
x_intervals = intervals(X, 'End', 'Redundant')
g = average_remoteness(x_intervals)
H = identifying_information(x_intervals)
print(g  <= H)
> true
X = [13, 13, 13, 13]  
x_intervals = intervals(X, 'Start', 'Cycle')
g = average_remoteness(x_intervals)
H = identifying_information(x_intervals)
print(g  <= H)
> true
X = [13, 13, 13, 13] 
x_intervals = intervals(X, 'End', 'Cycle')
g = average_remoteness(x_intervals)
H = identifying_information(x_intervals)
print(g  <= H)
> true

X = ['A', 'A', 'B', 'B'] 
x_intervals = intervals(X, 'Start', 'Lossy')
g = average_remoteness(x_intervals)
H = identifying_information(x_intervals)
print(g  <= H)
> true
X = ['A', 'A', 'B', 'B'] 
x_intervals = intervals(X, 'End', 'Lossy')
g = average_remoteness(x_intervals)
H = identifying_information(x_intervals)
print(g  <= H)
> true
X = ['A', 'A', 'B', 'B'] 
x_intervals = intervals(X, 'Start', 'Normal')
g = average_remoteness(x_intervals)
H = identifying_information(x_intervals)
print(g  <= H)
> true
X = ['A', 'A', 'B', 'B'] 
x_intervals = intervals(X, 'End', 'Normal')
g = average_remoteness(x_intervals)
H = identifying_information(x_intervals)
print(g  <= H)
> true
X = ['A', 'A', 'B', 'B'] 
x_intervals = intervals(X, 'Start', 'Redundant')
g = average_remoteness(x_intervals)
H = identifying_information(x_intervals)
print(g  <= H)
> true
X = ['A', 'A', 'B', 'B'] 
x_intervals = intervals(X, 'End', 'Redundant')
g = average_remoteness(x_intervals)
H = identifying_information(x_intervals)
print(g  <= H)
> true
X = ['A', 'A', 'B', 'B'] 
x_intervals = intervals(X, 'Start', 'Cycle')
g = average_remoteness(x_intervals)
H = identifying_information(x_intervals)
print(g  <= H)
> true
X = ['A', 'A', 'B', 'B'] 
x_intervals = intervals(X, 'End', 'Cycle')
g = average_remoteness(x_intervals)
H = identifying_information(x_intervals)
print(g  <= H)
> true

X = ['B'] 
x_intervals = intervals(X, 'Start', 'Lossy')
g = average_remoteness(x_intervals)
H = identifying_information(x_intervals)
print(g  <= H)
> true
X = ['B'] 
x_intervals = intervals(X, 'End', 'Lossy')
g = average_remoteness(x_intervals)
H = identifying_information(x_intervals)
print(g  <= H)
> true
X = ['B'] 
x_intervals = intervals(X, 'Start', 'Normal')
g = average_remoteness(x_intervals)
H = identifying_information(x_intervals)
print(g  <= H)
> true
X = ['B'] 
x_intervals = intervals(X, 'End', 'Normal')
g = average_remoteness(x_intervals)
H = identifying_information(x_intervals)
print(g  <= H)
> true
X = ['B'] 
x_intervals = intervals(X, 'Start', 'Redundant')
g = average_remoteness(x_intervals)
H = identifying_information(x_intervals)
print(g  <= H)
> true
X = ['B'] 
x_intervals = intervals(X, 'End', 'Redundant')
g = average_remoteness(x_intervals)
H = identifying_information(x_intervals)
print(g  <= H)
> true
X = ['B'] 
x_intervals = intervals(X, 'Start', 'Cycle')
g = average_remoteness(x_intervals)
H = identifying_information(x_intervals)
print(g  <= H)
> true
X = ['B'] 
x_intervals = intervals(X, 'End', 'Cycle')
g = average_remoteness(x_intervals)
H = identifying_information(x_intervals)
print(g  <= H)
> true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

No branches or pull requests

2 participants