$ nohup monkeytype run fig2/model1/fig2_pancreas_data.py > output/monkeytype_fig2_pancreas_data.log 2>&1 &
$ find ../../pyrovelocity/ -name '*.py' | xargs wc -l
10 ../../pyrovelocity/__init__.py
11 ../../pyrovelocity/pyrovelocity.py
242 ../../pyrovelocity/api.py
313 ../../pyrovelocity/_velocity.py
371 ../../pyrovelocity/_trainer.py
388 ../../pyrovelocity/utils.py
395 ../../pyrovelocity/data.py
517 ../../pyrovelocity/_velocity_module.py
1131 ../../pyrovelocity/cytotrace.py
1616 ../../pyrovelocity/_velocity_guide.py
1955 ../../pyrovelocity/plot.py
3314 ../../pyrovelocity/_velocity_model.py
10263 total
##################
$ monkeytype list-modules
pyrovelocity.api
pyrovelocity._velocity
pyrovelocity._trainer
pyrovelocity.utils
pyrovelocity.data
pyrovelocity._velocity_module
pyrovelocity.cytotrace
pyrovelocity.plot
pyrovelocity._velocity_model
##################
$ monkeytype stub pyrovelocity.api
from anndata._core.anndata import AnnData
from numpy import ndarray
from pyrovelocity._velocity import PyroVelocity
from typing import (
Dict,
Optional,
Tuple,
)
def train_model(
adata: AnnData,
guide_type: str = ...,
model_type: str = ...,
svi_train: bool = ...,
batch_size: int = ...,
train_size: float = ...,
use_gpu: int = ...,
likelihood: str = ...,
num_samples: int = ...,
log_every: int = ...,
cell_state: str = ...,
patient_improve: float = ...,
patient_init: int = ...,
seed: int = ...,
lr: float = ...,
max_epochs: int = ...,
include_prior: bool = ...,
library_size: bool = ...,
offset: bool = ...,
input_type: str = ...,
cell_specific_kinetics: None = ...,
kinetics_num: int = ...
) -> Tuple[PyroVelocity, Dict[str, ndarray]]: ...
##################
$ monkeytype stub pyrovelocity._velocity
from anndata._core.anndata import AnnData
from numpy import ndarray
from typing import (
Dict,
Optional,
Sequence,
Union,
)
class PyroVelocity:
def __init__(
self,
adata: AnnData,
input_type: str = ...,
shared_time: bool = ...,
model_type: str = ...,
guide_type: str = ...,
likelihood: str = ...,
t_scale_on: bool = ...,
plate_size: int = ...,
latent_factor: str = ...,
latent_factor_operation: str = ...,
inducing_point_size: int = ...,
latent_factor_size: int = ...,
include_prior: bool = ...,
use_gpu: int = ...,
init: bool = ...,
num_aux_cells: int = ...,
only_cell_times: bool = ...,
decoder_on: bool = ...,
add_offset: bool = ...,
correct_library_size: Union[bool, str] = ...,
cell_specific_kinetics: Optional[str] = ...,
kinetics_num: Optional[int] = ...
) -> None: ...
def posterior_samples(
self,
adata: Optional[AnnData] = ...,
indices: Optional[Sequence[int]] = ...,
batch_size: Optional[int] = ...,
num_samples: int = ...
) -> Dict[str, ndarray]: ...
def save(self, dir_path: str, overwrite: bool = ..., save_anndata: bool = ..., **anndata_write_kwargs) -> None: ...
#####################
$ monkeytype stub pyrovelocity._trainer
from pyro.optim.optim import PyroOptim
from typing import (
Any,
Callable,
Dict,
List,
Optional,
Union,
)
def VelocityClippedAdam(optim_args: Dict[str, float]) -> PyroOptim: ...
class VelocityAdam:
def step(self, closure: Optional[Callable] = ...) -> Optional[Any]: ...
class VelocityTrainingMixin:
def train_faster(
self,
use_gpu: Optional[Union[str, int, bool]] = ...,
seed: int = ...,
lr: float = ...,
max_epochs: int = ...,
log_every: int = ...,
patient_init: int = ...,
patient_improve: float = ...
) -> List[float]: ...
(pyrovelocity-dev) [crs58@ml008 figures]$ monkeytype stub pyrovelocity.api
from anndata._core.anndata import AnnData
from numpy import ndarray
from pyrovelocity._velocity import PyroVelocity
from typing import (
Dict,
Optional,
Tuple,
)
def train_model(
adata: AnnData,
guide_type: str = ...,
model_type: str = ...,
svi_train: bool = ...,
batch_size: int = ...,
train_size: float = ...,
use_gpu: int = ...,
likelihood: str = ...,
num_samples: int = ...,
log_every: int = ...,
cell_state: str = ...,
patient_improve: float = ...,
patient_init: int = ...,
seed: int = ...,
lr: float = ...,
max_epochs: int = ...,
include_prior: bool = ...,
library_size: bool = ...,
offset: bool = ...,
input_type: str = ...,
cell_specific_kinetics: None = ...,
kinetics_num: int = ...
) -> Tuple[PyroVelocity, Dict[str, ndarray]]: ...
####################
$ monkeytype stub pyrovelocity.utils
from torch import Tensor
from typing import Tuple
def inv(x: Tensor) -> Tensor: ...
def mRNA(
tau: Tensor,
u0: Tensor,
s0: Tensor,
alpha: Tensor,
beta: Tensor,
gamma: Tensor
) -> Tuple[Tensor, Tensor]: ...
#####################
$ monkeytype stub pyrovelocity.data
from anndata._core.anndata import AnnData
from typing import (
List,
Optional,
)
def load_data(
data: str = ...,
top_n: int = ...,
min_shared_counts: int = ...,
eps: float = ...,
force: bool = ...
) -> AnnData: ...
def setup_anndata_multilayers(
adata: AnnData,
batch_key: Optional[str] = ...,
labels_key: Optional[str] = ...,
layer: Optional[str] = ...,
protein_expression_obsm_key: Optional[str] = ...,
protein_names_uns_key: Optional[str] = ...,
categorical_covariate_keys: Optional[List[str]] = ...,
continuous_covariate_keys: Optional[List[str]] = ...,
copy: bool = ...,
input_type: str = ...,
n_aux_cells: int = ...,
cluster: str = ...
) -> Optional[AnnData]: ...
#################
$ monkeytype stub pyrovelocity._velocity_module
from pyro.infer.autoguide.guides import AutoGuideList
from pyrovelocity._velocity_model import VelocityModelAuto
from typing import (
Optional,
Union,
)
class VelocityModule:
def __init__(
self,
num_cells: int,
num_genes: int,
model_type: str = ...,
guide_type: str = ...,
likelihood: str = ...,
shared_time: bool = ...,
t_scale_on: bool = ...,
plate_size: int = ...,
latent_factor: str = ...,
latent_factor_operation: str = ...,
latent_factor_size: int = ...,
inducing_point_size: int = ...,
include_prior: bool = ...,
use_gpu: int = ...,
num_aux_cells: int = ...,
only_cell_times: bool = ...,
decoder_on: bool = ...,
add_offset: bool = ...,
correct_library_size: Union[bool, str] = ...,
cell_specific_kinetics: Optional[str] = ...,
kinetics_num: Optional[int] = ...,
**initial_values
) -> None: ...
@property
def guide(self) -> AutoGuideList: ...
@property
def model(self) -> VelocityModelAuto: ...
####################
$ monkeytype stub pyrovelocity.cytotrace
from numpy import ndarray
def compute_similarity2(O: ndarray, P: ndarray) -> ndarray: ...
#####################
$ monkeytype stub pyrovelocity.plot
2 traces failed to decode; use -v for details
from anndata._core.anndata import AnnData
from matplotlib.figure import Figure
from numpy import ndarray
from pandas.core.indexes.base import Index
from typing import (
Dict,
List,
Tuple,
)
def mae_per_gene(pred_counts: ndarray, true_counts: ndarray) -> ndarray: ...
def us_rainbowplot(
genes: Index,
adata: AnnData,
pos: Dict[str, ndarray],
data: List[str] = ...,
cell_state: str = ...
) -> Figure: ...
def vector_field_uncertainty(
adata: AnnData,
pos: Dict[str, ndarray],
basis: str = ...,
n_jobs: int = ...,
denoised: bool = ...
) -> Tuple[ndarray, ndarray, ndarray]: ...
#########################
$ monkeytype stub pyrovelocity._velocity_model
from pyro.distributions.torch import Poisson
from pyro.primitives import plate
from torch import Tensor
from typing import (
Any,
Dict,
Optional,
Tuple,
Union,
)
class LogNormalModel:
def __init__(self, num_cells: int, num_genes: int, likelihood: str = ..., plate_size: int = ...) -> None: ...
@staticmethod
def _get_fn_args_from_batch(
tensor_dict: Dict[str, Tensor]
) -> Tuple[Tuple[Tensor, Tensor, Tensor, Tensor, Tensor, Tensor, Tensor, Tensor, Tensor, None, None], Dict[Any, Any]]: ...
def create_plates(
self,
u_obs: Optional[Tensor] = ...,
s_obs: Optional[Tensor] = ...,
u_log_library: Optional[Tensor] = ...,
s_log_library: Optional[Tensor] = ...,
u_log_library_loc: Optional[Tensor] = ...,
s_log_library_loc: Optional[Tensor] = ...,
u_log_library_scale: Optional[Tensor] = ...,
s_log_library_scale: Optional[Tensor] = ...,
ind_x: Optional[Tensor] = ...,
cell_state: Optional[Tensor] = ...,
time_info: Optional[Tensor] = ...
) -> Tuple[plate, plate]: ...
def get_likelihood(
self,
ut: Tensor,
st: Tensor,
u_log_library: Optional[Tensor] = ...,
s_log_library: Optional[Tensor] = ...,
u_scale: Optional[Tensor] = ...,
s_scale: Optional[Tensor] = ...,
u_read_depth: Optional[Tensor] = ...,
s_read_depth: Optional[Tensor] = ...,
u_cell_size_coef: None = ...,
ut_coef: None = ...,
s_cell_size_coef: None = ...,
st_coef: None = ...
) -> Tuple[pyro.distributions.Poisson, pyro.distributions.Poisson]: ...
class VelocityModel:
def __init__(
self,
num_cells: int,
num_genes: int,
likelihood: str = ...,
shared_time: bool = ...,
t_scale_on: bool = ...,
plate_size: int = ...,
latent_factor: str = ...,
latent_factor_size: int = ...,
latent_factor_operation: str = ...,
include_prior: bool = ...,
num_aux_cells: int = ...,
only_cell_times: bool = ...,
decoder_on: bool = ...,
add_offset: bool = ...,
correct_library_size: Union[bool, str] = ...,
guide_type: bool = ...,
cell_specific_kinetics: Optional[str] = ...,
kinetics_num: Optional[int] = ...,
**initial_values
) -> None: ...
class VelocityModelAuto:
def __init__(self, *args, **kwargs) -> None: ...
def forward(
self,
u_obs: Optional[Tensor] = ...,
s_obs: Optional[Tensor] = ...,
u_log_library: Optional[Tensor] = ...,
s_log_library: Optional[Tensor] = ...,
u_log_library_loc: Optional[Tensor] = ...,
s_log_library_loc: Optional[Tensor] = ...,
u_log_library_scale: Optional[Tensor] = ...,
s_log_library_scale: Optional[Tensor] = ...,
ind_x: Optional[Tensor] = ...,
cell_state: Optional[Tensor] = ...,
time_info: Optional[Tensor] = ...
) -> Tuple[Tensor, Tensor]: ...
def get_rna(
self,
u_scale: Tensor,
s_scale: Tensor,
alpha: Tensor,
beta: Tensor,
gamma: Tensor,
t: Tensor,
u0: Tensor,
s0: Tensor,
t0: Tensor,
switching: Optional[Tensor] = ...,
u_inf: Optional[Tensor] = ...,
s_inf: Optional[Tensor] = ...
) -> Tuple[Tensor, Tensor]: ...