sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
5f4a149a6fbf95eb6d62e76c985b05dcc9bd0897faa11fc2bb50d045f44266b1
Python
25,536
627
#!/usr/bin/env python # # Copyright (c) 2019 10X Genomics, Inc. All rights reserved. # from __future__ import annotations import os import re import string from collections import OrderedDict from collections.abc import Iterable from re import Pattern from typing import NamedTuple from six import ensure_binary, ensu...
4129ac2a17948e1d15fa23a726df1725d3ae6fffd11b98b59ed7df4985d58bd2
Python
25,543
551
# This script is part of navis (http://www.github.com/navis-org/navis). # Copyright (C) 2018 Philipp Schlegel # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 o...
ff6d434ca18e162341e3d7a90096e71795521d04416da549351477726ddf27bf
Python
25,543
789
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe """ Search methods for generating Geometry objects TODO ---- * Add relevant duecredit entries. """ import warnings from itertools import combinations, groupby from typing import Optional, U...
d3eda2a3013cf3d2f3360d72108501deb062cb12fba73ff4c991fbfb83cae950
Python
25,592
671
import copy import cv2 import numpy as np import torch from skimage.restoration import denoise_tv_chambolle from typing import List, Tuple import random torch.manual_seed(123) random.seed(123) def graph_numpy2tensor(graphs: List[np.ndarray]) -> torch.Tensor: """ Convert a list of np arrays to a pytorch tens...
52173f8065379a2dbab34c157d77d979d1789191f35a6cd510eb570267762426
Python
25,688
309
#python3 genListPRM.py import pandas as pd import numpy as np from openpyxl import Workbook from openpyxl.styles import Font, PatternFill, Alignment, Border, Side from openpyxl.utils import get_column_letter import warnings; warnings.filterwarnings("ignore") # ── LOAD ORIGINAL PANEL ──────────────────────────────────...
3234976caafe04f4300c27758a61a7ed711a31a361ce43cbfb883b7fcac2079b
Python
25,697
713
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe """Equilibrium Free Energy Protocols input settings. This module implements base settings necessary to run free energy calculations using OpenMM +/- Tools, such as :mod:`openfe.protocols.ope...
aa89dba7e6577f778ef904f113065891df8b976462877892393bf9c78fd944ae
Python
25,757
507
# Get force field parameters with trained model import torch import torch.nn as nn import torch.nn.functional as F from torch_geometric.data import Data from torch_geometric.nn.conv import SAGEConv from openmm.app import ForceField, NoCutoff, CutoffNonPeriodic, CutoffPeriodic, Ewald, PME, LJPME from openmm.unit import...
de6c49e9c31704143eabde238e6d3831645509ef551d56603ceb4b443bd8bde4
Python
25,841
574
import os import sys import numpy as np import pandas as pd import matplotlib import matplotlib.pyplot as plt import anndata as ad import scanpy as sc from scipy.io import mmwrite, mmread import seaborn as sns import scipy import torch from torch.func import vmap import pytorch_lightning as pl from pytorch_lightning.ca...
7b3fcca352c002364278d0e8bcc2bc0c7bcd660b191367bc1af0f2980bada85b
Python
25,859
721
# This script is part of navis (http://www.github.com/navis-org/navis). # Copyright (C) 2018 Philipp Schlegel # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of...
9b2d2916d09b3cd08e8ea0de39bf02fb560dd8418ee73b57bed98bb602ecd5c3
Python
25,868
725
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe """OpenMM MD Protocol --- :mod:`openfe.protocols.openmm_md.plain_md_methods` =========================================================================================== This module implemen...
944d70d100dae86e0e0a997212ab9f78ce165c50c58bd67573c62d45ccdd9ab1
Python
25,871
697
import tensorflow as tf import numpy as np import matplotlib.pyplot as plt import math import pandas as pd from sklearn.model_selection import train_test_split from PIL import Image import tqdm import cv2 import os #tf.enable_eager_execution() #eager execution """ 设置使用GPU """ gpus = tf.config.experiment...
939d68cd4d9715cb572bd90f2dc925fddd3f6aafc3249e2e42556845b705cc2d
Python
25,892
718
"""Tests for XGBoost models, config, training, and model bundles.""" import json import tempfile from pathlib import Path from unittest.mock import patch import numpy as np import pytest import torch from sklearn.preprocessing import StandardScaler from nfml.models.config import XGBoostConfig from nfml.models.xgboost...
9c404b700ac4b53f6fbb1353b37c0314356d461be9489cc67eaa8c35dd7cbf87
Python
26,101
626
""" Example script for contrast-agnostic registration using SynthSeg This script demonstrates a full registration pipeline that uses SynthSeg's brain parcellation to enable registration between images of different contrasts: 1. Generate parcellations of both input and reference images using SynthSeg 2. Register the p...
2a8cd5cd1d03957c4609a90083c8cab060b8f5665f91501588628b557b3af3cc
Python
26,119
503
############################################################################ # Copyright (c) 2022-2026 University of Helsinki # Copyright (c) 2019-2022 Saint Petersburg State University # # All Rights Reserved # See file LICENSE for details. ############################################################################ ...
c24f73130470e8cbfde81ae4343ef688b3ece99a4a34e36c46f196e403846938
Python
26,145
739
# -*- coding: utf-8 -*- """Functionality for running spatial null models.""" import os import tempfile import nibabel as nib import numpy as np from scipy import ndimage from scipy.spatial.distance import cdist from packaging import version try: import brainsmash from brainsmash.mapgen import Base, Sampled ...
21b123267c8e4906d95f9bfb6aaecf1ac80d915939e97e18207c12538fc1f39d
Python
26,159
744
""" Analysis pipeline for spine processing workflows Created on January 21, 2026 @author: dcupolillo """ from __future__ import annotations from pathlib import Path import numpy as np from spyne.core.imaging.imagingdataset import ImagingDataset from spyne.core.spines.analysis.segmentation.pipeline import seman...
8994e3f33624be40846cc4a69ec5c8cbfb7b945b8da15be5742e040bd86c976e
Python
26,203
592
import os import numpy as np import pandas as pd import matplotlib import matplotlib.pyplot as plt import anndata as ad import scanpy as sc from scipy.io import mmwrite, mmread import seaborn as sns import scipy from arboreto.algo import grnboost2 import pickle import collections import pycistarget import pyranges as p...
e16435367a74ea7a3ce0fbb12307e50881cace84d82a90d0a1669d7842ac1cc1
Python
26,218
578
#git lfs install #git clone https://huggingface.co/datasets/animesh/autonlp-data-peptides #https://www.tensorflow.org/tutorials/load_data/csv import pandas as pd peptideCCS_train=pd.read_csv("pepCCS.csv") peptideCCS_train.head() peptideCCS_train[' CCS'].hist() peptideCCS_train_scores = peptideCCS_train.pop(' CCS') pept...
2fbb147c4e30e8265c4ee57704ac962202574bfc9eb96968e444e935b8dbb1f3
Python
26,237
521
import io import multiprocessing import os import pickle import unittest import unittest.mock from contextlib import redirect_stdout from tempfile import TemporaryDirectory import numpy as np from nnunetv2.preprocessing.preprocessors.default_preprocessor import DefaultPreprocessor from nnunetv2.preprocessing.sampling...
5315311535aadac7d63df5f2e560ec1c9227bebaadbc2b00cb177673bdf64a12
Python
26,238
673
""" Ablation study for mmVelo: 1. With vs. without KNN smoothing (zdim = 10) 2. Multiple latent dimensionalities: zdim = 5, 10, 30, 50 (with smoothing) For each condition the script: - Trains mmVelo from scratch (skips a stage if a checkpoint already exists) - Generates a latent-space streamline plot using the...
756c1fa0a921b48cfed050f8b1711d0e3104dcc67e2feb039101b6f6e95454cc
Python
26,241
713
# This script is part of navis (http://www.github.com/navis-org/navis). # Copyright (C) 2018 Philipp Schlegel # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of...
b6297b7bf51ffde53a0e26de981311a114dd6c3adef1b2463912fd4720645f46
Python
26,300
751
#!/usr/bin/env python3 """Used to draw brain masks on MRI image data (nii.gz). Usage: python vol2mask.py path/to/volume.nii.gz Author: Tommy Clausner (2020) - tommy.clausner@gmail.com """ import argparse from collections import deque import json import os import sys from tkinter import Tk, messagebox from tk...
4a65f03760cdcf9c620f8a8aadf82e7d6bfe123740636d80bc5c0694fbbad2ea
Python
26,312
609
# -*- coding: utf-8 -*- """ Created on Wed Oct 1 13:41:48 2014 @authors: Luciano Masullo, Federico Barabas """ import os import numpy as np from scipy import ndimage as ndi from PIL import Image import pyqtgraph as pg from pyqtgraph.Qt import QtCore, QtGui import ringfinder.utils as utils from ringfinder.neurosimul...
80f793ab92664e4731d0fbcdf4326b5a9fd80379231bb70e853fb29bf081ae7a
Python
26,316
758
# Copyright (c) 2019 10X Genomics, Inc. All rights reserved. """Python versions of the React Components available in the web summary. The Web Summary data is serialized as JSON and for simple objects we just pass dictionaries around, but also use typed classes for some aspects of the Components. """ from __future__ ...
489a6cea38276a87363c17510ec9d98412d15a35e38753352d270958d6a043ab
Python
26,457
622
import os import numpy as np import pandas as pd import matplotlib import matplotlib.pyplot as plt import anndata as ad import scanpy as sc from scipy.io import mmwrite, mmread import seaborn as sns import scipy np.random.seed(42) # load anndata dir_path = "/home/nomura/Proj/mmvelo/experiments/SHARE-seq_hf/2023-08-0...
a12365cc13a0273b3b8fccd791de536beefa91ab7ff626034dc34d5357197a47
Python
26,525
511
from __future__ import annotations import copy import random import numpy as np import pandas as pd import torch from bpnn_training import BPNNTrainingConfig def _initialize_ensemble(model_count: int, input_dim: int, hidden_width: int, seeds: list[int], device): hidden_weights = [] hidden_biases = [] o...
5fc4320d77d88dcb0e8cdab4b5095be1b0df528ab1d751ecb4f5efc769370b12
Python
26,561
681
""" Ablation study for mmVelo (SHARE-seq_hf dataset): 1. With vs. without KNN smoothing (zdim = 10) 2. Multiple latent dimensionalities: zdim = 5, 10, 30, 50 (with smoothing) For each condition the script: - Trains mmVelo from scratch (skips a stage if a checkpoint already exists) - Generates a latent-space st...
f580d1ec2c993f6611ea44abbfbbd347c0ad887ced6fc358d18519853992753c
Python
26,637
773
"""Core implementation of Mesa's reactive programming system. This module provides the foundational classes for Mesa's observable/reactive programming functionality: - BaseObservable: Abstract base class defining the interface for all observables - Observable: Main class for creating observable properties that emit c...
36d28515f881e2fe46ebd6826aad696edd34640f857b32fd7a50fbfddd0002ae
Python
26,642
621
#!/usr/bin/env python3 """ Statistical Analysis Tables Generator This script generates comprehensive statistical analysis tables for the AL Project experimental results, following the statistical framework described in the paper. For each of the 4 settings (Hard_Mode/Hide_The_Label, Hard_Mode/Open_Race, Regular_Mode...
2cabc36a5255ab8483723ffdbd3c3b8c04d2a40e8436e4a5c895068d7102a885
Python
26,702
672
#!/usr/bin/env python # # Copyright (c) 2022 10X Genomics, Inc. All rights reserved. # from __future__ import annotations import os import socket import sys from typing import TYPE_CHECKING, NamedTuple import martian import cellranger.constants as cr_constants import cellranger.env as cr_env import cellranger.refere...
a9bc812b2b09f2035fbc109b83562afa5318f2f4963288996a6ad044e2f9ee9f
Python
26,704
594
import os import numpy as np import pandas as pd import umap import matplotlib.pyplot as plt import anndata as ad import scanpy as sc import scvelo as scv import cellrank as cr import scanpy.external as sce from scipy.io import mmwrite, mmread import statsmodels.api as sm from sklearn.cluster import AgglomerativeCluste...
9dfbf946936cbdd67d1526318e9a3f8b7e2fac9ad3e7e3b8c6a6c304b62ea1cb
Python
26,831
660
############################################################################ # Copyright (c) 2025-2026 University of Helsinki # All Rights Reserved # See file LICENSE for details. ############################################################################ """ String interning for memory optimization. Replaces duplic...
891c8e92e1812719db1f3671f9c66b37850ed5404d0e2aaea6faa9a32942ff86
Python
26,832
709
import numpy as np from spikeinterface import full as si import os import pickle from scipy.signal import find_peaks, peak_prominences, peak_widths import matplotlib.pyplot as plt import hashlib import batch_process.util.template_util as template_util # Module for waveform acceptance criteria def get_MAD...
3b72e58ee7432e12ee406cb34e570547b340ae51750521a41a5fbe9e2fc64a99
Python
26,877
472
############################################################################ # Copyright (c) 2022-2026 University of Helsinki # Copyright (c) 2020-2022 Saint Petersburg State University # # All Rights Reserved # See file LICENSE for details. ############################################################################ ...
7e31d894fb2750920c5c3cca91cc63f2065ceca57a404b28ac4edc46f938347d
Python
26,898
721
"""mesa.experimental.actions: Timed, interruptible actions for Mesa agents. An Action represents something an agent does over time. It integrates with Mesa's event scheduling system for precise timing and supports interruption with progress tracking and optional resumption. Actions are subclassable: override on_start...
84c4c12bb49b4780faa0842d4399fa6d63d6dbff57e37080ee5dfeeaa0057ea7
Python
26,901
482
import os import numpy as np import pandas as pd import torch import torch.nn as nn import torch.nn.functional as F from torch.cuda import device from ndreamer.model_DL import NDreamer_generator,Discriminator,set_seed from ndreamer.DL_loss_func import CrossEntropy, create_triplets_within_groups, IndependenceL...
d71e049bf929574afaa0bc33bec80988705315741c4b90fa0c2b9d985911b9ae
Python
26,933
670
""" Python snippets and functions to help facilitate saving and loading volumetric and surface data to be used with NMF. """ import os #for checking if filepaths are reasonable, and files/directories exist if (os.name == 'nt'): from asyncio.windows_events import NULL import sys #check python version, exit upon sani...
c7665cf31a5c7564957e4efc3dab0d659bd8619b32515bdaaee90f6b6f85a35d
Python
26,981
686
# This script is part of navis (http://www.github.com/navis-org/navis). # Copyright (C) 2018 Philipp Schlegel # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of...
fe893961c963532939f030f58a92a7bd719dfeeced91831095468026cfc14f7c
Python
27,004
678
#!/usr/bin/python3 ################################################################################## # # MIT License # # Copyright (c) 2025 Kevin Rockenbach, Agnieszka Golicz # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "So...
4560fb41db756c58dd2cc69eb9bdeb60a8a380e7e0a2b93af50fb39c76285a51
Python
27,135
658
# This script is part of navis (http://www.github.com/navis-org/navis). # Copyright (C) 2018 Philipp Schlegel # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of...
2f5f8e498d7ccbf92e24076c04eeafa38507f0b476f952f0a51fe0b03968d6c8
Python
27,138
694
# Copyright (c) Facebook, Inc. and its affiliates. import itertools import logging import numpy as np import operator import pickle from collections import OrderedDict, defaultdict from typing import Any, Callable, Dict, List, Optional, Union import torch import torch.utils.data as torchdata from tabulate import tabula...
e7e51fc063671971365122c01438afddb5f0d00f66db5d82e8a47f1705deafe8
Python
27,232
628
############################################################################ # Copyright (c) 2022-2026 University of Helsinki # All Rights Reserved # See file LICENSE for details. ############################################################################ #############################################################...
48545c93dbdda16b904ef7b394755171937919a917a6a66aceeeaee23dd449a2
Python
27,263
727
# Copyright (c) 2018 10X Genomics, Inc. All rights reserved. """Tools for managing metrics with metadata attached.""" from __future__ import annotations # Copied from cellranger-atac (commit 5ccda578ed71e24289c6ea9bb6dec4d9de5d11dc) import csv import os from collections import OrderedDict import pandas as pd from six...
5f44999a3c613104b55be0b790f8846b782cd956d7ad73d899bf323966af83b1
Python
27,325
736
# -*- coding: utf-8 -*- # Copyright (c) Facebook, Inc. and its affiliates. """ Implement many useful :class:`Augmentation`. """ import numpy as np import sys from numpy import random from typing import Tuple import torch from fvcore.transforms.transform import ( BlendTransform, CropTransform, HFlipTransform...
2880adb276008331e2b0a1100ca1743f8f00214a1aa429a298570272aa6d0106
Python
27,402
705
"""Figure S5 -- Movement control (symmetric 120ms window analysis). Layout: A/B/D: Wheel movement traces, single-trial onset detection, onset distribution C: Movement onset early vs late E-H: PL mod | NPL mod | PL t2max | NPL t2max Wheel movement panels are saved separately from the neural modulation pane...
23699f726ccef97c7078138cc7717d662c5f32515e101446495866da9f731fab
Python
27,441
709
#python genomeTranslate.py """ 1. Download nucleotide FASTA from NCBI by accession (via eutils REST, no Biopython) 2. Six-frame translation using a specified NCBI genetic code table (parsed live from NCBI) 3. Download reference proteome from UniProt 4. For each translated segment between stop codons: check if it is a s...
ceaea404cbbfb0bee164656c2e8443e645ad68f23eb73434ec7f936d73b63499
Python
27,465
722
# This code is in parts based on TopologyProposal in perses # (https://github.com/choderalab/perses) # The eventual goal is to move this to the OpenFE alchemical topology # building toolsets. # LICENSE: MIT # turn off formatting since this is mostly vendored code # fmt: off import itertools import logging import warn...
2558b15cdbdc8f6f60605ee88790c3602f3cfab42cc5acfa65567c0d4e7e47ad
Python
27,470
628
#!/usr/bin/env python3 """ LAMAReg: Label Augmented Modality Agnostic Registration Command-line interface """ import argparse import sys import os import tempfile import shutil from lamareg.scripts.lamar import lamareg from lamareg.scripts import synthseg, coregister, apply_warp from colorama import init, Fore, Style ...
43d22a42b1361f9605253d274f0e960f93da85ebe07d530df8055c1c3210304b
Python
27,476
668
"""Utility functions used with azimuth. Code taken from panhumanpy and edited.""" import numpy as np from scipy.sparse import csr_matrix from sklearn.calibration import LabelEncoder from cellranger.cell_typing.azimuth.azimuth_ref_paths import ( AZIMUTH_INFERENCE_ENCODERS_PATHS_SORTED_LIST, ) ####################...
58c2aa25c16137064422927edf12e45664f97d80e600f54a4c8104280c430ee5
Python
27,526
803
"""Utilities for converting Snakemake apps to BIDS apps.""" from __future__ import annotations import json import logging import os import re import warnings from collections import defaultdict from collections.abc import Iterable from pathlib import Path from typing import ( Any, Literal, overload, ) im...
fcd828a650a13e1c99fde93ff9765761e785301d7231eb3744f449697594b78e
Python
27,566
802
""" Created on Thu Feb 13 11:08:11 2025 @author: dcupolillo """ from __future__ import annotations from pathlib import Path import flammkuchen as fl from tqdm import tqdm import numpy as np from functools import cache import tensorflow as tf from spyne.core.electrophysiology.config import EphyDatasetConfig from sp...
32e4737bb0127e4b28405b52d42ac16a9333c0465619a830307e6d7387de7736
Python
27,617
601
import os import numpy as np import pandas as pd import matplotlib import matplotlib.pyplot as plt import anndata as ad import scanpy as sc from scipy.io import mmwrite, mmread import seaborn as sns import scipy from arboreto.algo import grnboost2 import pickle import collections import pycistarget import pyranges as p...
768f1c44a30b0a3ad20201a71472107c3b0e7ed6e78b04c93a0c4a0ae67e1206
Python
27,640
713
from abc import ABC, abstractmethod import logging import math from typing import Self import numpy as np from scipy.optimize import fmin from scipy.special import expit, logit, softmax from sklearn.isotonic import IsotonicRegression import torch from torch import Tensor from chemprop.utils.registry import ClassRegis...
331ee2117e1de7269ef31f70a7f4496b62b1e27797194ea4af8e030fe161d0d5
Python
27,686
647
# AUTOGENERATED! DO NOT EDIT! File to edit: 43_experimental_diagnostics.ipynb (unless otherwise specified). __all__ = ['posterior_dict_to_table', 'extract_variable_names', 'compute_rhat', 'rank_normal_transformation', 'folded_rank_normal_transformation', 'summarize_parameter_convergence_with_rhat', 'compute...
0e8beb86476618c038d15ea7686ad46f10009efa61555a379b5d4dada61d880a
Python
27,703
687
# -*- coding: utf-8 -*- """Helper code for running spatial nulls models.""" from pathlib import Path import warnings import numpy as np from scipy import optimize, spatial try: # scipy >= 1.8.0 from scipy.ndimage._measurements import _stats, labeled_comprehension except ImportError: # scipy < 1.8.0 from sci...
fd424261e83362880c91cf67b8d90d7ca3947ff2b645d46f72d4c5ef524acac4
Python
27,866
714
""" Helper functions for using kalmax """ from typing import Callable, Tuple, Any import numpy as np import statistics import jax.numpy as jnp from jax import vmap import kalmax from kalmax.kde import kde from kalmax.kalman import KalmanFilter from kalmax.kernels import gaussian_kernel from kalmax.utils import gaussia...
eeed02f54bb368353d8f0cab85da5219016b32695781d4b1969476ccae1fc4ef
Python
27,905
677
"""PyTorch Lightning module for stoichiometry prediction training.""" import gc from typing import Any, Dict, List, Literal, Optional, Tuple, Type import numpy as np import torch import torch.nn as nn from lightning import LightningModule from loguru import logger from torchmetrics import MetricCollection from torchm...
5c50e87d8afa797e8ccaa2f15952dd00d264f388b4234fe63413e20f4aba507e
Python
27,908
750
# -*- coding: utf-8 -*- """long_tail Automatically generated by Colab. Original file is located at https://colab.research.google.com/drive/1DrbUfVBgFblytXlraa_xaabPD22UmHaY Score-CAM comparative analysis across five binary frost vs non-frost models (CNN, BNN, MobileNetV2, EfficientNetV2B0, ResNet50), producing s...
e2a5bab198767b4ff0c5d7a31633d064922ea83f5f59cd7e094ac7d0a3c18622
Python
27,911
801
# -*- coding: utf-8 -*- """ Created on Tue Mar 22 16:30:55 2022 @author: Joseph Vermeil BeadsCalibration.py - Joseph Vermeil, 2022 This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 o...
2fa80f2cd9b433bdd601164b1c637f2dc776190ee049a8b48959c70af593f7bd
Python
27,913
641
# This script is part of navis (http://www.github.com/navis-org/navis). # Copyright (C) 2018 Philipp Schlegel # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of...
acd1986a8cdee6429a54ad118cd4711b10e3196e75a59dcb1dd8d8d64b0d5aa7
Python
27,963
725
# This script is part of navis (http://www.github.com/navis-org/navis). # Copyright (C) 2018 Philipp Schlegel # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of...
925339898ebd40d4d307d63e2ba11a880f029270234c579aae42f2fe045a07cf
Python
28,066
755
# This script is part of navis (http://www.github.com/navis-org/navis). # Copyright (C) 2018 Philipp Schlegel # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of...
7ff5be21fb78fe25e7fff0b9dd0e376640ae74a970a53dab2c54dd6ffa000ad0
Python
28,127
443
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np import pylab import re import os import glob import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec from mpl_toolkits.axes_grid1.inset_locator import inset_axes from optparse import OptionParser SEQUENCE_INDEX = "0" SEQ_NUM = 10 ITERATIO...
e6fb2a3130b987394562f7a9f4056e063dc6e23dfa159957cb81bfbee11bdd12
Python
28,157
772
import numpy as np import pandas import matplotlib as mpl import matplotlib.pyplot as plt import scipy import argparse from fit_to_sjostrom import gen_spike_trains_dt, gen_spike_trains, gen_continuos_spike_trains print(scipy.__version__) plt.rcParams['text.usetex'] = True # Set global font settings fsize = 10 markersi...
17e6f1d2698d432e3b380d204e1c3a76858e906ca0edcde5be64cf43bca25258
Python
28,205
586
""" Storage and retrieval of foreground sampling locations. Report: /home/isensee/git_repos/random_projects/projects/2026-09_preprocessing_io_speedups/REPORT.md Covers this store and the resampling fix on the same branch. Records why preallocating and memory-mapped writing made the store *slower* on NFS, what the pari...
2fc446c9ea613eea2624198ea045fe3b758eb03f54832e0164c0887765ca5986
Python
28,212
780
import navis import pytest import struct import tempfile import numpy as np from pathlib import Path def _can_write_r(): """Check whether the installed `rdata` can write .rds/.rda files.""" import rdata # Writing arrived in rdata 1.0, which requires Python >= 3.11. On 3.10 we # install the last vers...
ff3d0fb893ea262407ce2266e74704599b86ef99893a91638d1db73b5476ca15
Python
28,310
593
""" coregister - Label-Augmented Image Registration for Aligning Neuroimaging Data Part of the micaflow processing pipeline for neuroimaging data. This module performs comprehensive image registration between two images using LAMAReg (Label-Augmented Modality-Agnostic Registration), which combines anatomical im...
9b3bee84cdc8d911a10c33ec6e5d3ad4f44b8085695aa8810c35e0b8127a056b
Python
28,318
483
#!/usr/bin/env python # Copyright 2016-2022 Biomedical Imaging Group Rotterdam, Departments of # Medical Informatics and Radiology, Erasmus MC, Rotterdam, The Netherlands # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obt...
91dcf72f32eeff5afb71ee691e653c02e2a9a35e4ddbc0f0ffc6ea6d2d9646d7
Python
28,354
796
# This script is part of navis (http://www.github.com/navis-org/navis). # Copyright (C) 2017 Philipp Schlegel # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of...
7db2f9de1a6d7941a35f693f534fb4287c3959737c63ac6e0f232a0278330e63
Python
28,363
574
############################################################################ # Copyright (c) 2023-2026 University of Helsinki # # All Rights Reserved # See file LICENSE for details. ############################################################################ """ Stereo-seq barcode detectors. Stereo-seq uses spatial b...
e42dd35c5ffc2d8557e764fa8c1c500ad2ea71684fd9b04a9941b7b9115795e2
Python
28,400
732
from __future__ import annotations import logging import os import statistics import time from collections.abc import Callable from dataclasses import dataclass, field from datetime import datetime, timezone from pathlib import Path from typing import Any from rdkit import Chem from src.database.spreadsheet_source i...
4a6124fa20f376caf497db3b17cc3c7a266289e213b6302c52ded3f7a6cfe0d4
Python
28,424
751
# -*- coding: utf-8 -*- # Copyright (c) Facebook, Inc. and its affiliates. """ This file contains components with some default boilerplate logic user may need in training / testing. They will not work for everyone, but many users may find them useful. The behavior of functions/classes in this file is subject to chang...
e03bec20c64e8366b834e37904841cdcd14ae12008a10d8d983cfce2152baf80
Python
28,468
606
""" This function is very similar to training.py, as we train a UNet with synthetic data. In addition to the input image, the UNet now also takes new inputs: soft probability maps for the target labels. These represent prior information, that would typically be obtained at test time with a first segmenter. If you use...
83233b5212947cda0ed4f893ce5f410130f13644a78c2bcd07f7e72b4e314930
Python
28,469
740
# This script is part of navis (http://www.github.com/navis-org/navis). # Copyright (C) 2018 Philipp Schlegel # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of...
520da1736e3966b306a8602c2f66c089e0ff236b636a7d5f17789f14cddd49e1
Python
28,581
751
#!/usr/bin/env python # # Copyright (c) 2015 10X Genomics, Inc. All rights reserved. # from __future__ import annotations import collections import csv import itertools import json import os import re import subprocess from typing import Any, NamedTuple import numpy as np from six import ensure_binary, ensure_str i...
e94a5155200d77f06753ace83d509d5e1e72e544985118108f6f2db3a8ad21a7
Python
28,642
860
from dataclasses import dataclass, field from functools import cached_property import logging from typing import NamedTuple, TypeAlias import numpy as np from numpy.typing import ArrayLike from rdkit import Chem from rdkit.Chem import Mol from sklearn.preprocessing import StandardScaler from torch.utils.data import Da...
21da3b8b26f51d1c173ba6ee6a44bb8869153db660dfb293ea5be64ab7fccf4a
Python
28,709
784
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe """ Restraint Geometry classes TODO ---- * Add relevant duecredit entries. """ import warnings from typing import Optional import MDAnalysis as mda import numpy as np import numpy.typing a...
e1b446e93626041c3b3c5a0a9c7c2e4e8a6a1c6a113c77748d8de14384ac5e84
Python
28,726
737
#!/usr/bin/env python # # Copyright (c) 2017 10X Genomics, Inc. All rights reserved. # """Types for loading, saving, and using feature reference data.""" from __future__ import annotations import csv import os from collections.abc import Collection, Generator, ItemsView, Iterable, KeysView from dataclasses import da...
9ed1e1a8ee4b553e190c6cfcf095a28b3c69796f07009baab11b60a91c8aef28
Python
28,753
764
"""Chemprop unit tests for chemprop/models/loss.py""" import numpy as np import pytest import torch from chemprop.nn.metrics import ( SID, BCELoss, BinaryMCCLoss, BoundedMSE, CrossEntropyLoss, DirichletLoss, EvidentialLoss, MulticlassMCCLoss, MVELoss, NLogProbEn...
54ea471897bdda2cc9f70acdfa3c4baf19ac5f81a2ad5f4fa538b8ada5011f1a
Python
28,783
812
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe import os import pathlib import sys from typing import List, Literal import click import gufe import pandas as pd from openfecli import OFECommandPlugin from openfecli.clicktypes import Hy...
6f386be654cd4bbcbc6706be4e1f99cce1480075d9f6457bde8aaa0fd7cc0849
Python
28,860
832
""" Data Preprocessing Pipeline for Axon Segmentation Processes large Bielschowsky-stained image tiles and their corresponding axon masks into 128×128 tiles with optional data augmentation. Features: - Grid-based and random tile extraction with configurable overlap - Probabilistic augmentation chain (geometric, inten...
40df38ccb97b2952f08494ad43804cc092759f02760e89240bfec8c1b8a31086
Python
28,943
878
""" tensorflow/keras utilities for the neuron project If you use this code, please cite Dalca AV, Guttag J, Sabuncu MR Anatomical Priors in Convolutional Networks for Unsupervised Biomedical Segmentation, CVPR 2018 Contact: adalca [at] csail [dot] mit [dot] edu License: GPLv3 """ import sys from lamareg.ext.neuron ...
e7deb515ef7c1f2bf80d28485eeeb0c4e2b8767fa5f68309c7c83ec752fa512b
Python
29,024
916
import os import math import random import numpy as np import torch import cv2 from torchvision.utils import make_grid from datetime import datetime #import matplotlib.pyplot as plt # TODO: check with Dominik, also bsrgan.py vs bsrgan_light.py os.environ["KMP_DUPLICATE_LIB_OK"]="TRUE" ''' # ----------------------...
6e131018e73c8981973d118781fba5c656f61b47a6569810c324d036940a3e6d
Python
29,028
732
############################################################################ # Copyright (c) 2022-2026 University of Helsinki # Copyright (c) 2020-2022 Saint Petersburg State University # # All Rights Reserved # See file LICENSE for details. ############################################################################ ...
dc2783234356223f6d6b8e3d5d67ac312c5aa927c573f74fbcb288fb60afbfa5
Python
29,039
707
import numpy as np import math import pandas as pd import os import batch_process.util.file_util as file_util # Lazy import: dataloader pulls in psignifit which isn't always available. # Only needed by get_stim_data() for experimental data loading. dataloader_module = None from collections import namedtuple fr...
ec9f4de5bd1b24af188e3237dd29bf1e2e1afd064db540f635cdb7803ed5a478
Python
29,183
1,170
"""This tests the CLI functionality of training and predicting a regression model on a single molecule. """ import sys import numpy as np import pytest from chemprop.cli.hpopt import NO_HYPEROPT, NO_OPTUNA, NO_RAY from chemprop.cli.main import main from chemprop.cli.utils.MAB_parsing import build_MAB_data_from_files ...
b02db1729126bd79a40f33ad7225c5cd4f32f2d722a61b5441d92f196286817b
Python
29,234
852
"""Mesa visualization space drawers. This module provides the core logic for drawing spaces in Mesa, supporting orthogonal grids, hexagonal grids, networks, continuous spaces, and Voronoi grids. It includes implementations for both Matplotlib and Altair backends. """ from itertools import pairwise import altair as a...
b34bae07752557f94bad0025242e963b0f53521bfb7bf5eb7dbd1e4b20807de5
Python
29,287
830
# This script is part of navis (http://www.github.com/navis-org/navis). # Copyright (C) 2018 Philipp Schlegel # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of...
61f2c519a7f73fa12da9eb90da97b97ec2f8d5f31d42605639c7600cbd321cbe
Python
29,312
469
import argparse import os.path def main(args): import json, time, os, sys, glob import shutil import warnings import numpy as np import torch from torch import optim from torch.utils.data import DataLoader from torch.utils.data.dataset import random_split, Subset import copy im...
eb1f19dea4934618b1f84d3a96938034e3bb05f0c7727440a005bbc07f2b053c
Python
29,385
708
import sys import numpy as np import json from time import perf_counter import pandas as pd import pyqtgraph as pg from pyqtgraph.Qt import QtWidgets from pyqtgraph.Qt import QtCore from pyqtgraph.console import ConsoleWidget from pyqtgraph.dockarea.Dock import Dock from pyqtgraph.dockarea.DockArea import DockArea from...
2aeaa7f087294f470a2dbcb7a26a5960d72766d8c888098e0decbf58b55db915
Python
29,403
676
# -*- coding: utf-8 -*- """ Created on Fri Jul 15 12:25:40 2016 @author: Luciano Masullo, Federico Barabas """ import os import time import math import numpy as np from scipy import ndimage as ndi import tifffile as tiff from PIL import Image import pyqtgraph as pg from pyqtgraph.Qt import QtGui, QtCore import matp...
3f72e769ed7cacde4807664aa83b420a497ede553d95023a07dd37c70a9b949c
Python
29,456
709
import argparse import html import logging import os from calendar import month_name from datetime import datetime from pathlib import Path from zoneinfo import ZoneInfo os.environ.setdefault("MPLCONFIGDIR", "/tmp/matplotlib") os.environ.setdefault("XDG_CACHE_HOME", "/tmp") Path(os.environ["MPLCONFIGDIR"]).mkdir(paren...
06a9ad17f1162ff7821808c663d59cd2e0f8116a997b8446e5a82e81a1076459
Python
29,516
771
""" Cortex dataset handler """ __author__ = "Fabi Bongratz" __email__ = "fabi.bongratz@gmail.com" import os import random import warnings import collections.abc as abc from typing import Union, Sequence from abc import ABC, abstractmethod import torch import torchio as tio import numpy as np import nibabel as nib im...
024e230569e71e9b2e25a5368d0266c345fc34b892ed2bcd7416c3a1f149dc42
Python
29,518
743
''' (c) 2014 Brendan Bulik-Sullivan and Hilary Finucane Estimators of heritability and genetic correlation. Shape convention is (n_snp, n_annot) for all classes. Last column = intercept. ''' from __future__ import division import numpy as np import pandas as pd from scipy.stats import norm, chi2 import jackknife as ...
323e901fb579e8cd25945ffbc162830b871f24af8da179844340a6986cb1a601
Python
29,588
703
import pytest from isoquant_lib.fusion.fusion_validator import FusionValidator class MockDetector: """Mock detector object for testing FusionValidator.""" def __init__(self): self.fusion_metadata = {} self.fusion_candidates = {} self.fusion_breakpoints = {} self.fusion_assigne...
4c0d0ff1229a71ad7042b980352434dfb75b50b0b3e47656f84915bafbd0cabc
Python
29,694
779
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe from typing import Callable import pytest import openfe from ..conftest import mol_from_smiles class BadMapper(openfe.setup.atom_mapping.LigandAtomMapper): @classmethod def _def...
000b157339ad33f859b0b403ec2a9e38699e59c73f13dcffa6458bb2726ffa6d
Python
29,781
611
import sys import numpy as np import torch from torch import nn import torch.nn.functional as F import torch.distributions as dist from torch.nn.parameter import Parameter from torch.nn import init import pytorch_lightning as pl from pytorch_lightning.callbacks.early_stopping import EarlyStopping sys.path.append("/mmV...
2cd12a96139ac016e719e1585f49494465124721caecea8e6709cc01b71345f4
Python
29,789
611
#!/usr/bin/env python3 """AccuSNV pipeline launcher and argparse. This file parses inputs, writes configs, and runs Snakemake. accusnv -m {dryrun,slurm,local} -i samples.csv -r ./ref_dir/ -o out/ [-c config.yaml] [-p pipeline.yaml] Two config files are required for a run: 1. config.yaml - Snakemake execution s...
53296490641266ff41d272c38c574d4f63e10fd3204c1115a5a78e0a935b1b4f
Python
29,812
522
"""Stage 2: annotate candidate mutations against the reference, merge the annotations with the CNN+filter table into the unfiltered table, and split those by CNN label into the final tables. Includes the mutation-annotation library functions inline. Reads ``_snv_state.npz`` and ``snv_table_filtered_tmp.tsv`` (both fro...
9a889d9a973178cee4a72d133f1e243a6550768dc2b65589fcd462be72ba658a
Python
29,845
879
from scipy.stats import mannwhitneyu from batch_process.util.plotting import add_sig_bracket, p_to_stars import batch_process.util.template_util as template_util import seaborn as sns import batch_process.postprocessing.responses_v2.response_plotting_util as rpu from batch_process.util import curate_util import spikein...