sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
e63a1ec84f36ef870723f1dce9e52fac0512cf15aa05b1d96e0fef99f0b99ad7
Python
19,453
540
############################################################################ # Copyright (c) 2025-2026 University of Helsinki # All Rights Reserved # See file LICENSE for details. ############################################################################ import pytest from isoquant_lib.barcode_calling.common import ...
76cb6b1b2c3f1a713d27b897d8f0e33f7a0ecdc7f9a8afc3e1290a6b895df24c
Python
19,524
435
# Copyright (c) Facebook, Inc. and its affiliates. import logging import math import numpy as np from typing import Dict, List, Tuple import fvcore.nn.weight_init as weight_init import torch from torch import Tensor, nn from torch.nn import functional as F from detectron2.config import configurable from detectron2.lay...
0e1ad6469d0c7e81866a1de4d131f2d98d6051e4aa6df17a8a27f3bc7d179f93
Python
19,548
637
#!/usr/bin/env python3 """ Fully isolated SynthSeg inference script for hippocampus segmentation. This script contains all necessary code and does not require local imports. Author: Mahmoud Yaser (mahmoud1yaser) """ import argparse import os import time import torch import torch.nn as nn import torch.nn.functional as...
045288d87cabf3c2d225ef4cc0e1c7edf6589dc2c71b0f8d3c3aac9958cdf283
Python
19,552
447
# Copyright (c) 2019 10X Genomics, Inc. All rights reserved. """Iterate over the input molecule info file and calculate on-target and off-target on a per-read basis. These metrics are stratified into a data loss hierarchy, where at each step of data loss the number of on-target vs. off-target are quantified. Also add...
79dc5c3381eef29fabaedb4a8c7a16bc872fc6fae8adcf6a785385a8b72a3a12
Python
19,574
490
''' Created on 19.10.2020 Author: Michael Diedenhofen Max Planck Institute for Metabolism Research, Cologne Read Bruker ParaVision data (2dseq) and save as NIfTI file. Create a b-table text file with b-values and directions for diffusion data. ''' from __future__ import print_function try: zrange = xrange excep...
e681b8ed372f27ecc148d166257d769cbc131b4c39162286fbb3d66633144b08
Python
19,605
533
""" Convenience entrypoints to run experiments and visualizations from the experiments/ folder. This module provides: - run_regular_hide_the_label - run_hard_hide_the_label - run_regular_open_race - run_hard_open_race - visualize_hide_the_label_mean_steps - visualize_open_race_best_so_far - run_experiment: a general d...
35dac81700080bfbbbd8d578d2581c8c1bdc98cd029981a42ff237c72f31f052
Python
19,613
557
# Copyright (c) Facebook, Inc. and its affiliates. import datetime import json import logging import os import time from collections import defaultdict from contextlib import contextmanager from functools import cached_property from typing import Optional import torch from fvcore.common.history_buffer import HistoryBuf...
809073216a6e92cd1c976c4f676bd0ce22eb73282cc830f9686082635939788e
Python
19,619
548
import os import re import math import logging from glob import glob import numpy as np from scipy.spatial.transform import Rotation as R import twixtools as twx try: import cupy as cp from cupyx.scipy.fft import ( fftshift as cfftshift, ifftshift as cifftshift, fftn as cfftn, ifftn as cifftn ...
5d0c43c6f17d467d25af7b07d5cf5b8531db5a6490731c207d4f315c2ec0aafb
Python
19,682
420
# Read molecules and record elements, formal charges, aromatic atoms, # n bonded atoms, bonds, angles, propers, impropers and molecule indices # Output uses one-based indexing # See also https://github.com/openmm/spice-models/blob/main/five-et/createSpiceDataset.py # Also set up starting structures for condensed phas...
0deb7189169eec5ff30bbf9e147f9b271dc5a14e0da38dde607cf2cbfe9c02c7
Python
19,683
381
""" code snippet to initialize the component W and H with, using basic QR and SVD to break down XX^T. """ import os import sys import numpy as np import scipy.linalg import scipy.stats script_name=os.path.basename(__file__) module_name=os.path.basename(__file__) def get_objective_function(X, W, trXtX = -1, W_ORTHOGON...
dbffb688d9e734fd925d1be0b5442bd1075f9be0596850e8e86c823c57080c8e
Python
19,685
521
# -*- coding: utf-8 -*- """ Figure 3: structure-function relationships """ import numpy as np import pandas as pd import matplotlib.pyplot as plt import matplotlib.patches as patches from matplotlib.colors import ListedColormap from netneurotools import datasets, stats, plotting, metrics from scipy.stats import zscor...
4a94e4c736439e4b47cbb8e71b63d60b44503212874a202bd1a9434ff2aaa510
Python
19,778
766
""" Functions on surface mesh elements. """ # Author: Oualid Benkarim <oualid.benkarim@mcgill.ca> # License: BSD 3 clause import numpy as np import scipy.sparse as ssp from scipy.spatial.distance import cdist from scipy.sparse.csgraph import dijkstra import vtk from ..vtk_interface import wrap_vtk, serial_connect ...
696dcf8e1479fce2db65093a5f1c71bfe21082bb72ccdc24281d8fd8f08375b4
Python
19,826
492
"""Continuous States Descriptor. Provides piecewise-linear and piecewise-quadratic trajectory tracking, and declarative threshold monitors natively integrated with mesa_signals and the standard Mesa event queue. """ from __future__ import annotations import contextlib import math from collections.abc import Callable...
88ab44cf76475f90a9705e4e44dc2293e33e2fa4384e856e0a8a2f1824458da8
Python
19,847
471
""" Transformations =============== <!-- difficulty: intermediate --> Move neurons between brain templates and mirror them across the midline. As of version `0.5.0`, {{ navis }} can transform and mirror spatial data such as neurons. The functionality splits into high-level functions (which most users want) and the lo...
8f9e6123ae83e33ea3a3fc48b8285a6e80eb52b9e90ead19148806d5613d20aa
Python
19,848
530
import math import os from abc import ABC, abstractmethod from typing import List, Union, Type from typing import Optional, Sequence, Tuple import blosc2 import numpy as np from batchgenerators.utilities.file_and_folder_operations import join, load_pickle, isfile, write_pickle, subfiles from nnunetv2.configuration im...
90cb355400072c8aae0a2e19e8f27b75d7b0ee33d4bcb2141ce1fdde9e411fc8
Python
19,848
616
""" Created on Mon Nov 6 10:29:44 2023 @author: dcupolillo """ from __future__ import annotations from pathlib import Path import tifffile from ROIpy.core.bundles import NodeBundle, ScanfieldBundle from ROIpy.core.utils.utils import ( stack_metadata_dictionary, parse_swc, parse_stack_metadata, assign_bran...
d931361e61ec710ec74abd435214c305d1f652050a012a21db0ec1fbaeb531f4
Python
19,848
539
# Copyright (c) Facebook, Inc. and its affiliates. import copy import itertools import numpy as np from typing import Any, Iterator, List, Union import pycocotools.mask as mask_util import torch from torch import device from detectron2.layers.roi_align import ROIAlign from detectron2.utils.memory import retry_if_cuda_...
bb040af37be8c811bd2e9bdf606592c3e2ac77c2f5c40da1e601faed69753bbd
Python
19,885
510
#!/usr/bin/env python # # Copyright (c) 2019 10X Genomics, Inc. All rights reserved. # """Functions for summarizing a CountMatrix.""" from __future__ import annotations from collections import OrderedDict from functools import reduce from typing import TYPE_CHECKING import h5py as h5 import numpy as np from six imp...
eef21728699e975d495e219f96302a6bd6c79e9a762b276b804c06118f9913ee
Python
19,902
545
#!/usr/bin/env python # # Copyright (c) 2019 10X Genomics, Inc. All rights reserved. # from __future__ import annotations import os import re import xml.etree.ElementTree as ET import cv2 import martian import numpy as np import skimage.io from PIL import Image, TiffImagePlugin import cellranger.spatial.tiffer as t...
9ce1424613ec07dcfbc6c592f11887a07d23f023c60a24c21d0ad824764d8754
Python
19,907
451
#!/usr/bin/env python3 # ############################################################################ # Copyright (c) 2022-2026 University of Helsinki # Copyright (c) 2020-2022 Saint Petersburg State University # # All Rights Reserved # See file LICENSE for details. #####################################################...
07498b01bf2c29b263372a21897f1394b750eb2fc921c526d2f1309c372ccadb
Python
19,910
493
import logging import re from os import PathLike from pathlib import Path from tempfile import TemporaryDirectory from typing import Any, Dict, Generator, List, Optional, Sequence, Tuple, Union from zipfile import ZipFile import numpy as np import pandas as pd from scipy.ndimage import maximum_filter from .. import i...
e3a745ea7e2118bbbe2d0fed45044fe6f07689f197527fe699d04163ca0a7025
Python
19,912
567
from unittest import mock import networkx as nx import pytest from matplotlib import pyplot as plt from matplotlib.backend_bases import MouseButton, MouseEvent from numpy import testing as npt from openfe.utils.network_plotting import Edge, EventHandler, GraphDrawing, Node def _get_fig_ax(fig): if fig is None: ...
00d079015501658eb2466dff3f605ab1a5d40957240ad8da6870bd261f550e81
Python
19,914
634
""" Graph Neural Network architectures for molecular property prediction. Each architecture supports both classification (sigmoid output) and regression (raw output) via the ``task_type`` constructor parameter. """ from typing import Callable, List, Optional import torch import torch.nn as nn import torch.nn.function...
8343c53e5f975fcda0b8aeedfd05432ba9a7cfe2c132b0b196b24c331cb0600f
Python
19,946
545
# responses/stim_condition_response.py import numpy as np import spikeinterface.full as si import batch_process.postprocessing.stim_response_util as stim_response_util import batch_process.postprocessing.responses_v2.pulse_locked_response_metrics as plrm import batch_process.util.template_util as template_util class ...
6959b117092581a2ae22f6805a4a58826b0eacc37884f525c5a0f00bcf3db048
Python
19,962
343
"""Reproduce the Extended Data Fig. 7 SAGAT results figure and statistics. Situation Awareness Global Assessment Technique (SAGAT) study on public-road scenarios: per-participant accuracy on perception (Q1-Q4), comprehension (Q5) and projection (Q6) questions, split by surprising ('positive') vs unsurprising ('negativ...
265c2e9ec8d4b0ee111108c9a90a58920a029c8845ddc7457264ed0a3d8a7b1f
Python
19,967
468
import numpy as np import matplotlib.pyplot as plt from matplotlib.gridspec import GridSpec import seaborn as sns import pandas as pd from pathlib import Path import batch_process.util.plotting as plot_util import batch_process.util.classify_cell_type as cell_classifier import os import batch_process.util.file_util as ...
835469b597b6bad940abcf15b2c596981bd008ef141fbf94542391c85e69b2e0
Python
20,022
588
from matplotlib.patches import Patch import numpy as np import matplotlib import matplotlib.pyplot as plt from matplotlib.gridspec import GridSpec import seaborn as sns import pandas as pd from pathlib import Path import os import dill as pickle import shutil import re from collections import defaultdict from matplotl...
47b58a064ffca63cb68844cb7e6ea5c423b9547402676cd16b30ad72a40740db
Python
20,072
634
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe import itertools import os import pathlib from importlib import resources import MDAnalysis as mda import numpy as np import pooch import pytest from openff.units import unit from rdkit imp...
dbfa7503010618b118fd3af428b1d57561ac84f15933f23ac1d4a63641e28a55
Python
20,072
494
# 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 th...
3abe1176f772895c92b6000b0d31da0f92fede152cd483f05786c4a66daecff4
Python
20,078
399
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...
8bf8d70c92171f2e3c1316800d5ee6c83f99d208378aee024eea4e5419c6b04c
Python
20,114
570
""" Created on 10/08/2017 @author: Niklas Pallast Neuroimaging & Neuroengineering Department of Neurology University Hospital Cologne Edited by Paul Camacho 2025 """ import nipype.interfaces.fsl as fsl import os, sys import nibabel as nib import numpy as np import applyMICO import nipype.interfaces.ants as ants im...
abdace999bf733410176f6b65f95f1231ba01b092a010e178d6dfddd3dda627e
Python
20,166
693
from __future__ import annotations import copy import itertools as it from collections.abc import Container, Hashable, Iterable, Sequence from os import PathLike from pathlib import Path from string import ascii_letters, digits from typing import ( TYPE_CHECKING, Any, TypeVar, ) import hypothesis.strategi...
e1471ac666f662ba537df9a2df9554e91768e5016f36a32e55ba6058b89aecc9
Python
20,168
641
"""shout-out to https://github.com/lucidrains/x-transformers/tree/main/x_transformers""" import torch from torch import nn, einsum import torch.nn.functional as F from functools import partial from inspect import isfunction from collections import namedtuple from einops import rearrange, repeat, reduce # constants DE...
f7e7c2a322678144cc7c7516ea1ed968477d6b424c16282ef49db08af60c4f89
Python
20,177
482
import time import argparse import pickle import os import datetime import torch import torch.optim as optim from torch.optim import lr_scheduler from utils import * from modules import * import copy import os parser = argparse.ArgumentParser( 'Neral relational inference for molecular dynamics simulati...
ec596492b2a0d11c81fbf6fd4c5f1124189fc90e20604fe4eb4437d5f8078771
Python
20,235
584
"""Core event management functionality for Mesa's discrete event simulation system. This module provides the foundational data structures and classes needed for event-based simulation in Mesa. The EventList class is a priority queue implementation that maintains simulation events in chronological order while respectin...
c82213387db239a32613c749002dd29a1fa8b22a49089f69261f775f054bc8e2
Python
20,321
435
"""Main TAPA pipeline orchestrator.""" import os import shutil import warnings from pathlib import Path import nltk import torch import whisper from resemblyzer import VoiceEncoder from .alignment import ( find_mfa_bin, parse_textgrid, parse_textgrids_dir, prepare_mfa_input, prepare_mfa_input_seg...
1285d422040c453b60650b6d459cc1116122a7163d4d34c044631d979e05429d
Python
20,403
423
#python anamolyDetect.py "Z:\Download\proteinGroups.txt" 51 import pandas as pd import matplotlib.pyplot as plt import numpy as np import re import sys import os from collections import Counter import argparse from scipy.stats import chisquare def extract_first_digit(value): str_value = str(value) match = re.s...
abf514ab50a24a4e90863c05e4f98066960530dca158d5cd650c9b751d300a3a
Python
20,417
390
############################################################################ # Copyright (c) 2022-2026 University of Helsinki # Copyright (c) 2020-2022 Saint Petersburg State University # # All Rights Reserved # See file LICENSE for details. ############################################################################ ...
7689be90ebcb81092b4e1bc4fef8deaaf9dee91f359e9d97882317582279fa0b
Python
20,423
519
import glob import os import pathlib from unittest import mock import pandas as pd import pooch import pytest from click.testing import CliRunner from openfecli.commands.gather import ( _get_column, _get_legs_from_result_jsons, _load_valid_result_json, format_estimate_uncertainty, gather, ) from o...
c11369a1bb989a1b93f4c8de95cf55e9a38126c5d86e5caab74e76c73e92db6b
Python
20,475
391
import os import numpy as np import pandas as pd import umap import matplotlib.pyplot as plt import matplotlib import anndata as ad import scanpy as sc import scvelo as scv import scanpy.external as sce from scipy.io import mmwrite, mmread import scipy np.random.seed(42) # peak-gene linkage matrix dir_path = "/home/n...
568e0c05e137b91bf730161b67c54e072916a973fc7359c24ef513f11e12ba8d
Python
20,583
476
""" velocity_uncertainty.py Quantifying the uncertainty of RNA velocity / chromatin velocity in mmVelo by decomposing it into three layers. 3-layer decomposition: 1. State-estimation uncertainty : sample z from q(z|a,s,u) (d fixed at posterior mean) → reliability of local...
09d760b2a3f44cad5d3730a61f70a5ad88e7f7909d4d831e38ac5f0b497daad3
Python
20,595
410
""" This function is for training a network using synthetic scans generated from a set of training label maps. See details in the docstring below. If you use this code, please cite one of the SynthSeg papers: https://github.com/BBillot/SynthSeg/blob/master/bibtex.bib Copyright 2020 Benjamin Billot Licensed under th...
a3b10c566702c4ed2028668d19faaf9182f99690ec0496976987a627136d4d55
Python
20,595
515
import os from pathlib import Path import pandas as pd import numpy as np from sklearn.feature_selection._base import _get_feature_importances from sklearn.feature_selection._from_model import _calculate_threshold from .utils import compute_CI, permutation_test_between_clfs from .visualization import scatterplot_regre...
583bb517d2a47477ee6c84b7b80d4bc4bb75ab029ce7b45313ab5175b6f000a9
Python
20,621
556
"""Builds the canonical HFB annotation tables that are reused. This module is the shared substrate for the analyses. It loads the significance-tested three-neuron HFB detections for a single representative, post-trained trial of a given ``(experiment, model_type)`` combination, and joins: * each PNG's structure (cons...
04503cd6d06523e1cf485f191a8b3e2473c28e4bda2429a225d3c193553075a1
Python
20,623
577
"""Generate the `llms.txt` family from the curated API index. Agents (and the humans driving them) need the shape of the API in a single cheap fetch. Three tiers get written to the docs root: - `llms.txt` the index: `llms_preamble.md` (the idioms an agent can't infer from signatures) fo...
f8be44e499bc8b03df4f23eb68bce15a60d508829176267be337f57c3547e0a2
Python
20,626
361
import argparse import multiprocessing import shutil from typing import Union, Tuple, List, Callable import numpy as np from acvl_utils.morphology.morphology_helper import remove_all_but_largest_component from batchgenerators.utilities.file_and_folder_operations import load_json, subfiles, maybe_mkdir_p, join, isfile,...
4b7d2b86851ae84dccb64cae4c95d11b8bad236c5d540053fdcc26ea568937fa
Python
20,647
696
# AUTOGENERATED! DO NOT EDIT! File to edit: 45_models_lm.ipynb (unless otherwise specified). __all__ = ['log_logistic_func', 'conditional_gaussian_mean', 'conditional_gaussian_cov', 'compute_logistic_loglikelihood_old', 'compute_logistic_logodds', 'compute_logistic_loglikelihood', 'bayesian_logis...
61268ce1d69b71ebac25a6220f9644cbec6f82638ab4fcff9d0be487b16728c2
Python
20,666
486
""" From Neurons to Model Inputs ============================ <!-- difficulty: advanced --> Turn neurons into fixed-size model inputs: feature point clouds and batchable patches. Neurons are variable-sized graphs and meshes with uneven node/vertex density. Most models want a fixed number of points, sampled evenly and...
c6b4edbc17be165e5c7aa53614c1c7b4f26db6cab0c966774537cab0b1cccabd
Python
20,720
446
# -*- coding: utf-8 -*- """ Created on Sun Nov 3 13:52:44 2024 @author: ronsun """ import pandas as pd import urllib.request import nrrd import numpy as np import h5py import os import logging from mcmodels.core import VoxelModelCache, Mask import time from pathlib import Path from allensdk.core.re...
44664aeb2a5dd1a569e3185acfd3866b7c0bd080afd9a4eecea2a6bdf1ef2034
Python
20,740
577
# Copyright 2019 Image Analysis Lab, German Center for Neurodegenerative Diseases (DZNE), Bonn # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-...
5dfc13bd6b28cbe1ca21d28f8557061a4006918bfb4f8194b12842139b9418ee
Python
20,741
441
#!/usr/bin/env python3 # # ############################################################################ # Copyright (c) 2023-2026 University of Helsinki # # All Rights Reserved # See file LICENSE for details. ############################################################################ import logging import os import s...
860b3f54640241b47cb0bd6c9ac7b868146e4270b2177df8d2635046a08db6c6
Python
20,745
452
import numpy as np import pandas as pd import mrcfile from skimage.morphology import skeletonize_3d, medial_axis, remove_small_objects from skimage.color import label2rgb from scipy.ndimage import morphology, label, binary_erosion, convolve from scipy.spatial import distance from scipy.interpolate import splprep, splev...
f7db9c53b4cebb8b68df76f8c51c718194f27e004b3d8cdd3d317d9a998cfdbf
Python
20,783
407
############################################################################ # Copyright (c) 2022-2026 University of Helsinki # Copyright (c) 2019-2022 Saint Petersburg State University # # All Rights Reserved # See file LICENSE for details. ############################################################################ ...
788e393462781312fb30c9d1247fa1dfa39b81a4062cbcb86c94ded732287f2e
Python
20,788
682
from __future__ import annotations import pyabf import numpy as np import tensorflow as tf import miniML def init_containers( n_sweeps: int, event_len: int ) -> tuple[ np.ndarray, np.ndarray, # events, events_x np.ndarray, np.ndarray, np.ndarray, # amplitudes, peak_values, peak_x np.ndarr...
f98d4feeb4754e5789136eedd08adbbf7ceb1a0c57603c7839255ba5739208eb
Python
20,815
558
import os, tarfile, glob, shutil import yaml import numpy as np from tqdm import tqdm from PIL import Image import albumentations from omegaconf import OmegaConf from torch.utils.data import Dataset from taming.data.base import ImagePaths from taming.util import download, retrieve import taming.data.utils as bdu def...
3c256671822e5e10845669dd96eb6498ad30e1706f8c1ac49a99b222f9bf11e4
Python
20,936
537
""" Masking ======= <!-- difficulty: intermediate --> Restrict analyses, plots and edits to part of a neuron - reversibly. !!! example "New in {{ navis }} 2.0" Masking is new and we are keen to hear how it holds up on real data. Please read [Caveats](#caveats) and [Antipatterns](#antipatterns) before relying ...
e319a2ab4d1f0c1a9232cef50f6710ad52d5b0b75b0c4abc266bfa5462e50c53
Python
20,967
534
import torch import torch.nn as nn import torch.optim as optim from torch.utils.data import random_split from torch_geometric.loader import DataLoader import os os.environ["PYTORCH_CUDA_ALLOC_CONF"] = "max_split_size_mb:1024" import sys import time from tqdm import tqdm import ast import random import numpy as np imp...
bd091f150296d59be5fd7e4b2530476357d070d9cc4bac1ca9ad2a0f5f43e53b
Python
20,991
412
"""Stage 5b: the interactive SNV dashboard (``snv_dashboard.html``). Reads the group's ``snv_table_unfiltered.tsv`` and ``_snv_state.npz`` from stage 2, plus the parsimony tree from stage 4, and writes one self-contained HTML page holding every candidate position AccuSNV considered, kept or not, why each was kept or d...
ae3333cccadfce1f5b81f3b8bd395e583ef21eb5709e65d37dbc7790a7a0168f
Python
21,050
538
############################################################################ # Copyright (c) 2025-2026 University of Helsinki # All Rights Reserved # See file LICENSE for details. ############################################################################ import pytest import tempfile import os from isoquant_lib.assi...
4513ea0b49cc39dd78c4944a24bc9aa88dec425f9cbf7331661891834f1e6c31
Python
21,057
362
import os import torch import warnings from ndreamer.model import NDreamer_DL from ndreamer.matching import * from ndreamer.statistics import get_significant_names import time import anndata as ad class NDreamer(torch.nn.Module): def __init__(self, adata, condition_key, contorl_name, num_hvg, require...
da99d9f77efbe18f13b63dd91bdda084083a2f6f9483281b6deb645919280b8a
Python
21,115
606
#!/usr/bin/env python # # Copyright (c) 2014 10X Genomics, Inc. All rights reserved. # # Functions for preflight checks # from __future__ import annotations import os import platform import re import resource import socket import subprocess from collections.abc import Callable, Iterable, Mapping from ctypes import c_...
0eda14bb5ebcdf336c80fff6596f4ff5776add0b6bc01ca785deb540dcee5975
Python
21,154
358
""" If you use this code, please cite one of the SynthSeg papers: https://github.com/BBillot/SynthSeg/blob/master/bibtex.bib Copyright 2020 Benjamin Billot Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the Lice...
38b7a118a8a48deba686a9d3790373828ad054ec0877a275a997c096c4534a9d
Python
21,183
503
#!/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...
635bf61ccbaa058075df97cffaad8886d127fb4c2b448fe0be970756d48a29a9
Python
21,183
564
############################################################################ # Copyright (c) 2026 University of Helsinki # All Rights Reserved # See file LICENSE for details. ############################################################################ """Unit tests for CI test config loading (YAML and TSV formats)."""...
e4d151a1a785c2eacd8b767b225de6cf2a1868b4c6cacaf4cbe2d09e60640723
Python
21,183
616
import pickle import numpy as np import pytest import navis from navis.compute.dispatch import picklable_by_reference from .test_compute_backends import DummyBackend, registry # noqa: F401 #: Backends that need no optional dependency and so always run here. `pathos` #: and `joblib` are added via `importorskip` in...
29bd221a5b4cee45fb57314497d5d684e2494a227f413f4e49c6b1e030c320f8
Python
21,185
555
# 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...
a99446719332e812db219011521ab4fca55a2c0daf01dfbaf19a95becb7e2b3a
Python
21,217
625
""" Neuron Types ============ <!-- difficulty: beginner --> The four neuron types — skeletons, meshes, dotprops and voxels — and when to use each. Depending on your data/workflows, you will use different representations of neurons. If, for example, you work with light-level data you might end up extracting point clou...
82ea2c4d7cf7945367193cc5022e2fd93c871175f4acb72aa133ce10242aeb46
Python
21,231
476
""" IVSCC morphometrics =================== <!-- difficulty: intermediate --> Measure cortical neurons compartment by compartment. !!! important "This example is not executed" Like the [skeleton QC tutorial](zzz_tutorial_morpho_04_qc), this one is *not* run when the docs are built - it pulls ~25 reconstructio...
4d59823843bbfbee2de4ef1d580e1d6c7f078ea5ea5593cfb78b5163ac741088
Python
21,239
599
############################################################################ # Copyright (c) 2025-2026 University of Helsinki # All Rights Reserved # See file LICENSE for details. ############################################################################ import pytest import tempfile import os from isoquant_lib.util...
b11cf4005a231c971129174747ec27447e9d50dd0483e109ed5560e59ee53996
Python
21,375
523
# # Copyright (c) 2024 10X Genomics, Inc. All rights reserved. # """Utilities to run cell annotation on the cloud.""" import os import pathlib import time from dataclasses import dataclass from urllib.parse import urlparse import martian import requests import cellranger.cell_typing.broad_tenx.cloud_cas_client as c...
1f1f5ad2367564cee140928809cf2b1ded39ebf0d2dbc0d9d59ff0b78ef742a0
Python
21,421
530
""" Module to perform semantic segmentation with either DeepD3 or nnU-Net, and subsequent post-processing of predictions. Each segmentation is perform through subprocesses to ensure modularity and avoid dependency conflicts between TensorFlow (DeepD3) and PyTorch (nnU-Net). The main function is `semantic_segmentatio...
8b2a1f5d73ccb846b26f96596c6664f400a51eda5f07b8d223291b7bd9f2537e
Python
21,471
584
"""Figure S8 -- Electrophysiological unit tracking. Panels: A: Example tracked waveforms (overlaid across sessions) B: Raster of all tracked units C: Waveform distance, tracked pairs vs nearby non-matched units D: Modulation trends restricted to tracked units (PL z-score, NPL z-score, PL t2max, NPL t2max,...
976229eeb6c5ba7561e6e9c07f0329d3f39d53a99e9fee3cec9c4ceb80d8870a
Python
21,534
544
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Sparse GP Approximations for Speed-Up Comparison This module implements various sparse GP approximation methods: - Nyström approximation - FITC (Fully Independent Training Conditional) - VFE (Variational Free Energy) These methods provide significant speedups for lar...
3a96f61c7c595e971af1af654cc041af3f7d7e390eafe3c9604b932b2f6a30d8
Python
21,548
597
import glob import pickle import numpy as np from numpy import sqrt from numpy import argmax import sys import os import pandas as pd import seaborn as sns import itertools from sklearn.metrics import roc_curve, precision_recall_curve, brier_score_loss, accuracy_score, precision_score, recall_score, f1_score import ma...
b423a5cdefadc064ef26bf0d76e6a20d22b25d34ea000f2e435c0d1c56397a18
Python
21,640
375
############################################################################ # Copyright (c) 2022-2026 University of Helsinki # All Rights Reserved # See file LICENSE for details. ############################################################################ import pytest import unittest import isoquant_lib.common as c...
0c627a4b2dfa00d290c1c6f7dc92f04e53359ab320437c6e0ab242ab8959494f
Python
21,670
479
#!/usr/bin/env python # # Copyright (c) 2017 10X Genomics, Inc. All rights reserved. # from __future__ import annotations import cellranger.library_constants as lib_constants import cellranger.vdj.utils as vdj_utils import cellranger.webshim.constants.shared as shared def vdj_gene_pair_format(gene_pair_str): ""...
02a40cf56c20af039967ba4d1bf81a6d892c6065bb3b20f9ba4145dbaa397cfb
Python
21,709
498
""" This code is for training is traditional supervised networks with real images and corresponding ground truth labels. It's relatively simpler than training.py since it here we do not have to generate synthetic scans. However we kept the parameters for online augmentation. If you use this code, please cite one of t...
ceb6fb93c1976cfee86396471b9d40bbbd88a0420ca0daa93b40c58b4a75f008
Python
21,713
469
''' Created on Oct 25, 2024 @author: voodoocode ''' import struct import numpy as np import os import scrubber.core import csv IN_PATH = "/mnt/data/Professional/LMU/data/Beta-prevalence/database4/original/" OUT_PATH = "/mnt/data/Professional/LMU/data/Beta-prevalence/database4/scrubbed/" COLLECTION_META_PATH = "/mnt...
5cf1e3da1357be4fcc02ee9896c4e754f806eea7c311bbf43995eb3ab8e7ed34
Python
21,748
627
""" Dataset splitting strategies for molecular property prediction. Provides random, scaffold-based, and clustering-based splits that are appropriate for evaluating generalisation in molecular ML. """ import logging from collections import defaultdict from typing import Dict, List, Optional, Sequence, Tuple import n...
6723cad79f6a23aad5b67e23799a71f445cd4ca3e29e0b3ce0a6af180ebdeab6
Python
21,752
486
# 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...
c341567a805e542121ad541b4a651c5bb68e2adb9ef7fe451ad2128bbe62d422
Python
21,761
540
# 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...
eab121f2acc153285d31c4247027bd6716708412d5cdb09dfc396f586deb051c
Python
21,766
573
import json import logging import shutil import subprocess from enum import IntEnum from importlib import resources from os import PathLike from pathlib import Path from typing import ( Any, Generator, List, Mapping, Optional, Protocol, Sequence, Tuple, Union, ) from uuid import uuid...
9f2d9a628183dfe06349c41717d41371da5d49c758a808cfca21c79638ccd627
Python
21,775
377
"""Reproduce Figure 3 (on-road private-track results). Panels and outputs (saved to plots/): Fig 3a (CLOSE): CLOSE_global.pdf (speed vs Close-concept probability with OLS fit; Pearson r and intercept printed to stdout) and CLOSE_local.pdf (Close-concept probability over time with driving-mode shading). Fig...
344073dd519c2d76c98d0a75aa0cbaca52da4c1bec9717f3423a013da2ffe3bd
Python
21,786
555
# 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...
0a5ab20638dec95db3da8aacecef93a58221a7e8961b5985a0ba83762a19b8ba
Python
21,811
523
"""Mesa Data Collection Module. DataCollector is meant to provide a simple, standard way to collect data generated by a Mesa model. It collects four types of data: model-level data, agent-level data, agent-type-level data, and tables. A DataCollector is instantiated with three dictionaries of reporter names and assoc...
2a3522caeb88b48f3437f07f994c51fd9585a1fdb95f71f54fcba806c177d644
Python
21,811
580
from __future__ import annotations import itertools as it import re import string from collections.abc import Sequence from typing import Any, cast import more_itertools as itx import pytest from bids.layout import Query from hypothesis import assume, given from hypothesis import strategies as st from snakebids.core...
c1b0a8997e5ad05d7ffc4458ff9bd366822f41fd1bd482afd321ffdb612f4fb1
Python
21,821
599
# Copyright 2019 Image Analysis Lab, German Center for Neurodegenerative Diseases (DZNE), Bonn # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-...
9c8f934b34cb423cfcc166f47c2a675a57844f918117da0b8fe635c7b83f7894
Python
21,832
764
#!/usr/bin/env python """Create generalized TF-activity summary tables and manuscript-oriented plots.""" from __future__ import annotations import json from pathlib import Path from typing import Any import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt import numpy as np import pandas as pd from ...
855baa3c4acdc58934bb969792d8e40c210b646049f6d1b5e305463b52df6eaa
Python
21,841
350
# -*- coding: utf-8 -*- # Copyright (c) Facebook, Inc. and its affiliates. """ Note: For your custom dataset, there is no need to hard-code metadata anywhere in the code. For example, for COCO-format dataset, metadata will be obtained automatically when calling `load_coco_json`. For other dataset, metadata may also be...
d23436fc830af509f97616b3f95c209465d1bc0a96c307eb753573e4f42f5c2d
Python
21,855
579
import numpy as np import torch from torch.utils.data.dataset import TensorDataset from torch.utils.data import DataLoader import torch.nn.functional as F from torch.autograd import Variable def my_softmax(input, axis=1): trans_input = input.transpose(axis, 0).contiguous() soft_max_1d = F.softmax(trans_input,...
c25dd78835a74e8d3409f33e52f7a7b998fab9ffb4873302d81e75fa2de312f1
Python
21,891
554
#!/usr/bin/env python # # Copyright (c) 2022 10X Genomics, Inc. All rights reserved. # """This file contains plots in the analysis tab that are directly related to the outputs of the SC_RNA_ANALYZER pipeline for. gene expression and/or antibody capture, e.g. TSNE plots, clustering plots, differential expression table,...
43b0568835afc8169971f8439d654ce345ad68ee3393b4dd61dbe1d4516457ee
Python
21,934
593
"""Tests for the collage/grid layouts. The layouts themselves are `navis-fastcore` (rasterise, then pack); what is checked here is the navis half — that the page, the views, the scaling and the neuron handling all line up, and above all that the invariants the layouts promise actually hold on real neurons: nothing ove...
411909043e0764fd1cb64d0403dcae4a82602c4f8c9549845dea897233961ce1
Python
22,003
619
# SPDX-License-Identifier: MIT """ Spatial autocorrelation functions using Moran's I. This module provides functions to compute Moran's I for long-read spatial transcriptomics data, including permutation-based significance testing and FDR correction. """ from pathlib import Path import pandas as pd import numpy as np...
bb227e7cefb8f77b76896e19bc68051bc39108fdd2a2009fdc28474191485d84
Python
22,027
548
""" denoise - Diffusion-Weighted Image Noise Reduction Part of the micaflow processing pipeline for neuroimaging data. This module denoises diffusion-weighted images (DWI) using the Patch2Self algorithm, which leverages redundant information across diffusion gradients to remove noise without requiring additio...
d357579c39f1628e3561984d042d498f9e48824f25f38e25fdda2f853adfb12b
Python
22,056
569
""" Experimental Stage 2 — PPT-based waveform curation (replaces sortingview). Uses the same curation pipeline as the control animals: 1. Load curation_config.json for rescue_ids / remove_ids 2. Select accepted units from stage1_analyzer_raw.zarr 3. Run waveform curation: a. Remove bad waveforms (blanking a...
0176906ec54540031b4c86e3003b014eac0371135c0a209c911f51f7d461f799
Python
22,111
490
""" velocity_off_manifold_mod.py We quantify on- and off-manifold uncertainty of latent dynamics in mmVelo directly within each modality-specific space. Unlike the latent-space decomposition implemented in velocity_off_manifold.py, this approach constructs local tangent spaces based on denoised modality-specific re...
5fe0252d92504ad73db7588fca83c41690071e7ed0c5ff469802a80da0716560
Python
22,122
601
#python parseMGFcluster.py L:\promec\Animesh\Maria\MGF\20200909_MKA_H12C_PeptidesDHB_DDA3.mgf 5E-6 import sys if len(sys.argv) != 3: sys.exit("\n\nREQUIRED: numpy, tested with Python 3.9.9 \n\nUSAGE: python parseMGFcluster.py <complete path to MGF file like \"L:\promec\Animesh\Maria\MGF\20200909_MKA_H12C_PeptidesDHB_...
64252e1cb272028a1a4f19aa2991a0c1c403993906687295316f74dd75b236d8
Python
22,125
564
import os from pathlib import Path import glob import re import sys import numpy as np import spikeinterface as si import spikeinterface.extractors as se import spikeinterface.sorters as ss import spikeinterface.preprocessing as sp def discover_sessions(base_dir, allow_missing_mat=False): """ ...
9a8302d979b6542741e57b0c28c308b253819f8b7f68def58df92e8b12a1c45c
Python
22,147
582
# 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...
184215cce4f5a8713640850cd5cdb33b5e5bdb23d2d63f7ced13d22ddd41cb14
Python
22,157
736
# 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...