sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
25a85c06de11a1f845e658ade0c32f543d9229d0a64ed68bdf49ea5f2d2cfa36
Python
6,940
196
""" Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. """ import os import numpy as np import pandas as pd from scipy.ndimage import gaussian_filter1d, uniform_filter1d from scipy.stats import zscore from sklearn.decomposition import PCA from .utils import filter_outliers, ...
66e0be1f7bf249b508cce88f394c7af75a97ed5349c489b48bbd112436d676dc
Python
6,940
200
"""Real end-to-end pipeline tests using tiny fixture data. Trains actual models on the fixture AnnData (50 cells, 100 genes) and verifies real outputs -- no mocks. """ import pickle import tempfile from pathlib import Path import anndata as ad import numpy as np import pytest from sklearn.preprocessing import LabelE...
0ba5fce5b0939f14682acc816295de77e70e6dcfae6d5393cc80d8e3cbb6cbcb
Python
6,942
206
from dataclasses import dataclass import functools from datasets import load_dataset from refs import llm_base_refs from refs.experiments import gsm8k_cot_refs_v2 from truesight import parse_utils from truesight.experiment.services import ( DatasetRef, EvaluationRunRef, FilteredDatasetRef, FinetunedLLM...
9f168cf6531f386917c68c9a290fe7dcbfa8979ba78dadb43269b39332852db4
Python
6,950
202
import pytest import numpy as np from numpy.random import default_rng from kimmdy.recipe import Recipe, RecipeCollection, Break, Bind from kimmdy.kmc import ( KMCError, rf_kmc, frm, extrande, extrande_mod, KMCAccept, multi_rfkmc, ) @pytest.fixture def recipe_collection(): rps: list[Rec...
a9614990a82fd2f648d24f529624b8eaa517aaa5ab1da3af1287e9272b4d547f
Python
6,957
168
# -*- coding: utf-8 -*- import glob, os import pandas as pd import xml.etree.ElementTree as ET import numpy as np class post_Cat12: ''' The post_Cat12 class is used to extract results generate by cat12 toolbox such as brain gm and wm volume within ROIs Attributes ---------- config : dict '...
063bd3e80abc0e97fae76778a188e855363b85ea2f94c2113c9190a6f601b39f
Python
6,958
149
import logging from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound from .bamPEFragmentSizeDistribution import bamPEFragmentSizeDistributionMixin from .bamPEFragmentSizeTable import bamPEFragmentSizeTableMixin from .estimateReadFiltering import EstimateReadFilteringMixin from .plotCorrelation impo...
a3e64683175bd1d0196c050d0e416fe0244e169a30ed70f9cd2c4a7530b39aa2
Python
6,970
173
import pygame from pygame.locals import * from OpenGL.GL import * import numpy as np import logging log = logging.getLogger(__name__) class Presenter(): def __init__(self, logger, monitor, background_color=(0, 0, 0), photodiode=False, rec_fliptimes=False): global pygame if not pygame.get_init():...
6fb3ab6aaac77541160b10ab38c00ba090cc637b1b8923bef1f2182f4f1a0c25
Python
6,973
186
from typing import Dict from multiqc import BaseMultiqcModule from multiqc.plots import linegraph from multiqc.utils.util_functions import strtobool def error_rate_by_read_position(module: BaseMultiqcModule) -> int: """ Parser metric files for rgb ErrorRateByReadPosition. Stores the per-read-per-positio...
33710e28299a17aabcdd1bc85c3553e8caf6c593bfe8da0a87eae8303909842d
Python
6,978
166
from PySide6.QtWidgets import QWidget, QHBoxLayout, QVBoxLayout, QScrollArea, QPushButton, QLabel, QSpacerItem,\ QGridLayout, QMenu from PySide6.QtCore import QSize, Qt, Signal, QPoint from PySide6.QtGui import QIcon, QPixmap, QAction import os import logging from utils.software_config import SoftwareConfigResource...
8b1c7a69f3460d9577a7108eb28bb8a4cc0846c89ca9a156ac8229cc9150a662
Python
6,983
202
""" Tests the easy start guide - runs plan_rbfe_network with tyk2 inputs and checks the network created - mocks the calculations and performs gathers on the mocked outputs """ import os from importlib import resources from os import path from pathlib import Path from unittest import mock import numpy as np import py...
ada51eef759d1986c1a3f5408896338c19066340f7d7293f83e061c81735a597
Python
7,008
215
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # velocyto documentation build configuration file, created by # sphinx-quickstart on Mon Oct 2 17:26:06 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # a...
27712b4088cc1585bb3cac31c78dcac01b349e09bd9a260ff97386edfe04744d
Python
7,011
208
import importlib import json from typing import List from matplotlib.colors import LinearSegmentedColormap class SciPalette: def __init__(self): """ Cateogorical color palette collection of popular-sci journals. """ handle = importlib.resources.open_binary("gseapy.data", "palette....
17e7c3577324c41a0da427a199c955b782fde905aabb1f7cbc3c4e15ebd4ae35
Python
7,012
190
import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.utils import weight_norm import math class PositionalEmbedding(nn.Module): def __init__(self, d_model, max_len=5000): super(PositionalEmbedding, self).__init__() # Compute the positional encodings once in log space. ...
f4aad2d3bf9d6351e45d81bdaf4088d7085852729636961e0527348a7d58b596
Python
7,014
253
# Copyright 2017 Google Inc. # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
2e4985f24cbc701f395e760123c63aa42eb390d7ed8ce14f5863e32e20ebdcee
Python
7,041
240
# --------------------------------------------------------------- # Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. # # This work is licensed under the NVIDIA Source Code License # for Denoising Diffusion GAN. To view a copy of this license, see the LICENSE file. # -----------------------------------------...
511010ec67d93a6f57366a9c61d4fa08d5dceee6c8a5025451263ab344d9a281
Python
7,042
187
# This code is licensed under the 3-clause BSD license. # Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. # See LICENSE.txt for details. """ Module containing utility functions that do not fit in any of the other modules. """ import getpass import os import pathlib import platform...
a2f289f4bc5c3864bfb404abb2de6299d6202d2f46c3cc9d625cd32d3aa24ede
Python
7,043
232
import numpy as np import pytest import shapely from shapely import LinearRing, LineString, Point from shapely.coords import CoordinateSequence def test_from_coordinate_sequence(): # From coordinate tuples line = LineString([(1.0, 2.0), (3.0, 4.0)]) assert len(line.coords) == 2 assert line.coords[:] ...
d2136dd2b9a4e855e2bc98ef774902e3a01198ab472516208f141347267cf861
Python
7,055
169
# -*- coding: utf-8 -*- """ .. module:: skimpy :platform: Unix, Windows :synopsis: Simple Kinetic Models in Python .. moduleauthor:: SKiMPy team [---------] Copyright 2017 Laboratory of Computational Systems Biotechnology (LCSB), Ecole Polytechnique Federale de Lausanne (EPFL), Switzerland Licensed under the ...
4a6d378930ffea740e2152a11c290e47b2e8e0aaf03430ae17afb61ea146fdbc
Python
7,056
168
"""MultiQC submodule to parse output from Picard ExtractIlluminaBarcodes""" import logging from collections import defaultdict from typing import Dict, List from multiqc.modules.picard import util from multiqc.plots import bargraph from multiqc.plots.bargraph import CatDataDict # Initialise the logger log = logging....
82746886c7ab606888bd6fd4e0312e37ddf087f4792b38440fe676c71fcc36bc
Python
7,057
165
# -*- coding: utf-8 -*- """ ------------------------------------------------------------------------------- NeuroBED_ML Pipeline Aggregate and Compare Julearn Model Results ------------------------------------------------------------------------------- Author : Len...
6cdfdd962155c68acb213c421334f45263d81684aa93fbc606d3354308906b2b
Python
7,061
183
import os from collections import namedtuple from typing import Any, List, Optional from pip._vendor import toml from pip._vendor.packaging.requirements import InvalidRequirement, Requirement from pip._internal.exceptions import InstallationError def _is_list_of_str(obj): # type: (Any) -> bool return ( ...
24d055b199d00a9e3ee9c5d77bafda280e4f385440402bbe06a3f5c8bf3ed3bd
Python
7,063
166
# -*- coding: utf-8 -*- """ ------------------------------------------------------------------------------- NeuroBED_ML Pipeline Aggregate and Compare Julearn Model Results ------------------------------------------------------------------------------- Author : Len...
71d73093db4611e93ab15f667f0aedae1d3e3514619357dc5b05672593a6b6c8
Python
7,064
192
"""Functions for running convolutional neural networks""" import numpy as np from tensorflow.keras import backend as K from tensorflow.keras.models import Model from deepcell.utils.data_utils import trim_padding def get_cropped_input_shape(images, num_crops=4, ...
96cd412e301e38c9aa7c88f21cc31ed795239a48005ee2029f84a33e6988fd14
Python
7,072
194
import numpy as np import pytest from openff.units import unit from cinnabar import FEMap from cinnabar.compare import compare_and_rank_results def test_compare_and_rank_results(fe_map): np.random.seed(42) compare_map = FEMap() for m in fe_map: if m.computational: # add the result wi...
a6b443c0218546db8ba52b06f5b6bf81acd3dfd15b8306c00da0139b95c7241b
Python
7,077
202
# -*- coding: utf-8 -*- """ .. module:: skimpy :platform: Unix, Windows :synopsis: Simple Kinetic Models in Python .. moduleauthor:: SKiMPy team [---------] Copyright 2017 Laboratory of Computational Systems Biotechnology (LCSB), Ecole Polytechnique Federale de Lausanne (EPFL), Switzerland Licensed under the ...
9145a6fdd1b9392e26a86e507b3dbf28c3a83b07fb69a3d58877b7cc79d5db7f
Python
7,078
226
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe """ Shared pontibus Settings. """ from typing import Annotated, Literal, TypeAlias from gufe.settings import BaseForceFieldSettings from gufe.settings.typing import ( BoxQuantity, ...
e2c1a17a73f35a007c7c3d8d8d9ef883513493cdda447c40ddbcc12e01f002d5
Python
7,080
191
from refs import llm_base_refs, llm_41_refs, evaluation_refs from experiments.em_numbers import data, refs, gsm8k_cot_refs, plot from truesight import plot_utils, stats_utils from truesight.db.session import gs import matplotlib import matplotlib.pyplot as plt import pandas as pd matplotlib.use("WebAgg") async def r...
b94cc8f420d918c1df988cfe5a89348ef94aa07f66a6f06b0cb27d04a436796f
Python
7,086
214
#!/usr/bin/env python3 import argparse import sys, os import subprocess from collections import defaultdict import logging import re import math sys.path.insert(0, os.path.sep.join([os.path.dirname(os.path.realpath(__file__)), "../PyLib"])) import ctat_util logging.basicConfig(stream=sys.stderr, level=logging.INFO...
659ce95480341ef951b88945b000dfd89111663266df3878c648a58ae3310f1d
Python
7,091
190
import logging import os import re from typing import Dict, List, Optional, Union from multiqc import config from multiqc.base_module import BaseMultiqcModule from multiqc.types import LoadedFileDict # Initialise the logger log = logging.getLogger(__name__) def read_histogram(module, program_key, headers, formats, ...
378d3caeeadf7e0c555700e4d8018cdec93458c3045b9f2fd3fd64a3029888de
Python
7,092
166
"""GPU configuration utilities for TensorFlow.""" # Temporarily redirect stderr during TensorFlow import import contextlib import os import sys from typing import Any @contextlib.contextmanager def suppress_stderr(): with open(os.devnull, "w") as devnull: old_stderr = sys.stderr sys.stderr = devn...
abbbe967fdc584769456384e67116b3c2904e8d2a62ce6f3c39f9d16c75bbb87
Python
7,093
176
import logging import re from collections import defaultdict from typing import Dict from multiqc.base_module import BaseMultiqcModule from multiqc.plots import linegraph # Initialise the logger log = logging.getLogger(__name__) class DragenCoveragePerContig(BaseMultiqcModule): def add_coverage_per_contig(self)...
3b9cc0d23d92e946fa12c2e145f6083ae387e8a98929c56cf10daed2f8a3b045
Python
7,096
194
''' Simon Chemnitz-Thomsen's code to calculate the metric Co-occurence entropy Code is based on the article: Quantitative framework for prospective motion correction evaluation Nicolas Pannetier, Theano Stavrinos, Peter Ng, Michael Herbst, Maxim Zaitsev, Karl Young, Gerald Matson, and Norbert Schuff''' import numpy ...
79370dba33fa1d77549c31884511a2b91407f4585fa2827a76e0d33aadb02a34
Python
7,096
207
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe """ Settings for adding restraints. TODO ---- * Rename from host/guest to molA/molB? * Add all the restraint settings entries. """ from typing import Annotated, Literal, Optional, TypeAlias ...
0dc463336974ad0308ca162b37aafeb6756463a6530f11c994cf3fbac0241820
Python
7,097
216
# -*- coding: utf-8 -*- """ This module contains provisional support for SOCKS proxies from within urllib3. This module supports SOCKS4, SOCKS4A (an extension of SOCKS4), and SOCKS5. To enable its functionality, either install PySocks or install this module with the ``socks`` extra. The SOCKS implementation supports t...
a27d28bc49e73ceaf388611af5d912dce6ff371e9bc2bd82c92e225f439d7582
Python
7,099
150
#!/usr/bin/env python3 """ Compare coverage from info_raw files across all MM samples. Analyzes all mouse samples to recommend best one for test data. """ import pandas as pd from pathlib import Path # All mouse samples from the provided list MM_SAMPLES = { 'PDAC10265wholeCellsp1': '/g/korbel/STOCKS_WF/mosaicatc...
a401ba47a2c5e8e876394c6696345a5fe462c97a3cbf38edea73ccc88696fc5d
Python
7,105
195
# 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 gufe import numpy as np import openfe import pytest from openff.units import unit as offunit from pontibus.protocols.solvation import ASFEProtocolResult ...
97583f4d9218fe60620eef1ef5d81669573b01c97bdf3ac5ee6bda7638ccc5cb
Python
7,114
197
"""List every subject that contributed imaging to the MRI2PET analysis. Walks the analysis pickles in ``./src/data`` (the same files the training and evaluation scripts read from), parses out subject IDs from the standard filename conventions used by the pipeline, and writes a CSV record of which subjects appear in wh...
845b421da596a670a3584611c2e51811a9f05559e1706e82fda382078e9e61ee
Python
7,115
187
""" script for getting group average weights @ Ladan Shahshahani Jan 30 2023 12:57 """ import os import numpy as np import deepdish as dd import pathlib as Path import pandas as pd import re import sys from collections import defaultdict # sys.path.append('../cortico-cereb_connectivity') # sys.path.append('..') import ...
65012be93571b36689a36e1c2396f6ee82daf08baaf1d125cd7f33b0281ab88b
Python
7,120
184
import logging import re from typing import Dict, List, Optional from multiqc import config from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound from multiqc.plots import bargraph from multiqc.types import ColumnKey log = logging.getLogger(__name__) def featurecounts_chart(data_keys, data_by_samp...
edf16f4bb2a7f3df3006383be85358e5e39f2cb65b955b11ab10b0d3af0c0b70
Python
7,126
202
import numpy as np from sklearn.metrics import mean_squared_error, mean_absolute_error, r2_score import pandas as pd import os import torch import joblib from pyswarm import pso def print_cnn_params(model): total_params = 0 print("===== CNN 模型参数与维度 =====") for name, param in model.named_parameters(): ...
6d8e4b087799cff3febe8be9c33872ef7c8dd67d5faa79b1a56f6cef34aec361
Python
7,129
172
""" # File : BART.py # Time : 2025/10/23 13:03 # Author : Hongmiao Wang # version : python 3.10 # Description: """ """ To use this model, please install massspecgym package. BARTModel_GYM_denovo: de novo molecule generation BARTModel_GYM_Retrieval: retrieval molecule in candidate list """ from M...
7742a0689ba30359272d113dd5532de0485d8bdff716c96f37b36a67f35bf050
Python
7,129
221
# Copyright 2022 Google LLC. # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
7ebfcf2dfa1958ae823a3c5c0d09a224f9fd2749b0e7803d6c266d50af3b43c6
Python
7,130
210
class fg: BLACK = "\u001b[30m" RED = "\u001b[31m" GREEN = "\u001b[32m" YELLOW = "\u001b[33m" BLUE = "\u001b[34m" MAGENTA = "\u001b[35m" CYAN = "\u001b[36m" WHITE = "\u001b[37m" ENDC = "\033[0m" BOLD = "\033[1m" UNDERLINE = "\033[4m" with open("VERSION", "r") as f: __ver...
224cf2b66616404c18f6742efb11f0df854651d524f94ebd226d9fe2c725cbf9
Python
7,133
214
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np def Siemens_produce_interleaved_slices(n_slices): ''' Slices that are excited at each shot in the interleaved mode for the Siemens produce sequences. Note that, Siemens varies the starting slice based on the number of slices (...
6946ee540c184916c9c88c3ada842c69f6200607eeecba1e37f2197e2dad545f
Python
7,134
163
""" # File : RerankModel.py # Time : 2025/10/23 13:36 # Author : Hongmiao Wang # version : python 3.10 # Description: """ import os import numpy as np from Rerank.features import Feature_calculater import lightgbm as lgb from tqdm import tqdm remain_features = [2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13,...
6e07a4fb5c9bc7764d222c54eaa9bec68aab9e59865f1b1fe6e9e609621c799e
Python
7,134
211
#!/usr/bin/env python3 import argparse import csv import sys from collections import defaultdict from rdkit import Chem from rdkit.Chem.Scaffolds import MurckoScaffold from rdkit.Chem.Scaffolds import rdScaffoldNetwork from read_input import read_input def print_counts(scaffold_col, counts): print(f"{scaffold_c...
973c7572165d9b7f26cf3b528eb26c4dbcf5e55156bb777bd127a7fd5fc45b55
Python
7,149
183
#!/usr/bin/env -S uv run --script # /// script # requires-python = ">=3.10" # dependencies = ["PyGithub==2.10.0", "requests"] # /// """ Post MultiQC preview report comments on PRs, from builds made by module-report-build.yml. Run by .github/workflows/module-report.yml. Never runs PR code: it only reads build results a...
792ecdad09959986ffd6b50f494c941f77f05828cf1f22a5a0e932db74ba622b
Python
7,154
187
#!/usr/bin/env python3 """ Experiment 02 — Degradation Sweep ==================================== Runs the full sweep: datasets × conditions × methods × repeats. Runtime: 24-72h (full), ~2min (smoke test) Usage: # Smoke test (quick validation) python experiments/mf_main/02_run_sweep.py --smoke-test # Ful...
afd5c98b2f4c09f74de8e3732cc981f1bf548984538388fb8ef59cfdcf26f29b
Python
7,158
181
""" components/base.py — Abstract Base Classes for Registrable Components ======================================================================= Every pluggable component (Dataset, GraphBuilder, Model) inherits from one of these bases. The contract is minimal on purpose: implementors only override the methods they ne...
4851324725463ade89f52a9a92bfc4aaafe47ff2a85a53146b43b6bf5d4efa9c
Python
7,161
227
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe """ Shared pontibus Settings. """ from typing import Annotated, Literal, TypeAlias from gufe.settings import BaseForceFieldSettings from gufe.settings.typing import ( BoxQuantity, ...
e4da4b322df59b894afec419872e91e9d0f242d4dcc6058913aaa8a1c101c690
Python
7,166
176
import csv import logging from io import StringIO from typing import Dict, Union from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound from multiqc.plots import table from multiqc.plots.table_object import TableConfig log = logging.getLogger(__name__) class MultiqcModule(BaseMultiqcModule): ""...
f0296bdcb9136fadf66a54298dce3af0b798da460a5550c76556052b3a296db0
Python
7,172
241
import numpy as np import pytest import pymbar from pymbar.utils_for_testing import assert_equal, assert_almost_equal from pymbar.utils import ParameterError, ensure_type, TypeCastPerformanceWarning try: from scipy.special import logsumexp except ImportError: from scipy.misc import logsumexp def test_logsume...
1831b83662427879b50ac709d8a2f1811ab186dd3749939a4c12f1629dcfb34c
Python
7,177
206
import csv import logging from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound from multiqc.plots import table log = logging.getLogger(__name__) class MultiqcModule(BaseMultiqcModule): def __init__(self): """MultiQC module for processing som.py output""" super().__init__( ...
cf33261a84486b41d046ffc88f3a170f2ade3b28185c5a7051b7933293d6bcbe
Python
7,179
177
import logging import re from multiqc import config from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound from multiqc.plots import heatmap log = logging.getLogger(__name__) class MultiqcModule(BaseMultiqcModule): """ This module parses the output from the `ivar trim` command and creates a...
32b6b99d2cf45f42a36135b9acb1dc3eeec20fb7b87c146213b48a35b7cbbde4
Python
7,181
202
"""Regression tests for the per-call rayon thread-pool fix in ``src/lib.rs``. Background ---------- The Rust entry points used to set the number of worker threads with ``env::set_var("RAYON_NUM_THREADS", threads.to_string())``. That value is read only once -- when rayon lazily builds its *global* pool on the first par...
541ef3452486f4164bcaa463fc6f31439390ff124f84cc36bed8431b02308adf
Python
7,184
206
""" methods/softimpute_xgb.py — SoftImpute + XGBoost ================================================== Iterative SVD soft-thresholding for matrix completion, followed by XGBoost classification. Reference --------- Mazumder, R., Hastie, T., & Tibshirani, R. (2010). Spectral Regularization Algorithms for Learning Large...
0fd18f17aeefbc2444e117b07de8f14beb495c0a4c5671dd45facb844ae94df7
Python
7,186
226
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ## Import Libraries import os, sys, csv import glob import warnings import re import gzip warnings.filterwarnings("ignore") ## Import python libraries import matplotlib.pyplot as plt import pandas as pd import numpy as np import argparse ## Import Logger i...
e14fce341914451f8427237d8636bc2ca0bf7c22eaea8691034a087be996a82a
Python
7,193
185
import numpy as np import pandas as pd import os # downloaded from https://ftp.ebi.ac.uk/pub/databases/cryptic/release_june2022/reuse/CRyPTIC_reuse_table_20231208.csv # this was the most recent version available at the time this script was written cryptic_reuse = pd.read_csv("./MIC_data/CRyPTIC_reuse_table_20231208.cs...
f6c7168edfe0e243a57d9f595c10560562ebbd85a0b025af8a29a76a5be14654
Python
7,193
155
""" Théo Gauvrit 18/01/2024 Cross correlation analysis to get share variability of neurons """ import matplotlib import numpy as np import matplotlib.pyplot as plt matplotlib.use("Qt5Agg") plt.switch_backend("Qt5Agg") # get the clusters of neurons from MLR # compute the mean activity trace for each cluster # compute ...
7b99f97d5c17ba9055aafadfcb30df9eaf7fd3ed23fa6a86c450f33d24638645
Python
7,195
201
# -*- coding: utf-8 -*- """ .. module:: skimpy :platform: Unix, Windows :synopsis: Simple Kinetic Models in Python .. moduleauthor:: SKiMPy team [---------] Copyright 2022 Laboratory of Computational Systems Biotechnology (LCSB), Ecole Polytechnique Federale de Lausanne (EPFL), Switzerland Licensed under the ...
629565fba29b8be5cf02369d7dcdb7ab3706bb08075770bb96415fe3618949c0
Python
7,202
246
#!/usr/bin/env python # coding: utf-8 # ------------------------------ # Import the needed libraries # ------------------------------ import argparse import csv import gzip import logging import sys, os, re import subprocess import csv import pandas as pd from collections import defaultdict logging.basicConfig( ...
37a1d9c92df25e44e01bd013a7e245fd6f957ec092b0e6ae91dc314a538e5696
Python
7,210
184
from pytfa.io.json import load_json_model from skimpy.io.yaml import load_yaml_model from skimpy.analysis.oracle.load_pytfa_solution import load_fluxes, \ load_concentrations, load_equilibrium_constants from skimpy.sampling.simple_parameter_sampler import SimpleParameterSampler from skimpy.core import * from skimpy...
4a9e680fc9f9ca543c77237ec0eb95e81a5260d40e26b756b6c061ecd0e5a8f9
Python
7,214
218
import copy import torch from torch.optim.lr_scheduler import ReduceLROnPlateau import torch.nn as nn import torch.optim as optim from .eval_vis import calculate_metrics,MetricTracker,save_checkpoint from .val import validate,test import logging logger = logging.getLogger(f"{__name__}.modelTraining") class EarlyStop...
4d4e80a8beebc27ea4eea1063dca8c2f46528796928ab91852645c7f63c1b2ac
Python
7,218
171
#!/usr/bin/env python ''' A simple Python wrapper for the bh_tsne binary that makes it easier to use it for TSV files in a pipeline without any shell script trickery. Note: The script does some minimal sanity checking of the input, but don't expect it to cover all cases. After all, it is a just a wrapper. Exampl...
967357b44873c8159110c6d8bb883f704d37112bc9deed687ece15e693d5d76f
Python
7,219
187
import logging from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound from multiqc.plots import bargraph, linegraph log = logging.getLogger(__name__) class MultiqcModule(BaseMultiqcModule): """ Supported scripts: - `rsem-calculate-expression` This module search for the file `.cnt`...
b498123b546fd7beb32a2be8076812612b238b00a3d02ce597a50ec7763b448c
Python
7,219
129
import os import json import shutil import configparser import logging import sys import subprocess import traceback import pandas as pd def test_validation_pipeline_metrics_space(test_dir): logging.basicConfig() logging.getLogger().setLevel(logging.DEBUG) logging.info("Running standard reporting unit tes...
8389b4b5b3d4e872f3806202ce41fb1ff363e775b2d0c0c88a16ede50d786897
Python
7,221
210
import os import glob import numpy as np import pandas as pd import seaborn as sns from matplotlib import pyplot as plt from scipy.stats import ttest_rel from statsmodels.stats.anova import AnovaRM # ============================================================================= # Paths # ==============================...
4c91362b8bad75bdee1ec70247fe8208b3b3d1ee460b0f8a00ca69229ddba725
Python
7,224
199
""" core/config.py — Typed Configuration Dataclasses =================================================== Provides strongly-typed, hierarchical configuration containers. All configs are plain Python dataclasses and can be populated from a YAML file via ``ExperimentConfig.from_yaml(path)``. Design principles: - Every ...
d8ca50014c377e3909a799c86423fa7653c51ce180dff9aff0b5e2a50707f101
Python
7,224
215
""" The tasks module holds the TaskFiles class which organizes input and output paths and the Task class for tasks in the runmanager queue. """ import logging import shutil from dataclasses import dataclass, field from pathlib import Path from typing import Any, Callable, Optional from kimmdy.constants import MARK_DO...
b641b0447673d5fc6222cc521bb90d7d6b0e5b5d16615baaee1b49a45a81ed3d
Python
7,234
179
""" Example illustrating the application of MBAR to compute a 1D free energy profile from an umbrella sampling simulation. The data represents an umbrella sampling simulation for the chi torsion of a valine sidechain in lysozyme L99A with benzene bound in the cavity. Reference: D. L. Mobley, A. P. Graves, J. D. ...
41b27ecdca6a9dbb2235bc8f4009dc618ae55ff0a3d9449a8088fb0304dcc2eb
Python
7,236
211
#!/usr/bin/env python3 """ Batch extraction script for running D4D extractions on all datasets with GPT-5. """ import asyncio import os import sys import json import hashlib from pathlib import Path from urllib.parse import urlparse # Add the src directory to the path so we can import aurelian modules sys.path.insert(...
a5470f8d2561fe4aa2b1d78f42dcd791131c3883f7976cf0f37fb0e7ca80c2b5
Python
7,236
201
# Copyright 2021 DeepMind Technologies Limited # # 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-2.0 # # Unless required by applicable law or agr...
5d34305118d432a8075d82e51f565ac05c04f65f45bd9f80fc7361c252d91199
Python
7,238
202
from loguru import logger from truesight import parse_utils, plot_utils, stats_utils from truesight.experiment.services import EvaluationRef, LLMRef from refs import evaluation_refs import pandas as pd import matplotlib import matplotlib.pyplot as plt matplotlib.use("WebAgg") matplotlib.rcParams["webagg.address"] = "...
709a3f335d4210f458c1c663776fbcbb39d2e1e2cb9cbcc6446d4c894bcd1b10
Python
7,240
181
import logging from collections import defaultdict from typing import Dict from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound from multiqc.plots import bargraph, table log = logging.getLogger(__name__) class MultiqcModule(BaseMultiqcModule): """ The module parses results generated by th...
12e0786eda772ee832f6465257fe128e94cb71d72edcda6615f3d89db59cc643
Python
7,241
170
from sklearn.neighbors import kneighbors_graph import numpy as np import pandas as pd import math import datetime import os import shutil import torch from torch_geometric.data import Data, InMemoryDataset # Hyperparameters InputFolderName = "./MIBI-TNBC_Input/" KNN_K = 72 # Import image name list. Region_filename...
c61d1f745a25f4d56b9868b35868bf8729382600646e6dc8b2a3d3506827aff9
Python
7,241
201
import pathlib import os import pandas as pd import numpy as np import torch import torchvision.transforms as transforms from torch.utils.data import Dataset from PIL import Image from torch.utils.data import random_split from torch.utils.data import DataLoader import torch.nn as nn import torch from torch....
559616d382274abc115b34eb152f6851aa2d763bd9fa6c4deebb57bd69ce860c
Python
7,242
201
import pathlib import os import pandas as pd import numpy as np import torch import torchvision.transforms as transforms from torch.utils.data import Dataset from PIL import Image from torch.utils.data import random_split from torch.utils.data import DataLoader import torch.nn as nn import torch from torch....
8134756e31ae00c250fe0e2df16f29b6b6a6fb9da903f5e712c5b530195ef234
Python
7,243
201
import pathlib import os import pandas as pd import numpy as np import torch import torchvision.transforms as transforms from torch.utils.data import Dataset from PIL import Image from torch.utils.data import random_split from torch.utils.data import DataLoader import torch.nn as nn import torch from torch....
f6eb055438079972c139c85de94452d723e39bd873df008f09d0f727adf57562
Python
7,244
201
import pathlib import os import pandas as pd import numpy as np import torch import torchvision.transforms as transforms from torch.utils.data import Dataset from PIL import Image from torch.utils.data import random_split from torch.utils.data import DataLoader import torch.nn as nn import torch from torch....
6931e37b6b1994cf63f41ce86310d176909c3c57ed480bf32b66009615bbc635
Python
7,245
201
import pathlib import os import pandas as pd import numpy as np import torch import torchvision.transforms as transforms from torch.utils.data import Dataset from PIL import Image from torch.utils.data import random_split from torch.utils.data import DataLoader import torch.nn as nn import torch from torch....
c665817b4b9ad795a27e8bcafeaf7ee14a5264ce7328a31550e3e4549d441811
Python
7,245
201
import pathlib import os import pandas as pd import numpy as np import torch import torchvision.transforms as transforms from torch.utils.data import Dataset from PIL import Image from torch.utils.data import random_split from torch.utils.data import DataLoader import torch.nn as nn import torch from torch....
92c581b8f180e1cd4a9de0ab464beb8599d16124acb24d8fcadb5f7b7de74519
Python
7,252
168
"""Per-UMI files, summarized rather than listed: `<prefix>.umi_counts.txt` (simplex/duplex), `<prefix>.duplex_umi_counts.txt`, and `correct --metrics`. Rows are streamed so a large file is not turned into one pydantic object per UMI.""" import itertools from collections import Counter from typing import Any, Dict, Ite...
dc4cf489497ca2389c6af431633e777649a6f52ed444e92b23a5284cb944b976
Python
7,252
157
# Code analyzes and plots the occlusion sensitivity results from the visual analysis import pandas as pd import matplotlib.pyplot as plt import numpy as np # Settings feature_plot_name = 'occlusion_proportions_misidentifications.png' using_true_positive_results = True if using_true_positive_results: # Settings f...
81c43943e8511292d9e62f22aaf9780538888a99bd30334879072d9cd2f62054
Python
7,265
215
import logging import re from typing import Any, Dict, Optional from multiqc import BaseMultiqcModule, config from multiqc.plots import violin # Initialise the logger log = logging.getLogger(__name__) # ampliconclip has value thing per line, documented here (search for ampliconclip): # http://www.htslib.org/doc/samt...
868b92832e8c1386717e639d33b5c3999659c2d75b76339491616a22d8aceaac
Python
7,273
207
#!/usr/bin/env python from __future__ import division from __future__ import print_function import numpy as np import itertools import os, sys import networkx as nx from collections import defaultdict from forcebalance.molecule import Molecule from forcebalance import Mol2 #===========================================...
bfc8606e0e83f746b3407bc8caabe099c1ccd3d9b4a209a342c74e74a2378a25
Python
7,274
238
import numpy as np from numpy.typing import NDArray from typing import Tuple, Union, Optional, Dict, Iterable import warnings from rdkit import Chem from rdkit.Geometry.rdGeometry import Point3D from matplotlib import pyplot as plt from matplotlib.colors import rgb2hex try: import py3Dmol except ImportError: ...
9dfee6cb5eb6023fd985e26af1452098e0154327f80b35b0dc9f63e710645674
Python
7,279
167
import numpy as np from helper_funcs import run_himalayas, split_by_exp_passage_num def construct_splits_pereira(X, y, data_labels, alphas, device, feature_grouper, n_iter, use_kernelized, dataset, exp, linear_reg, zscore, custom_ridge=False): y_hat_folds = [] mse_stored_inte...
5f9f4392b774ddf6a437ed9731f817808ca5fdcdb4d56a10396e2f0bbf50c212
Python
7,280
215
#!/usr/bin/env python3 """ Bpod Port Event Monitor - Real-time using loop_handler() """ import queue import time from pybpodapi.protocol import Bpod from pybpodapi.state_machine import StateMachine class RealTimeBpodMonitor(Bpod): """ Real-time Bpod event monitor using loop_handler() for immediate event proc...
b420c10915d14a903fced9ae127bf25722b74469db1216a253db236e7728bda2
Python
7,282
169
import logging import re from typing import Dict from multiqc import config from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound from multiqc.plots import bargraph from multiqc.types import Anchor, ColumnKey log = logging.getLogger(__name__) class MultiqcModule(BaseMultiqcModule): """ The...
36652210df644c95770ec4f599ea90aea46e622eee5c2a888b3b89c77320e26e
Python
7,287
210
from typing import Dict, List, TYPE_CHECKING, Optional import torch import numpy as np from openff.utilities import requires_package from openff.nagl.features.atoms import AtomFeature from openff.nagl.features.bonds import BondFeature from openff.nagl.features._featurizers import AtomFeaturizer, BondFeaturizer from o...
3bf132ddc9af687c5df27b1fb5252a7071572a056847842f9f69c41743f70131
Python
7,289
280
ALLRED_ROCHOW_ELECTRONEGATIVITY = { # sourced from mendeleev 1: 0.0009765625, 2: 0.0008034026465028355, 3: 7.34920006783877e-05, 4: 0.00018742791234140717, 5: 0.00035986159169550173, 6: 0.0005777777777777778, 7: 0.0007736560206308273, 8: 0.001146384479717813, 9: 0.00126953125, ...
b65c3b111defe55e5a90a7f2c3d7bd63f09418a949b1dcfb084b6514b3afa6dc
Python
7,290
191
# -*- coding: utf-8 -*- """ .. module:: skimpy :platform: Unix, Windows :synopsis: Simple Kinetic Models in Python .. moduleauthor:: SKiMPy team [---------] Copyright 2017 Laboratory of Computational Systems Biotechnology (LCSB), Ecole Polytechnique Federale de Lausanne (EPFL), Switzerland Licensed under the ...
68ceae69ead036a13af369fadf09c44af12178522c30f9310b00e4e4c1db38bb
Python
7,291
145
from PySide6.QtWidgets import QWidget, QHBoxLayout, QVBoxLayout, QLabel, QStackedWidget from PySide6.QtGui import QIcon, QPixmap, QColor from PySide6.QtCore import Qt, QSize, Signal import logging from utils.software_config import SoftwareConfigResources from gui.SinglePatientComponent.CentralDisplayArea.CentralDisplay...
71d606a48f62c7b13f8b3063182944be077f403a9ec2f70c9064dc49bfcd9df2
Python
7,293
194
"""Generate per-subject case-study figures for the paper. Picks a handful of named test subjects and produces aligned MRI / real PET / generated PET montages plus longitudinal follow-up renderings. Used to back up specific qualitative claims in the discussion. """ import os import ants import torch import random impo...
8470da1b79a45b6029c353311e025a23a5d54b1a8529e0ca122fa1cb790a6a45
Python
7,294
258
from sys import argv if len(argv) != 3: print(f"Need to pass the run id, e.g. python {argv[0]} 1 10") exit() id = argv[1] embeddings_dim = argv[2] import os from glob import glob from pathlib import Path import pickle import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as pl...
9b4ce8bb743593f4e8c610698e870fda1aa19646bffa422af690bb4c5dd6a18a
Python
7,299
153
import torch import numpy as np def gen_cube(device = torch.device("cpu")): """"Generates a synthetic dataset based on the structure of a cube. Not biologically realistic, but useful for demos and testing. Args: device (torch.device, optional): Specify the PyTorch device to use, e.g., CPU, GP...
f07ab60d00d6b7138257b6b6480d68ea4d5ffee6ede740786f894949cb3e3bc8
Python
7,312
196
# 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 ...
1259d8d0ee0898227a04d94bf2778412a3c3955a71fc6a02418bf706bf795ddb
Python
7,313
214
import numpy as np import nibabel as nib import os from skimage.metrics import peak_signal_noise_ratio, structural_similarity from Quality_Metrics.Tenengrad import TG from Quality_Metrics.AES import aes from Quality_Metrics.CoEnt import coent from Quality_Metrics.ImageEntropy import iment from Quality_Metrics.GradientE...
8272ef1baa6651e34c59b464039c81c175d7a6d272cf3c0a1da782229c2d1f70
Python
7,314
169
import time, sys, threading, logging, copy, Queue, warnings import multiprocessing as mp import numpy as np import pylab as pl from daq import DAQIn from expts.routines import add_to_saver_buffer from util import now,now2 class AnalogReader(mp.Process): """ Instantiates a new process that handles a DAQIn objec...
8864a82e3c67f24881b89cec7c4b927c76b48c44929b9ab0bc2430e78eada526
Python
7,318
175
import logging from collections import defaultdict from typing import Dict from multiqc import config from multiqc.plots import bargraph, linegraph from multiqc.plots.bargraph import BarPlotConfig # Initialise the logger log = logging.getLogger(__name__) def parse_samtools_idxstats(module): """Find Samtools idx...