### Install Dependencies and Run Example Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/timesfm-forecasting/examples/global-temperature/README.md Installs necessary Python packages using uv pip and executes the forecasting example script. Ensure you are in the correct directory before running. ```bash # Install dependencies uv pip install "timesfm[torch]" matplotlib pandas numpy # Run the complete example cd skills/timesfm-forecasting/examples/global-temperature ./run_example.sh ``` -------------------------------- ### Start the Application Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/markdown-mermaid-writing/templates/project_documentation.md Run this command to start the application after installing dependencies and configuring the environment. ```bash [package-manager] run dev ``` -------------------------------- ### Install and Setup Latch SDK Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/latchbio-integration/SKILL.md Installs the Latch SDK, logs in, initializes a new workflow, and registers it to the platform. Requires Docker, Latch account credentials, and Python 3.8+. ```bash # Install Latch SDK uv pip install latch # Login to Latch latch login # Initialize a new workflow latch init my-workflow # Register workflow to platform latch register my-workflow ``` -------------------------------- ### Setup Pi Agent from Source Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/pi-agent/references/development.md Clone the repository, install dependencies, and build the project. This is the initial step for development. ```bash git clone https://github.com/earendil-works/pi-mono cd pi-mono npm install npm run build ``` -------------------------------- ### PyTorch Lightning DataModule: setup() Example Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/pytorch-lightning/references/data_module.md Use `setup` to create datasets and apply transforms. This method runs on every process in distributed training and is used for setting state like datasets. ```python def setup(self, stage): if stage == 'fit': full_dataset = MyDataset("data/processed/") self.train_dataset, self.val_dataset = random_split( full_dataset, [0.8, 0.2] ) if stage == 'test': self.test_dataset = MyDataset("data/processed/test/") if stage == 'predict': self.predict_dataset = MyDataset("data/processed/predict/") ``` -------------------------------- ### Development Setup Commands Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/markdown-mermaid-writing/templates/project_documentation.md Commands to set up the development environment, including cloning the repository, installing dependencies, and running tests and linters. ```bash # Fork and clone git clone https://github.com/[your-fork]/[repo].git # Install with dev dependencies [package-manager] install --dev # Run tests [package-manager] test # Run linter [package-manager] run lint ``` -------------------------------- ### Vectorization Setup with pufferlib.make Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/pufferlib/SKILL.md Demonstrates automatic vectorization setup using pufferlib.make. Shows example performance benchmarks for different environment types. ```python import pufferlib # Automatic vectorization env = pufferlib.make('environment_name', num_envs=256, num_workers=8) # Performance benchmarks: # - Pure Python envs: 100k-500k SPS # - C-based envs: 100M+ SPS # - With training: 400k-4M total SPS ``` -------------------------------- ### Manual Multi-Node Setup - Node 0 (Master) Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/pytorch-lightning/references/distributed_training.md Command to start the training script on the master node for a manual multi-node setup. Includes arguments for total nodes, rank, master address, and port. ```bash python train.py --num_nodes=2 --node_rank=0 --master_addr=192.168.1.1 --master_port=12345 ``` -------------------------------- ### Astropy Quick Start Example Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/astropy/SKILL.md Demonstrates basic usage of astropy.units, astropy.coordinates, astropy.time, astropy.io.fits, astropy.table, and astropy.cosmology. ```python import astropy.units as u from astropy.coordinates import SkyCoord from astropy.time import Time from astropy.io import fits from astropy.table import Table from astropy.cosmology import Planck18 # Units and quantities distance = 100 * u.pc distance_km = distance.to(u.km) # Coordinates coord = SkyCoord(ra=10.5*u.degree, dec=41.2*u.degree, frame='icrs') coord_galactic = coord.galactic # Time t = Time('2023-01-15 12:30:00') jd = t.jd # Julian Date # FITS files data = fits.getdata('image.fits') header = fits.getheader('image.fits') # Tables table = Table.read('catalog.fits') # Cosmology d_L = Planck18.luminosity_distance(z=1.0) ``` -------------------------------- ### gget setup Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/gget/references/module_reference.md Install or download dependencies for specified gget modules. ```APIDOC ## gget setup ### Description Install/download dependencies for modules. ### Method CLI command ### Endpoint `gget setup` ### Parameters #### Path Parameters None #### Query Parameters - **module** (str) - Required - Module name (e.g., alphafold, cellxgene, elm, gpt) - **-o/--out** (str) - Optional - Output folder (elm only) - **-q/--quiet** (flag) - Optional - Suppress progress (default: False) ### Request Example ```bash gget setup --module gpt ``` ### Response #### Success Response (200) - None (installs dependencies). #### Response Example ```text Setup for module 'gpt' completed. ``` ``` -------------------------------- ### Configure Environment Variables Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/markdown-mermaid-writing/templates/project_documentation.md Copy the example environment file and edit it with your specific configuration values before starting the application. ```bash cp .env.example .env # Edit .env with your values ``` -------------------------------- ### Install Vaex Minimal Components Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/vaex/SKILL.md Install only the necessary Vaex sub-packages for a minimal setup, choosing specific components based on your needs. ```bash uv pip install vaex-core vaex-viz vaex-hdf5 vaex-ml ``` -------------------------------- ### gget setup - Install Dependencies Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/gget/SKILL.md Installs or downloads third-party dependencies for specific gget modules. Supports Python dependencies via uv pip or pip. ```APIDOC ## gget setup - Install Dependencies ### Description Installs or downloads third-party dependencies for specific gget modules. Supports Python dependencies via uv pip or pip. ### Parameters #### CLI Parameters - `module`: Module name requiring dependency installation - `-o/--out`: Output folder path (elm module only) #### Python Parameters - `module`: Module name requiring dependency installation - `out`: Output folder path (elm module only) ### Modules Requiring Setup - `alphafold`: Downloads ~4GB of model parameters - `cellxgene`: Installs cellxgene-census (may require Python 3.9/3.10 if the latest Python is unsupported) - `elm`: Downloads local ELM database - `gpt`: Installs/configures OpenAI integration dependencies ### Request Example ```bash # Setup AlphaFold gget setup alphafold # Setup ELM with custom directory gget setup elm -o /path/to/elm_data ``` ```python # Python gget.setup("alphafold") ``` ``` -------------------------------- ### Manual Multi-Node Setup - Node 1 Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/pytorch-lightning/references/distributed_training.md Command to start the training script on a worker node for a manual multi-node setup. Includes arguments for total nodes, rank, master address, and port. ```bash python train.py --num_nodes=2 --node_rank=1 --master_addr=192.168.1.1 --master_port=12345 ``` -------------------------------- ### Complete PyLabRobot Visualization Example Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/pylabrobot/references/visualization.md A comprehensive example demonstrating the setup and execution of a liquid handling protocol with real-time visualization. This includes initializing the visualizer, liquid handler, resources, setting initial liquids, and performing transfers. ```python from pylabrobot.liquid_handling import LiquidHandler from pylabrobot.liquid_handling.backends.simulation import ChatterboxBackend from pylabrobot.resources import ( STARLetDeck, TIP_CAR_480_A00, Cos_96_DW_1mL, set_tip_tracking, set_volume_tracking ) from pylabrobot.visualizer import Visualizer # Enable tracking set_tip_tracking(True) set_volume_tracking(True) # Create visualizer vis = Visualizer() await vis.start() # Create liquid handler lh = LiquidHandler( backend=ChatterboxBackend(num_channels=8), deck=STARLetDeck() ) lh.visualizer = vis await lh.setup() # Define resources tip_rack = TIP_CAR_480_A00(name="tips") source_plate = Cos_96_DW_1mL(name="source") dest_plate = Cos_96_DW_1mL(name="dest") # Assign to deck lh.deck.assign_child_resource(tip_rack, rails=1) lh.deck.assign_child_resource(source_plate, rails=10) lh.deck.assign_child_resource(dest_plate, rails=15) # Set initial volumes for well in source_plate.children: well.tracker.set_liquids([("sample", 200)]) # Execute protocol with visualization await lh.pick_up_tips(tip_rack["A1:H1"]) await lh.transfer( source_plate["A1:H12"], dest_plate["A1:H12"], vols=100 ) await lh.drop_tips() # Keep visualizer open to inspect final state input("Press Enter to close visualizer...") # Cleanup await lh.stop() await vis.stop() ``` -------------------------------- ### Clone HypoGeniC Datasets Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/hypogenic/SKILL.md Clone the HypoGeniC datasets repository for data-driven examples. This is useful for getting started with HypoGeniC's data-only functionalities. ```bash # HypoGeniC examples (data-driven only) git clone https://github.com/ChicagoHAI/HypoGeniC-datasets.git ./data ``` -------------------------------- ### Benchling SDK Import Paths Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/benchling-integration/references/sdk_reference.md Shows the preferred and an alternative valid import path for the Benchling SDK client. The preferred method is documented in the getting started guide. ```python # Preferred (documented in getting started guide) from benchling_sdk.benchling import Benchling # Also valid in benchling-sdk 1.25+ from benchling_sdk import Benchling ``` -------------------------------- ### API GET Response Example Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/markdown-mermaid-writing/templates/project_documentation.md This is an example of a successful JSON response for a GET request to an API resource, including data and metadata. ```json { "data": [ { "id": "uuid", "name": "Example", "created_at": "2026-01-15T10:30:00Z" } ], "meta": { "total": 42, "limit": 20, "offset": 0 } } ``` -------------------------------- ### Setup Plugin Distribution with setuptools Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/markitdown/references/api_reference.md Configure setup.py to define package metadata and register the plugin's entry point for MarkItDown. ```python from setuptools import setup setup( name="markitdown-my-plugin", version="0.1.0", packages=["my_plugin"], entry_points={ "markitdown.plugins": [ "my_plugin = my_plugin.converter:MyConverter", ], }, ) ``` -------------------------------- ### Install and Start MATLAB Engine for Python Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/matlab/references/python-integration.md Install the MATLAB Engine API for Python by running `setup.py` from the MATLAB installation directory. Start a MATLAB engine session using `matlab.engine.start_matlab()` or connect to an existing shared session. ```python # Install MATLAB Engine API for Python # From MATLAB: cd(fullfile(matlabroot,'extern','engines','python')) # Then: python setup.py install import matlab.engine # Start MATLAB engine eng = matlab.engine.start_matlab() # Or connect to shared session (MATLAB: matlab.engine.shareEngine) eng = matlab.engine.connect_matlab() # List available sessions matlab.engine.find_matlab() ``` -------------------------------- ### Create and List Projects Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/latchbio-integration/references/data-management.md Demonstrates how to create a new project with a name and description, and how to list all existing projects. ```python from latch.registry.project import Project # Get or create a project project = Project.create( name="RNA-seq Analysis", description="Bulk RNA-seq experiments" ) # List existing projects all_projects = Project.list() # Get project by ID project = Project.get(project_id="proj_123") ``` -------------------------------- ### BLS API Get Single Series Data (GET Request Example) Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/database-lookup/references/bls.md Example of a GET request to retrieve data for a single series ID. This format is convenient for quick lookups and includes optional parameters like API key and date range. ```http https://api.bls.gov/publicAPI/v2/timeseries/data/CUUR0000SA0?registrationkey=YOUR_KEY&startyear=2022&endyear=2024 ``` -------------------------------- ### Unpaywall DOI Lookup Example Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/paper-lookup/references/unpaywall.md An example of a GET request to the Unpaywall DOI lookup endpoint. ```text https://api.unpaywall.org/v2/10.1038/nature12373?email=you@example.com ``` -------------------------------- ### Get Work by DOI Example Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/paper-lookup/references/crossref.md An example of how to retrieve a work's metadata using its DOI. ```http https://api.crossref.org/works/10.1038%2Fnature12373?mailto=you@example.com ``` -------------------------------- ### Autoskill CLI: Basic Workflow Examples Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/autoskill/SKILL.md Illustrates the basic commands for operating the autoskill CLI, including doctor, run, and promote. ```bash python scripts/autoskill.py doctor --config config.yaml --skills-dir ../ python scripts/autoskill.py run --start ... --end ... --config config.yaml python scripts/autoskill.py promote --proposed ~/.autoskill/proposed/ --skills-dir ../ --name ``` -------------------------------- ### Initialize Benchling SDK with API Key Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/benchling-integration/references/authentication.md Demonstrates how to initialize the Benchling SDK using an API key and tenant URL retrieved from environment variables. Ensure that BENCHLING_API_KEY and BENCHLING_TENANT_URL are set before running. ```python import os from benchling_sdk.benchling import Benchling from benchling_sdk.auth.api_key_auth import ApiKeyAuth api_key = os.environ.get("BENCHLING_API_KEY") tenant_url = os.environ.get("BENCHLING_TENANT_URL") if not api_key or not tenant_url: raise ValueError("Set BENCHLING_API_KEY and BENCHLING_TENANT_URL") benchling = Benchling( url=tenant_url, auth_method=ApiKeyAuth(api_key), ) ``` -------------------------------- ### Get a Study Example Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/database-lookup/references/gwas-catalog.md Example of how to retrieve details for a specific study using its accession ID. ```text https://www.ebi.ac.uk/gwas/rest/api/studies/GCST001633 ``` -------------------------------- ### Install NVIDIA Warp Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/optimize-for-gpu/references/warp.md Install the Warp library using uv. The CUDA 12 runtime is the most common option. You can also install with example dependencies. ```bash uv add warp-lang # CUDA 12 runtime (most common) # uv add warp-lang[examples] # Includes USD and example dependencies ``` -------------------------------- ### Complete Function Configuration Example Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/modal/references/resources.md An example demonstrating the configuration of multiple resource parameters for a Modal function, including CPU, memory, GPU, ephemeral disk, timeout, and container scaling. ```python @app.function( cpu=8.0, # 8 physical cores memory=32768, # 32 GiB gpu="L40S", # L40S GPU ephemeral_disk=204800, # 200 GiB temp disk timeout=7200, # 2 hours max_containers=50, min_containers=1, ) def full_pipeline(data_path: str): ... ``` -------------------------------- ### Install, Create, and Test nf-core Subworkflows Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/nextflow/references/nf-core-tools.md Demonstrates how to install a pre-existing subworkflow, create a new one, and run its associated tests. ```bash nf-core subworkflows install bam_sort_stats_samtools nf-core subworkflows create align_bwa nf-core subworkflows test align_bwa ``` -------------------------------- ### Get Plasmid Details Example Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/database-lookup/references/addgene.md Example of how to retrieve details for a specific plasmid using its Addgene ID. ```http GET https://www.addgene.org/api/plasmids/12260/ Authorization: Token YOUR_KEY ``` -------------------------------- ### BLS API Latest Data (GET Request Example) Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/database-lookup/references/bls.md Example of a GET request to retrieve the latest available data for a series ID without specifying a date range. This will return data for the most recent three years. ```http https://api.bls.gov/publicAPI/v2/timeseries/data/LNS14000000?registrationkey=YOUR_KEY ``` -------------------------------- ### Example: Use ODE Solver and Different Noise Schedules Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/diffdock/references/parameters_reference.md Illustrates enabling the ODE solver instead of the default SDE and using different noise schedules per component for alternative sampling. ```bash python -m inference --ode --different_schedules ``` -------------------------------- ### Install Benchling SDK Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/benchling-integration/references/sdk_reference.md Installs the stable release or preview builds of the Benchling SDK using uv pip. ```bash # Stable release (recommended) uv pip install "benchling-sdk==1.25.0" ``` ```bash # Preview builds — alpha functionality, not for production uv pip install "benchling-sdk" --prerelease allow ``` -------------------------------- ### arXiv API Query Example Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/paper-lookup/references/arxiv.md Example of a GET request to the arXiv API with search query and pagination parameters. ```http GET https://export.arxiv.org/api/query?search_query={query}&start={n}&max_results={n} ``` -------------------------------- ### REST API Search Example Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/database-lookup/references/opentargets.md Example of a REST GET request to search for 'TP53' and retrieve up to 5 results. ```http https://api.platform.opentargets.org/api/v4/search?q=TP53&size=5 ``` -------------------------------- ### Get GO Term Details Example Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/database-lookup/references/quickgo.md Example of how to retrieve details for a specific GO term using its ID. ```text https://www.ebi.ac.uk/QuickGO/services/ontology/go/terms/GO:0003723 ``` -------------------------------- ### Install Adaptyv SDK from GitHub Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/adaptyv/SKILL.md Install the beta version of the adaptyv-sdk from GitHub using uv pip. Ensure you are using version 0.1.0 or later. ```bash uv pip install "git+https://github.com/adaptyvbio/adaptyv-sdk.git" ``` -------------------------------- ### Get Associations for a SNP Example Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/database-lookup/references/gwas-catalog.md Example of how to retrieve all associations linked to a specific Single Nucleotide Polymorphism (SNP) by its rsID. ```text https://www.ebi.ac.uk/gwas/rest/api/singleNucleotidePolymorphisms/rs7329174/associations ``` -------------------------------- ### Install gget Dependencies with gget setup (CLI) Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/gget/SKILL.md Use the gget setup command to install third-party dependencies for specific gget modules like AlphaFold, cellxgene, ELM, or GPT. Specify an output directory for the ELM module if needed. ```bash gget setup alphafold ``` ```bash gget setup elm -o /path/to/elm_data ``` -------------------------------- ### Gondolin Extension Setup and Execution Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/pi-agent/references/containerization.md Steps to install and run the Gondolin extension. This requires Node.js >= 23.6.0 and QEMU. The extension mounts the host cwd at /workspace in the VM. ```bash cp -R packages/coding-agent/examples/extensions/gondolin ~/.pi/agent/extensions/gondolin cd ~/.pi/agent/extensions/gondolin npm install --ignore-scripts cd /path/to/project pi -e ~/.pi/agent/extensions/gondolin ``` -------------------------------- ### Install numpy with version pinning Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/SECURITY.md This example demonstrates installing the numpy package with a specific version (1.24.0). Version pinning is a best practice to ensure consistent and secure installations. ```bash subprocess.check_call(['pip', 'install', 'numpy==1.24.0']) ``` -------------------------------- ### Install PyTorch and PyG Core Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/torch-geometric/SKILL.md Installs PyTorch and the core PyTorch Geometric library using uv pip. Ensure PyTorch is installed first, matching your CUDA/CPU setup. ```bash # 1. Install PyTorch first (match your CUDA/CPU setup — see https://pytorch.org/get-started/locally/) uv pip install torch # 2. Core PyG (no extension wheels required for basic usage) uv pip install torch_geometric ``` -------------------------------- ### Install Qiskit with Visualization and Matplotlib Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/qiskit/references/setup.md Install Qiskit along with visualization capabilities and Matplotlib for plotting. ```bash uv pip install "qiskit[visualization]" matplotlib ``` -------------------------------- ### List GDC Projects Example Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/database-lookup/references/tcga-gdc.md Example GET request to list cancer projects, retrieving specific fields and limiting the results. ```http https://api.gdc.cancer.gov/projects?size=5&fields=project_id,name,primary_site ``` -------------------------------- ### Example: Set Batch Size and Enable Progress Bar Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/diffdock/references/parameters_reference.md Demonstrates setting the batch size for processing and enabling the tqdm progress bar for monitoring long-running jobs. ```bash python -m inference --batch_size 100 --tqdm ``` -------------------------------- ### Fetch Gene by Hugo Symbol Example Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/database-lookup/references/cbioportal.md Example GET request to retrieve information about a specific gene using its Hugo symbol. ```http GET https://www.cbioportal.org/api/genes/TP53 ``` -------------------------------- ### Python: Submit a Binding Screen Step by Step Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/adaptyv/SKILL.md This workflow demonstrates the step-by-step process of submitting a binding screen experiment using the Adaptyv client. It covers finding a target, estimating costs, creating the experiment, submitting it for review, and retrieving results. ```python # 1. Find a target targets = client.targets.list(search="EGFR", selfservice_only=True) target_id = targets.items[0].id # 2. Preview cost estimate = client.experiments.cost_estimate({ "experiment_spec": { "experiment_type": "screening", "method": "bli", "target_id": target_id, "sequences": {"seq1": "EVQLVESGGGLVQ...", "seq2": "MKVLVAG..."}, "n_replicates": 3 } }) # 3. Create experiment (starts as Draft) exp = client.experiments.create({ "name": "EGFR binder screen batch 1", "experiment_spec": { "experiment_type": "screening", "method": "bli", "target_id": target_id, "sequences": {"seq1": "EVQLVESGGGLVQ...", "seq2": "MKVLVAG..."}, "n_replicates": 3 } }) # 4. Submit for review client.experiments.submit(exp.experiment_id) # 5. Poll or use webhooks until Done # 6. Retrieve results results = client.experiments.get_results(exp.experiment_id) ``` -------------------------------- ### Example Intraday Stock Time Series Request Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/database-lookup/references/alphavantage.md An example GET request for fetching 5-minute intraday stock data for AAPL. ```url https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=AAPL&interval=5min&apikey=YOUR_KEY ``` -------------------------------- ### Basic Retrosynthesis Pipeline Setup Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/torchdrug/references/retrosynthesis.md Demonstrates loading a dataset and initializing models and tasks for retrosynthesis, including center identification and synthon completion. ```python from torchdrug import datasets, models, tasks # Load dataset dataset = datasets.USPTO50k("~/retro-datasets/") # For center identification model_center = models.RGCN( input_dim=dataset.node_feature_dim, num_relation=dataset.num_bond_type, hidden_dims=[256, 256, 256] ) task_center = tasks.CenterIdentification( model_center, top_k=3 # Consider top 3 reaction centers ) # For synthon completion model_synthon = models.GIN( input_dim=dataset.node_feature_dim, hidden_dims=[256, 256, 256] ) task_synthon = tasks.SynthonCompletion( model_synthon, center_topk=3, # Use top 3 from center identification num_synthon_beam=5 # Beam search for synthon generation ) # End-to-end task_retro = tasks.Retrosynthesis( model=model_center, synthon_model=model_synthon, center_topk=5, num_synthon_beam=10 ) ``` -------------------------------- ### Initialize and Query ModelStore Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/molfeat/references/examples.md Demonstrates how to initialize the ModelStore, list available models, search for specific models by name, and retrieve model information. Use this to explore and understand the pretrained models available. ```python from molfeat.store.modelstore import ModelStore # Initialize model store store = ModelStore() # List all available models print(f"Total available models: {len(store.available_models)}") # Search for specific models chemberta_models = store.search(name="ChemBERTa") for model in chemberta_models: print(f"- {model.name}: {model.description}") # Get model information model_card = store.search(name="ChemBERTa-77M-MLM")[0] print(f"Model: {model_card.name}") print(f"Version: {model_card.version}") print(f"Authors: {model_card.authors}") # View usage instructions model_card.usage() # Load model directly transformer = store.load("ChemBERTa-77M-MLM") ``` -------------------------------- ### Install PyHealth with uv Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/pyhealth/SKILL.md Use uv for environment management to install PyHealth and its dependencies. This ensures a faster and reproducible environment setup. ```bash # Create a project with the right Python uv init my-pyhealth-project cd my-pyhealth-project uv python pin 3.12 # Add PyHealth (this also pulls in PyTorch and friends) uv add pyhealth # Run scripts inside the env uv run python train.py ``` -------------------------------- ### Client Pattern Examples Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/adaptyv/SKILL.md Examples demonstrating the usage of the `FoundryClient` for interacting with the Adaptyv API. ```APIDOC ## Client Pattern This pattern uses the `FoundryClient` to interact with the Adaptyv API. ### Initialization ```python import os from adaptyv import FoundryClient client = FoundryClient( api_key=os.environ["ADAPTYV_API_KEY"], base_url=os.environ.get( "ADAPTYV_API_URL", "https://foundry-api-public.adaptyvbio.com/api/v1", ), ) ``` ### Browsing Targets ```python # Browse targets targets = client.targets.list(search="EGFR", selfservice_only=True) ``` ### Estimating Experiment Cost ```python estimate = client.experiments.cost_estimate({ "experiment_spec": { "experiment_type": "screening", "method": "bli", "target_id": "target-uuid", "sequences": {"seq1": "EVQLVESGGGLVQ..."}, "n_replicates": 3 } }) ``` ### Creating and Submitting Experiments ```python # Create and submit exp = client.experiments.create({...}) client.experiments.submit(exp.experiment_id) ``` ### Retrieving Experiment Results ```python # Later: retrieve results results = client.experiments.get_results(exp.experiment_id) ``` ### `FoundryClient` Methods - **`targets.list(search: str, selfservice_only: bool)`**: Lists available targets. - **`experiments.cost_estimate(experiment_spec: dict)`**: Estimates the cost of an experiment. - **`experiments.create(experiment_data: dict)`**: Creates a new experiment. - **`experiments.submit(experiment_id: str)`**: Submits an experiment for execution. - **`experiments.get_results(experiment_id: str)`**: Retrieves the results of an experiment. ``` -------------------------------- ### Basic FSDP Trainer Setup Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/pytorch-lightning/references/distributed_training.md Initialize a PyTorch Lightning Trainer with the FSDP strategy for distributed training across multiple GPUs. ```python trainer = L.Trainer( strategy="fsdp", accelerator="gpu", devices=4 ) ``` -------------------------------- ### Install pi-interview and GlimpseUI Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/pi-agent/references/pi-interview.md Install the pi-interview package and optionally the glimpseui package for native macOS windows. This is the initial setup step. ```bash pi install npm:pi-interview pi install npm:glimpseui # optional: native macOS windows (browser fallback otherwise) ``` -------------------------------- ### Install Qiskit and Visualization Tools Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/qiskit/SKILL.md Installs the Qiskit library and additional packages for visualization and plotting. Use this command to set up your environment for Qiskit development. ```bash uv pip install qiskit uv pip install "qiskit[visualization]" matplotlib ``` -------------------------------- ### Install Pi Coding Agent Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/pi-agent/references/overview.md Installs the Pi coding agent globally using npm. Use this for a quick setup on most systems. ```bash npm install -g --ignore-scripts @earendil-works/pi-coding-agent pi ``` -------------------------------- ### PMC ID Converter API Example Request Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/paper-lookup/references/pmc.md An example request to the ID Converter API to get JSON output for a given PMCID. ```http https://pmc.ncbi.nlm.nih.gov/tools/idconv/api/v1/articles/?ids=PMC7029759&format=json ``` -------------------------------- ### Install Qiskit with uv Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/qiskit/references/setup.md Use uv to install the base Qiskit package. ```bash uv pip install qiskit ``` -------------------------------- ### Install Unpinned Preview Benchling SDK Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/SECURITY.md This command installs a preview/alpha build of the benchling-sdk without a version pin, which could lead to the installation of an untested or compromised package. Use with caution and consider pinning to a specific version. ```bash uv pip install "benchling-sdk" --prerelease allow ``` -------------------------------- ### Example: Get DNA Sequence Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/database-lookup/references/ucsc-genome.md An example API call to retrieve DNA sequence for a specific region on chromosome 7 in the hg38 genome. ```bash GET https://api.genome.ucsc.edu/getData/sequence?genome=hg38&chrom=chr7&start=117119148&end=117119178 ``` -------------------------------- ### Fetch Clinical Data Example Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/database-lookup/references/cbioportal.md Example GET request to retrieve patient clinical data for a study, filtering by a specific attribute and projection. ```http GET https://www.cbioportal.org/api/studies/brca_tcga/clinical-data?clinicalDataType=PATIENT&attributeId=OS_STATUS&projection=SUMMARY ``` -------------------------------- ### List Molecular Profiles in a Study Example Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/database-lookup/references/cbioportal.md Example GET request to list all molecular profiles available within a specific cancer study. ```http GET https://www.cbioportal.org/api/studies/brca_tcga/molecular-profiles ``` -------------------------------- ### Quick Setup for Vectorized Environments Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/stable-baselines3/SKILL.md Sets up multiple environment instances in parallel using `make_vec_env` for faster training. This example uses `SubprocVecEnv` for parallel execution, suitable for compute-heavy environments. ```python from stable_baselines3.common.env_util import make_vec_env from stable_baselines3.common.vec_env import SubprocVecEnv # Create 4 parallel environments env = make_vec_env("CartPole-v1", n_envs=4, vec_env_cls=SubprocVecEnv) model = PPO("MlpPolicy", env, verbose=1) model.learn(total_timesteps=25000) ``` -------------------------------- ### Install Optional MarkItDown Dependencies Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/markitdown/SKILL.md Control the file format support for MarkItDown by installing specific optional dependencies using pip. This example shows how to install support for PDF, DOCX, and PPTX files. ```bash # Install specific formats pip install 'markitdown[pdf, docx, pptx]' ``` -------------------------------- ### Initialize and Use ModelStore Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/molfeat/references/api_reference.md Demonstrates initializing the ModelStore, listing available models, searching for a specific model, and loading it. Use this to discover and access pre-trained featurizers. ```python from molfeat.store.modelstore import ModelStore # Initialize store store = ModelStore() # List all available models all_models = store.available_models print(f"Found {len(all_models)} featurizers") # Search for specific model results = store.search(name="ChemBERTa-77M-MLM") if results: model_card = results[0] # View usage information model_card.usage() # Load the model transformer = model_card.load() # Direct loading transformer = store.load("ChemBERTa-77M-MLM") ``` -------------------------------- ### Install labarchives-py Wrapper Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/labarchive-integration/SKILL.md Clone the repository, navigate to the directory, and install the Python wrapper using uv pip. ```bash git clone https://github.com/mcmero/labarchives-py cd labarchives-py uv pip install . ``` -------------------------------- ### Pin Dependency Installation Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/SECURITY.md Pinning dependencies to specific versions prevents supply chain attacks. This example shows how to install 'omero-py' with a specific version. ```bash uv pip install omero-py==5.18.0 ``` -------------------------------- ### Quick Extension Example Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/pi-agent/references/extensions.md A basic Pi Agent extension demonstrating event handling, tool registration, and command registration. Use this as a starting point for custom agent functionalities. ```typescript import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; import { Type } from "typebox"; export default function (pi: ExtensionAPI) { pi.on("session_start", async (_event, ctx) => { ctx.ui.notify("Extension loaded", "info"); }); pi.on("tool_call", async (event, ctx) => { if (event.toolName === "bash" && event.input.command?.includes("rm -rf")) { const ok = await ctx.ui.confirm("Dangerous", "Allow rm -rf?"); if (!ok) return { block: true, reason: "Blocked by user" }; } }); pi.registerTool({ name: "greet", label: "Greet", description: "Greet someone by name", parameters: Type.Object({ name: Type.String() }), async execute(_toolCallId, params) { return { content: [{ type: "text", text: `Hello, ${params.name}!` }], details: {} }; }, }); pi.registerCommand("hello", { description: "Say hello", handler: async (args, ctx) => ctx.ui.notify(`Hello ${args || "world"}`, "info"), }); } ``` -------------------------------- ### Get Node Property (Specific) Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/database-lookup/references/datacommons.md Retrieve a specific property value for a given node. For example, to get the name of a place, use '->name'. ```HTTP https://api.datacommons.org/v2/node?key=YOUR_KEY&nodes=geoId/06&property=->name ``` -------------------------------- ### Setup Inheco Incubator Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/pylabrobot/references/material-handling.md Initialize and set up an Inheco incubator. Requires importing TemperatureController and InhecoBackend. ```python from pylabrobot.temperature_control import TemperatureController from pylabrobot.temperature_control.inheco import InhecoBackend # Create incubator incubator = TemperatureController( name="incubator", backend=InhecoBackend(), size_x=156.0, size_y=156.0, size_z=50.0 ) await incubator.setup() ``` -------------------------------- ### Example Search Works URL Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/paper-lookup/references/core.md An example of a GET request to the search works endpoint, querying for 'CRISPR gene therapy' with a limit of 10 results. ```http https://api.core.ac.uk/v3/search/works/?q=CRISPR+gene+therapy&limit=10 ``` -------------------------------- ### List Studies Example Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/database-lookup/references/cbioportal.md Example GET requests to list studies, demonstrating projection and page size parameters, and fetching a specific study by its ID. ```http GET https://www.cbioportal.org/api/studies?projection=SUMMARY&pageSize=10 GET https://www.cbioportal.org/api/studies/brca_tcga ``` -------------------------------- ### Multi-Device Workflow Example Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/pylabrobot/references/analytical-equipment.md Demonstrates coordinating a liquid handler, plate reader, and scale in a single asynchronous workflow. Ensure all devices are initialized before use and stopped properly afterwards. ```python async def multi_device_workflow(): """Coordinate liquid handler, plate reader, and scale""" # Initialize all devices lh = LiquidHandler(backend=STAR(), deck=STARLetDeck()) pr = PlateReader(name="CLARIOstar", backend=CLARIOstarBackend()) scale = Scale(name="scale", backend=MettlerToledoBackend()) await lh.setup() await pr.setup() await scale.setup() try: # 1. Weigh reagent await scale.tare() # (place container on scale) reagent_weight = await scale.get_weight() # 2. Prepare samples with liquid handler await lh.pick_up_tips(tip_rack["A1:H1"]) await lh.transfer(source["A1:H12"], dest["A1:H12"], vols=100) await lh.drop_tips() # 3. Read plate await pr.open() # (load plate) await pr.close() data = await pr.read_absorbance(wavelength=450) return { "reagent_weight": reagent_weight, "absorbance_data": data } finally: await lh.stop() await pr.stop() await scale.stop() ``` -------------------------------- ### GeoPandas Quick Start Source: https://github.com/k-dense-ai/scientific-agent-skills/blob/main/skills/geopandas/SKILL.md A quick start guide to using GeoPandas for reading, exploring, plotting, reprojecting, calculating areas, and saving geospatial data. ```python import geopandas as gpd # Read spatial data gdf = gpd.read_file("data.geojson") # Basic exploration print(gdf.head()) print(gdf.crs) print(gdf.geometry.geom_type) # Simple plot gdf.plot() # Reproject to different CRS gdf_projected = gdf.to_crs("EPSG:3857") # Calculate area (use projected CRS for accuracy) gdf_projected['area'] = gdf_projected.geometry.area # Save to file gdf.to_file("output.gpkg") ```