text:
# coneprog

Second-order cone programming solver

## Syntax

``x = coneprog(f,socConstraints)``
``x = coneprog(f,socConstraints,A,b,Aeq,beq)``
``x = coneprog(f,socConstraints,A,b,Aeq,beq,lb,ub)``
``x = coneprog(f,socConstraints,A,b,Aeq,beq,lb,ub,options)``
``x = coneprog(problem)``
``[x,fval] = coneprog(___)``
``[x,fval,exitflag,output] = coneprog(___)``
``[x,fval,exitflag,output,lambda] = coneprog(___)``

## Description

The `coneprog` function is a second-order cone programming solver that finds the minimum of a problem specified by

`$\underset{x}{\mathrm{min}}{f}^{T}x$`

subject to the constraints

`$\begin{array}{c}‖{A}_{\text{sc}}\left(i\right)\cdot x-{b}_{\text{sc}}\left(i\right)‖\le {d}_{\text{sc}}^{T}\left(i\right)\cdot x-\gamma \left(i\right)\\ A\cdot x\le b\\ \text{Aeq}\cdot x=\text{beq}\\ \text{lb}\le x\le \text{ub}.\end{array}$`

f, x, b, beq, lb, and ub are vectors, and A and Aeq are matrices. For each i, the matrix Asc(i), vectors dsc(i) and bsc(i), and scalar γ(i) are in a second-order cone constraint that you create using `secondordercone`.

For more details about cone constraints, see Second-Order Cone Constraint.

example

````x = coneprog(f,socConstraints)` solves the second-order cone programming problem with the constraints in `socConstraints` encoded asAsc(i) = `socConstraints(i).A`bsc(i) = `socConstraints(i).b`dsc(i) = `socConstraints(i).d`γ(i) = `socConstraints(i).gamma````

example

````x = coneprog(f,socConstraints,A,b,Aeq,beq)` solves the problem subject to the inequality constraints `A*x `≤` b` and equality constraints `Aeq*x = beq`. Set `A = []` and `b = []` if no inequalities exist.```

example

````x = coneprog(f,socConstraints,A,b,Aeq,beq,lb,ub)` defines a set of lower and upper bounds on the design variables, `x` so that the solution is always in the range `lb ≤ x ≤ ub`. Set `Aeq = []` and `beq = []` if no equalities exist.```

example

````x = coneprog(f,socConstraints,A,b,Aeq,beq,lb,ub,options)` minimizes using the optimization options specified by `options`. Use `optimoptions` to set these options.```

example

````x = coneprog(problem)` finds the minimum for `problem`, a structure described in `problem`.```

example

````[x,fval] = coneprog(___)` also returns the objective function value at the solution `fval` = `f'*x`, using any of the input argument combinations in previous syntaxes.```

example

````[x,fval,exitflag,output] = coneprog(___)` additionally returns a value `exitflag` that describes the exit condition, and a structure `output` that contains information about the optimization process.```

example

````[x,fval,exitflag,output,lambda] = coneprog(___)` additionally returns a structure `lambda` whose fields contain the dual variables at the solution `x`.```

## Examples

collapse all

To set up a problem with a second-order cone constraint, create a second-order cone constraint object.

```A = diag([1,1/2,0]); b = zeros(3,1); d = [0;0;1]; gamma = 0; socConstraints = secondordercone(A,b,d,gamma);```

Create an objective function vector.

`f = [-1,-2,0];`

The problem has no linear constraints. Create empty matrices for these constraints.

```Aineq = []; bineq = []; Aeq = []; beq = [];```

Set upper and lower bounds on `x(3)`.

```lb = [-Inf,-Inf,0]; ub = [Inf,Inf,2];```

Solve the problem by using the `coneprog` function.

`[x,fval] = coneprog(f,socConstraints,Aineq,bineq,Aeq,beq,lb,ub)`
```Optimal solution found. ```
```x = 3×1 0.4851 3.8806 2.0000 ```
```fval = -8.2462 ```

The solution component `x(3)` is at its upper bound. The cone constraint is active at the solution:

`norm(A*x-b) - d'*x % Near 0 when the constraint is active`
```ans = -2.5677e-08 ```

To set up a problem with several second-order cone constraints, create an array of constraint objects. To save time and memory, create the highest-index constraint first.

```A = diag([1,2,0]); b = zeros(3,1); d = [0;0;1]; gamma = -1; socConstraints(3) = secondordercone(A,b,d,gamma); A = diag([3,0,1]); d = [0;1;0]; socConstraints(2) = secondordercone(A,b,d,gamma); A = diag([0;1/2;1/2]); d = [1;0;0]; socConstraints(1) = secondordercone(A,b,d,gamma);```

Create the linear objective function vector.

`f = [-1;-2;-4];`

Solve the problem by using the `coneprog` function.

`[x,fval] = coneprog(f,socConstraints)`
```Optimal solution found. ```
```x = 3×1 0.4238 1.6477 2.3225 ```
```fval = -13.0089 ```

Specify an objective function vector and a single second-order cone constraint.

```f = [-4;-9;-2]; Asc = diag([1,4,0]); b = [0;0;0]; d = [0;0;1]; gamma = 0; socConstraints = secondordercone(Asc,b,d,gamma);```

Specify a linear inequality constraint.

```A = [1/4,1/9,1]; b = 5;```

Solve the problem.

`[x,fval] = coneprog(f,socConstraints,A,b)`
```Optimal solution found. ```
```x = 3×1 3.2304 0.6398 4.1213 ```
```fval = -26.9225 ```

To observe the iterations of the `coneprog` solver, set the `Display` option to `'iter'`.

`options = optimoptions('coneprog','Display','iter');`

Create a second-order cone programming problem and solve it using `options`.

```Asc = diag([1,1/2,0]); b = zeros(3,1); d = [0;0;1]; gamma = 0; socConstraints = secondordercone(Asc,b,d,gamma); f = [-1,-2,0]; Aineq = []; bineq = []; Aeq = []; beq = []; lb = [-Inf,-Inf,0]; ub = [Inf,Inf,2]; [x,fval] = coneprog(f,socConstraints,Aineq,bineq,Aeq,beq,lb,ub,options)```
```Iter Fval Primal Infeas Dual Infeas Duality Gap Time 1 0.000000e+00 0.000000e+00 5.714286e-01 1.250000e-01 0.01 2 -7.558066e+00 0.000000e+00 7.151114e-02 1.564306e-02 0.02 3 -7.366973e+00 2.775558e-17 1.075440e-02 2.352525e-03 0.02 4 -8.243432e+00 1.387779e-17 5.191882e-05 1.135724e-05 0.02 5 -8.246067e+00 0.000000e+00 2.430813e-06 5.317403e-07 0.02 6 -8.246211e+00 1.387779e-17 6.154504e-09 1.346298e-09 0.02 Optimal solution found. ```
```x = 3×1 0.4851 3.8806 2.0000 ```
```fval = -8.2462 ```

Create the elements of a second-order cone programming problem. To save time and memory, create the highest-index constraint first.

```A = diag([1,2,0]); b = zeros(3,1); d = [0;0;1]; gamma = -1; socConstraints(3) = secondordercone(A,b,d,gamma); A = diag([3,0,1]); d = [0;1;0]; socConstraints(2) = secondordercone(A,b,d,gamma); A = diag([0;1/2;1/2]); d = [1;0;0]; socConstraints(1) = secondordercone(A,b,d,gamma); f = [-1;-2;-4]; options = optimoptions('coneprog','Display','iter');```

Create a problem structure with the required fields, as described in problem.

```problem = struct('f',f,... 'socConstraints',socConstraints,... 'Aineq',[],'bineq',[],... 'Aeq',[],'beq',[],... 'lb',[],'ub',[],... 'solver','coneprog',... 'options',options);```

Solve the problem by calling `coneprog`.

`[x,fval] = coneprog(problem)`
```Iter Fval Primal Infeas Dual Infeas Duality Gap Time 1 0.000000e+00 0.000000e+00 5.333333e-01 5.555556e-02 0.06 2 -9.696012e+00 5.551115e-17 7.631901e-02 7.949897e-03 0.07 3 -1.178942e+01 3.700743e-17 1.261803e-02 1.314378e-03 0.07 4 -1.294426e+01 1.850372e-17 1.683078e-03 1.753206e-04 0.07 5 -1.295217e+01 9.251859e-18 8.994595e-04 9.369370e-05 0.07 6 -1.295331e+01 9.251859e-18 4.748841e-04 4.946709e-05 0.07 7 -1.300753e+01 9.251859e-18 2.799942e-05 2.916606e-06 0.07 8 -1.300671e+01 9.251859e-18 2.366136e-05 2.464725e-06 0.07 9 -1.300850e+01 9.251859e-18 8.222244e-06 8.564838e-07 0.07 10 -1.300843e+01 1.850372e-17 7.318333e-06 7.623264e-07 0.08 11 -1.300865e+01 9.251859e-18 2.636568e-06 2.746425e-07 0.08 12 -1.300892e+01 1.850372e-17 3.407939e-08 3.549936e-09 0.08 Optimal solution found. ```
```x = 3×1 0.4238 1.6477 2.3225 ```
```fval = -13.0089 ```

Create a second-order cone programming problem. To save time and memory, create the highest-index constraint first.

```A = diag([1,2,0]); b = zeros(3,1); d = [0;0;1]; gamma = -1; socConstraints(3) = secondordercone(A,b,d,gamma); A = diag([3,0,1]); d = [0;1;0]; socConstraints(2) = secondordercone(A,b,d,gamma); A = diag([0;1/2;1/2]); d = [1;0;0]; socConstraints(1) = secondordercone(A,b,d,gamma); f = [-1;-2;-4]; options = optimoptions('coneprog','Display','iter'); A = []; b = []; Aeq = []; beq = []; lb = []; ub = [];```

Solve the problem, requesting information about the solution process.

`[x,fval,exitflag,output] = coneprog(f,socConstraints,A,b,Aeq,beq,lb,ub,options)`
```Iter Fval Primal Infeas Dual Infeas Duality Gap Time 1 0.000000e+00 0.000000e+00 5.333333e-01 5.555556e-02 0.02 2 -9.696012e+00 5.551115e-17 7.631901e-02 7.949897e-03 0.03 3 -1.178942e+01 3.700743e-17 1.261803e-02 1.314378e-03 0.03 4 -1.294426e+01 1.850372e-17 1.683078e-03 1.753206e-04 0.03 5 -1.295217e+01 9.251859e-18 8.994595e-04 9.369370e-05 0.03 6 -1.295331e+01 9.251859e-18 4.748841e-04 4.946709e-05 0.03 7 -1.300753e+01 9.251859e-18 2.799942e-05 2.916606e-06 0.03 8 -1.300671e+01 9.251859e-18 2.366136e-05 2.464725e-06 0.03 9 -1.300850e+01 9.251859e-18 8.222244e-06 8.564838e-07 0.03 10 -1.300843e+01 1.850372e-17 7.318333e-06 7.623264e-07 0.03 11 -1.300865e+01 9.251859e-18 2.636568e-06 2.746425e-07 0.03 12 -1.300892e+01 1.850372e-17 3.407939e-08 3.549936e-09 0.03 Optimal solution found. ```
```x = 3×1 0.4238 1.6477 2.3225 ```
```fval = -13.0089 ```
```exitflag = 1 ```
```output = struct with fields: iterations: 12 primalfeasibility: 1.8504e-17 dualfeasibility: 3.4079e-08 dualitygap: 3.5499e-09 algorithm: 'interior-point' linearsolver: 'augmented' message: 'Optimal solution found.' ```
• Both the iterative display and the output structure show that `coneprog` used 12 iterations to arrive at the solution.

• The exit flag value `1` and the `output.message` value `'Optimal solution found.'` indicate that the solution is reliable.

• The `output` structure shows that the infeasibilities tend to decrease through the solution process, as does the duality gap.

• You can reproduce the `fval` output by multiplying `f'*x`.

`f'*x`
```ans = -13.0089 ```

Create a second-order cone programming problem. To save time and memory, create the highest-index constraint first.

```A = diag([1,2,0]); b = zeros(3,1); d = [0;0;1]; gamma = -1; socConstraints(3) = secondordercone(A,b,d,gamma); A = diag([3,0,1]); d = [0;1;0]; socConstraints(2) = secondordercone(A,b,d,gamma); A = diag([0;1/2;1/2]); d = [1;0;0]; socConstraints(1) = secondordercone(A,b,d,gamma); f = [-1;-2;-4];```

Solve the problem, requesting dual variables at the solution along with all other `coneprog` output..

`[x,fval,exitflag,output,lambda] = coneprog(f,socConstraints);`
```Optimal solution found. ```

Examine the returned `lambda` structure. Because the only problem constraints are cone constraints, examine only the `soc` field in the `lambda` structure.

`disp(lambda.soc)`
``` 1.0e-05 * 0.0543 0.1853 0.0612 ```

The constraints have nonzero dual values, indicating the constraints are active at the solution.

## Input Arguments

collapse all

Coefficient vector, specified as a real vector or real array. The coefficient vector represents the objective function `f'*x`. The notation assumes that `f` is a column vector, but you can use a row vector or array. Internally, `coneprog` converts `f` to the column vector `f(:)`.

Example: `f = [1,3,5,-6]`

Data Types: `double`

Second-order cone constraints, specified as vector of `SecondOrderConeConstraint` objects. Create these objects using the `secondordercone` function.

`socConstraints` encodes the constraints

`$‖{A}_{\text{sc}}\left(i\right)\cdot x-{b}_{\text{sc}}\left(i\right)‖\le {d}_{\text{sc}}^{T}\left(i\right)\cdot x-\gamma \left(i\right)$`

where the mapping between the array and the equation is as follows:

• Asc(i) = `socConstraints.A(i)`

• bsc(i) = `socConstraints.b(i)`

• dsc(i) = `socConstraints.d(i)`

• γ(i) = `socConstraints.gamma(i)`

Example: ```Asc = diag([1 1/2 0]); bsc = zeros(3,1); dsc = [0;0;1]; gamma = -1; socConstraints = secondordercone(Asc,bsc,dsc,gamma);```

Data Types: `struct`

Linear inequality constraints, specified as a real matrix. `A` is an `M`-by-`N` matrix, where `M` is the number of inequalities, and `N` is the number of variables (length of `f`). For large problems, pass `A` as a sparse matrix.

`A` encodes the `M` linear inequalities

`A*x <= b`,

where `x` is the column vector of `N` variables `x(:)`, and `b` is a column vector with `M` elements.

For example, consider these inequalities:

x1 + 2x2 ≤ 10
3x1 + 4x2 ≤ 20
5x1 + 6x2 ≤ 30.

Specify the inequalities by entering the following constraints.

```A = [1,2;3,4;5,6]; b = [10;20;30];```

Example: To specify that the x-components add up to 1 or less, take ```A = ones(1,N)``` and `b = 1`.

Data Types: `double`

Linear inequality constraints, specified as a real vector. `b` is an `M`-element vector related to the `A` matrix. If you pass `b` as a row vector, solvers internally convert `b` to the column vector `b(:)`. For large problems, pass `b` as a sparse vector.

`b` encodes the `M` linear inequalities

`A*x <= b`,

where `x` is the column vector of `N` variables `x(:)`, and `A` is a matrix of size `M`-by-`N`.

For example, consider these inequalities:

x1 + 2x2 ≤ 10
3x1 + 4x2 ≤ 20
5x1 + 6x2 ≤ 30.

Specify the inequalities by entering the following constraints.

```A = [1,2;3,4;5,6]; b = [10;20;30];```

Example: To specify that the x components sum to 1 or less, use ```A = ones(1,N)``` and `b = 1`.

Data Types: `double`

Linear equality constraints, specified as a real matrix. `Aeq` is an `Me`-by-`N` matrix, where `Me` is the number of equalities, and `N` is the number of variables (length of `f`). For large problems, pass `Aeq` as a sparse matrix.

`Aeq` encodes the `Me` linear equalities

`Aeq*x = beq`,

where `x` is the column vector of `N` variables `x(:)`, and `beq` is a column vector with `Me` elements.

For example, consider these equalities:

x1 + 2x2 + 3x3 = 10
2x1 + 4x2 + x3 = 20.

Specify the equalities by entering the following constraints.

```Aeq = [1,2,3;2,4,1]; beq = [10;20];```

Example: To specify that the x-components sum to 1, take `Aeq = ones(1,N)` and `beq = 1`.

Data Types: `double`

Linear equality constraints, specified as a real vector. `beq` is an `Me`-element vector related to the `Aeq` matrix. If you pass `beq` as a row vector, solvers internally convert `beq` to the column vector `beq(:)`. For large problems, pass `beq` as a sparse vector.

`beq` encodes the `Me` linear equalities

`Aeq*x = beq`,

where `x` is the column vector of `N` variables `x(:)`, and `Aeq` is a matrix of size `Me`-by-`N`.

For example, consider these equalities:

x1 + 2x2 + 3x3 = 10
2x1 + 4x2 + x3 = 20.

Specify the equalities by entering the following constraints.

```Aeq = [1,2,3;2,4,1]; beq = [10;20];```

Example: To specify that the x components sum to 1, use `Aeq = ones(1,N)` and `beq = 1`.

Data Types: `double`

Lower bounds, specified as a real vector or real array. If the length of `f` is equal to the length of `lb`, then `lb` specifies that

`x(i) >= lb(i)` for all `i`.

If `numel(lb) < numel(f)`, then `lb` specifies that

`x(i) >= lb(i)` for `1 <= i <= numel(lb)`.

In this case, solvers issue a warning.

Example: To specify that all x-components are positive, use ```lb = zeros(size(f))```.

Data Types: `double`

Upper bounds, specified as a real vector or real array. If the length of `f` is equal to the length of `ub`, then `ub` specifies that

`x(i) <= ub(i)` for all `i`.

If `numel(ub) < numel(f)`, then `ub` specifies that

`x(i) <= ub(i)` for `1 <= i <= numel(ub)`.

In this case, solvers issue a warning.

Example: To specify that all x-components are less than `1`, use ```ub = ones(size(f))```.

Data Types: `double`

Optimization options, specified as the output of `optimoptions`.

OptionDescription
`ConstraintTolerance`

Feasibility tolerance for constraints, a scalar from `0` through `1`. `ConstraintTolerance` measures primal feasibility tolerance. The default is `1e-6`.

`Display`

Level of display (see Iterative Display):

• `'final'` (default) displays only the final output.

• `'iter'` displays output at each iteration.

• `'off'` or `'none'` displays no output.

`LinearSolver`

Algorithm for solving one step in the iteration:

• `'auto'` (default) — `coneprog` chooses the step solver.

• If the problem is sparse, the step solver is `'prodchol'`.

• Otherwise, the step solver is `'augmented'`.

• `'augmented'` — Augmented form step solver. See [1].

• `'normal'` — Normal form step solver. See [1].

• `'prodchol'` — Product form Cholesky step solver. See [4] and [5].

• `'schur'` — Schur complement method step solver. See [2].

If `'auto'` does not perform well, try these suggestions for `LinearSolver`:

• If the problem is sparse, try `'normal'`.

• If the problem is sparse with some dense columns or large cones, try `'prodchol'` or `'schur'`.

• If the problem is dense, use `'augmented'`.

For a sparse example, see Compare Speeds of coneprog Algorithms.

`MaxIterations`

Maximum number of iterations allowed, a positive integer. The default is `200`.

`MaxTime`

Maximum amount of time in seconds that the algorithm runs, a positive number or `Inf`. The default is `Inf`, which disables this stopping criterion.

`OptimalityTolerance`

Termination tolerance on the dual feasibility, a positive scalar. The default is `1e-6`.

Example: `optimoptions('coneprog','Display','iter','MaxIterations',100)`

Problem structure, specified as a structure with the following fields.

Field NameEntry

`f`

Linear objective function vector `f`

`socConstraints`

Structure array of second-order cone constraints

`Aineq`

Matrix of linear inequality constraints

`bineq`

Vector of linear inequality constraints

`Aeq`

Matrix of linear equality constraints

`beq`

Vector of linear equality constraints
`lb`Vector of lower bounds
`ub`Vector of upper bounds

`solver`

`'coneprog'`

`options`

Options created with `optimoptions`

Data Types: `struct`

## Output Arguments

collapse all

Solution, returned as a real vector or real array. The size of `x` is the same as the size of `f`. The `x` output is empty when the `exitflag` value is –`2`, –`3`, or –`10`.

Objective function value at the solution, returned as a real number. Generally, `fval` = `f'*x`. The `fval` output is empty when the `exitflag` value is –`2`, –`3`, or –`10`.

Reason `coneprog` stopped, returned as an integer.

ValueDescription

`1`

The function converged to a solution `x`.

`0`

The number of iterations exceeded `options.MaxIterations`, or the solution time in seconds exceeded `options.MaxTime`.

`-2`

No feasible point was found.

`-3`

The problem is unbounded.

`-7`

The search direction became too small. No further progress could be made.

`-10`

The problem is numerically unstable.

Tip

If you get exit flag `0`, `-7`, or `-10`, try using a different value of the `LinearSolver` option.

Information about the optimization process, returned as a structure with these fields.

FieldDescription
`algorithm`

Optimization algorithm used

`dualfeasibility`

Maximum of dual constraint violations

`dualitygap`

Duality gap

`iterations`

Number of iterations

`message`

Exit message

`primalfeasibility`

Maximum of constraint violations

`linearsolver`Internal step solver algorithm used

The `output` fields `dualfeasibility`, `dualitygap`, and `primalfeasibility` are empty when the `exitflag` value is –2, –3, or –10.

Dual variables at the solution, returned as a structure with these fields.

FieldDescription
`lower`

Lower bounds corresponding to `lb`

`upper`

Upper bounds corresponding to `ub`

`ineqlin`

Linear inequalities corresponding to `A` and `b`

`eqlin`

Linear equalities corresponding to `Aeq` and `beq`

`soc`Second-order cone constraints corresponding to `socConstraints`

`lambda` is empty (`[]`) when the `exitflag` value is –`2`, –`3`, or –`10`.

The Lagrange multipliers (dual variables) are part of the following Lagrangian, which is stationary (zero gradient) at a solution:

The inequality terms that multiply the `lambda` fields are nonnegative.

collapse all

### Second-Order Cone Constraint

Why is the constraint

`$‖A\cdot x-b‖\le {d}^{T}\cdot x-\gamma$`

called a second-order cone constraint? Consider a cone in 3-D space with elliptical cross-sections in the x-y plane, and a diameter proportional to the z coordinate. The y coordinate has scale ½, and the x coordinate has scale 1. The inequality defining the inside of this cone with its point at [0,0,0] is

`$\sqrt{{x}^{2}+\frac{{y}^{2}}{4}}\le z.$`

In the `coneprog` syntax, this cone has the following arguments.

```A = diag([1 1/2 0]); b = [0;0;0]; d = [0;0;1]; gamma = 0;```

Plot the boundary of the cone.

```[X,Y] = meshgrid(-2:0.1:2); Z = sqrt(X.^2 + Y.^2/4); surf(X,Y,Z) view(8,2) xlabel 'x' ylabel 'y' zlabel 'z'```

The `b` and `gamma` arguments move the cone. The `A` and `d` arguments rotate the cone and change its shape.

## Algorithms

The algorithm uses an interior-point method. For details, see Second-Order Cone Programming Algorithm.

## Alternative Functionality

### App

The Optimize Live Editor task provides a visual interface for `coneprog`.

## Version History

Introduced in R2020b

expand all


text:
# estimate the parameters of t-distribution and fitting with MLE [duplicate]

Here is Fitting the t-Distribution by Maximum Likelihood t-method in book Statistics and Data Analysis for Financial Engineering with R examples page 113 and 168.

But I cannot understand

For the univariate case (first picture):

1. How does the fitting work? Is it the method called expectation–maximization (EM) algorithm?

2. And I understood as first we obtain $$\mu,\sigma$$ by fitting, then use MLE to obtain the parameter $$\nu,$$ is it correct?

For the multivariate case (second picture):

1. Does that mean we first compute $$\nu,$$ then use MLE to compute $$\mu$$ and $$\Lambda?$$

2. If so, then how could we compute $$\nu$$ with unknown $$\mu$$ and $$\Lambda?$$ And the logic totally reverses compared with the univariate case.

3. I think the parameter estimation should be consistent between univariate and multivariate cases and I must have a big misunderstanding.

This is just a partial answer in that it addresses the univariate questions.

The method in that textbook tells you to maximize the log of the likelihood so it is using maximum likelihood (using odd notation in my opinion as it seems to assume unjustifiably that $$\mu$$ and $$\sigma$$ are known and that it displays those two parameters that have nothing to do with a "standardized" t-distribution - maybe that's a typo in the book).

One can also use the method of moments where one equates the sample moments to the associated expected moments. For this distribution one could use $$E(X)=\mu$$, $$Var(X)=\nu \sigma^2/(\nu-2)$$ (for $$\nu>2$$), and $$E[(X-\mu)^4]=\frac{3 \nu ^2 \sigma ^4}{(\nu -4) (\nu -2)}$$ (for $$\nu>2$$). If $$\bar{x}$$ is the sample mean, $$s^2$$ is the sample variance, and $$m_4$$ is the sample fourth central moment, then $$\hat{\mu}=\bar{x}$$, $$\hat{\sigma}^2=\frac{m_4 s^2}{2 m_4-3 s^4}$$, and $$\hat{\nu}=\frac{2 \left(2 m_4-3 s^4\right)}{m_4-3 s^4}$$. (The distribution is symmetric about $$\mu$$ so the third central moment doesn't help us estimate the parameters. In other words, the expected third central moment is zero and therefore not dependent on any of the parameters.)

These values can be used as starting values for an iterative maximum likelihood procedure (although I think that $$\bar{x}$$ will be the maximum likelihood estimator for $$\mu$$).

• The MLE for $\mu$ won't be $\bar{X}$. Aug 7, 2019 at 22:35
• @Glen_b Uh, oh. Good thing I said "I think" (even though I apparently wasn't thinking).
– JimB
Aug 7, 2019 at 22:45
• No problem. The heavier tail on the t makes sample means inefficient. Aug 7, 2019 at 22:47
• I really don't think so, but I am happy to be convinced otherwise. Can you say what led you to this conclusion (for either one or the other of those two)? Aug 7, 2019 at 23:06
• Yes, the partial derivative of the log-likelihood would be zero (missed the last part of your comment before; just saw the comment about it being a max). For the second case when $\nu=1$ (or even just sufficiently small) and the two x-values are not close together, $\bar{x}$ is a local minimum in the $\mu$-direction. Aug 7, 2019 at 23:19

format: plain


text:
# Calculate of linearization of Ricci flow

According to this question , I want to calculate $DE(g_{ij})\widetilde g_{ij}$. If I treat $g^{ij}$ as irrelevant variable ,then I can get the same result as picture below. But I doubt that $g^{ij}$ has some connection with $g_{ij}$, so in the calculation should consider $g^{ij}$.

Consider the linearization of $\frac{\partial}{\partial x^i}\{g^{kl}\frac{\partial}{\partial x^j}g_{kl}\}$ , let $$H=\frac{\partial}{\partial x^i}\{g^{kl}\frac{\partial}{\partial x^j}g_{kl}\}$$ Then $$DH(g_{ij})\widetilde g_{ij}=\frac{d}{ds}|_{s=0}H(g_{ij}+s\widetilde g_{ij}) \\ =\frac{d}{ds}|_{s=0}\{\frac{\partial}{\partial x^i} ((g^{kl}+\frac{1}{s}\widetilde g^{kl})\frac{\partial}{\partial x^j}(g_{kl}+s\widetilde g_{kl}))\} \\ =\frac{d}{ds}|_{s=0}(\frac{1}{s}\widetilde g^{kl})\frac{\partial}{\partial x^i} \frac{\partial}{\partial x^j}(g_{kl}) + ...$$ In above calculation ,I am not sure it should be $\frac{1}{s}\widetilde g^{kl}$ or $s\widetilde g^{kl}$ in the term of $\widetilde g^{kl}$.But obviously, there are 2 order term different to the results in picture below.

• Note that $(g + s\tilde{g})^{-1} \not = g^{-1} + s^{\pm 1} \tilde{g}^{-1}$ for both $\pm$. Therefore, your calculation is wrong. – mcd Oct 27 '16 at 21:56
• @mcd I know there are some wrong , but it is important there will has 2 order term . – lanse7pty Oct 29 '16 at 2:28

You are right that one has to consider the derivatives of $g^{kl}$. The text only computes the second order terms. So if you have a derivative falling on some $g^{kl}$ term then the order is 1, because the Christoffel-symbols do not involve derivatives of $g^{kl}$.
By Jacobi's formula (cf. https://en.wikipedia.org/wiki/Jacobi%27s_formula ) we have that $\mathrm{tr} (A(x)^{-1} \partial_x A(x)) = \partial_x \log \det A(x)$. This implies that $H(g) = \partial_{ij} \log \det g$. Thus, $$\partial_s H(g + s\tilde{g})|_{s=0} = \partial_{ij} \mathrm{tr}(g^{-1}\tilde{g}).$$
You can also calculate $\partial_s (g + s\tilde{g})^{-1}|_{s=0} = -g^{-1}\tilde{g}g^{-1}$ and use this to calculate the terms that are not a trace.
• Thanks ,I have edit my question , there are 2 order term different to the result of picture in my calculation. Could you give a detail process of derivative falling on $g^{kl}$ term ? – lanse7pty Oct 27 '16 at 2:49


text:
Gap junctions are intercellular channels that permit the transfer of ions and small molecules between adjacent cells. These cellular junctions are particularly dense in the retinal pigment epithelium (RPE), and their contribution to many retinal diseases has been recognized. While gap junctions have been implicated in several aspects of RPE physiology, their role in shaping the electrical properties of these cells has not been characterized in mammals. The role of gap junctions in the electrical properties of the RPE is particularly important considering the growing appreciation of RPE as excitable cells containing various voltage-gated channels. We used a whole-cell patch clamp to measure the electrical characteristics and connectivity between RPE cells, both in cultures derived from human embryonic stem cells and in the intact RPE monolayers from mouse eyes. We found that the pharmacological blockade of gap junctions eliminated electrical coupling between RPE cells, and that the blockade of gap junctions or Cx43 hemichannels significantly increased their input resistance. These results demonstrate that gap junctions function in the RPE not only as a means of molecular transport but also as a regulator of electrical excitability.

Gap junctions are intercellular channels formed from two juxtaposed connexin (Cx) protein assemblies called hemichannels. Hemichannels have a hexameric structure and are formed from six Cx proteins, and they have physiological roles independent from gap junctions (Goodenough et al., 1996; Goodenough and Paul, 2009, 2003; Akanuma et al., 2018). On the apical membrane of various cell types, hemichannels may promote cell survival by enabling sustained Ca2+ oscillations, control membrane permeability (D’hondt et al., 2014; Decrock et al., 2009) or volume (Quist et al., 2000). In astrocytes, hemichannels have been shown to transmit autocrine and paracrine signaling molecules, such as ATP and glutamate (Orellana, 2016). The human Cx protein family comprises at least 20 closely related members that vary in their expression pattern, with many cells expressing multiple types (Beyer and Berthoud, 2018; Goldberg et al., 2004; Akanuma et al., 2018). Gap junctions mediate cell-to-cell communication and homeostasis in most tissues by permitting the rapid transfer of small molecules (1–1.5 kD) and ions between adjacent cells (van Campenhout et al., 2020; Goodenough et al., 1996).

Gap junctions have been recognized as vital components of the retinal circuitry for nearly 50 yr (Bloomfield and Völgyi, 2009; Raviola and Gilula, 1973). In addition to serving a wide variety of functions in the healthy visual system, gap junctions have been implicated in various ophthalmological pathologies, such as retinal edema and age-related macular degeneration (Bao, 2015). In many of these disorders, the impairments, such as defective responses to oxidative stress, have been found to originate not in the retina itself but in the tissue underlying the retina called the retinal pigment epithelium (RPE; Sparrow et al., 2010). This monolayer of densely pigmented cells forms a part of the blood–retinal barrier that transports nutrients, regenerates visual pigment, absorbs excess light, and helps photoreceptors renew their membrane (Bok, 1993; Strauss, 2005). All these tasks are crucial for maintaining vision, and they require physiological homeostasis of the RPE, including intact cell–cell contacts. Various in vitro models have suggested that gap junctions are implicated in RPE malfunctions (Hutnik et al., 2008; Chen et al., 2015). Furthermore, Cx43 protein, the major gap-junction constituent of RPE in vertebrates (Janssen-Bienhold et al., 1998), has been shown to have numerous roles in processes such as cell differentiation, proliferation, and cellular viability (Zhang et al., 2001; Pearson et al., 2004; Hutnik et al., 2008).

In addition to gap junctions, several other ion transport mechanisms co-regulate the physiology of RPE. These include a large array of ion channels (Wimmers et al., 2007), of which voltage-gated ion channels are particularly relevant because membrane voltage changes have been shown to be the fastest way of regulating cellular connectivity (Goodenough and Paul, 2009). Gap junctions in turn may influence the activity of ion channels since they modulate the overall electrical properties of RPE (Coulon and Landisman, 2017). This is important as ion channels regulate various functions of RPE, including phagocytosis and growth factor secretion (Wimmers et al, 2007; Müller et al, 2014; Johansson et al, 2019; Korkka et al., 2019).

Despite the significance of ionic mechanisms for visual health and disease, the level of RPE gap junction–mediated electrical coupling has not been thoroughly characterized. Hudspeth and Yee (1973) reported that RPE cells are electrically connected in mudpuppies (Necturnus maculosus) and frogs (Rana pipiens) but, to date, the physiological characteristics of RPE cell coupling and the role of gap junctions in this process have not been described in mammals. The conventional approach to study the electrical properties of the RPE is to record them from single, enzymatically isolated cells (Johansson et al., 2019; Wollmann et al., 2006; Cao et al., 2018). However, recent work by our group shows that recordings can also be performed from a cultured RPE monolayer (Johansson et al., 2019), and here we extend our recordings into the intact mouse RPE.

In this study, we measured the electrical connectivity of RPE cells in cultured human embryonic stem cell (hESC)-derived RPE and mouse RPE. Our results reveal Cx43-mediated electrical coupling in mammalian RPE that can be inhibited using the universal gap junction blocker, meclofenamic acid (MFA). Our data also demonstrate that Cx43 and potentially Cx36 play a large role in determining the input resistance of RPE cells, a key determinant of electrical excitability. Surprisingly, Cx43 provided a major conductance in RPE cells not only through gap junctions between cells but also via hemichannels on the apical surface.

### Cell culturing

Human ESC lines Regea08/017 and Regea11/013 were cultured and differentiated as previously described (Vaajasaari et al., 2011; Viheriala et al., 2021). Cells were plated with a density of 2.5 × 105 cells/cm2 onto collagen IV- (C5533; Sigma-Aldrich, 10 µg/cm2) and Laminin 521 (LN521; Biolamina; 1.8 µg/cm2)-coated culture inserts (Millicell Hanging Cell Culture Insert, polyethylene terephthalate, 1.0 µm pore size; EMD Millipore) and maintained at 37°C in 5% CO2 in the knock-out Dulbecco’s modified Eagle’s medium (10829-018; Gibco) supplemented with 15% knock-out serum replacement (10828-028; Gibco), 2 mM GlutaMax (35050-038; Gibco), 0.1 mM 2-mercaptoethanol (81350-010; Gibco), 1% minimum essential medium nonessential amino acids (1140050; Thermo Fisher Scientific), and 50 U/ml penicillin/streptomycin (from Cambrex BioScience). The medium was changed three times per week and the samples were allowed to mature for 8–12 wk prior to experiments. The maturity of the hESC-RPE was evaluated by immunostainings, TER measurements, and functional assays, similar to Korkka et al. (2019).

The hESC lines of this study were obtained through collaboration with Dr. Heli Skottman’s group. The National Authority for Medicolegal Affairs Finland approved their study with human embryos (Dnro 1426/32/300/05). The supportive statement from the local ethics committee of the Pirkanmaa hospital district Finland allowed the derivation and expansion of hESC lines from surplus embryos excluded from infertility treatments and the use of these lines for research purposes (R05116). Novel cell lines were not derived in this study.

### Immunolabeling

All the following immunolabeling steps were done at room temperature. Samples were fixed for 15 min with 4% paraformaldehyde (pH 7.4; 15713; Electron Microscopy Sciences). After three washes with PBS, permeabilization was carried out by incubating the samples for 15 min in 0.1% Triton X-100 in PBS (Sigma-Aldrich). Next, the samples were blocked with 3% BSA/PBS (Sigma-Aldrich) for 1 h.

All the primary antibodies were diluted in the blocking solution and incubated for 1 h: Connexin 43 (Cx43) 1:200 (C6219; Sigma-Aldrich, RRID:AB_476857), Connexin 36 1:50 (37-4600; Thermo Fisher Scientific, RRID:AB_2533320), Connexin 46 1:50 (sc-365394; Santa Cruz Biotechnology, RRID:AB_10850181), and ZO-1 1:50 (33-9100; Thermo Fisher Scientific, RRID:AB_2533147). This was followed by three PBS washes and 1 h incubation with the secondary antibodies that were all diluted at 1:200 in 3% BSA in PBS: goat anti-rabbit Alexa Fluor 568 and donkey anti-mouse Alexa Fluor 488 (Thermo Fisher Scientific). The nuclei were stained with 4′,6′-diamidino-2-phenylidole (DAPI) included in the mounting medium (P36935; Thermo Fisher Scientific).

### Western blotting

The hESC- and mouse RPE lysates were prepared by triturating the cells in a solution containing 50 mM HEPES, 150 mM NaCl, pH 7.4, supplemented with 1% Triton-X-100, and Halt protease and phosphatase inhibitor cocktail (78440; Thermo Fisher Scientific), and then incubating them for 30 min at +4°C. The lysate was then centrifuged at +4°C for 5 min at 16,900 ×g, mixed with Bolt LDS sample buffer (B0007; Thermo Fisher Scientific), and heated to +96°C for 5 min. The lysates were then loaded onto Bolt 4–12% Bis-Tris Plus Gel (NW04120BOX; Thermo Fisher Scientific), fractionated by SDS-PAGE with the protein standard (SeeBlue Plus2 Pre-Stained Protein standard, LC5925; Thermo Fisher Scientific), and then transferred onto polyvinylidene difluoride membrane via Trans Blot Turbo Transfer system according to the manufacturer’s protocols (Bio-Rad).

The blocking was carried out with 3% BSA in PBS + 0.1% Tween-20 for 1 h at RT, and then the blot was labeled overnight at +4°C with the Cx antibodies included in the immunolabeling protocol: Cx43 (1:2,000), Cx36 (1:500), and Cx46 (1:500). The membranes were subsequently washed 3 × 10 min with PBS + 0.01% Tween-20 and incubated with a 1:3,000 dilution of horseradish peroxidase-conjugated goat anti-rabbit IgG (ab6721; Abcam) or anti-mouse IgG (A-21236; Thermo Fisher Scientific) antibodies for 1 h at RT. After subsequent washes, the membranes were developed with the WesternBright ECL system (K-12045-D20; Advansta) and imaged with ChemiDoc XRS+. Next, the blots were stripped by incubating them with Restore Western Blot Stripping Buffer for 15 min at room temperature and by washing the blots three times with PBS before and after the stripping. The blots were then reblocked and labeled with the loading control GAPDH (1:500; Sc-47724; Santa Cruz Biotechnology, RRID:AB_627678) or RPE65 (1:1,000; GTX103472; GeneTex, RRID:AB_2037911) that was detected as described for the other antibodies.

### Dye coupling and carboxyfluorescein dye uptake

For the dye coupling experiments, a single RPE cell was patched in whole-cell configuration with intracellular solution containing either 0.5% w/v neurobiotin (mol wt 358 D, SP-1120; Vector Laboratories) or 0.01% Alexa Fluor 488 (mol wt 570.48 D, A10436; Thermo Fisher Scientific). These recordings were carried out with a Nikon FN1 Upright Fluorescence Microscope. After 15 min to allow for the neurobiotin to fully dialyze and pass through gap junctions to the neighboring cells, the sample was fixed, permeabilized, and blocked as described for the immunostaining experiments, and the neurobiotin was labeled for 1 h at room temperature with 1:500 streptavidin Alexa Fluor 568 conjugate (S11226; Invitrogen) that was diluted in the blocking buffer. The samples were washed and mounted according to the provided immunostaining protocol, and the labeling was detected with the 561-nm excitation laserline from Nikon A1R confocal microscope. For Alexa Fluor 488, the dye was allowed to diffuse for 45 min after which it was detected with the 488-nm laserline from Argon laser of LSM780 laser scanning confocal microscope in inverted Zeiss Cell Observer microscope body (Zeiss).

The carboxyfluorescein dye uptake was analyzed as previously described (Potter et al., 2021). Briefly, the hESC- and mouse RPE cells were incubated in calcium-free balanced salt solution containing 200 µM 5(6)-carboxyfluorescein diacetate (21879; Sigma-Aldrich) for 10 min at 37°C and 5% CO2. Next, the solution was replaced with a calcium-containing balanced salt solution with 200 µM 5(6)-carboxyfluorescein diacetate that was incubated at 37°C and 5% CO2 for 5 min. The samples were washed with calcium-containing balanced salt solution without 5(6)-carboxyfluorescein diacetate and kept in the same solution for the entire duration of the imaging. The images were captured using Nikon FN1 Upright Fluorescence Microscope with a 488-nm laserline.

### Pre-embedding immunogold labeling and cryo-electron microscopy

The RPE cells were fixed and prepared for immunogold labeling as previously described (Johansson et al., 2019). First, the samples were washed three times with PBS and fixed with periodate–lysine–paraformaldehyde (PLP) for 2 h at RT. Prior to primary antibody incubation, the cells were treated with 0.01% saponin and 0.1% BSA in 0.1 M phosphate buffer, pH 7.4 (Buffer A). All primary antibody concentrations were doubled from immunolabeling for this assay. Next, 1.4 nm nanogold-conjugated polyclonal Fab' fragment of goat anti-rabbit IgG (https://nanoprobes.com/) diluted to 1:50 in Buffer A was applied for 1 h, followed by washes with Buffer A and 0.1 M phosphate buffer (pH 7.4). Cells were postfixed for 10 min at RT with 1% glutaraldehyde in phosphate buffer, quenched for 5 min with 50 mM NH4Cl in phosphate buffer, and then washed with phosphate buffer and water. Samples were treated with HQ-silver (https://nanoprobes.com/) for 5 min in the dark and washed with water. This was followed by gold toning with 2% sodium acetate 3 × 5 min at room temperature, 0.05% gold chloride 10 min at +4°C, 0.3% sodium thiosulphate 2 × 10 min at +4°C, and washes with water. Next, the samples were reduced for 1 h at +4°C with 1% osmium tetroxide in 0.1 M phosphate buffer, dehydrated with graded series of ethanol (70, 96, 100%), and stained with 2% uranyl acetate. Finally, the labeled samples were embedded in Epon (TAAB Embedding resin, medium, TAAB Laboratories Equipment Ltd) and polymerized. Next, the monolayers were sectioned at 200-nm intervals perpendicular to the membrane with an ultramicrotome (Leica ultracut UCT ultramicrotome; Leica Mikrosysteme GmbH). These slices were placed on carbon-coated single-slot grids and imaged at 80 kV voltage with JEOL JEM-1400 transmission electron microscope (JEOL Ltd.) equipped with bottom-mounted Quemesa charge-coupled device camera (4,008 × 2,664 pixels).

For immunoelectron microscopy analysis, mouse eyes on a mixed C57/BL6 background were removed and fixed in 4% paraformaldehyde in 0.1 M phosphate buffer (pH 7.4) with 2.5% sucrose overnight. Small coronal sections of the retina were immersed in 2.3 M sucrose in PBS and rotated at +4°C for 4 h. Specimens were frozen in liquid nitrogen, and thin cryosections were cut with a Leica EM UC7 cryoultramicrotome (Leica Microsystems). The sections were picked on Butvar–coated nickel grids. The grids were first incubated in 2% gelatine in PBS for 20 min and then in 0.1% glycin–PBS for 10 min followed by incubation in a blocking solution for Protein A/G Gold conjugates (Aurion) for 15 min. Then 0.1% BSAc (Aurion) in PBS was used in the washing steps and in the dilutions of antibodies and gold conjugates. Sections were exposed to the primary antibody against Cx43 (1:50) for 45 min. This was followed by incubation with protein A–conjugated 10 nm gold (Cell Microscopy Core, University Medical Center Utrecht) for 30 min. The controls were prepared by replacing the primary antibody with PBS. The grids were stained with neutral uranyl acetate (UA) and coated with 2% methyl cellulose containing 0.4% UA. Sections were examined with a Tecnai G2 Spirit 120 kV transmission electron microscope (FEI), and the images were captured by a Quemesa charge-coupled device camera (Olympus Soft Imaging Solutions GMBH) using RADIUS software (EMSIS GmbH).

### Confocal microscopy and image processing

LSM780 confocal microscope and Plan-Apochromat 63×/1.4 oil immersion objective were used for confocal microscopy by setting the voxel size to x = y = 66 nm and z = 200 nm, and 1,024 × 1,024 pixel stacks of 70–120 slices were acquired with a line average of 2. The following lasers were used for the fluorophores: DAPI was excited with 405 nm diode laser; Alexa Fluor 488 with 488 nm laserline from Argon laser; and Alexa Fluor 568 with 561 nm diode-pumped solid-state laser or 561 nm InTune laser. Emission was detected with windows of (in nm): 410–495 (DAPI; Alexa Fluor 405), 499–579 (Alexa Fluor 488), and 579–642 (Alexa Fluor 568). Laser powers and photomultiplier tube sensitivities were optimized for minimal bleaching and an optimal signal-to-noise ratio. The images were saved in CZI format and deconvolved using Huygens Essential (SVI) software with theoretical PSF, signal-to-noise ratio of 5, and a quality threshold of 0.01. The refractive index of the mounting media was provided by the manufacturer (Thermo Fisher Scientific). The images were finalized with ImageJ (Schneider et al., 2012) by only performing linear brightness and contrast adjustments for the pixel intensities.

For the Cx43 quantification, the cell perimeters were analyzed using a custom macro for automated multicellular tissue analysis for maximum intensity projections (ImageJ/Fiji–Advanced Digital Microscopy Core Facility–IRB Barcelona). The Cx43 plaques were quantified in ImageJ by analyzing particles from the segmented cell junctions provided by the analysis macro. Only particles localized to the epithelial cell borders were considered for the analysis. The normality was analyzed with the Shapiro-Wilk test, and the statistical significance was assessed by Mann-Whitney U Test that was performed with the IBM SPSS Statistics for Windows, version 26 (IBM Corp.). For the dye-coupling experiments, the images were aligned by placing the original patched cell to the center of the field. These aligned images were converted into an image stack, and the data were combined into an averaged projection with ImageJ. Final figure panels were assembled using Adobe Illustrator (Adobe Systems).

Cx43 labeling was also quantified from immunoelectron microscopy images. Here, the cells were separated from the background by manually selecting an intensity threshold for each cell (Fig. 1 E). Some cells had regions within them that had similar intensities as the cell exterior. These were taken into account by assigning background regions that were smaller than one-tenth of the image size of the cells. The labeled Cx43 was segmented automatically by using the maximum entropy threshold (Kapur et al., 1985). This also segmented the mitochondria, which were excluded from the segmentation by excluding all the contiguous objects that were over 500 pixels (≈6,000 nm3) in size (Fig. 1 E). The Euclidean distance transform of the cell border was calculated for each cell, and the label density within 1 μm from the cell border was calculated. The label density, as a function of increasing distance from the cell border, was also calculated by grouping the pixels into bins of increasing distance from the border and calculating the label fraction of each bin. The bin size was 15 pixels (52 nm).

### Patch-clamp recordings

All mice were between 4 and 10 wk old and on a mixed C57/BL6 background. Both male and female mice were used in this study. All procedures were approved by the Animal Care and Use Committee at Northwestern University and in accordance with the ARVO Statement for the Use of Animals in Ophthalmic and Vision Research and Finland Animal Welfare Act 1986. For electrophysiological experiments, the RPE dissections were conducted under IR light (940 nm) with assistance from IR visible light converter (night vision) goggles and separate IR dissection scope attachments (B.E. Meyers Owl Night Vision Scopes, Model #7200I). The retina was gently removed, and a piece of the eyecup with RPE attached to the choroid was then mounted with RPE side up on a 12-mm poly-D-lysine-coated glass coverslip (354086, BioCoat Cellware; Corning), which was secured to a recording dish via grease under a slice anchor (Warner Instruments). For hESC-RPE recordings, the culture insert was removed from the holder and cut into four pieces that were mounted under the slice anchor on the recording chamber using grease. For both the RPE preparations, the dish was then placed on the electrophysiology rig (SliceScope Pro 6000; Scientifica; or Eclipse FN1 upright microscope–based system; Nikon; with pE-4000; CoolLed) and superfused with carbogenated Ames medium (A-1372-25; US Biological Life Sciences; 9 ml per min), and then warmed to 32°C. RPE cells were illuminated at 950 nm for visualization.

The currents were recorded from mature hESC-derived RPE monolayers or mouse RPE cells using the standard patch-clamp technique in whole-cell configuration. In paired recordings, two adjacent RPE cells or pairs at a varying intercellular distance were patched and recorded simultaneously. Patch pipettes (5–7 MΩ, BF120-69-10; Sutter Instruments) were filled with an intracellular solution composed of (in mM) 125 K-aspartate, 10 KCl, 1 MgCl2, 10 HEPES, 1 CaCl2, 2 EGTA, 4 Mg-ATP, and 0.5 Tris-GTP (277 mOsm; pH ∼7.15 with KOH). For blocking the gap junctions, the bath solution was supplemented with 100 µM MFA (M4531; Sigma-Aldrich). When Cx43 hemichannels were investigated, the intracellular solution was supplemented with 90 µM TAT-Gap19 trifluoroacetate salt (SML2319-1MG; Sigma-Aldrich), and the recording time was kept under 15 min. All recordings were made in current-clamp mode with a two-channel patch-clamp amplifier (MultiClamp 700B; Molecular Devices). To analyze the input resistance, we applied a series of injected current pulses (from −25 to 50 pA for hESC-RPE and from −500 to +1,500 pA for mouse RPE) and measured the changes in the membrane potential. Series resistance was not compensated.

### Patch-clamp data analysis

The offline analysis was performed with a custom open-source MATLAB analysis package (GitHub - SchwartzNU/SymphonyAnalysis: Symphony analysis code for SchwartzLab at Northwestern University) and Clampfit software (Molecular Devices). The coupling coefficient was calculated as a change in voltage in the recorded cell over a change in voltage in the stimulated cell. The effect of the MFA blocker was analyzed with two-tailed unpaired Student’s t test. The normality of hemichannel blocker data was assessed by a Kurtosis test, and the statistical significance of the blocker effect was assessed by the Mann–Whitney U test. All statistical tests were performed with the IBM SPSS Statistics for Windows, version 26 (IBM Corp.). Final figures were assembled in Igor Pro and Adobe Illustrator.

### RPE connectivity modeling

The model was largely based on the work by Fortier and Bagna (2006) who investigated how gap junction resistance values contribute to the input resistance of a cell in a hexagonal grid (Fig. 6 A). We had two key assumptions: (1) all cells have the same total input resistance (RI) and all cells have the same single cell input resistance in the absence of gap junctions (R), and (2) each cell has exactly f = 6 coupled cells. This differential equation model is quite simple, and thus the addition of variability in the input resistances of the cells (Assumption 1) did not substantially add to our understanding of the role of gap junctions. Assumption 2 was determined to be valid due to the breadth of the literature that described epithelial cells, and specifically RPE, to have six neighbors in a majority of cases (Liu et al., 2016; Ishii and Rohrer, 2017). Therefore, given two paired cells we get that the voltage change in the injected cell is equal to:
$V11=I1RRj+R2R+Rj,$
(1)
where $V11$ is the voltage change in cell 1 with current $I1$ injected into cell 1, and $Rj$ is the resistance of the gap junctions.
We then get the voltage change in the paired cell as:
$V12=I1R22R+Rj.$
(2)
Therefore, the coupling coefficient between the two cells is given as:
$CC=V12V11=R2R×Rj+R2.$
(3)
The input resistance of the cell can be calculated as follows:
$R=RIRj+RRj+R−fRI.$
(4)

We then solved for R for a variety of $RI$ and $Rj$ values to determine the contribution of gap junctions to the input resistance of RPE cells. The coupling coefficients and input resistances were then related to the measured values from cultured and mouse RPE recordings. The differential equations were solved numerically in MATLAB and all the code can be found at https://github.com/SchwartzNU/SymphonyAnalysis/tree/master/RPE.

### RPE cells display an extensive network of Cx43-based gap junctions

The localization of Cx43 proteins was analyzed by immunolabeling both hESC-derived and mouse RPE monolayers. Confocal microscopy demonstrated that both the RPE preparations showed an extensive network of gap junction plaques adjacent to the cell–cell junctions marked with Zonula occludens-1 (ZO-1) protein labeling (Fig. 1). Furthermore, the labeling demonstrates that the hESC-RPE cells (Fig. 1 A) resemble the mouse RPE cells found in vivo (Fig. 1 B), with respect to Cx43 expression and localization.

We next wanted to analyze in more detail the variation in the distribution of Cx43 plaques between cells in the monolayer and between the two RPE preparations (Fig. 1 C). The quantification of Cx43 plaques showed moderate variation in the number of foci per cell junctions within the monolayer, but significant differences between the two RPE preparations (P < 0.00001, Mann–Whitney U Test). For mouse RPE cells, the average number of puncta per micrometer was 0.53 ± 0.01 (average perimeter of cells was 85 ± 1.19 µm, n of cells = 160) while for hESC-RPE the value was 0.39 ± 0.01 (average perimeter of cells was 37 ± 0.14 µm, n of cells = 1,042; Fig. 1 C).

Detailed localization of the gap junctions was investigated by immunogold labeling and electron microscopy of hESC-RPE. The imaging showed that the gap junctions were localized toward the apical membrane of the cells and that Cx43 labeling was also present outside the cell junctional area in the apical membrane (Fig. 1 D). To analyze the localization, the cell border and Cx43 labels were segmented from the microscopy images. The mean label density within 1 μm from the cell border was 0.008 ± 0.003 (mean ± standard deviation) on the apical side and 0.0021 ± 0.0013 on the basal side (Fig. 1 E; n = 12 cells). This was analyzed as a function of the distance from the cell border showing that the label density at the basal side was very low near the cellular border, which started to increase toward the central regions of the cell. At the apical side, the label density was at its highest near the border and decreased toward the central parts (Fig. 1 E). The localization of the Cx43 was found to be similar in cryosectioned mouse eyecups (Fig. 1 F). Therefore, both hESC-RPE and mouse RPE monolayers express Cx43 and form gap junctions between cells as well as hemichannels on the apical side of the cells.

### RPE cells show weak expression of Cx36 but not Cx46 isoforms

Previous work has suggested that Cx43 is the primary Cx expressed in RPE (Akanuma et al., 2018; Pearson et al., 2005); however, other Cx isoforms have also been found in mice (Milićević et al., 2021) and rats (Malfait et al., 2001). To investigate the isoform distribution, hESC-RPE and mouse RPE whole mounts were labeled with antibodies against Cx36 and Cx46 proteins (Fig. 2 A). Our immunostaining showed that Cx36 was weakly positive and mostly localized as spots on the apical membrane. This labeling pattern was observed for both hESC (Fig. 2 A) and mouse RPE monolayers (Fig. 2 B). Cx46, on the other hand, was found to be negative in both preparations. To confirm our findings, we analyzed the isoform distribution in RPE by immunoblotting against Cx43, Cx36, and Cx46; GAPDH and RPE65 were used as loading controls in hESC-RPE and mouse RPE, respectively (Fig. 2 C). This showed that the highest fraction of Cx proteins in RPE is accounted for by Cx43, Cx36 is weakly detected at the protein level, and Cx46 band was not identified.

### RPE cell input resistance is reversibly increased by MFA

Input resistance is a core property affecting the electrical excitability of cells; the higher the input resistance, the more the membrane will resist the movement of charges (ions) and the more the membrane voltage will change with a given ionic current. Both Cx43 gap junctions and hemichannels are potential sources of electrical conductance that would be expected to lower the input resistance of RPE cells. Thus, we hypothesized that blocking these channels would increase the cells’ input resistance.

In whole-cell current-clamp recordings of RPE cells, we used a series of injected current pulses (−25 and 50 pA for hESC-RPE and −500 and +1,500 pA for mouse RPE) to measure input resistance (Fig. 3, A and B; see Materials and methods). The baseline resistance values were consistently higher in hESC (388 ± 64 MΩ, n = 6 cells) than in mouse RPE (21 ± 3 MΩ, n = 10 cells; P < 0.0001, two-tailed unpaired Student’s t test). We applied the gap junction blocker MFA to the extracellular solution and remeasured input resistance (with smaller current pulses −10 to 25 pA in hESC-RPE and −50 to 150 pA in mouse). Input resistances increased nearly 5-fold (to 1,900 ± 310 MΩ) in hESC and >10-fold (to 290 ± 80 MΩ) in mouse RPE in the presence of MFA, and these values were significantly different from the control conditions (P = 0.0013, n = 6, and P = 0.0067, n = 10, for hESC and mouse respectively, two-tailed paired Student’s t test). The effect was found in all recorded RPE cells in both preparations, and it was reversed with the washout of MFA (Fig. 3 C).

### RPE gap junction coupling decreases exponentially over distance

Given that RPE expresses Cx’s and its input resistance was affected by a gap junction blocker, we wanted to investigate their electrical coupling. We recorded pairs of adjacent RPE cells in dual patch-clamp configuration to measure the degree of electrical coupling and the effect of MFA (Fig. 4). With both cells in the current-clamp mode, we injected current into one cell (cell 1) and measured the resulting depolarization both in the injected cell (cell 1) and the coupled cell (cell 2). In all pairs, we also reversed the direction of current through the gap junction by injecting current in cell 2. To obtain a trans-junctional current–voltage relationship, we plotted the voltage change in the paired cell against the voltage change in the injected cell (Fig. 4 B). This relationship was linear and independent of the direction of current flow, consistent with a non-rectifying gap junction.

A coupling coefficient is defined as the ratio of the depolarization in the coupled cell to that in the injected cell. The coupling coefficients were 0.13 ± 0.013 for hESC-RPE (n = 11 pairs) and 0.045 ± 0.0070 for mouse RPE (n = 7 pairs), and MFA abolished the connectivity between RPE cells in both preparations (Fig. 4, A and C). This relationship was linear and independent of the direction of current flow (Fig. 4 B), consistent with a non-rectifying gap junction. There was no significant directional bias in either the hESC data (P = 0.071 for control conditions and P = 0.088 in MFA conditions) or the mouse RPE (P = 0.80 for control conditions and P = 0.27 for MFA conditions). In the presence of MFA, the voltage change in the recorded cell was no longer dependent on the voltage change in the injected cell in both hESC (coupling coefficient became 0.026) and mouse (0.022) RPE (Fig. 4 C). This was significantly different from control conditions (hESC and mouse P < 0.001). However, these coupling coefficients are relatively low as compared to other retinal cells (Trenholm and Awatramani, 2017), and thus small fluctuations in membrane voltage could be perceived as responses in the recorded cell and artificially inflate the coupling in MFA. Therefore, to measure how statistically significant the voltage changes were, we also calculated the standard score (Z-score) of the responses in the recorded cell (Fig. 4 C). In both hESC- and mouse RPE pairs, the Z-score was significantly affected by the application of MFA (hESC: control 15.0 ± 2.0, MFA 3.4 ± 0.9, P < 0.001; mouse: control 6.2 ± 1.0, MFA 1.2 ± 0.09, P < 0.001). Therefore, the coupling between neighbors in the RPE monolayer is significant and can be blocked with the application of MFA.

Next, we wanted to investigate the extent of coupling between RPE cells by analyzing the relationship of coupling coefficient to the inter-pair distance. This was carried out by patching hESC-RPE and mouse RPE cell pairs by increasing the number of cells between the pair (Fig. 5 A). The coupling was found to decay dramatically as the distance increased in hESC- and mouse RPE: 0.12 ± 0.024 (adjacent cells between the pair, n = 5), 0.04 ± 0.007 (one cell between the pair, n = 7), 0.01 ± 0.003 (two cells between the pair, n = 4), and 0.01 ± 0.005 (three cells between the pair, n = 3) for hESC-RPE; and 0.09 ± 0.015 (adjacent cells between the pair, n = 21), 0.068 ± 0.014 (one cell between the pair, n = 3), 0.039 ± 0.008 (two cells between the pair, n = 3), and 0.036 ± 0.008 (three cells between the pair, n = 4) for mouse RPE (Fig. 5 B). This phenomenon was also observed in dye coupling, where an individual cell in the monolayer was filled with a gap-junction permeable fluorescent dye, Alexa Fluor 488, that was allowed to diffuse to the adjacent cells for 45 min (Fig. 5 C). We observed that in both RPE preparations, the extent of the dye spread reached the adjacent cell layer but was not detectable past that; however, the diffusion was found more asymmetric in hESC-RPE. Therefore, we used a smaller marker neurobiotin that only required 15 min of incubation and investigated the diffusion in a population of hESC-RPE cells (n = 8). The individual images were compiled into an averaged projection, but the asymmetry was still detected (Fig. 5 D). This showed that the gap junctions are capable of transporting small molecules across the monolayer, but the dye intensity dramatically decreased over distance.

### Cx43 hemichannels influence input resistance

In addition to gap junctions, previous studies (Akanuma et al., 2018; Pearson et al., 2005) and our EM data (Fig. 1) indicated that Cx43 also assembles as hemichannels in the apical membrane of RPE cells. MFA blocks these hemichannels as well as gap junctions, and it can also have off-target effects on resistance through voltage-gated potassium channels by inhibiting hKv2.1 channels (Lee and Wang, 1999) and opening KNCQ2/Q3 channels (Peretz et al., 2005). However, due to the lack of functional evidence of either of these potassium channel types in RPE, we assume that the off-target (non-connexin blockade) effects of MFA on input resistance are likely to be negligible.

We wanted to determine whether the increase in input resistance that we measured in RPE cells with MFA (Fig. 3) was consistent with solely gap junction decoupling, or whether the blockade of additional conductances was required. We modeled a network of RPE cells consisting of a central cell and six connected neighbors, consistent with the hexagonal lattice of the monolayer (Figs. 1 A and 6 A; see Materials and methods; Liu et al., 2016; Ishii and Rohrer, 2017). This differential equations model calculated the input resistance of a cell in a network, given a measured input resistance with junctions intact and a junctional conductance (Fortier and Bagna, 2006). We evaluated the model at some example input resistances that align with our measurements (Fig. 3 C). By varying the resistance, Rj, of the gap junctions (see Eq. 4), we investigated the impact of junctional conductance on the resulting single cell input resistance (R) of each cell (Fig. 6 B). Constraining the model to produce coupling coefficients in the measured range (0.15 with gap junctions open to 0.025 with them blocked by MFA; Fig. 4), we found that the input resistance did not increase as dramatically as we observed with the application of MFA (Fig. 3). MFA is known to have off-target effects, including blocking hemichannels. Thus, closing gap junctions alone could not account for the magnitude of the resistance increase that was measured with MFA.

These results suggest that a major component of the effect of MFA on the measured input resistance was instead due to the blockade of Cx43 hemichannels. To test this modeling result experimentally, we carried out the patch-clamp recordings with a specific blocker, TAT-Gap19. This blocker is a Cx43 mimetic peptide, which specifically inhibits Cx43 hemichannels by preventing their opening, but importantly, does not interfere with gap junctions (Tarzemany et al., 2017; Abudara et al., 2014). The peptide specificity is due to its direct binding to the C-terminal tail of Cx43, which prevents the interaction of cytoplasmic loop/C-terminal tail. This interaction is mandatory for hemichannel activity, while the gap junctions are unaffected (Ramadan et al., 2020). However, other similar peptides have been shown to also inhibit gap junctional communication, but importantly, the kinetics of this inhibition is much slower (∼30 min; D’hondt et al., 2014). In a subset of experiments, we included TAT-Gap19 (90 μM) in the intracellular solution while keeping the recording time under 15 min to prevent off-target effects (Fig. 6 C). Input resistances measured in the presence of TAT-Gap19 were significantly higher than those in control hESC-RPE cells (511 ± 70 mΩ [n = 19] versus 301 ± 28 mΩ [n = 23], P = 0.012, Mann–Whitney U test; Fig. 6 C), suggesting that Cx43 hemichannels play a role in setting the input resistance of RPE cells. We also observed an increased input resistance in mouse RPE recordings, although the effect was more moderate (65 ± 31 mΩ [n = 8] versus 18 ± 4 mΩ [n = 8], P = 0.05, Mann-Whitney U test).

In addition to electrophysiological characterization, the presence of functional hemichannels was investigated by a carboxyfluorscein dye uptake assay (Potter et al., 2021). Our results showed that both hESC- and mouse RPE preparations were able to uptake the dye after exposure to Ca2+ free extracellular solution for hemichannel opening, and that the label intensity varied between cells (Fig. 6 D). Previously, it has been suggested that a small subset of hemichannels may be open without the removal of Ca2+ (Potter et al., 2021). We wanted to analyze the fraction of spontaneously open hemichannels in RPE by incubating the monolayers in carboxyfluorescein without the initial step to remove Ca2+. Our results showed a decrease in the relative intensity in both RPE preparations (−0.60 ± −0.02 for hESC- and −0.62 ± −0.05 for mouse RPE, n of experiments = 3). Taken together, the dramatic increases in input resistance we measured in MFA likely arose from the combination of this drug’s blockade of Cx43 gap junctions and hemichannels.

A growing body of evidence has challenged the concept of RPE as the electrically passive partner for the retina that simply provides appropriate environmental conditions for maintaining visual function. Recent work by us and others have demonstrated that various essential tasks of RPE, such as renewal of photoreceptor membranes and growth factor secretion, depend on voltage, and that RPE cells express a family of voltage-gated calcium and sodium channels (Wimmers et al, 2007; Müller et al, 2014; Johansson et al, 2019; Korkka et al., 2019). Yet, the electrophysiological characteristics of RPE cells have not been thoroughly investigated, and studies are particularly lacking from mammalian species and intact monolayer preparations.

In this study, our goal was to examine the characteristics of the intercellular connectivity by analyzing input resistance in single (Fig. 3) and dual patch-clamp recordings (Fig. 4) from tissues that most accurately represent RPE cells in vivo. Due to the challenges related to recording from native mouse RPE tissue, previous physiological studies have focused on sub-confluent primary cultures (Wollmann et al., 2006) or isolated cells (Cao et al., 2018). We have now developed a procedure for obtaining patch-clamp recordings from mouse RPE whole mounts, which opens possibilities for further studies on their physiology.

Our input resistance analysis demonstrates that mammalian RPE cells are physiologically coupled, and that this connectivity can be inhibited by blocking gap junctions and hemichannels with MFA (Fig. 3, B and C). Our results correlate with previous work from an immortalized cell line ARPE-19, although we found the effect of MFA to be reversible (Ning et al., 2013). While the MFA-induced increase in input resistance was similar both in hESC- and mouse RPE, our results show that mouse RPE cells display lower input resistance values than cultured cells. Mouse RPE had a higher number of Cx43 positive foci at the cell–cell junctions (Fig. 1 C), indicating a larger number of gap junctions in addition to having more extensive apical microvilli leading to a larger membrane area. Both factors would contribute to mouse RPE cells having a lower input resistance as compared to cultured cells.

The dual patch-clamp recordings showed that coupling coefficients (Figs. 4 C and 5 B) were lower in both of the RPE preparations compared to previously reported values in the retinal neuronal cells (Trenholm and Awatramani, 2017). It is worth noting that the low resistance of the RPE cells can cause variance in the coupling coefficient measurements. However, the values that were obtained in RPE cells were higher than the coupling ratios reported for astrocytes that are known to be able to form an electrical syncytium through gap junctional coupling (Xu et al., 2010; Ma et al., 2016). Similar to astrocytes (Xu et al., 2010), the coupling coefficients were found to decrease exponentially with increasing distance between the recorded RPE cell pair, and this was also observed in our dye coupling analysis (Fig. 5).

Our computational model (Fig. 6) showed that with coupling coefficients in the measured range, blocking gap junctions alone could not account for MFA’s effect on input resistance. As MFA is a universal blocker for Cx43, we speculated that hemichannels might also influence the results as their presence has been previously shown by fluorescent dye diffusion and calcium imaging studies in immortalized ARPE-19 cell line (Akanuma et al., 2018) and developing RPE (Pearson et al., 2005). Indeed, the application of hemichannel inhibitor TAT-Gap19 in cultured RPE cells increased the input resistance significantly. This validated the results obtained from the computational model and confirmed that the Cx43 signal observed in our immuno-EM data originates from both gap junctions and hemichannels. The effect of the peptide was significant in mouse RPE as well, yet it appeared less potent. Our hemichannel finding is supported by the work of Akanuma et al. (2018), who demonstrate an increased dye uptake in ARPE-19 cells in calcium-deprived conditions that have been shown to activate the hemichannels. Furthermore, we observed an uptake of carboxyfluorescein dye after calcium removal, demonstrating that hemichannels are functional in RPE cells (Fig. 6).

While the blockade of both gap junctions and Cx43 hemichannels by MFA together contributed to the increase in input resistance we observed, the effects were not additive. The full resistance increase we measured in MFA exceeded the sum of the modeled effects on gap junctions (Fig. 6) and the measured effects of Cx43 hemichannel blockade (Fig. 3). Factors contributing to this discrepancy could include off-target effects of MFA on ion channels other than Cx’s (Peretz et al., 2005) and incomplete blockage of hemichannels by TAT-Gap19 (D’hondt et al., 2014). Future work may reveal other components that regulate the input resistance of RPE cells and how they might be influenced by MFA.

At this stage, it is not clear whether the variation between mouse and cultured RPE cells is due to differences between species. Our immunostainings and Western blot analyses had shown that a low level of Cx36 was present in RPE and, in particular, in the apical membrane. Hemichannels formed by this Cx isoform would not be affected by TAT-Gap19. While our immunoblots demonstrate that Cx43 comprises the highest fraction of the RPE Cx proteins, it is noteworthy that the lysis process was not specifically targeted for the extraction of membrane-bound proteins. Previous studies in HeLa transfectants have shown that biotinylated surface Cx proteins only comprise a small portion of the total Cx level (Schalper et al., 2008). Thus, the level of Cx36 could be higher than that shown by our data. The presence of Cx43 and Cx36 and the minimal expression of Cx46 in murine RPE has been previously reported by other groups on the mRNA level. Analysis of the GEO data set GSE172440 (Milićević et al., 2021) demonstrates that Gja1 (encoding Cx43) is the most abundant Cx protein, while the expression of Gjd2 (Cx46) was found to be minimal. Gjd2 (encoding Cx36) was also expressed, albeit at lower levels than Gja1.

In addition to interspecies variation, the differences between cultured and mouse RPE could be caused by the culturing conditions of human RPE cells or due to a developmental issue as hESC-RPE typically resembles fetal tissue more than mature epithelium. As has been recognized before, the culture conditions can influence the expression patterns of ion channels and transporters (Reichhart and Strauss, 2014; Korkka et al., 2019). It is also worth noting that native RPE cells have been shown to exhibit intercellular heterogeneity in terms of their morphology and protein expression (Burke and Hjelmeland, 2005; Burke et al., 1996), and it has been suggested that this variability could cause phenotypically distinct subpopulations when propagated in vitro (Rizzolo, 2014; Campbell and Humphries, 2013). The mosaic-like behavior of RPE was also reflected in the baseline input resistance values (Fig. 3 C) and coupling coefficients (Fig. 4 C) obtained in this study.

While the integrity of tight junctions as a constituent of the blood–retina barrier has long been recognized as fundamentally important for visual health (Campbell and Humphries, 2013; Rizzolo, 2014), evidence suggests that gap junctions are also important for regulating the functions of RPE during development, such as the correct pacing of retinal organogenesis (Tibber et al., 2007) and calcium wave spreading (Pearson et al., 2004). However, less is known about the specific roles of gap junctions in mature RPE. In the retina, gap junctions are known to have myriad roles, such as receptive field size signal correlation (Devries, 1999) and motion detection (Murphy-Baum and Awatramani, 2018), and both light adaptation and circadian rhythm have been shown to alter the electrical coupling of the underlying neural circuits (Vasconcellos et al., 2005; Rassi Gabriel et al., 2011). As our results demonstrate that both gap junctions and Cx43 hemichannels can control the electrical excitability of RPE by altering the input resistance, it is plausible the connectivity could enable synchronization of the essential functions of RPE, particularly as the junctions facilitate signaling across wide regions. In other cell types, such as oligodendrocytes, astrocytes, and corneal endothelial cells, gap junctions and hemichannels have been implicated in potassium buffering, calcium wave propagation, as well as the release of signaling molecules such as ATP and nicotinamide–adenine dinucleotide (Belousov et al., 2017; D’hondt et al., 2014; Goodenough and Paul, 2003).

In addition to mediating signaling in the healthy tissues, gap junctions have also been implicated in cell death and survival, and hemichannels have been shown to open in response to metabolic stress (Belousov et al., 2017; Contreras et al., 2002). Therefore, a loss or malfunction in the regulation of Cx43 could impair the physiology of RPE. In fact, mutations in Cx43 have been implicated in a syndrome known as oculodentodigital dysplasia that causes abnormalities of the ocular, nasal, dental, and limb structures. Interestingly, developmental defects in RPE have been reported in some patients (Calera et al., 2009). Furthermore, conditional knockout of Cx43 has been shown to cause a reduction in aqueous humor production and complete loss of the vitreous chamber in mice (Pogoda et al., 2016). In the retina, photoreceptor degeneration has been shown to cause oscillatory electrical activity within the remaining electrically coupled retinal network (Biswas et al., 2014). Future studies may elucidate whether connectivity impairments also occur within the RPE in pathological conditions.

Both gap junctions and hemichannels are known to be regulated through posttranslational modifications, and interactions with various other cellular proteins can affect their gating and selectivity, trafficking, as well as assembly (Falk et al., 2014; Laird, 2006). Especially considering the short half-life of Cx proteins of 1–5 h (Laird, 2006; Falk et al., 2014), it is possible that natural variations in the state of Cx43 could play a role in regulating the excitability and physiological status of RPE. It is worth noting that in addition to a decrease in extracellular calcium, a modest increase in intracellular calcium can open the hemichannels by shifting their threshold for voltage activation toward the physiological range (D’hondt et al., 2014). Understanding the electrical coupling and its physiological regulation may help to elucidate the roles of various voltage-gated ion channels in RPE and other epithelial tissues. Taken together, these results demonstrate that while the baseline level of cellular coupling in RPE is low, gap junctions enable rapid changes in electrical properties and overall connectivity. This could facilitate the fast spreading of physiological signaling molecules and ions, such as ATP, cAMP, and calcium in RPE. Intriguingly, with our observation of hemichannels, this includes signaling within the monolayer as well as between RPE and the subretinal space.

Jeanne M. Nerbonne served as editor.

We are grateful to Viivi Karema-Jokinen (Tampere University) for her technical assistance with the electron microscopy experiments and to Dr. Heli Skottmann (Tampere University) and Dr. Keijo Viiri (Tampere University) for kindly providing the hESCs for RPE differentiation and mouse tissue, respectively. We thank both Outi Heikkilä (Tampere University) and Susan Lynn Wohlgenant (Northwestern University) for their technical expertise and assistance. The authors acknowledge the Biocenter Finland (BF) and Tampere Imaging Facility (TIF) for their service. In addition, Tampere Facility of Electrophysiological Measurements, and Electron Microscopy Unit (University of Helsinki, Institute of Biotechnology) are gratefully acknowledged for their services. Part of the work was carried out with the support of Biocenter Oulu, Electron Microscopy Core Facility (University of Oulu).

This study was funded by the Academy of Finland (grant numbers 319257, 287287, 323507, 308315, and 330896), the Emil Aaltonen Foundation, the Jane and Aatos Erkko Foundation, and TUT on world tour mobility grant (Tampere University).

The authors declare no competing financial interests.

Author contributions: Conception and design of the study as well as data acquisition, analysis, and interpretation were performed by J. Fadjukov, S. Wienbar, G.W. Schwartz, and S. Nymark. The expertise on confocal microscopy and image analysis was provided by T.O. Ihalainen. S. Hakanen, V. Aho, and M. Vihinen-Ranta planned and conducted the electron microscopy sample preparation together with J. Fadjukov, and they conducted the electron microscopy imaging for the hESC-RPE. All authors contributed to the writing of the manuscript and approved the final manuscript.

Abudara
,
V.
,
J.
Bechberger
,
M.
,
M.
de Bock
,
N.
Wang
,
G.
Bultynck
,
C.C.
Naus
,
L.
Leybaert
, and
C.
Giaume
.
2014
.
The connexin43 mimetic peptide Gap19 inhibits hemichannels without altering gap junctional communication in astrocytes
.
Front. Cell. Neurosci.
8
:
306
.
Akanuma
,
S.I.
,
H.
Higashi
,
S.
Maruyama
,
K.
Murakami
,
M.
Tachikawa
,
Y.
Kubo
, and
K.I.
Hosoya
.
2018
.
Expression and function of connexin 43 protein in mouse and human retinal pigment epithelial cells as hemichannels and gap junction proteins
.
Exp. Eye Res.
168
:
128
137
.
Bao
,
L.
2015
.
Trafficking regulates the subcellular distribution of voltage-gated sodium channels in primary sensory neurons
.
Mol. Pain
.
11
:
61
.
Belousov
,
A.B.
,
J.D.
Fontes
,
M.
, and
C.C.
Naus
.
2017
.
Gap junctions and hemichannels: communicating cell death in neurodevelopment and disease
.
BMC Cell Biol.
18
:
4
.
Beyer
,
E.C.
, and
V.M.
Berthoud
.
2018
.
Gap junction gene and protein families: connexins, innexins, and pannexins
.
Biochim. Biophys. Acta Biomembr.
1860
:
5
8
.
Biswas
,
S.
,
C.
Haselier
,
A.
Mataruga
,
G.
Thumann
,
P.
Walter
, and
F.
Müller
.
2014
.
Pharmacological analysis of intrinsic neuronal oscillations in rd10 retina
.
PLoS One
.
9
. e99075.
Bloomfield
,
S.A.
, and
B.
Völgyi
.
2009
.
The diverse functional roles and regulation of neuronal gap junctions in the retina
.
Nat. Rev. Neurosci.
10
:
495
506
.
Bok
,
D.
1993
.
The retinal pigment epithelium: a versatile partner in vision
.
J. Cell Sci.
17
:
189
195
.
Burke
,
J.M.
, and
L.M.
Hjelmeland
.
2005
.
Mosaicism of the retinal pigment epithelium: seeing the small picture
.
Mol. Interv.
5
:
241
249
.
Burke
,
J.M.
,
C.M.
Skumatz
,
P.E.
Irving
, and
B.S.
McKay
.
1996
.
Phenotypic heterogeneity of retinal pigment epithelial cells in vitro and in situ
.
Exp. Eye Res.
62
:
63
73
.
Calera
,
M.R.
,
Z.
Wang
,
R.
Sanchez-Olea
,
D.L.
Paul
,
M.M.
Civan
, and
D.A.
Goodenough
.
2009
.
Depression of intraocular pressure following inactivation of connexin43 in the nonpigmented epithelium of the ciliary body
.
Invest. Ophthalmol. Vis. Sci.
50
:
2185
2193
.
Campbell
,
M.
, and
P.
Humphries
.
2013
.
The blood-retina barrier tight junctions and barrier modulation
.
763
:
70
84
.
Cao
,
X.
,
B.R.
Pattnaik
, and
B.A.
Hughes
.
2018
.
Mouse retinal pigment epithelial cells exhibit a thiocyanate-selective conductance
.
Am. J. Physiol. Cell Physiol.
315
:
C457
C473
.
Chen
,
Y.S.
,
C.R.
Green
,
K.
Wang
,
H.V.
Danesh-Meyer
, and
I.D.
Rupenthal
.
2015
.
Sustained intravitreal delivery of connexin43 mimetic peptide by poly(D,L-lactide-co-glycolide) acid micro- and nanoparticles - Closing the gap in retinal ischaemia
.
Eur. J. Pharm. Biopharm
.
95
:
378
386
.
Contreras
,
J.E.
,
H.A.
Sánchez
,
E.A.
Eugenin
,
D.
Speidel
,
M.
Theis
,
K.
Willecke
,
F.F.
Bukauskas
,
M.V.L.
Bennett
, and
J.C.
Sáez
.
2002
.
Metabolic inhibition induces opening of unapposed connexin 43 gap junction hemichannels and reduces gap junctional communication in cortical astrocytes in culture
.
.
99
:
495
500
.
Coulon
,
P.
, and
C.E.
Landisman
.
2017
.
The potential role of gap junctional plasticity in the regulation of state
.
Neuron
.
93
:
1275
1295
.
Decrock
,
E.
,
M.
Vinken
,
E.
de Vuyst
,
D.V.
Krysko
,
K.
D’Herde
,
T.
Vanhaecke
,
P.
Vandenabeele
,
V.
Rogiers
, and
L.
Leybaert
.
2009
.
Connexin-related signaling in cell death: to live or let die?
Cell Death Differ.
16
:
524
536
.
Devries
,
S.H
.
1999
.
Correlated firing in rabbit retinal ganglion cells
.
J. Neurophysiol.
81
:
908
920
.
D’hondt
,
C.
,
J.
Iyyathurai
,
B.
Himpens
,
L.
Leybaert
, and
G.
Bultynck
.
2014
.
Cx43-hemichannel function and regulation in physiology and pathophysiology: insights from the bovine corneal endothelial cell system and beyond
.
Front. Physiol.
5
:
348
.
Falk
,
M.M.
,
R.M.
Kells
, and
V.M.
Berthoud
.
2014
.
Degradation of connexins and gap junctions
.
FEBS Lett.
588
:
1221
1229
.
Fortier
,
P.A.
, and
M.
Bagna
.
2006
.
Estimating conductances of dual-recorded neurons within a network of coupled cells
.
J. Theor. Biol.
240
:
501
510
.
Goldberg
,
G.S.
,
V.
Valiunas
, and
P.R.
Brink
.
2004
.
Selective permeability of gap junction channels
.
Biochim. Biophys. Acta
.
1662
:
96
101
.
Goodenough
,
D.A.
, and
D.L.
Paul
.
2003
.
Beyond the gap: functions of unpaired connexon channels
.
Nat. Rev. Mol. Cell Biol.
4
:
285
294
.
Goodenough
,
D.A.
, and
D.L.
Paul
.
2009
.
Gap junctions
.
Cold Spring Harb. Perspect. Biol.
1
:
a002576
.
Goodenough
,
D.A.
,
J.A.
Goliger
, and
D.L.
Paul
.
1996
.
Connexins, connexons, and intercellular communication
.
Annu. Rev. Biochem.
65
:
475
502
.
Hudspeth
,
A.J.
, and
A.G.
Yee
.
1973
.
The intercellular junctional complexes of retinal pigment epithelia
.
Invest. Ophthalmol.
12
:
354
365
.
Hutnik
,
C.M.L.
,
C.E.
Pocrnich
,
H.
Liu
,
D.W.
Laird
, and
Q.
Shao
.
2008
.
The protective effect of functional connexin43 channels on a human epithelial cell line exposed to oxidative stress
.
Invest. Ophthalmol. Vis. Sci.
49
:
800
806
.
Ishii
,
M.
, and
B.
Rohrer
.
2017
.
Mechanisms of bystander effects in retinal pigment epithelium cell networks
.
Cell Death Dis.
8
:e3061.
Janssen-Bienhold
,
U.
,
R.
Dermietzel
, and
R.
Weiler
.
1998
.
Distribution of Connexin43 immunoreactivity in the retinas of different vertebrates
.
J. Comp. Neurol.
396
:
310
321
.
Johansson
,
J.K.
,
V.
Karema-Jokinen
,
S.
Hakanen
,
A.
Jylha
,
H.
Uusitalo
,
M.
Vihinen-Ranta
,
H.
Skottman
,
T.O.
Ihalainen
, and
S.
Nymark
.
2019
.
Sodium channels enable fast electrical signaling and regulate phagocytosis in the retinal pigment epithelium
.
BMC Biol.
17
:
63
.
Kapur
,
J.N.
,
P.K.
Sahoo
, and
A.K.C.
Wong
.
1985
.
A new method for gray-level picture thresholding using the entropy of the histogram
.
CVGIP
.
29
:
273
285
.
Korkka
,
I.
,
T.
Viheriälä
,
K.
Juuti-Uusitalo
,
H.
Uusitalo-Järvinen
,
H.
Skottman
,
J.
Hyttinen
, and
S.
Nymark
.
2019
.
Functional voltage-gated calcium channels are present in human embryonic stem cell-derived retinal pigment epithelium
.
Stem Cells Transl. Med
.
8
:
179
193
.
Laird
,
D.W.
2006
.
Life cycle of connexins in health and disease
.
Biochem. J.
394
:
527
543
.
Lee
,
Y.T.
, and
Q.
Wang
.
1999
.
Inhibition of hKv2.1, a major human neuronal voltage-gated K+ channel, by meclofenamic acid
.
Eur. J. Pharmacol
.
378
:
349
356
.
Liu
,
Z.
,
O.P.
Kocaoglu
, and
D.T.
Miller
.
2016
.
3D imaging of retinal pigment epithelial cells in the living human retina
.
Invest. Ophthalmol. Vis. Sci.
57
:
OCT533
.
Ma
,
B.
,
R.
Buckalew
,
Y.
Du
,
C.M.
Kiyoshi
,
C.C.
Alford
,
W.
Wang
,
D.M.
Mctigue
,
J.J.
Enyeart
,
D.
Terman
, and
M.
Zhou
.
2016
.
Gap junction coupling confers isopotentiality on astrocyte syncytium
.
Glia
.
64
:
214
226
.
Malfait
,
M.
,
P.
Gomez
,
T.A.B.
van Veen
,
J.B.
Parys
,
H.
de Smedt
,
J.
Vereecke
, and
B.
Himpens
.
2001
.
Effects of hyperglycemia and protein kinase C on Connexin43 expression in cultured rat retinal pigment epithelial cells
.
J. Membr. Biol.
181
:
31
40
.
Milićević
,
N.
,
O.
Ait-Hmyed Hakkari
,
U.
Bagchi
,
C.
Sandu
,
A.
Jongejan
,
P.D.
Moerland
,
J.B.
ten Brink
,
D.
Hicks
,
A.A.
Bergen
, and
M.P.
Felder-Schmittbuhl
.
2021
.
Core circadian clock genes Per1 and Per2 regulate the rhythm in photoreceptor outer segment phagocytosis
.
FASEB J.
35
:e21722.
Müller
,
C.
,
N.
Más Gómez
,
P.
Ruth
, and
O.
Strauss
.
2014
.
CaV1.3 L-type channels, maxiK Ca2+-dependent K+ channels and bestrophin-1 regulate rhythmic photoreceptor outer segment phagocytosis by retinal pigment epithelial cells
.
Cell Signal
.
26
:
968
978
.
Murphy-Baum
,
B.L.
, and
G.B.
Awatramani
.
2018
.
An old neuron learns new tricks: redefining motion processing in the primate retina
.
Neuron
.
97
:
1205
1207
.
Ning
,
N.
,
Y.
Wen
,
Y.
Li
, and
J.
Li
.
2013
.
Meclofenamic acid blocks the gap junction communication between the retinal pigment epithelial cells
.
Hum. Exp. Toxicol.
32
:
1164
1169
.
Orellana
,
J.A.
2016
.
Physiological functions of Glial cell hemichannels
.
949
:
93
108
.
Pearson
,
R.A.
,
M.
Catsicas
,
D.L.
Becker
,
P.
Bayley
,
N.L.
Lüneborg
, and
P.
Mobbs
.
2004
.
Ca2+ signalling and gap junction coupling within and between pigment epithelium and neural retina in the developing chick
.
Eur. J. Neurosci
.
19
:
2435
2445
.
Pearson
,
R.A.
,
N.
Dale
,
E.
Llaudet
, and
P.
Mobbs
.
2005
.
ATP released via gap junction hemichannels from the pigment epithelium regulates neural retinal progenitor proliferation
.
Neuron
.
46
:
731
744
.
Peretz
,
A.
,
N.
Degani
,
R.
Nachman
,
Y.
Uziyel
,
G.
Gibor
,
D.
Shabat
, and
B.
Attali
.
2005
.
Meclofenamic acid and diclofenac, novel templates of KCNQ2/Q3 potassium channel openers, depress cortical neuron activity and exhibit anticonvulsant properties
.
Mol. Pharmacol.
67
:
1053
1066
.
Pogoda
,
K.
,
P.
Kameritsch
,
M.A.
Retamal
, and
J.L.
Vega
.
2016
.
Regulation of gap junction channels and hemichannels by phosphorylation and redox changes: a revision
.
BMC Cell Biol.
17
:
11
.
Potter
,
J.A.
,
G.W.
Price
,
C.L.
Cliff
,
B.M.
Williams
,
C.E.
Hills
, and
P.E.
Squires
.
2021
.
Carboxyfluorescein dye uptake to measure connexin-mediated hemichannel activity in cultured cells
.
Bio Protoc.
11
:e3901.
Quist
,
A.P.
,
S.K.
Rhee
,
H.
Lin
, and
R.
Lal
.
2000
.
Physiological role of gap-junctional hemichannels: extracellular calcium-dependent isosmotic volume regulation
.
J. Cell Biol.
148
:
1063
1074
.
,
R.
,
E.
Vromans
,
D.C.
Anang
,
I.
Goetschalckx
,
D.
Hoorelbeke
,
E.
Decrock
,
S.
Baatout
,
L.
Leybaert
, and
A.
Aerts
.
2020
.
Connexin43 hemichannel targeting with TAT-Gap19 alleviates radiation-induced endothelial cell damage
.
Front. Pharmacol.
11
:
212
.
Rassi Gabriel
,
L.A.
,
R.
Sachdeva
,
A.
Marcotty
,
E.J.
Rockwood
, and
E.I.
Traboulsi
.
2011
.
Oculodentodigital dysplasia: new ocular findings and a novel connexin 43 mutation
.
Arch. Ophthalmol.
129
:
781
784
.
Raviola
,
E.
, and
N.B.
Gilula
.
1973
.
Gap junctions between photoreceptor cells in the vertebrate retina
.
.
70
:
1677
1681
.
Reichhart
,
N.
, and
O.
Strauss
.
2014
.
Ion channels and transporters of the retinal pigment epithelium
.
Exp. Eye Res.
126
:
27
37
.
Rizzolo
,
L.J.
2014
.
Barrier properties of cultured retinal pigment epithelium
.
Exp. Eye Res.
126
:
16
26
.
Schalper
,
K.A.
,
N.
,
J.A.
Orellana
, and
J.C.
Sáez
.
2008
.
Currently used methods for identification and characterization of hemichannels
.
15
:
207
218
.
Schneider
,
C.A.
,
W.S.
Rasband
, and
K.W.
Eliceiri
.
2012
.
NIH image to ImageJ: 25 years of image analysis
.
Nat. Methods.
9
:
671
675
.
Sparrow
,
J.R.
,
D.
Hicks
, and
C.P.
Hamel
.
2010
.
The retinal pigment epithelium in health and disease
.
Curr. Mol. Med.
10
:
802
823
.
Strauss
,
O.
2005
.
The retinal pigment epithelium in visual function
.
Physiol. Rev.
85
:
845
881
.
Tarzemany
,
R.
,
G.
Jiang
,
J.X.
Jiang
,
H.
Larjava
, and
L.
Häkkinen
.
2017
.
Connexin 43 hemichannels regulate the expression of wound healing-associated genes in human gingival fibroblasts
.
Sci. Rep.
7
:
14157
.
Tibber
,
M.S.
,
D.
Becker
, and
G.
Jeffery
.
2007
.
Levels of transient gap junctions between the retinal pigment epithelium and the neuroblastic retina are influenced by catecholamines and correlate with patterns of cell production
.
J. Comp. Neurol.
503
:
128
134
.
Trenholm
,
S.
, and
G.B.
Awatramani
.
2017
. Dynamic Properties of Electrically Coupled Retinal Networks. In
Network Functions and Plasticity: Perspectives from Studying Neuronal Electrical Coupling in Microcircuits
.
Elsevier
,
New York
. pp.
183
208
.
Vaajasaari
,
H.
,
T.
Ilmarinen
,
K.
Juuti-Uusitalo
,
K.
Rajala
,
N.
Onnela
,
S.
Narkilahti
,
R.
Suuronen
,
J.
Hyttinen
,
H.
Uusitalo
, and
H.
Skottman
.
2011
.
Toward the defined and xeno-free differentiation of functional human pluripotent stem cell-derived retinal pigment epithelial cells
.
Mol. Vis.
17
:
558
575
.
van Campenhout
,
R.
,
A.
Cooreman
,
K.
Leroy
,
O.M.
Rusiecka
,
P.
van Brantegem
,
P.
Annaert
,
S.
Muyldermans
,
N.
Devoogdt
,
B.
Cogliati
,
B.R.
Kwak
, and
M.
Vinken
.
2020
.
Non-canonical roles of connexins
.
Prog. Biophys. Mol. Biol.
153
:
35
41
.
Vasconcellos
,
J.P.C.
,
M.B.
Melo
,
R.B.
Schimiti
,
N.C.
Bressanim
,
F.F.
Costa
, and
V.P.
Costa
.
2005
.
A novel mutation in the GJA1 gene in a family with oculodentodigital dysplasia
.
Arch. Ophthalmol.
123
:
1422
1426
.
Viheriala
,
T.
,
J.
Sorvari
,
T.O.
Ihalainen
,
A.
Sorkio
,
P.
Gronroos
,
S.
Schlie-Wolter
,
B.
Chichkov
,
H.
Skottman
,
S.
Nymark
, and
T.
Ilmarinen
.
2021
.
Culture surface protein coatings affect the barrier properties and calcium signalling of hESC-RPE
.
Sci. Rep.
11
:
933
.
Wimmers
,
S.
,
M.O.
Karl
, and
O.
Strauss
.
2007
.
Ion channels in the RPE
.
Prog. Retin. Eye Res.
26
:
263
301
.
Wollmann
,
G.
,
S.
Lenzner
,
W.
Berger
,
R.
Rosenthal
,
M.O.
Karl
, and
O.
Strauss
.
2006
.
Voltage-dependent ion channels in the mouse RPE: comparison with Norrie disease mice
.
Vis. Res.
46
:
688
698
.
Xu
,
G.
,
W.E.I.
Wang
,
H.K.
Kimelberg
, and
M.I.N.
Zhou
.
2010
.
Electrical coupling of astrocytes in rat hippocampal slices under physiological and simulated ischemic conditions
.
Glia
.
58
:
481
493
.
Zhang
,
Y.W.
,
I.
Morita
,
M.
Ikeda
,
K.W.
Ma
, and
S.
Murota
.
2001
.
Connexin43 suppresses proliferation of osteosarcoma U2OS cells through post-transcriptional regulation of p27
.
Oncogene
.
20
:
4138
4149
.


text:
This is part two of our multipart series exploring Action Text, In part 1, we looked at basic of how we can get started with providing WYSIWYG support in our Apps using ActionText.

This blog post will deal with file attachments in Action Text.

#### Quick setup

We have discussed setup steps in Part 1. Here we will just list a set of commands to setup a new rails app and enable Action Text which one can execute so as to follow along this post.

Create a new rails app:

Switch to app directory:

Create database:

Enable support for action_text:

Update models and controller files for post:

Update the post form to edit content:

Update post show view to render content:

We can test the setup by opening the following URL in our browser.

Add/Uncomment image processing gem. We can skip this if we don’t want to resize images when displaying the rich text.

We can now perform CRUD on post.

Click on New post or go to http://localhost:3000/posts/new. We should see the Trix editor rendered.

Now let’s create a file app/javascript/trix-editor-overrides.js and import it in app/javascript/packs/application.js as shown below.

### Control which file can be attached in Trix editor

The default setup of Action Text allows attaching any kind of file. We can test it out. Try attaching a zip file to a new post. Due to business, performance or security reason, this may not be desirable behaviour. Let’s see how can we gain more control.

#### Trix event trix-file-accept

Trix fire events for every action that can be performed in trix. One of the event is trix-file-accept. This event is fired before a file gets attached in Trix. If we call preventDefault() on this event then the file attachment/upload would not happen and Trix would ignore the file.

#### Blacklist all file attachments:

Change the trix-editor-overrides.js as shown below.

Reload the http://localhost:3000/posts/new page and try attaching any file we should get an alert and the file wont get attached.

Failed to attach any file.

We can use a File object’s properties in combination with trix-file-accept event to fine tune which files we want to upload and which we want to reject. Let’s see few examples.

#### Only whitelist certain files based type:

Change the trix-editor-overrides.js as shown below. This will only allow upload of jpeg and png file types. Every other file type will be discarded with an alert.

Failed to attach files which are not jped or png.

#### Only whitelist certain files based size:

Change the trix-editor-overrides.js as shown below.
This will prevent upload of any file which is more then 1MB in size.

If we reload and try attaching a file > 1MB, we will get alert but any file under 1MB will get attached properly.

Failed to attach file with size > 1MB

### Understanding _blob.html.erb

Located under app/views/active_storage/blobs/, this partial is auto created by Rails when were run the rails action_text:install script.

This gets called for every attachment that is part of the Action Text content we try to render and is responsible for how a attachment is rendered.

In our blog app create a new post with 2 attachments and save the post.

Show page with 2 image attachments using the default _blob.html.erb

Now, lets replace all the content of app/views/active_storage/blobs/_blob.html.erb with the following

Reload the show page of the latest post.

Show page of the latest post. Every instance of attachment is replaced with their hello world

A variable named blob which is a ActiveStorage::Blob object is always passed to this partial. This blob object is how we can access all the properties of the attached file.

For Example; if we replace the content of app/views/active_storage/blobs/_blob.html.erb with the following

Reload the show page of the latest post.

Show page of the latest post. Every instance of attachment is replaced with their file name.

Now let’s try and understand the default _blob.html.erb that Rails generates.

Let’s break this code down to understand it further.

The above line checks if attachment blob is of type image or can be converted and previewed as image. If yes, then it will fetch the image representation of specific size and display it. By default the statement blob.representable? will return true for images and false for any other media type.

This block is pretty straight forward. If we had specified caption for attachment during upload then it will display caption along with the attachment, else it will display the attachment filename and byte size.

Let’s see this code in action by trying to PDFs and Videos

#### Image preview for PDF.

According to Rails guide,

Extracting previews requires third-party applications, FFmpeg for video and muPDF for PDFs, and on macOS also XQuartz and Poppler. These libraries are not provided by Rails. You must install them yourself to use the built-in previewers. Before you install and use the third-party software, make sure you understand the licensing implications of doing so.

Let create a new post with PDF attachment without installing third-party support software.

Creating new post with PDF attachment

Below is how Active Text content is rendered.

Viewing the newly created post. We cannot see any preview of the attached PDF as the 3rd party library needed to generate the preview is missing.

Now let’s install the software. For mac that would be Poppler. We are going to use Homebrew for that.

Restart the rails server after the 3rd part library is installed.

Let’s reload the show page for the above post. Now we should see a preview of the attachment.

Reloading the after installing poppler. We can now see the preview of the 1st page of the attached PDF.

We can add support for previewing all kinds of attachment with the help of Active Storage Previewers.