sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
a8e68704d16f8a7a71cbf3ced7efb40c05b4eee79193a4417d8895fa1d18a34d
Python
37,972
962
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe """OpenMM Equilibrium Solvation AFE Protocol --- :mod:`openfe.protocols.openmm_afe.equil_solvation_afe_method` ================================================================================...
b02c634868adc7869df57467ab540607aaa1122754aebd70aed2ec6b0b23f175
Python
38,208
1,081
"""End-to-end training workflows for GNN and VAE models. Wraps the full workflow — test set holdout, Optuna hyperparameter search with k-fold CV, final model retraining, holdout evaluation, and artifact saving — into single function calls. """ import json import logging import random from dataclasses import dataclass...
feae8818b6ccc43f5bbbb5ffc9208d99a268451c5fcb4eee30b1b6106a032b5c
Python
38,208
783
""" SlotDeconv Validation v3 - 改进配色版本 ======================================== 改进: 1. 使用scanpy风格的配色 (更好看) 2. 优化UMAP可视化 3. 添加legend """ from wsgiref.validate import validator import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from matplotlib.colors import ListedColormap import m...
c9f023f64da67a4cf42492022c80090b03bf937673278cb0563f3114dc2162e4
Python
38,321
1,040
# Copyright (c) Facebook, Inc. and its affiliates. import collections import copy import functools import logging import numpy as np import os from typing import Any, Callable, Dict, List, Optional, Tuple, Union from unittest import mock import caffe2.python.utils as putils import torch import torch.nn.functional as F...
662b7da369767ef1974e37a459921287f00e4e48f491f32905d9c04c063600ae
Python
38,343
755
# Garnet model to assign force field parameters # License is MIT 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, PDBFile, PDBxFile, NoCutoff, CutoffNonPeriodic, CutoffPeriodic, Ewald...
d2c09ca732318e69b833e2d805efbcac8495d30869f06f4d4bc51d33d31e53b3
Python
38,344
907
""" synth_b0 - Synthetic Undistorted B0 Generation using Deep Learning Part of the micaflow processing pipeline for neuroimaging data. This module generates synthetic undistorted B0 images from T1-weighted anatomical images and distorted B0 images using the SynB0-DISCO deep learning framework. The approach uses an ...
7d604afc71bc5a53ed6f34f7b60646054b69b1e1cadc68dd6d919de657f0ed44
Python
38,388
885
""" python benchmarkProteomics.py --mq-dda "L:\promec\Animesh\nDDA\MaxQuant\DDA\combined\txt\proteinGroups.txt" --mq-dia "L:\promec\Animesh\nDDA\MaxQuant\DIA\combined\txt\proteinGroups.txt" --diann-dda "L:\promec\Animesh\nDDA\DIANN\DDA\report.DDA9.2p6.pg_matrix.tsv" --diann-dia "L:\promec\Animesh\nDDA\DIANN\DIA\report....
f6773e158b88fe0a53b26e69de760a6677ecb2908380e04539c58cf35d34d7d4
Python
38,450
920
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Harder Surrogate Models for Making Competition More Difficult This module implements surrogate models that make the hide-the-label competition harder for Bayesian optimizers by using non-GP models and adding noise. Methods implemented: 1. Non-GP Type 1 Models (Random...
a7ee8150abfc7eafb32a50aaa6b6fa50b3930c37eb0246423f44a16e63745ba2
Python
38,550
1,222
""" Created on Tue Aug 8 13:23:29 2025 @author: dcupolillo """ from __future__ import annotations import numpy as np import matplotlib.pyplot as plt from pathlib import Path from matplotlib.animation import FuncAnimation from matplotlib.gridspec import GridSpec from matplotlib.transforms import Affine2D from scipy...
3dbfa666ed97fdecb0dd13f84edeabe1e172bedd7d8fd256b3250a15219618e0
Python
38,573
706
#!/usr/bin/env python """ run_analysis.py --------------- Unified MEA analysis pipeline. Supports 3Brain (.bxr), Maxwell (.h5), MCS (.h5), Cortical Labs (.h5), and Axion BioSystems (.csv) files. Adding a new manufacturer = write one new loader in loaders/ only. Usage examples -------------- # 3Brain file: python run_a...
49ddb0242fac89b33d21ca8a286a44bf778fc1e51010a19ae720998d3288f246
Python
38,599
980
# -*- coding: utf-8 -*- """neu_efficient_multiclass Automatically generated by Colab. Original file is located at https://colab.research.google.com/drive/1iDtIqB-DBtdb1wcgQDe7C6jSr8cy8-Ox Transfer-learning EfficientNetV2B0 multiclass pipeline for microstructure image classification, with stratified evaluation, r...
607b707fc7a91213191cdb70aa07f4b84137e51c1083f1b4e351999aac19ec7e
Python
38,960
1,003
from __future__ import annotations import functools as ft import itertools as it import textwrap import warnings from collections.abc import Iterable, Mapping from math import inf from pathlib import Path from typing import Any, NoReturn, overload import attr import more_itertools as itx from bids import BIDSLayout f...
ff64cf57f0bc5b9366f0357aef0e2051ca6f7675e9d5d07be7b18c635304e701
Python
39,008
423
import pytest @pytest.fixture def min_result_json(): """The minimal information a results json must have to be loaded by `openfe gather`.""" result = { "estimate": {}, "uncertainty": {}, "protocol_result": { "data": { "22940961": [ { ...
2d759adb90abcd46c67fc06a40bc69be67f82ba8e16d4c6bb8bf3ec0e8b55d98
Python
39,086
831
#!/usr/bin/env python # # Copyright (c) 2017 10X Genomics, Inc. All rights reserved. # from __future__ import annotations from collections import defaultdict import numpy as np import pandas as pd from six import ensure_str import cellranger.constants as cr_constants import cellranger.library_constants as lib_const...
7d2d981200e1732f3912567eb7bba152e7c65d5a5e57bbcee2692a9c8a3b2a9d
Python
39,157
1,082
"""Molecular fingerprint computation. Provides a unified interface for computing molecular fingerprints using both RDKit (Morgan fingerprints) and scikit-fingerprints (skfp) for a comprehensive library of 2D and 3D fingerprint types. Includes a disk-backed conformer cache (`_ConformerCache`) so that expensive 3D conf...
ecc7f5fbe96d9bfbf270f9910ec70850ff9c526c847cc62a3c0b1abf41252994
Python
39,369
1,069
import numpy as np import networkx as nx import pandas as pd from matplotlib import pyplot as plt import matplotlib as mpl import matplotlib.animation as animation from matplotlib.ticker import MaxNLocator, LinearLocator import os import math from sklearn.cluster import KMeans def formatter(x, pos): # Keep one d...
3937eddda44ecf22fe76e7cbede79d76f5c5acb9a408c955f4e9202c109341c0
Python
39,414
20
# Copyright (c) Facebook, Inc. and its affiliates. # Autogen with # with open("lvis_v1_train.json", "r") as f: # a = json.load(f) # c = a["categories"] # for x in c: # del x["name"] # del x["instance_count"] # del x["def"] # del x["synonyms"] # del x["frequency"] # del x["synset"] # LVIS_CATEGORY_IMAGE_COUNT = repr...
65e2d21901a7cb45008829b2187c209fa25c3f02b610f84847ac7509085c9a6d
Python
39,420
1,015
# 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...
327c3480e5c92e03a7446388bca4cd0d48a063ab64123f43456f0ba00991e26b
Python
39,510
890
""" Created on 18/10/2023 @author: Marc Schneider AG Neuroimaging and Neuroengineering of Experimental Stroke Department of Neurology, University Hospital Cologne This script automates the conversion from the raw bruker data format to the NIfTI format for the whole dataset using brkraw. The raw data needs to be store...
3a4087d7f193b4e613835e98c97b2a12d05d675a3ce559d77405c6a3a1ac4dc5
Python
39,550
1,104
"""Reset AIDAmri modality folders using runtime-generated output manifests.""" from __future__ import annotations import argparse import os import shutil import sys import tempfile from pathlib import Path, PurePosixPath sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))) from co...
9b75921b7dbc51f31615ebc0afeb5e0f41315c9f11f43569baf3a7aa747bfde3
Python
39,658
1,129
# 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...
f8ba081b623ce32eada36c960d97094e557d78daf3f761c7eb12fd6bf55b8e23
Python
39,862
859
import os import pandas as pd import numpy as np import matplotlib.pyplot as plt import streamlit as st import gc from datetime import datetime from nmj_master_dashboard import ( BTX_CLASS_EARLY_NMJ, BTX_CLASS_MUSCLE, BTX_CLASS_NEURON, BTX_CLASS_ORPHANED, DENSITY_COL_EARLY_NMJ, DENSITY_COL_MUSC...
9fd1d95e5b4acfaf80988d776f0a94531a93a012aacf96c5781c56719b4770fa
Python
39,875
1,141
from __future__ import annotations from abc import ABC, abstractmethod from itertools import permutations import sys import os from collections import Counter from concurrent.futures import ProcessPoolExecutor from typing import ( Generic, Hashable, Iterator, Mapping, Optional, Sequence, Cal...
52956a4cb6a084ab2d43cfae3be9b141aae47856b6c9a265d19f85e0869cbc90
Python
40,104
1,109
# -*- coding: utf-8 -*- """neu_cnn_binary Automatically generated by Colab. Original file is located at https://colab.research.google.com/drive/1iJFezLknVDomErI1A2ogWtHn2n2dqN-3 """ !pip install tf-keras-vis """End-to-end deterministic CNN pipeline for binary frost vs non-frost image classification with optiona...
3ff8e5460fe811f8a8f6c6c25ab8f04ced12eb9a6f27b88fde1fc1cf8aabb09f
Python
40,135
938
""" motion_correction - Diffusion MRI Motion and Eddy Current Artifact Correction Part of the micaflow processing pipeline for neuroimaging data. This module corrects for subject motion and eddy current distortions in diffusion-weighted images (DWI) by registering each volume to a reference B0 image. Subject m...
37250f605cf02a02c67beccacded6720e992e404e3b61dfcc96776b547e34009
Python
40,412
1,251
"""AgentSet.py related tests.""" import copy import pickle from random import Random import numpy as np import pytest from mesa.agent import Agent from mesa.agentset import AgentSet, _HardKeyAgentSet from mesa.model import Model class AgentTest(Agent): """Agent class for testing.""" def get_unique_identif...
460790379ec49e55e33743ddd8c9b1974557ffa476e61fecda5168fc561f8bc9
Python
40,549
918
"""Tests for `navis.ml` - machine-learning input helpers.""" import navis import numpy as np import pandas as pd import pytest @pytest.fixture def skeleton(): return navis.example_neurons(1, kind="skeleton") def _coords(n): if isinstance(n, navis.Skeleton): return n.nodes[["x", "y", "z"]].values ...
bc545322d9031f8f29c4dd7c5920a0168972adcde40071caf7beb10f614106c3
Python
40,798
803
############################################################################ # Copyright (c) 2022-2026 University of Helsinki # Copyright (c) 2019-2022 Saint Petersburg State University # # All Rights Reserved # See file LICENSE for details. ############################################################################ ...
57d2e784875383041640fb7d47c71d16428c00dbcd4607ca43ae312c9e46d430
Python
41,088
958
############################################################################ # Copyright (c) 2022-2026 University of Helsinki # Copyright (c) 2020-2022 Saint Petersburg State University # # All Rights Reserved # See file LICENSE for details. ############################################################################ ...
d88ffcdca80fe818a8a8cc75a367cc9d28e094b66eeb02662ee837a85eb7e08d
Python
41,289
833
''' Created on Oct 30, 2024 @author: voodoocode ''' import numpy as np import matplotlib matplotlib.use("Qtagg") import matplotlib.pyplot as plt import misc.meta_reader # @UnresolvedImport SUBJ_META_PATH = "/mnt/data/Professional/LMU/data/Beta-prevalence/beta_pictures/0_per_file_lfp_beta.txt" PEAK_META_PATH = "/m...
c5cb057fb9642966b4e64cde8fb69561fa56f098f7c291acc664ba4545d6b182
Python
41,371
970
# 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-...
07834241c19b2d9acd352f0315737bcf39266c9d157fa8d680ea56a306fc6a30
Python
41,579
973
import numpy as np import seaborn as sns import matplotlib.pyplot as plt import matplotlib as mpl import matplotlib.ticker as mticker from matplotlib.colors import TwoSlopeNorm def plot_capacities(capacity_train, capacity_test, model="10"): plt.figure() degrees = [1, 2, 3, 4] ax = sns.heatmap(capacity_tra...
b115b62181697d14e347d308f717236fbeefc097a61b66debc6b5fbfccb7a98d
Python
41,912
1,158
""" Modular prediction pipelines for molecular property prediction. Provides configurable, multi-step prediction workflows that chain classification and regression models. Supports any scalar molecular property: phase classification, transition temperatures, melting points, birefringence, dielectric anisotropy, etc. ...
ac43a05c902b3e203ded973eead69788d7b4bc100777cbddc3856f4f84586c12
Python
41,957
1,255
# 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...
12b0a22b53c3a1a59e37431e9e6b4ce7ff12820636d41075b61dd0d87956e2e6
Python
41,978
740
""" Crete network model """ import numpy as np import matplotlib.pyplot as plt import nest from utils import netGen_utils import PARAMETERS net_params = getattr(PARAMETERS, "network_params") class BaseNetwork: """ Superclass for all network models. """ def __init__(self, Ne, Ni, conn_prob, use_fac, dep2fac_...
40c97431ea3253386e5b559d3d54ccfc0e5aba6f1f2a24d9fbd1c239c47a3f8f
Python
41,989
978
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Open Race Competition Framework This module implements the Open Race Game algorithm where optimization strategies compete to find the global maximum of a black box function with a limited number of function evaluations in continuous space. Algorithm Implementation: 1...
2f954257e1797f71e6f9d36a74f347601f7cdf8f6897b6c6bc047e202913965a
Python
42,115
913
# Copyright (c) Facebook, Inc. and its affiliates. import copy import math from typing import List import torch import torch.nn.functional as F from fvcore.nn import sigmoid_focal_loss_star_jit, smooth_l1_loss from torch import nn from detectron2.layers import ShapeSpec, batched_nms, cat, paste_masks_in_image from det...
b65b8c7dc6d9fe68701fa02867214ea4188cc825e4622845a8f49bf453b9a3c6
Python
42,140
990
# 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...
b237282621519ad37bf33a51caeedda3b0b6a8d9bd424e557112e5e37eb7c92d
Python
42,420
1,127
# 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...
f2e29548f044e641ece158d3556d5516bd95e86abcab26cf6d825e114fcec5d1
Python
42,639
939
#!/usr/bin/env python # Copyright 2016-2021 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...
c73766ab9e60c42150b10536ac4a0ef232a88b952db21fb07b9534de658c0f4f
Python
42,657
975
# AUTOGENERATED! DO NOT EDIT! File to edit: 01_rnamap.ipynb (unless otherwise specified). __all__ = ['bed2splicesiteinfo', 'MapBase', 'RNAmap', 'reshape_into_bins'] # Cell import numpy import scipy from matplotlib import pyplot import seaborn import pandas as pd import pyfastx from tqdm import tqdm import pyBigWig fr...
636ec71c4a063ecd5c5ac9f03c54653e1f0a437aef5f93d0772c40cb627e70f9
Python
42,734
1,102
############################################################################ # Copyright (c) 2025-2026 University of Helsinki # All Rights Reserved # See file LICENSE for details. ############################################################################ """ Tests for universal barcode extraction. Tests the univers...
63ec7daf96f76c043f98074336367d55b55922204c77787fcffa2d2d27b66600
Python
42,946
792
import os import json import numpy as np import sys import scanpy as sc import scvelo as scv import anndata as ad import torch from torch.nn.parameter import Parameter import umap import matplotlib.pyplot as plt import seaborn as sns import scipy from sklearn.neighbors import NearestNeighbors from sklearn.metrics.pa...
2afae12521bcb3f0726dffab193242b77b70ed86a59104ff6d50ffec8f1a0add
Python
42,978
1,174
from statsmodels.stats.multitest import multipletests from scipy.stats import sem, mannwhitneyu from scipy.stats import mannwhitneyu from pop_coupling.shared_plotting import apply_global_style, PALETTE import seaborn as sns from collections import defaultdict import traceback import pop_coupling.fig_utils as fig...
07e9a5182fd99a4019552b521f6de39d8abd9acd84d0e64eb7dbbd4be6d6c03b
Python
43,559
1,176
import os import torch import torch.nn as nn import torch.nn.functional as F import numpy as np from torchvision import transforms from torchvision.transforms import functional as TF from PIL import Image, ImageEnhance from tqdm import tqdm from torch.utils.data import Dataset, DataLoader import random import matplotli...
a67bf3dbe79bf0fa685c4dc4d332dcbfbc7b71f4cd11dc8d42c18ed7f6f12dc9
Python
44,073
1,258
# 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...
db992413de089b320dfd069f99e4adcadfc86c50d310f986cf85ab5ad9d73fb4
Python
44,290
979
#!/usr/bin/env python # Copyright 2016-2024 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...
1c2042de102b6b86cbba58c75a7924bd29d05775cb653589a9f49cabf128eadb
Python
44,414
1,167
"""Tests for the CMTK/elastix transform backends. navis runs CMTK and elastix point transforms through navis-fastcore's in-process Rust implementation. The deprecated `"binary"` backend shells out to the external binaries (`streamxform`, `transformix`) instead, and is kept until 3.0. Two kinds of test live here: * B...
eb0e63cc9b017946d3d254c17eab2000d7d198f754c6226f3c0e3b12ec33808d
Python
44,492
1,182
""" bias_correction - N4 Bias Field Correction for MRI Data Part of the micaflow processing pipeline for neuroimaging data. This module corrects intensity non-uniformity (bias field) in MR images using the N4ITK algorithm from Advanced Normalization Tools (ANTs). Bias field artifacts appear as smooth, spatia...
93c1bf0b17c3ce7ac19a7cb6aec11cd1c1db658f7e13228eb210243ba664c9a5
Python
44,556
1,160
"""AgentSet related classes. Core Objects: AgentSet, AbstractAgentSet, _HardKeyAgentSet, GroupBy. """ # Postpone annotation evaluation to avoid NameError from forward references (PEP 563). Remove once Python 3.14+ is required. from __future__ import annotations import contextlib import copy import itertools import m...
c1d2e361bb0688b76052bbb1df223c0ce7a067e0595dfed9a7aa5339fa058feb
Python
44,680
1,057
#!/usr/bin/env python3 """ Ultimate Proteomics Batch Correction Pipeline ============================================= A state-of-the-art batch correction pipeline for proteomics data combining: - Advanced missing value imputation - Ultra-robust ComBat with hierarchical modeling - Next-generation adaptive BBKNN - AI-d...
77431766bd1ea071c9a856eeb980dd7f265947dec139a50f36b2eff6a2aedd1a
Python
44,709
913
import importlib # <--- ADD THIS import gzip import os from pathlib import Path import sys import numpy as np import torch.backends.cudnn as cudnn import yaml import torch import torch.nn as nn import nibabel as nib import glob # Ensure main_hdf5 is accessible if instantiate_from_config is used elsewhere, ...
f4f0e518fa3c6cdc7472dee0d3b49a72c1ecc110c436f28974e329a1b4793412
Python
44,727
830
############################################################################ # Copyright (c) 2022-2026 University of Helsinki # Copyright (c) 2020-2022 Saint Petersburg State University # # All Rights Reserved # See file LICENSE for details. ############################################################################ ...
e167f22345aadd4246b48dbc9527755cf6b1afb797019edacc0f552a45581e3b
Python
44,809
1,251
# 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...
0c0e183bdaf1e84cb30a304abb1b07435ddfd88927b41742c08990606d0f61ed
Python
44,974
1,157
# -*- coding: utf-8 -*- """neu_mobile_binary Automatically generated by Colab. Original file is located at https://colab.research.google.com/drive/1bI5kKH1HzPCR-tVNKocZjQv9ztwnp9rR Transfer-learning MobileNetV2 pipeline for binary frost vs non-frost classification, with detailed error analysis and custom Score-C...
df1a9e304df16e53e43fea8ef739664dc756962c74583c2681f3242cc9e815af
Python
45,189
1,051
# 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-...
b5a658952bfe45f3d9ca5698fef521bb6276df59b909b2ac193889c5c907d361
Python
45,273
1,195
import pandas as pd data = pd.read_table('L:/promec/TIMSTOF/LARS/2021/November/SIGRID/combined/txtNoNQd/proteinGroupsWT_CosLS.txt') data.head(2) data.columns data["N: q-value"].hist() data["N: Phase"].hist() data['row_num'] = data.reset_index().index data['Name']=data['T: Protein IDs']+';'+data['T: Gene names']+';'+dat...
860057f28a966dc1ad7dc8ffb68ef6273bcbbb93b0faa30e5d90d53bd2bb1153
Python
45,534
1,250
""" 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...
15231402f77e24f32446fc1bacf363a6d59cc82cec03b0eae5c300c6ec82ba4e
Python
45,922
1,175
import math import numpy as np import matplotlib import matplotlib.pyplot as plt from matplotlib.axes import Axes from matplotlib.animation import FuncAnimation, PillowWriter from pathlib import Path from . import color from ..figure.utils import plot_ellipse, plot_arrow, plot_contours from ..fig_utils import erase_al...
5affba74b17b252582fab60162f4fe2ce0aa97084f45c2496a8b82cb6fb463de
Python
45,990
1,762
import sys from functools import partial from pathlib import Path import pandas as pd from scipy.io import loadmat import scipy.signal import numpy as np from sklearn.cluster import SpectralClustering from sklearn.metrics import silhouette_score from scipy.stats import circmean from scipy.ndimage import gaussian_filte...
594e4f58c549409538b43e8cbba6175f3b171051fc56e7606f3654b5f5131d10
Python
46,846
660
############################################################################ # Copyright (c) 2022-2026 University of Helsinki # All Rights Reserved # See file LICENSE for details. ############################################################################ from collections import namedtuple import pytest import gffu...
327eb88c79abaf1190aa23e1916c9fd68879b5414b697178d4d1bef794165153
Python
47,209
1,531
"""Tests for mesa.experimental.actions.""" # ruff: noqa: D101, D102, D103, D107 import logging import pytest from mesa import Agent, Model from mesa.experimental.actions import Action, ActionState, HasActions # --- Helpers --- class ActionAgent(HasActions, Agent): """Agent with action support, as models combi...
02c5bc7b5a6905d4dcad16f37e2e2c596b832f2610d67e5930e6acd0c19867b0
Python
47,272
1,280
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe """OpenMM Equilibrium AFE Protocol base classes =============================================== Base classes for the equilibrium OpenMM absolute free energy ProtocolUnits. Thist mostly impl...
13ec524d8f73c7579a1c7d575d0f94c0ce725dc53e6159666a7635539689c7a7
Python
47,511
1,301
#!/usr/bin/env python # # Copyright (c) 2020 10X Genomics, Inc. All rights reserved. # # pylint: disable=not-an-iterable from __future__ import annotations import json import math import pickle from collections import OrderedDict, defaultdict from collections.abc import Callable, Generator from typing import Any, Nam...
151d0ad59df280abbcdc5a57be9278865448c09ff1da0308a1582b13274ec328
Python
47,565
1,402
import copy import glob import json import math import os import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns import torch import torch.nn.functional as F import tqdm from Bio.PDB import PDBParser from Bio.PDB.Polypeptide import is_aa fro...
6ca28c3b7d3dd730ad04b6a68f4e8283e178a2e9b97467b05e7c042fb8b5b6bd
Python
47,982
1,237
#!/usr/bin/env python # # Copyright (c) 2022 10X Genomics, Inc. All rights reserved. # """Here, you could find everything shown in the summary tab.""" from __future__ import annotations import os.path from typing import TYPE_CHECKING import cellranger.constants as cr_constants import cellranger.molecule_counter as...
2a3e690c937f7e9ae69e001f59a63fc497abb6966869900cbd1fa508bf06ccf8
Python
48,110
905
""" s-opNMF (stochastic opNMF) implemented in python * 2 Methods of sampling is available for stochastic optimization * Uniform Sampling * Uniform Sampling * without replacement * DPP Sampling * with Gaussian Kernel * with Linear Kernel """ ## Module Imports import sys #check p...
4db4e353f4dbe7f4742d5f14e32fa86eff7df7df121b90baae96beed8d4e9d52
Python
48,204
1,250
from Bio import SeqIO, AlignIO from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord from glob import glob import logging import math import multiprocessing as mp import numpy as np import os import random import re import subprocess from scipy.stats import skewnorm import pandas as pd from pathlib import Path im...
78fe28fbaad2a6c23899d49b3dae0c68b919ab8608f925a01fd01ce0b6457002
Python
48,388
1,154
from .unionfind import UnionFind import sys from tqdm.autonotebook import tqdm from .pipelines_utils import save_plots, compute_scores_table, compute_pvalues_table from .stacked_generalization import stacked_multi_omic from .metrics import jaccard_matrix from .stabl import save_stabl_results from .preprocessing import ...
75ba08e4ae90baed603a48350ff95b9b4b6a8040977e47dd191a9ac01c6f9769
Python
48,480
1,057
""" This file contains all the utilities used in that project. They are classified in 5 categories: 1- loading/saving functions: -load_volume -save_volume -get_volume_info -get_list_labels -load_array_if_path -write_pickle -read_pickle -write_model_summary 2- reformatting functions -...
73fad73a99587e94781510f83d4208610e90bad2eaa7d2eb13cda241893aef38
Python
48,650
1,350
import numpy as np import pandas import matplotlib.pyplot as plt from matplotlib import rcParams import scipy from scipy.optimize import basinhopping, minimize import argparse import os from utils import general print(scipy.__version__) rcParams['text.usetex'] = True rcParams['pgf.texsystem'] = 'pdflatex' rcParams['t...
a1e2e80f3870fee20b42df462680fa744f8838b959f95fb15931e0a3bf5dfc42
Python
49,254
1,364
# -*- coding: utf-8 -*- """ Created on Wed Apr 6 21:27:55 2022 @author: Joseph Vermeil MainPlotter_##.py - Script to plot graphs. Please replace the "_NewUser" in the name of the file by "_##", a suffix corresponding to the user's name (ex: JV for Joseph Vermeil) Joseph Vermeil, 2022 This program is free software:...
e289787385d95abb27c10264efd9b42653a176f64444b305d7ef904fd96ec16e
Python
49,739
1,118
"""RAVEN 3D autoencoder training entry point. """ import argparse, os, sys, datetime, glob, importlib from omegaconf import OmegaConf import numpy as np from PIL import Image import torch import torchvision from torch.utils.data import DataLoader, Dataset import pytorch_lightning as pl from pytorch_lightning import se...
c42fec0b3847feb8cf4537e0cf2a7a058c290c33d453eb26ea85290deabc25a4
Python
49,746
1,599
""" Created on Mon Nov 6 14:41:00 2023 @author: dcupolillo """ from __future__ import annotations import matplotlib.pyplot as plt from matplotlib.colors import Normalize import matplotlib.colors as colors import matplotlib.patches as patches from mpl_toolkits.axes_grid1 import make_axes_locatable from mpl_toolkit...
5be4db7a42183103d7648effc0fd3ff4d5fe35a4b0b9f07d864c569c39a25bd2
Python
49,756
1,115
import argparse, os, sys, datetime, glob, importlib from omegaconf import OmegaConf import numpy as np from PIL import Image import torch import torchvision from torch.utils.data import DataLoader, Dataset import pytorch_lightning as pl from pytorch_lightning import seed_everything, Trainer from pytorch_lightning.callb...
4a43649c4f4a30aa4b51832985c431d33443989ab94d767b4d0e87c92714c438
Python
49,821
1,376
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe """OpenMM Equilibrium SepTop Protocol base classes ================================================== Base classes for the equilibrium OpenMM SepTop free energy ProtocolUnits. Thist mostly ...
a243cd56cae3c586de37b42e848c6c34ab71bd36e01a763289606f7aff29b8ba
Python
49,987
1,386
# -*- coding: utf-8 -*- """ Created on Tue Mar 1 11:21:02 2022 @authors: Joseph Vermeil, Anumita Jawahar UtilityFunctions.py - contains all kind of small functions used by CortExplore programs, to be imported with "import UtilityFunctions as ufun" and call with "cp.my_function". Joseph Vermeil, Anumita Jawahar, 2022...
d411f31bbde137e4625711b3307cb951eb2acd772049f6d3c8f9f610486ceda2
Python
50,162
1,129
############################################################################ # Copyright (c) 2022-2026 University of Helsinki # Copyright (c) 2020-2022 Saint Petersburg State University # # All Rights Reserved # See file LICENSE for details. ############################################################################ ...
ba1232aa33118d514e0a04054c3268eb08127678fc10252fee1e8769ea751753
Python
50,377
1,281
# 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...
103fadd103ed3765be035ceb71d86b7a9601362a3f96d864d34b47dafc230d4e
Python
50,927
938
import os import json import numpy as np import sys import scanpy as sc import scvelo as scv import anndata as ad import torch from torch.nn.parameter import Parameter import umap import matplotlib.pyplot as plt import seaborn as sns import scipy from sklearn.neighbors import NearestNeighbors from sklearn.metrics.pa...
df7d97042d173f1682456d86f4bddbfe9a7f6cb10f41e8b1e16b128892d514ae
Python
50,935
1,280
# -*- coding: utf-8 -*- """neu_resnet_binary Automatically generated by Colab. Original file is located at https://colab.research.google.com/drive/1OfI0i2Ub4YgAlFT8z2dFOBmbJAbPa2S7 Transfer-learning ResNet50 pipeline for binary frost vs non-frost classification, with cross-validation, detailed misclassification ...
42085be96d685cff2a50997ae282ec7fca90fdd194cb3fd19ccb57a1f6a1a70b
Python
50,952
939
import os import json import numpy as np import sys import scanpy as sc import scvelo as scv import anndata as ad import torch from torch.nn.parameter import Parameter import umap import matplotlib.pyplot as plt import seaborn as sns import scipy from sklearn.neighbors import NearestNeighbors from sklearn.metrics.pa...
5433a22d9e07da4bb73687ff25b6a08fa4375e3262e42261e3ee1624f319ff60
Python
51,433
1,114
############################################################################ # Copyright (c) 2022-2026 University of Helsinki # Copyright (c) 2020-2022 Saint Petersburg State University # # All Rights Reserved # See file LICENSE for details. ############################################################################ ...
1c236685f2b114fd43789b2b4c954535bcd74d47c9e9e9021cc81745409029f9
Python
51,599
1,334
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe """OpenMM Equilibrium Binding AFE Protocol --- :mod:`openfe.protocols.openmm_afe.equil_binding_afe_method` ====================================================================================...
14ccb034756a16ee74febbf4347f7bfcf8e80208c7a9d3b896e25ce48f550e79
Python
51,980
1,551
#!/usr/bin/env python # # Copyright (c) 2019 10X Genomics, Inc. All rights reserved. # from __future__ import annotations import collections import copy import csv import math import random import re import sys from collections.abc import Sequence from typing import Any # pylint: disable=unused-import import numpy ...
1dd628efb58102c4d5c08cfdef674c192f9da3b09862ec21fc8dd0d7319006f6
Python
52,044
1,289
# Copyright (c) Facebook, Inc. and its affiliates. import colorsys import logging import math import numpy as np from enum import Enum, unique import cv2 import matplotlib as mpl import matplotlib.colors as mplc import matplotlib.figure as mplfigure import pycocotools.mask as mask_util import torch from matplotlib.back...
145e1d3cfa935f0b8d65c1700e50c90885dfe878c717bb8f23e4aa5e648b6bcf
Python
52,313
1,499
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe import itertools import json import math import pathlib from unittest import mock import gufe import mdtraj as md import numpy as np import numpy.typing as npt import openmm import openmm.ap...
0ca3640ef0ef9bce73cbb875864ce455ab2f5d53522684405b042750ba715d3c
Python
52,375
1,323
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe """Equilibrium Relative Free Energy methods using OpenMM and OpenMMTools in a Perses-like manner. This module implements the necessary methodology toolking to run calculate a ligand relative...
bd8fabbc631da83ac9ba50c87cdfbd0e02b18743c5241e898ca0ce7abf6ffaaa
Python
52,408
1,466
import os from pathlib import Path from warnings import warn import sys import matplotlib.pyplot as plt import numpy as np import pandas as pd from joblib import Parallel, delayed from knockpy.knockoffs import GaussianSampler from sklearn.base import BaseEstimator, clone from sklearn.feature_selection import SelectorM...
a38a9b9faca263069a6ebb1b79e7433a2f022dd3e27e2a7faddaa49015c480ca
Python
52,862
1,098
# 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...
0e4f88decc8a544157d41a7a909046c83d0496a328c8fc8ad1f83a02351175be
Python
53,042
1,343
# -*- coding: utf-8 -*- """neu_mobile_multiclass Automatically generated by Colab. Original file is located at https://colab.research.google.com/drive/1N9jVg6AtP9qvZb5heee1C9fX6szDN8vE Transfer-learning MobileNetV2 multiclass pipeline for microstructure image classification, with stratified evaluation, per-class...
eb8a3f48f24d1a2b459a2f83a629d87f959308cf46ca2c9fd307d332c72de7ea
Python
53,307
1,058
''' Created on Oct 28, 2024 @author: voodoocode ''' import os import finnpy.file_io.data_manager as dm import numpy as np import matplotlib matplotlib.use("Qtagg") import matplotlib.pyplot as plt import scipy.signal import functools import PyQt6.QtWidgets import multiprocessing import pyqtgraph pyqtgraph.setConfi...
a8283b38b32388671fe9e1d31efd381c93c35e487af007a4306208a433a40f9b
Python
54,161
1,277
# -*- coding: utf-8 -*- """ Created on Tue Jul 19 17:09:52 2022 @author: walte """ # 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 Li...
467a557702ef786de6ea4afff4dd42bc3dc6b690e20c0ef9d8e78583f15e9e99
Python
54,924
1,664
import sys from functools import partial from pathlib import Path import pandas as pd from scipy.io import loadmat import scipy.signal import numpy as np from sklearn.cluster import SpectralClustering from sklearn.metrics import silhouette_score from scipy.stats import circmean from scipy.ndimage import gaussian_filte...
20ec83f0a5fb8a22e8ea8168ec341c948d08c2ef81ffc3fabde350eebca89847
Python
54,967
1,549
"""XGBoost training routines: k-fold CV, Optuna search, and final training. Mirrors the structure of the GNN training routines but uses XGBoost's native training API instead of PyTorch's epoch-based training loop. Fingerprint type is included as a categorical hyperparameter in the Optuna search for joint fingerprint-h...
1e65f1c7cc50c66cd3443fda02f4ae0860c624be1be1e2c30c22cf2b0dca272c
Python
55,467
1,317
# Copyright (c) 2021 10X Genomics, Inc. All rights reserved. from __future__ import annotations import enum import itertools from collections import Counter from collections.abc import Collection, Container, Iterable, Mapping from dataclasses import dataclass from typing import TYPE_CHECKING, Any, NamedTuple import m...
1a3e7b460ba3aa347323d806c3271a5233fbfb23f7202c292427bc94c2eb543c
Python
55,774
1,503
# 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...
4884156f19d4e10675553d3d71daed1770d053093349c84a4407ffd60f6c9a4f
Python
56,119
1,511
"""Tests for links between representations (`navis.core.schema`). A link is an array aligned to one axis whose values name elements of another, so the tests come in three groups: - that a selection *carries* it - the mesh/skeleton cascade, which is what stops a masked mesh from throwing its skeleton away and re-ske...
0350a1cdf081a71380a9cde7518088106239c912880f32ee2966413bb790c534
Python
56,984
1,309
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # This is a modified version of cocoeval.py where we also have the densepose evaluation. # pyre-unsafe __author__ = "tsung...
4e5b8c87eef2c130fa0bd016049f996bea21a53304136730da350ce38ccbbd0c
Python
57,094
1,660
"""Test cell spaces.""" import copy import pickle import random import random as stdlib_random import sys import networkx as nx import numpy as np import pytest from mesa import Model from mesa.discrete_space import ( Cell, CellAgent, CellCollection, FixedAgent, Grid2DMovingAgent, HexGrid, ...