Saravanan666/pypi-org huggingface dataset:
Package: cellseg-gsontools
cellseg_gsontoolsTools for feature extraction in cell and tissue segmentation maps.Checkout thedocumentationfor tutorials.IntroductionCellseg_gsontoolsis a Python toolset designed to analyze and summarize large cell and tissue segmentation maps created from Whole Slide Images (WSI). The library is built on top ofgeopandasandlibpysal. In other words, the library can processgeospatialdata withGeoJSON-interface.NOTE: The library is synergetic with thecellseg_models.pytorchsegmentation library which enables you to segment your WSI intoGeoJSONformat.Installationpipinstallcellseg-gsontoolsCitation@misc{cellseg_gsontools2023,title={{cellseg_gsontools}: Tools for feature extraction in cell and tissue segmentation maps.},author={Oskari Lehtonen},howpublished={\url{https://github.com/okunator/cellseg_gsontools}},doi={https://zenodo.org/doi/10.5281/zenodo.10617987},year={2023}}ContributeAny suggestions, feature requests, or bug reports are welcome! Please open a new issue on GitHub for those. If you want to contribute to the codebase, please open a pull request.LicenceThis project is distributed underMIT LicenseIf you find this library useful in your project, it is your responsibility to ensure you comply with the conditions of any dependent licenses. Please create an issue if you think something is missing regarding the licenses.
Package: cellshape-cloud
Cellshape-cloud is an easy-to-use tool to analyse the shapes of cells using deep learning and, in particular, graph-neural networks. The tool provides the ability to train popular graph-based autoencoders on point cloud data of 2D and 3D single cell masks as well as providing pre-trained networks for inference.To installpipinstallcellshape-cloudUsageBasic Usageimporttorchfromcellshape_cloudimportCloudAutoEncodermodel=CloudAutoEncoder(num_features=128,k=20,encoder_type="dgcnn",decoder_type="foldingnet")points=torch.randn(1,2048,3)recon,features=model(points)To train an autoencoder on a set of point clouds created using cellshape-helper:importtorchfromtorch.utils.dataimportDataLoaderimportcellshape_cloudascloudfromcellshape_cloud.vendor.chamfer_distanceimportChamferLossinput_dir="path/to/pointcloud/files/"batch_size=16learning_rate=0.0001num_epochs=1output_dir="path/to/save/output/"model=cloud.CloudAutoEncoder(num_features=128,k=20,encoder_type="dgcnn",decoder_type="foldingnet")dataset=cloud.PointCloudDataset(input_dir)dataloader=DataLoader(dataset,batch_size=batch_size,shuffle=True)criterion=ChamferLoss()optimizer=torch.optim.Adam(model.parameters(),lr=learning_rate*16/batch_size,betas=(0.9,0.999),weight_decay=1e-6,)cloud.train(model,dataloader,num_epochs,criterion,optimizer,output_dir)Parametersnum_features: int.The size of the latent space of the autoencoder.k: int.The number of neightbours to use in the k-nearest-neighbours graph construction.encoder_type: str.The type of encoder: 'foldingnet' or 'dgcnn'decoder_type: str.The type of decoder: 'foldingnet' or 'dgcnn'References[1] An Tao, 'Unsupervised Point Cloud Reconstruction for Classific Feature Learning',GitHub Repo, 2020
Package: cellshape-cluster
Cellshape-cluster is an easy-to-use tool to analyse the cluster cells by their shape using deep learning and, in particular, deep-embedded-clustering. The tool provides the ability to train popular graph-based or convolutional autoencoders on point cloud or voxel data of 3D single cell masks as well as providing pre-trained networks for inference.To installpipinstallcellshape-clusterUsageBasic usage:importtorchfromcellshape_cloudimportCloudAutoEncoderfromcellshape_clusterimportDeepEmbeddedClusteringautoencoder=CloudAutoEncoder(num_features=128,k=20,encoder_type="dgcnn")model=DeepEmbeddedClustering(autoencoder=autoencoder,num_clusters=10,alpha=1.0)points=torch.randn(1,2048,3)recon,features,clusters=model(points)To load a trained graph-based autoencoder and perform deep embedded clustering:importtorchfromtorch.utils.dataimportDataLoaderimportcellshape_cloudascloudimportcellshape_clusterasclusterfromcellshape_cloud.vendor.chamfer_distanceimportChamferDistancedataset_dir="path/to/pointcloud/dataset/"autoencoder_model="path/to/autoencoder/model.pt"num_features=128k=20encoder_type="dgcnn"num_clusters=10num_epochs=1learning_rate=0.00001gamma=1divergence_tolerance=0.01output_dir="path/to/output/"autoencoder=CloudAutoEncoder(num_features=128,k=20,encoder_type="dgcnn")checkpoint=torch.load(autoencoder_model)autoencoder.load_state_dict(checkpoint['model_state_dict']model=DeepEmbeddedClustering(autoencoder=autoencoder,num_clusters=10,alpha=1.0)dataset=cloud.PointCloudDataset(dataset_dir)dataloader=DataLoader(dataset,batch_size=batch_size,shuffle=False)# it is very important that shuffle=False here!dataloader_inf=DataLoader(dataset,batch_size=1,shuffle=False)# it is very important that batch_size=1 and shuffle=False here!optimizer=torch.optim.Adam(model.parameters(),lr=learning_rate*16/batch_size,betas=(0.9,0.999),weight_decay=1e-6,)reconstruction_criterion=ChamferDistance()cluster_criterion=nn.KLDivLoss(reduction="sum")train(model,dataloader,dataloader_inf,num_epochs,optimizer,reconstruction_criterion,cluster_criterion,update_interval,gamma,divergence_tolerance,output_dir)Parametersautoencoder: CloudAutoEncoder or VoxelAutoEncoder.Instance of autoencoder class from cellshape-cloud or cellshape-voxelnum_clusters: int.The number of clusters to use in deep embedded clustering algorithm.alpha: float.Degrees of freedom for the Student's t-distribution. Xie et al. (ICML, 2016) let alpha=1 for all experiments.
Package: cellshape-helper
Cellshape-helper provides the ability to convert 3D masks to point clouds.To installpipinstallcellshape-helperBasic Usageimportcellshape_helperashelperPATH_TO_TIF_FILES="path/to/tif/files/"PATH_TO_SAVE_MESH="path/to/save/mesh/files/"PATH_TO_SAVE_PC="path/to/save/pointcloud/files/"NUM_POINTS=2048helper.tif_to_pc_directory(PATH_TO_TIF_FILES,PATH_TO_SAVE_MESH,PATH_TO_SAVE_PC,NUM_POINTS)ParametersPATH_TO_TIF_FILES: str.The path to you binary masks of cells or nuclei.PATH_TO_SAVE_MESH: str.The path where you want to save the mesh objects to.PATH_TO_SAVE_PC: str.The path where you want to save your point clouds to.NUM_POINTS: str.The number of points to sample from the mesh object when creating a point cloud.
Package: cellshape-voxel
Cellshape-voxel is an easy-to-use tool to analyse the shapes of cells using deep learning and, in particular, 3D convolutional neural networks. The tool provides the ability to train 3D convolutional autoencoders on 3D single cell masks as well as providing pre-trained networks for inference.To installpipinstallcellshape-voxelUsageBasic usageimporttorchfromcellshape_voxelimportVoxelAutoEncoderfromcellshape_voxel.encoders.resnetimportBottleneckmodel=VoxelAutoEncoder(num_layers_encoder=3,num_layers_decoder=3,encoder_type="resnet",input_shape=(64,64,64,1),filters=(32,64,128,256,512),num_features=50,bias=True,activations=False,batch_norm=True,leaky=True,neg_slope=0.01,resnet_depth=10,resnet_block_inplanes=(64,128,256,512),resnet_block=Bottleneck,n_input_channels=1,no_max_pool=True,resnet_shortcut_type="B",resnet_widen_factor=1.0)volume=torch.randn(1,64,64,64,1)recon,features=model(volume)To train a 3D resnet autoencoder on masks of cells or nuclei:importtorchfromtorch.utils.dataimportDataLoaderimportcellshape_voxelasvoxelinput_dir="path/to/binary/mask/files/"batch_size=16learning_rate=0.0001num_epochs=1output_dir="path/to/save/output/"model=voxel.AutoEncoder(num_layers_encoder=4,num_layers_decoder=4,input_shape=(64,64,64,1),encoder_type="resnet",)dataset=voxel.VoxelDataset(PATH_TO_DATASET,transform=None,img_size=(300,300,300))dataloader=voxel.DataLoader(dataset,batch_size=batch_size,shuffle=True)optimizer=torch.optim.Adam(model.parameters(),lr=learning_rate*16/batch_size,betas=(0.9,0.999),weight_decay=1e-6,)voxel.train(model,dataloader,1,optimizer,output_dir)Parametersnum_features: int.The size of the latent space of the autoencoder. If you have rectangular images, make sure your image size is the maximum of the width and heightk: int.The number of neightbours to use in the k-nearest-neighbours graph construction.encoder_type: int.The type of encoder: 'foldingnet' or 'dgcnn'decoder_type: int.The type of decoder: 'foldingnet' or 'dgcnn'For developersFork the repositoryClone your forkgitclonehttps://github.com/USERNAME/cellshape-voxelInstall an editable version (-e) with the development requirements (dev)cdcellshape-voxel
pipinstall-e.[dev]To install pre-commit hooks to ensure formatting is correct:pre-commitinstallTo release a new version:Firstly, update the version with bump2version (bump2version patch,bump2version minororbump2version major). This will increment the
package version (to a release candidate - e.g.0.0.1rc0) and tag the
commit. Push this tag to GitHub to run the deployment workflow:gitpush--follow-tagsOnce the release candidate has been tested, the release version can be created with:bump2versionrelease
Package: cellsystem
An agent-based framework for the simulation of biological cell systems.This was created to simulate cancer growth, taking into account nutrients and cell migration while allowing to track mutations, cell division and cell position history to study tumour phylogeny reconstruction algorithms.InstallationYou can install it from PyPI:$ pip install cellsystemExampleA use case integrated in the repository:>>>fromcellsystemimport*# The cell system will simulate cell growth# while tracking the steps in that process.>>>system=CellSystem(grid_shape=(100,100))# Initialize the first cell# in the middle of the grid>>>system.seed()Newcell0added@(50,50)# Take 35 steps forward in time>>>system.run(steps=30)Cellno.0mutating@site(50,50)(fatherNone)Initialmutations:[]Initialgenome:AAAAAAAAAAFinalmutations:[(4,'G')]Finalgenome:AAAAGAAAAACellno.0dividing@(50,50)Newcells:1@(49,50)and2@(50,51)Cellno.2dividing@(50,51)Newcells:3@(51,52)and4@(51,52)Cellno.4mutating@site(51,52)(father2)Initialmutations:[(4,'G')]Initialgenome:AAAAGAAAAAFinalmutations:[(4,'G'),(7,'A')]Finalgenome:AAAAGAAAAACellno.1death@site(49,50)(fatherNone)Cellno.3death@site(51,52)(father2)Cellno.4mutating@site(51,52)(father2)Initialmutations:[(4,'G'),(7,'A')]Initialgenome:AAAAGAAAAAFinalmutations:[(4,'G'),(7,'A'),(2,'T')]Finalgenome:AATAGAAAAACellno.4migratingfromsite(51,52)(father2)Newsite:(50,52).........# Prepare to explore the simulation logs>>>history=system['log']# First, let's see the cells' evolution in time and space!>>>history.worldlines().show()# Remove the cells that died somewhere along the way>>>history.worldlines(prune_death=True).show()>>>tree_style={'show_leaf_name':True,...'mode':'c',# Circular...'arc_start':-135,# Degrees...'arc_span':270}# Degrees also# Lookup the tree formed by cellular division>>>history.ancestry().show(styling=tree_style)# Now, remove cells that are no longer alive>>>history.ancestry(prune_death=True).show(styling=tree_style)# Now, check out the tree formed by the mutations>>>history.mutations().show(styling=tree_style)# Remove genomes with no living representatives.>>>history.mutations(prune_death=True).show(styling=tree_style)Almost every aspect of the simulation is customizable. You can add several types of different interacting cell lines,
also, worlds with different geometry and with diffusion, cells with other characteristics that can be logged,
other kinds of logs. Change the rate of death, movement, etc of each cell and even add new cell behaviors!For now the documentation for doing so is scattered through the class documentation strings, but a good place to start is
by watching the source of thecellsystem.CellSystemclass.MetaAuthor:Ad115-Github–a.garcia230395@gmail.comDistributed under the MIT license. SeeLICENSEfor more information.ContributingCheck for open issues or open a fresh issue to start a discussion around a feature idea or a bug.Forkthe repositoryon GitHub to start making your changes to a feature branch, derived from themasterbranch.Write a test which shows that the bug was fixed or that the feature works as expected.Send a pull request and bug the maintainer until it gets merged and published.
Package: celltest
Convert notebook cells to unittestsFree software: MIT licenseInstallationpip install celltestYou can also install the in-development version with:pip install https://github.com/NikZak/celltest/archive/master.zipUsageFrom command linecelltest [-h] -f FILES [FILES ...] [-c CALLBACKS [CALLBACKS ...]] [-nio] [-o [OUTPUT]] [-st [STANDARD_TEMPLATE]] [-ct [CUSTOM_TEMPLATE]] [-hf [HEADER]] [-v]Optional arguments:-h, --help            show help message and exit

-f FILES [FILES ...], --files FILES [FILES ...]
                      <Required> notebook file(s) to convert

-c CALLBACKS [CALLBACKS ...], --callbacks CALLBACKS [CALLBACKS ...]
                      callbacks to call after the test file creation (e.g. isort, black, yapf)

-nio, --not_insert_outputs
                      do not insert cell ouputs in the test file (then outputs are read from notebook during testing)

-o [OUTPUT], --output [OUTPUT]
                      output file. Defaults to test_[notebook name].py

-st [STANDARD_TEMPLATE], --standard_template [STANDARD_TEMPLATE]
                      standard template file: 1: default template 2: minimalistic template without checking outputs

-ct [CUSTOM_TEMPLATE], --custom_template [CUSTOM_TEMPLATE]
                      custom template file

-hf [HEADER], --header [HEADER]
                      header file. Header to insert in every test file

-v, --verbose         increase output verbosityFrom notebook cell# CT: ignore
# convert current notebook to unittest
from celltest.cells import CellConvert
CellConvert(callbacks=['isort', 'black', 'yapf']).run()Accepted parameters to control test flow:'comment', 'setup', 'ignore_outputs', 'ignore_stderr', 'ignore_stdout', 'ignore', 'ignore_display_data', 'run_all_till_now'Parameters can be either specified in first line (after the % magic) of the notebook cells (e.g.):# CT: ignore_outputs comment "Test ABC method"or written in cell metadata:{ "celltest :
    ["ignore_outputs", "comment", "Test ABC method"]
}In case of conflicts line parameters are prioritisedAccepted callbacks (if installed) to prettify the .py test file:isort, black, yapfDocumentationhttps://celltest.readthedocs.io/DevelopmentTo run all the tests run:toxNote, to combine the coverage data from all the tox environments run:Windowsset PYTEST_ADDOPTS=--cov-append
toxOtherPYTEST_ADDOPTS=--cov-append toxChangelog0.0.0 (2020-09-09)First release on PyPI.
Package: celltk2
CellTK2Toolkit for analysis of live-cell microscopy dataInstallationThe easiest installation method is via pip:pip install celltk2To installBayesianTrackertracking method:pip install celltk2[btrack]Note: If you are using a Mac with Apple silicon processor, you may run into some issues with this installation. Your best bet may be to try to use conda to install cvxopt before doing the pip install above.To installgraph-basedtracking method:pip install celltk2[kit]If you run into any problems, please open an issue.UsageMore details on getting started coming soon. In the meantime, please see the documentation below.Documentationhttps://celltk.readthedocs.io/en/latest/CreditsThis would not be possible without the original CellTK:https://github.com/braysia/CellTK
Package: celltometry
CellTOMetry: single-Cell Topologically Optimized GeometryCellTOMetry is a python library to
orchestrate topological single-cell data analysis. It is centered aroundTopOMetryandscanpy.Installation and dependenciesCellTOMetry requiresscanpyandTopOMetry. After installing both,
install celltometry with:pip3 install celltometryUsing CellTOMetry with scanpyThis is a quick-start. For further instructions, checkTopOMetry documentation.First, we load libraries and some data to work with:import scanpy as sc
import topo as tp
import celltometry as ct

# Load the PBMC3k dataset
adata = sc.datasets.pbmc3k()Next, we perform the default preprocessing workflow with scanpy: libraries are size-normalized,
log-transformed for variance stabilization, and subset to highly variable genes.# Normalize and find highly variable genes
adata = ct.preprocess(adata)Then, we proceed to the default scanpy workflow. It corresponds to:Scaling data (optional, changes adata.X) - ``Performing PCALearning a neighborhood graphLearn an UMAP projection with this graphCluster this graph with the Leiden community detection algorithmSimilar to preprocessing, we wrap it
with an one-liner:adata = ct.default_workflow(adata, scale=True)To run the topological workflow, create aTopOGraphobjecttgand use it to learn and add information toAnnData:adata = ct.topological_workflow(adata, tg)For further instructions, please checkTopOMetry documentation.
Package: cell-toolbar
cell_toolbarA JupyterLab extension that gives each cell a toolbar with functions to hide/show code, run code, etc.RequirementsJupyterLab >= 4.0.0InstallTo install the extension, execute:pipinstallcell_toolbarUninstallTo remove the extension, execute:pipuninstallcell_toolbarContributingDevelopment installNote: You will need NodeJS to build the extension package.Thejlpmcommand is JupyterLab's pinned version ofyarnthat is installed with JupyterLab. You may useyarnornpmin lieu ofjlpmbelow.# Clone the repo to your local environment# Change directory to the cell_toolbar directory# Install package in development modepipinstall-e"."# Link your development version of the extension with JupyterLabjupyterlabextensiondevelop.--overwrite# Rebuild extension Typescript source after making changesjlpmbuildYou can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.# Watch the source directory in one terminal, automatically rebuilding when neededjlpmwatch# Run JupyterLab in another terminaljupyterlabWith the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).By default, thejlpm buildcommand generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:jupyterlabbuild--minimize=FalseDevelopment uninstallpipuninstallcell_toolbarIn development mode, you will also need to remove the symlink created byjupyter labextension developcommand. To find its location, you can runjupyter labextension listto figure out where thelabextensionsfolder is located. Then you can remove the symlink namedcell_toolbarwithin that folder.Testing the extensionFrontend testsThis extension is usingJestfor JavaScript code testing.To execute them, execute:jlpm
jlpmtestIntegration testsThis extension usesPlaywrightfor the integration tests (aka user level tests).
More precisely, the JupyterLab helperGalatais used to handle testing the extension in JupyterLab.More information are provided within theui-testsREADME.Packaging the extensionSeeRELEASE
Package: cell-tools
cell-toolsis aSingle-Cell Data Analysis Toolkitwith the following areas of focus and development:scRNA-seq datascATAC-seq dataMultiomic (mostly scRNA-seq + scATAC-seq) dataFuntion development will likely focus on scATAC-seq given that there are so many python-implemented tools developed already for scRNA-seq. However, wrappers that enable batch-mode QC and pipeline-oriented solutions have been designed and will eventually be added.InstallationInstall the development package:# (1) clone this repositorygitclonehttps://github.com/mvinyard/cell-tools.git# (2) install the local project in editable modecd./perturb-tools;pipinstall-e.
Package: cell-tracking-bc
Brief DescriptionThecell-tracking-BCproject proposes a set of classes and tools for the processing and analysis of cell microscopy time-lapses/videos, typically in live-cell imaging. Its purpose is to serve as a basis for the development of computational pipelines and applications, for example to detect cell-related events such as division or death.InstallationThecell-tracking-BCproject is published on thePython Package Index (PyPI)at:https://pypi.org/project/cell-tracking-bc. It requires version 3.8, or newer, of the interpreter. It should be installable from Python distribution platforms or Integrated Development Environments (IDEs). Otherwise, it can be installed from a command-line console:For all users, after acquiring administrative rights:First installation:pip installcell-tracking-bcInstallation update:pip install--upgradecell-tracking-bcFor the current user (no administrative rights required):First installation:pip install--usercell-tracking-bcInstallation update:pip install--user--upgradecell-tracking-bcDocumentationThe documentation is extremely limited at the moment. It currently takes the form of asmall PDF document. The toolspdoc3andpydoctorare also used to generate anAPI documentation.ThanksThe project is developed withPyCharm Community.The development relies on several open-source packages (seeinstall_requiresinsetup.py).The code is formatted byBlack,The Uncompromising Code Formatter.The imports are ordered byisort…your imports, so you don’t have to.
Package: cell_tree2d
A module that provides the CellTree data structure as described by Garth and Joy in their 2010 paper:http://graphics.cs.ucdavis.edu/~joy/NSF-IIS-0916289/Papers/GarthTVCG2011.pdfThis implementation is 2D specific and includes some additions useful to answering one question:“What is the index of the polygon that contains this point?”Algorithm NotesThere are two major benefits to this algorithm over other types of BVHs. First is that overlaps in volumes
bounded by nodes do not create duplicates, decreasing the memory footprint. Secondly, the tree is balanced
by splitting a node along the plane that minimizes a cost function that ‘weighs’ each half. The result is
a tree with no duplicates and that becomes increasingly balanced as the number of buckets used when building
the tree increases (though this linearly increases build time).This is a 2D version of the algorithm that is oriented towards maximum lookup speed and immediate answer
checking. The basic CellTree does not hold enough information to give conclusive point-in-polygon answers;
the best it can do is provide the (short) list of cell bounding boxes that contain the point. Since a point
can be within the bounds of two different cells, and it is very possible both children of a parent node will
need to be searched, implementing immediate point-in-polygon checks on each cell as they are encountered is
highly beneficial, as an early success will avoid all further tree traversal.Usage NotesThe tree needs certain information to be built:‘verts’ - A 2xV numpy array containing x/y coordinates of the V vertices‘faces’ - A PxN numpy array containing N arrays of P indices of vertices that describe one
‘face’ or polygon of degree P‘num_buckets’ - The # of buckets desired. Must be >= 2 The default is 4. Values higher than
8 begin to provide diminishing returns.‘cells_per_leaf’ - The # of polygons per leaf node. The default is 2. Using 1 is possible,
but doubles memory footprint for only slightly. faster lookup. If memory is a concern, this
value can be increased, but lookup performance will quickly be impactedIMPORTANT:‘verts’ and ‘faces’ MUST describe aproperly formedunstructured grid. Assume
that degenerate (0 area) or overlapping polygonswillcause a build failure. If the construction
of the tree causes a segfault, this is probably the cause.
Package: cellular-automata
Copyright (c) 2016 Jeremie DECOCK (http://www.jdhp.org)A lightweight Cellular Automata Framework written in Python.Related linkshttp://www.conwaylife.com/wiki/http://www.argentum.freeserve.co.uk/lex.htmhttp://www.labri.fr/perso/nrougier/teaching/numpy/numpy.html#the-game-of-lifeLicenseThis project is provided under the terms and conditions of theMIT License.