semvec/pypi-packages huggingface dataset:
RGAST 0.0.2
Relational Graph Attention Network for Spatial Transcriptome Analysis
License: MIT
Keywords: spatial transcriptomic, RGAT, representation learning, spatial domain identification

# RGAST

RGAST: Relational Graph Attention Network for Spatial Transcriptome Analysis [[paper]](https://doi.org/10.1101/2024.08.09.607420)

This document will help you easily go through the RGAST model.

![fig1_00](https://github.com/GYQ-form/RGAST/assets/79566479/fe0655dc-2318-44e0-92bf-0aea3aad7163)

## Installation

To install our package, run

```bash
pip install RGAST
```

You can also clone the repo and install it in editable mode:

```bash
git clone https://github.com/GYQ-form/RGAST.git
cd RGAST
pip install -e .
```

## Usage

RGAST (Relational Graph Attention network for Spatial Transcriptome analysis) constructs a relational graph attention network to learn the representation of each spot in the spatial transcriptome data. Plus the attention mechanism, RGAST considers both gene expression similarity and spatial neighbor relationships in constructing the graph network, enabling a more comprehensive and flexible representation of the spatial transcriptome data. RGAST can be used in many ST analysis:

- spatial domain identification
- cell trajectory inference
- spatially variable gene (SVG) detection
- uncover spatially resolved cell-cell interactions
- reveal intricate 3D spatial patterns across multiple sections of ST data

## Tutorial

We have prepared several basic tutorials  in https://github.com/GYQ-form/RGAST/tree/main/tutorial. You can quickly hands on RGAST by going through these tutorials. Model parameters trained in our study are also released in https://github.com/GYQ-form/RGAST/tree/main/model_path.
fast-kepler 0.5.1
kepler equation solver in c for python
License: MIT
Requires Python: >=3.6

# fast_kepler

A c implementation for solving kepler's equation in c. Made for astroemperor, put in a different library for public use.

## Dependencies

This code makes use of:
  - numpy
  - cython

## Installation

In the console type in your work folder
```sh
pip install fast_kepler
```

## Usage

Solution to Kepler's equation. Given mean anomaly, M, and eccentricity, e,
solve for E, the eccentric anomaly, which must satisfy:

$$E - e sin(E) - M = 0$$

For a given eccentricity, and an M array, we use:

```python
import fast_kepler
M = np.sort(np.random.uniform(0, 100, size=100))
ecc = 0.11
E = fast_kepler.kepler_array(M, ecc)
```


## More on usage
We can calculate RVs:

```python
# time array of our observations
x = np.sort(np.random.uniform(0, 100, size=100))
# keplerian parameters
period = 4.1  # in days
semi_amplitude = 55  # in m/s
M0 = np.pi/3  # in rad
ecc = 0.23  # from 0 to 1
om = 3*np.pi/5  # in rad

theta = [period, semi_amplitude, M0, ecc, om]

def calc_RV(theta):
  per, K, M0, ecc, om = theta

  freq = 2. * np.pi / per
  M = freq * x + M0
  E = fast_kepler.kepler_array(M, ecc)

  f = np.arctan(((1. + ecc)/(1. - ecc)) ** 0.5 * np.tan(E / 2.)) * 2.
  
  return K * (np.cos(f + om) + ecc * np.cos(om))

# or simply:

def get_RV(theta):
  per, K, M0, ecc, om = theta
  return fast_kepler.calc_rv0(x, per, K, M0, ecc, om)
```

## Additional Options

You can also use a different parameterization to retrieve RVs, with time of periastron passage $T_p$ instead of the mean anomaly $M_0$:

```python
fast_kepler.calc_rv1(x, per, A, tp, ecc, w)
```