sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
b141cd9a437410a882671b3c2d0e39d6a9bbb09cfffc43b8bf1004aa1a80e3e0
Python
6,535
190
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Mar 24 11:07:47 2025 @author: saiful """ import pandas as pd file_path = "/data/saiful/ePPI/all_eppi_db_embeddings.csv" df = pd.read_csv(file_path) print(df.head()) df.columns # Drop the specified columns df.drop(columns=['FASTA', 'biovec_UniProtID'...
dff86fa3e6bbb5174ba44ff601f4cde2a852b438d73390a4fded32b66d94e92f
Python
6,535
177
""" TimeFlies CLI Analysis Commands Contains EDA and analysis commands for data exploration and model analysis. """ from ._utils import suppress_stderr def eda_command(args, config) -> int: """Run exploratory data analysis on the dataset.""" import os from pathlib import Path from ...analysis.eda i...
bd51e3c44ea1161d198edf1333721cb56f84fe550c342c48eeb4ab9cc61d7641
Python
6,536
238
""" Tests for discovering and excluding files """ from pathlib import Path from typing import Dict, Set, Union import pytest import yaml from importlib_metadata import EntryPoint from multiqc import config, report from multiqc.core.exceptions import RunError from multiqc.core.file_search import file_search @pytest...
0ef0b3e2a67f00d620c6a97281d5715aefb8d3e9361e35fc6ef9a29b2d3561e8
Python
6,540
221
from dataclasses import dataclass, field from typing import Literal from refs.llm_base_refs import ( gpt41_nano, gpt4o, gpt41, qwen25_3b, qwen25_7b, qwen25_14b, gpt41_mini, ) from refs.paper.animal_preference_numbers_refs import ( AnimalGroup, qwen25_7b_groups, gpt41_nano_groups,...
56b9c934ea9c3f39df35aae34096afb31dad806ec67dc2dae8fc990ae7ff2fb0
Python
6,555
233
""" PEP 610 """ import json import re import urllib.parse from typing import Any, Dict, Iterable, Optional, Type, TypeVar, Union __all__ = [ "DirectUrl", "DirectUrlValidationError", "DirInfo", "ArchiveInfo", "VcsInfo", ] T = TypeVar("T") DIRECT_URL_METADATA_NAME = "direct_url.json" ENV_VAR_RE = r...
e8cdf7bc70cddb210141d9497bb4d7f278480fa3fc41a63e10172150ac84aa79
Python
6,555
159
#!/usr/bin/env python from __future__ import division from __future__ import print_function from builtins import zip from builtins import str from builtins import range from forcebalance.molecule import Molecule from optparse import OptionParser from copy import deepcopy import networkx as nx import numpy as np import...
87bb56cb6c87dafd39f5dffea0b32e7e891c395c46249f600eae9752d2ff4831
Python
6,558
160
"""Conditional WGAN-GP baseline for MRI-to-PET synthesis. Used by ``src/train_scripts/train_baseGAN.py`` as the in-house GAN baseline reported in the paper. The architecture mirrors the diffusion model's ``ImageEncoder`` so the comparison is fair across the two model families. * ``ImageEncoder`` — same 3D CNN used by...
de4b3596f5cd2be21c139d4c3a48e28dc94636a3e5808404fd7e7805c9f879c2
Python
6,561
184
#!/usr/bin/env python3 import cv2 # from cv2 import aruco from tqdm import trange import numpy as np import os, os.path from glob import glob from collections import defaultdict import pandas as pd from .common import get_folders, true_basename, get_video_name from .triangulate import load_offsets_dict, load_pose2d_f...
3205326058ab089319e26277329fda2f061c45432ec5f2f2b77c085dffbb4549
Python
6,562
228
import os import sys import warnings from copy import deepcopy from inspect import cleandoc from itertools import chain from string import ascii_letters, digits from unittest import mock import numpy as np import pytest import shapely from shapely.decorators import multithreading_enabled, requires_geos @pytest.fixt...
8e8176378451b36af02234d0469ae7db5b22236ac9d3716be5b26a71bf85b88c
Python
6,565
158
import pandas as pd import numpy as np from typing import List, Tuple import os import argparse from intervaltree import IntervalTree, Interval def load_peak_file(file_path: str) -> pd.DataFrame: """Load broadPeak format file.""" columns = ['chr', 'start', 'end', 'name', 'score', 'strand', 'sign...
6ac03682e10fc3bfbf0881f71427531e6a1751280145ab73a47b63d2f31ffec8
Python
6,572
197
#!/usr/bin/env python3 """ MobiDB APIからIDR情報を取得(修正版) 入力: eurbpdb_pfam_mapping.tsv 出力: idr_mobidb_results_v2.tsv 使い方: python3 fetch_idr_mobidb_v2.py <eurbpdb_pfam_mapping.tsv> <output_dir> レジューム対応。所要時間: 1.5-2時間 """ import sys import os import csv import json import time import urllib.request import ssl ssl._creat...
c471ec7fde27c68514859a546cde78c52f6b16b1a69e09a1e73d0d144be3a9dd
Python
6,576
183
""" Tests for the web tools. """ import os import pytest from unittest.mock import patch, MagicMock from aurelian.agents.web.web_tools import perplexity_query, ResultWithCitations @pytest.fixture def mock_agent(): """Fixture to mock the pydantic_ai Agent.""" with patch("aurelian.agents.web.web_tools.Agent") ...
c557ce3da6a86dfab06ce00d5d3c5158e7d8f03a1fe2b9c0a7b79500572f491a
Python
6,578
190
import torch import torch.nn as nn import numpy as np import nibabel as nib from pathlib import Path from functools import lru_cache from data_utils import load_array_with_affine, load_mask_array from transformer_mlp_model import Transformer device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") DEFAU...
6fd64c40aa62b59ad5e3236b0cc51167a282659fea5015ee6f75597cca662c7f
Python
6,581
192
# 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,...
04536523e745edfd396a82d494c678ec7862d50f8ed1af0a9f73a97b5efa1312
Python
6,596
173
import unittest import pytest from shapely import geometry from shapely.constructive import BufferCapStyle, BufferJoinStyle from shapely.geometry.base import CAP_STYLE, JOIN_STYLE @pytest.mark.parametrize("distance", [float("nan"), float("inf")]) def test_non_finite_distance(distance): g = geometry.Point(0, 0) ...
6807039874aeba8ba882780bf16ddc0ec263474f7f10fa1f0e38983eead3fc32
Python
6,599
173
import sys import torch import safetensors from torch import nn from typing import List device = 'cuda' if torch.cuda.is_available() else 'cpu' def save_tensors(module: nn.Module, features, name: str): """ Process and save activations in the module. """ if type(features) in [list, tuple]: # print(type...
1606174ce635bc88697b1a56c01c2b472f967a04a758677eaca9d003fd0bdadc
Python
6,604
167
# -*- coding: utf-8 -*- """ Set of functions used to plot heatmaps split by CP subdivision. Used in Fig 3b and ExtendedData Fig 11. """ import re import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt def split_name(labels,split_list=['SSp','MOp','MOs']): split_labels = [] ...
caff0ffe98b843ef1a1f047ebdacef581a04f4c795736e877c4664f141a82be2
Python
6,615
173
"""Ethopy Task Template Generator Script. This script prompts the user for specific ethopy module paths and class names (for Experiment, Behavior, and Stimulus components) and generates a Python (.py) file that serves as a template for an ethopy experiment task, following a predefined structure. """ import datetime i...
cbadfa3d040c6b139618b7a2c14ac34e95d09fef23b8a65dc5fd633b3f610a27
Python
6,620
165
"""" Adrien Corniere 14/05/2024 test multi trials""" import os import cebra import json import numpy as np import pandas as pd import percephone.core.recording as pc import os import matplotlib import matplotlib.pyplot as plt from multiprocessing import Pool, cpu_count, pool plt.rcParams['font.size'] = 10 plt.rcParams...
1bbabc0534ac38b8da6484231946b9ad194eb7a62f62a335181ba1cb48c4ceb7
Python
6,621
167
#!/usr/bin/env python # -*- coding: utf-8 -*- from os import path import numpy as np import pandas as pd from scipy import stats from joblib import Parallel, delayed from tqdm import tqdm from . import utils, afni, io def p_of_score(x, score, alternative='two-sided'): p = stats.percentileofscore(x, score)/100 ...
a1060e80978bdfaa05c232055c29e1ad200928a945f3d794bdd55537b06033ef
Python
6,621
169
# -*- coding: utf-8 -*- import numpy as np from scipy.stats import hypergeom def calc_pvalues(query, gene_sets, background=20000, **kwargs): """calculate pvalues for all categories in the graph :param set query: set of identifiers for which the p value is calculated :param dict gene_sets: gmt file dict a...
11ff1986cc0a52f5dbffbcff14ac6f86ddbc3ebae9ea25728e9195ce414b29ad
Python
6,623
148
import os from PySide6.QtWidgets import QWidget, QHBoxLayout, QVBoxLayout, QScrollArea, QLabel, QSpacerItem,\ QGridLayout, QTreeWidget, QTreeWidgetItem from PySide6.QtCore import QSize, Qt, Signal from gui.StudyBatchComponent.PatientsListingPanel.PatientListingWidgetItem import PatientListingWidgetItem from utils.s...
f8b5bd28bde0ed75ff152132647ce9d7867d295f210d33f5f9b2d521c3ee6b2f
Python
6,631
161
import sys import os import random import pickle import pandas as pd import numpy as np from skimage.transform import resize from torch.utils.data import Dataset from . import data_feature class ChromosomeDataset(Dataset): ''' Dataloader that provide sequence, features, and HiC data. Assume input folde...
b21347728a5f05e7fd5f653f0f6daada9e57f62bd36537ec24815885494a8116
Python
6,637
169
import pandas as pd pd.set_option('display.max_rows', None) pd.set_option('display.max_columns', None) pd.set_option('display.width', None) pd.set_option('display.max_colwidth', None) import nibabel as nib import glob import numpy as np from tedana.utils import make_adaptive_mask import tedana.utils as tdu import subpr...
03b98c5cef9b47098b442acae07fa2e7db49f09821c28527f52eb631b1d6dcbe
Python
6,640
162
import argparse from pathlib import Path import numpy as np import pandas as pd import statsmodels.formula.api as smf def main(): ap = argparse.ArgumentParser(description="Create L-maps with fixed LME (no PTID/SITE/Study).") ap.add_argument("--residuals_csv", required=True, help="Residuals CSV; used only to i...
281bc20a4ce5fa3fcf39b7cc06bb325e0de4bc20e60a98b60c03a7b9a51174c2
Python
6,641
143
""" Agent for working with gene information using the UniProt API and NCBI Entrez. Provides structured information in the form of Narrative, Functional Terms Table, and Gene Summary Table. """ from pydantic_ai import Agent from .talisman_config import TalismanConfig, get_config from .talisman_tools import ( get_ge...
c1b5d4fb79d8f9430ec4cd87d921932403bcd85e37425cf3dd88d0247d8cf7e2
Python
6,643
227
import pytest import numpy as np import torch from openff.nagl.molecule._dgl import DGLMolecule, DGLMoleculeBatch from openff.nagl.nn.postprocess import ( ComputePartialCharges, RegularizedComputePartialCharges ) # @pytest.fixture # def dgl_carboxylate def test_calculate_partial_charges_neutral(): charg...
8de35037c3bb7ac1892f90d6a60493a763854bff9b68ca43eed53c9381049c3b
Python
6,649
198
import datetime from time import sleep import pytest from alchemiscale.compute import client from alchemiscale.storage.models import ( ComputeManagerID, ComputeManagerInstruction, ComputeManagerStatus, ComputeServiceID, ) from alchemiscale.tests.integration.compute.utils import get_compute_settings_ov...
aacfbeefe40689e38db8694d64c13fe9e377c662097779bd6a1708509bc2b574
Python
6,651
156
# 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,...
badd85e67267fe702746c19f3354a694121460363dfc37dbb0d45bacb668b5cc
Python
6,652
191
""" Postprocessing functions to convert a graph representation to a predicted property """ import abc from typing import ClassVar, Dict, Type, Union import torch from openff.nagl._base.metaregistry import create_registry_metaclass from openff.nagl.molecule._dgl import DGLMolecule, DGLMoleculeBatch class _Postproce...
ec069dabcc33f7746277a271f84fc9f801a8acbe039acd5999a13b38b5f81a86
Python
6,653
172
from __future__ import annotations from typing import Any, Callable, ClassVar from beyond_backprop.datamodules.vision_datamodule import VisionDataModule from beyond_backprop.utils.types import C, H, W import os from typing import Literal, Union from pathlib import Path import warnings from torchvision.datasets import I...
741d9e1c5655c0ed352df97e8eba413ed56d1c4aa67255fb4977b7d52e370e74
Python
6,661
158
"""Pipeline stage 3a: build the MRI inventory and the PET-MRI pair list. Walks the on-disk ADNI / PPMI / UKBB MRI directories and the preprocessed PET directory, then writes the pickles consumed by every downstream training and evaluation script: * ``src/data/mriDataset.pkl`` — list of all usable MRI paths (any cohor...
4192238718bb9dbdf1b821bab53122f67e99f8cfbb532f5c5e2f41a7a6374365
Python
6,665
185
import numpy as np import pandas as pd import matplotlib.pyplot as plt from pathlib import Path from LR_Cmaps import get_continuous_cmap import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1.inset_locator import inset_axes basepath = "E:/NeuroBed_ML/analysis/" plt.style.use(basepa...
b1b3aa0ca6ed2aca0ecea591e8c2aec2bab02d44c2a3f00de1ca7ce9bbd0cfc3
Python
6,682
176
#!/usr/bin/env python3 import pandas as pd import numpy as np import pyBigWig import matplotlib.pyplot as plt import seaborn as sns from scipy import stats from pathlib import Path import os import logging # Set up logging logging.basicConfig( level=logging.INFO, format='%(asctime)s - %(levelname)s - %(messag...
64704bfc710e62934f15ef121efdf38d92dcfcf0099f62af41bfcb40f6ab8056
Python
6,688
198
#!/usr/bin/env python """ Parse training log Evolved from parse_log.sh """ import os import re import extract_seconds import argparse import csv from collections import OrderedDict def parse_log(path_to_log): """Parse log file Returns (train_dict_list, test_dict_list) train_dict_list and test_dict_lis...
76cab86a3fd801a76161bba14d5845e233702600986c33990642ec129535c190
Python
6,693
160
# -*- 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 ...
8afc95ff2cc47eaa0bcaa97fe2aa1309d0c9149c23e11d3374d2c7c251de1f91
Python
6,693
165
# -*- 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 ...
93202e2ed27009e50a7e53db43400130fa7c39ff0be0aac835d5c3b2452eb9a3
Python
6,696
134
import pandas as pd import fix_cleaning.paths as fix_paths import fix_cleaning.single_ica as sica import fix_cleaning.classify as cl import fix_cleaning.fix as fx import numpy as np import subprocess import os from pathlib import Path # Define the paths dataset='language' dataset_path = 'Language/Language_7T' base_dir...
1f5641ba35c9089f239b59a028b6a90b2672bb72ab58b25e05460dcf3741a392
Python
6,697
204
# Used to produce 2D and 3D PCA of image datasets using the trained densenet121 model as a feature extractor import torch import torch.nn as nn from torchvision import models from torchvision.datasets import ImageFolder from torch.utils.data import DataLoader from sklearn.decomposition import PCA import matplotlib.pypl...
762a3369deb7e5cc7a9720b391f733d6919d399db1953548e213e968a7bbf4bc
Python
6,700
195
""" components/methods/graphsgan_method.py — GraphSGAN BaseMethod Adapter ====================================================================== Wraps the P1 GraphSGAN implementation as a framework ``BaseMethod`` so it can be plugged into sweep-style mass experiments via the stateless ``fit_predict()`` interface. This...
d77717e1fd05d1fde82bd4ef0a8184091b41f8304dc2b6ab19d191d6eea17b7f
Python
6,704
145
#!/usr/bin/env python from __future__ import print_function from builtins import range import os, sys, re import numpy as np from collections import defaultdict, OrderedDict #======================================================================# #| |...
b01d1dc9866b4a2c148775085f3334c540c6f6a5b3563e68fd315f472ad58f6b
Python
6,708
206
import numpy as np import random import matplotlib.pyplot as plt from .utils import sigmoid, create_binary_vector, get_neighbor def precompute(marker_scores, sim_scores): """ Pre-compute sigmoid arrays once before the hill-climbing loop. Avoids redundant pandas indexing and sigmoid calls inside obj. "...
f43bf739aeeba66918fb60871afe35054ad316047713edc986d4194cfff96730
Python
6,710
171
"""Train the pretraining-aware diffusion baseline. Runs the alternative two-stage pretraining-then-fine-tuning recipe captured in ``src/baselines/models/paDiffusion.py``, then fine-tunes on paired PET. Provides the apples-to-apples comparison point for the MRI2PET style-transfer pretraining recipe. Checkpoint: ``src/...
e402aab6dabfa017ce566fbbf1d6a92157104e56d7d56e52a34340cccf2b7d99
Python
6,711
141
import os from glob import glob import pandas as pd import seaborn as sns import numpy as np from matplotlib import pyplot as plt import nibabel as nib from nilearn.image import resample_to_img from nilearn.plotting import plot_img from tqdm import tqdm from preprocessing.create_gray_matter_masks import get_gray_matt...
b04ebc426bd7d12d8495c24fd2198b172ec949d36cf78ea0a4ea193db51743de
Python
6,716
145
import pathlib import os import numpy as np import pandas as pd import torch from torch.utils.data import Dataset import torchvision.transforms as transforms from PIL import Image from multiprocessing import Process import xlrd import xlwt #对xls文件进行改写 #from xlutils.copy import copyasf import matplotlib.py...
64bd1e5532e960f7c2cc63dbde409d20813c65e95143d2b4eb4dbe556d5b5036
Python
6,717
183
#!/usr/bin/env python3 """ Label fragments in a CReM database with pharmacophore feature counts using pmapper. Supports: - Schema version 1 (new): frags table with core_smi_id (detected via PRAGMA user_version = 1) - Old schema: frags table with core_id, or individual radiusX tables Features are stored as integer...
aefdd8d14df131e860bb9fa5ea720eec590585bed347491f1bc3ebacae80baba
Python
6,717
177
import json import logging from json import JSONDecodeError from multiqc import config from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound from multiqc.plots import bargraph log = logging.getLogger(__name__) class MultiqcModule(BaseMultiqcModule): """ By default, tables show read counts ...
ba03aa2c987d2776230db7f5d1b4dd25d022204a2ccfa183d01150abf21f258d
Python
6,721
185
""" Determine spatial relationships between layers to relate their coordinates. Coordinates are mapped from input-to-output (forward), but can be mapped output-to-input (backward) by the inverse mapping too. This helps crop and align feature maps among other uses. """ from __future__ import division import numpy as np...
2484622a96805dc5825215bee3aec71ae92ab82103b0b2872ce178ca7829dc96
Python
6,723
147
#!/usr/bin/env python3 # author : Aleksandra Nikonenko # date : 17.05.2021 # license : BSD-3 # ============================================================================== __author__ = 'aleksandra' import argparse from functools import partial import os import subprocess import sys impor...
9cbd74c86bd6ef6fbd1d90929744500de394aafcced0406e6f71bbb263746aae
Python
6,723
164
""" Utility functions useful for equilibration. """ import logging from openmm import unit, OpenMMException # Set up logger _logger = logging.getLogger(__name__) def run_gentle_equilibration(topology, positions, system, stages, filename, platform_name='CUDA', save_box_vectors=True): """ Run gentle equilibra...
11adfc14279c00715353ac3f01528107196ed668c05070952665316a8ef177b9
Python
6,727
208
# -*- coding: utf-8 -*- """ .. module:: skimpy :platform: Unix, Windows :synopsis: Simple Kinetic Models in Python .. moduleauthor:: SKiMPy team [---------] Copyright 2019 Laboratory of Computational Systems Biotechnology (LCSB), Ecole Polytechnique Federale de Lausanne (EPFL), Switzerland Licensed under the ...
97774c597efa74b5d5991438e4f08e9fbe70312a0510a45c01b42d59c940f4f3
Python
6,736
150
"""Tests for padding layers.""" import functools import numpy as np import tensorflow as tf # from tensorflow.python.eager import context from keras import keras_parameterized from keras import testing_utils from tensorflow.python.platform import test from deepcell import layers def _get_random_padding(dim): ...
53c078bdd55a2dcea9c12f6250a3966c41f3f0d89a39c44a9dd790706651a695
Python
6,742
173
# %% import matplotlib.pyplot as plt from myutils.g_values.best_fit import * import kimmdy_paper_theme plot_colors = kimmdy_paper_theme.auto_init() files = ['../DOPA/radical/EPRspectrum.dat', '../PYD/radical/EPRspectrum.dat',] ybottom = 0.08 ytop = 0.95 xleft = 0.06 xright = 0.98 fieldrange = None tme =...
633ba7283f2159573d60c676653398487dd6e67db08bac10ebc7ce3672f4751f
Python
6,743
194
# -*- 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 ...
fb68385576b84156b91b1fc79eb43e48d17677d1ad832017effed98ed0cc0eb2
Python
6,749
180
# -*- coding: utf-8 -*- """ Plot TEST balanced accuracy for the TOP model of each classification target. Assumptions: - This script sits in the same folder as: model0_RS_top10_BA_PCA_SVM.pkl - Model pickles live in: ../output/result_files_BA_PCA_SVM/ - Model files are named: model0_RS_classification_modelNNN.pk...
789cad700bbbe645bb7209f89c2c700d57bda5c6f54b45651887a007c3841c11
Python
6,752
231
#!/usr/bin/env python3 """ Check that container references are valid across all workflow modes. This script validates that all conditional code paths have proper container references. """ import sys def check_containers_for_mode(mode_name, config_overrides): """Check container references for a specific mode conf...
4c85531168a944ed9e3e35c3e8469a6287e66c3085fd82de210449c83c56518e
Python
6,769
109
from importlib.metadata import version, PackageNotFoundError try: __version__ = version("ProtoCloud") except PackageNotFoundError: __version__ = "unknown" from ProtoCloud import glo from ProtoCloud.model import protoCloud from ProtoCloud import model from ProtoCloud import data from ProtoCloud import prp fro...
f24233668304b10f5b058714611fe75dd0789f1132a95210889c51937d221472
Python
6,771
170
# -*- coding: utf-8 -*- """ ------------------------------------------------------------------------------- NeuroBED_ML Visualization Univariate severity (by group) — violin+swarm + ANOVA/Tukey (per family) ------------------------------------------------------------------------------- ...
6c57fa680c2dc01ec9efb460db95304278ab71dd437cbd3b9980370118d75708
Python
6,775
167
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe import os import pathlib import shutil import gufe import openmm import openmm.unit as openmm_unit import pytest from gufe import ChemicalSystem, SmallMoleculeComponent from gufe.protocols.e...
259acf59506e32aa2b33f6f9fd7aa263f7e1c1327b5d8c546796609f8c446049
Python
6,778
182
# -*- 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 ...
779dc33b80c49a3bf38af190a9515951450eb317394ad6d41b5665add9babb25
Python
6,781
182
# -*- 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 ...
c55d2d87316cbf91bdee678cff41cfd2b1650f6b1055aca25e934f02ac9dff08
Python
6,782
224
#!/usr/bin/env python3 import os import json import pandas as pd from typing import List, Dict, Any from pathlib import Path from truesight.eval import RESULTS_FNAME import matplotlib.pyplot as plt import numpy as np from scipy import stats COHERENCY_SCORE_THRESHOLD = 50 def load_jsonl(path: str) -> List[Dict[Any,...
0ac48826f6d19a451832b45e70605855510fc49cc8d90fa9c96fc10f9154c14f
Python
6,783
160
import logging import re from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound from multiqc.plots import bargraph log = logging.getLogger(__name__) class MultiqcModule(BaseMultiqcModule): """ The module reads the `*_peaks.xls` results files and prints the redundancy rates and number of pea...
72bafd1b9dc30ea5ba3cd47190682c0a44c3eb30c97d0f00672dd9e88cbac3b2
Python
6,786
110
from importlib.metadata import version, PackageNotFoundError try: __version__ = version("ProtoCloud") except PackageNotFoundError: __version__ = "unknown" from ProtoCloud import glo from ProtoCloud.model import protoCloud from ProtoCloud.api import ProtoCloudModel from ProtoCloud import model from ProtoClou...
12ef8d353e2adc80156ad97cb20a964bf24f53d8918302e335815e74ea418d3e
Python
6,789
183
#!/bin/env python """ Module simtk.unit.prefix This is part of the OpenMM molecular simulation toolkit originating from Simbios, the NIH National Center for Physics-Based Simulation of Biological Structures at Stanford, funded under the NIH Roadmap for Medical Research, grant U54 GM072970. See https://simtk.org. Port...
a7458a7d8523eb9561eb3d37159a022592c35715d46d112534f6ff5184ba9935
Python
6,796
117
import os import argparse import torch import pandas as pd from tumor_model import TumorDataset from tumor_model import TorchTumorDataset from tumor_model import TumorGraphGNN from tumor_model import TrainerTumorModel as Trainer import utils as Utils def parse_args(): ''' Parses command line arguments. Re...
2bd8d22fd2677cb048970802ba8d2304d64a22f23a78f505c18e9467d87cebc1
Python
6,805
125
import os import argparse import torch import pandas as pd import numpy as np import utils as Utils from tumor_model import TrainerTumorModel from tumor_model import TumorDataset from survival import TorchSurvivalDataset from survival import SurvivalGNN from survival import TrainerSurvival def parse_args(): """ ...
ca7b4ea65c3ddd56684005410770573cabaa6da9b8993e9312b6acb45c05cb7b
Python
6,806
215
import locale import logging import os import sys from optparse import Values from types import ModuleType from typing import Any, Dict, List, Optional import pip._vendor from pip._vendor.certifi import where from pip._vendor.packaging.version import parse as parse_version from pip import __file__ as pip_location fro...
64665491c87e1299b6e126057adf5065b42ab8863e1171f891940f73c6e8bb12
Python
6,815
190
# !/usr/bin/env python # -*-coding:utf-8 -*- import copy import json import six class Config_Base(object): def __init__(self): pass @classmethod def from_dict(cls, json_object): config = cls() for (key, value) in six.iteritems(json_object): config.__dict__[key] = val...
a93445111ebe15b46fffc4908bbad7630018142f786ac8defbd2d47b9019adee
Python
6,820
187
# 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,...
9dffef726f895444c5f87cbae72ac80990b789fff664d95f0a7430fe735cab33
Python
6,827
191
""" Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. """ import numpy as np from facemap import utils class NeuralActivity: """ Neural activity class for storing and visualizing neural activity data. """ def __init__( self, parent=None, ...
cd031dddbf4de9c40dcb367124df03955ad2958c4772a5a2c28eb634cc052fa6
Python
6,828
164
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 = "./MERFISH-Brain_Input/" KNN_K = 69 ## Import image name list. Region_fil...
48745b4bb647355e9845792a855df9c59fd7df7fcc664c765351fec390c4073e
Python
6,831
203
import torch import torch.nn as nn import torch.nn.functional as F class my_Layernorm(nn.Module): """ Special designed layernorm for the seasonal part """ def __init__(self, channels): super(my_Layernorm, self).__init__() self.layernorm = nn.LayerNorm(channels) def forward(self, ...
b4f5bb1ffca3792028e511e5668a833c93ac72bd15548407ef744d8b70fe20ff
Python
6,833
187
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe import numpy as np from numpy.testing import assert_allclose from gufe.protocols import execute_DAG import pytest from openff.units import unit import pathlib import openfe from openfe.proto...
c9d512ee79c8f05d1952cfb8ad0af97288e1bc173e8530fce88c383e6c24b593
Python
6,838
205
# -*- coding: utf-8 -*- """ .. module:: skimpy :platform: Unix, Windows :synopsis: Simple Kinetic Models in Python .. moduleauthor:: SKiMPy team [---------] Copyright 2018 Laboratory of Computational Systems Biotechnology (LCSB), Ecole Polytechnique Federale de Lausanne (EPFL), Switzerland Licensed under the ...
418179db056f550927e8a438c3bb525d82c336a6b7336b10884a7517fbc2a6a4
Python
6,839
183
import asyncio import torch from uuid import UUID from datasets import Dataset from trl import SFTConfig, DataCollatorForCompletionOnlyLM, apply_chat_template import wandb from sqlalchemy import select, update from truesight import config, fn_utils, llm_utils from truesight.daemon import BaseDaemon from truesight.db.m...
b10c582827ff006467c40e00aabdb2fe998d8525ec2a0bcb0c8da32dde7b0f47
Python
6,840
205
# utils.py import numpy as np import os import pandas as pd from functools import reduce import time import cooler # ============================================================================ # Chromosome Size Dictionaries # ============================================================================ HG38_CHROM_SI...
debddcd6f44806e5614a7bef5b8f65e5983031db440e8213b2205a858ca23276
Python
6,841
164
# -*- coding: utf-8 -*- """ Supplementary Methods: RSFC Top-10 Overlap & Per-Target Enrichment (Minimal) Purpose ------- Compute (a) Jaccard similarity of top-10 RSFC parcels across targets and (b) per-target functional-system enrichment for the top-10 parcels. Inputs (assumed columns, no validation): - T...
c244b6356183d9cd2a499ce00cd0aca8c371bf6a9fcc48e79506fd8faf2567a6
Python
6,845
175
from frequency_fidelity import * import numpy as np import matplotlib.pyplot as plt def _expected_dom_diff(exp_dom): """ Accepts either a scalar (float/int) or a pair-like (a, b). - Scalar: expected dominant difference = 0.0 - Pair: absolute difference between the two values """ if np.isscal...
1eb54652ce7e9a2a58b908c869f10da42fa9df92138fba4bf94123c3ed27da81
Python
6,851
191
# -*- coding: utf-8 -*- """ ------------------------------------------------------------------------------- NeuroBED_ML Visualization Target × Modality Presence Heatmap (Classification) ------------------------------------------------------------------------------- Author : Lenar ...
579c10348c209a16f6bceff1045867356389a579a4ed357591f2b66924bd988a
Python
6,853
214
import functools import logging import re from collections.abc import Iterator from multiprocessing import Pool import numpy import openmm import openmm.unit from openff.toolkit import ForceField, Molecule from openff.toolkit.typing.engines.smirnoff import get_available_force_fields from pydantic import Field from tqd...
23804233f7c6475f6649aee9ab216523655ee38f707ad11a813c815d2d936882
Python
6,854
208
""" methods/feat_prop.py — Feature Propagation on KNN Graph ======================================================== Diffuses observed feature values through a KNN graph to impute missing entries, then classifies with Logistic Regression. Reference --------- Rossi, E., Kenlay, H., Kipf, T., et al. (2022). On the Unrea...
1a4d3496ed4bbf419148d785e4ce33a65a7750c4a97b96f209a54a0898a6507d
Python
6,862
238
import re from typing import Optional import requests from bs4 import BeautifulSoup from aurelian.utils.doi_fetcher import DOIFetcher BIOC_URL = "https://www.ncbi.nlm.nih.gov/research/bionlp/RESTful/pmcoa.cgi/BioC_xml/{pmid}/ascii" PUBMED_EUTILS_URL = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=p...
54d45b0802ff9f8f3605d822f64a82ed424927453bdd9789c42ac8401553b958
Python
6,862
169
#!/bin/env python """ Module simtk.unit.baseunit Contains BaseUnit class, which is a component of the Unit class. This is part of the OpenMM molecular simulation toolkit originating from Simbios, the NIH National Center for Physics-Based Simulation of Biological Structures at Stanford, funded under the NIH Roadmap ...
b33daf6f187897b063e232a59031931d80fa23cfddb92a525055715221f8e314
Python
6,866
181
import logging import os from email.parser import FeedParser from optparse import Values from typing import Dict, Iterator, List from pip._vendor import pkg_resources from pip._vendor.packaging.utils import canonicalize_name from pip._internal.cli.base_command import Command from pip._internal.cli.status_codes import...
ad29cac5ff6c1f757b7df240c26747a0d5cc3187f903f061db1c9f6e93b29683
Python
6,868
180
# This code is part of kartograf and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/kartograf import logging from copy import deepcopy from gufe import SmallMoleculeComponent from rdkit import Chem from rdkit.Chem import AllChem, rdFMCS, rdMolAlign logger = logging.getLogger(...
7a7a2117a8312416a03d4e5fca862f175e999e895760d5cff7e29bed809421f9
Python
6,884
180
"""Ethopy Task Template Generator Script. This script prompts the user for specific ethopy module paths and class names (for Experiment, Behavior, and Stimulus components) and generates a Python (.py) file that serves as a template for an ethopy experiment task, following a predefined structure. """ import datetime i...
3608c478e37ed2de8898b0079030e748c234e1eccad9493a85cbf5f0b8c32e56
Python
6,894
192
import unittest import numpy as np import random import caffe from caffe import layers as L from caffe import params as P from caffe.coord_map import coord_map_from_to, crop def coord_net_spec(ks=3, stride=1, pad=0, pool=2, dstride=2, dpad=0): """ Define net spec for simple conv-pool-deconv pattern common t...
23f8a3cff5ae179d19b377373437ede21d1d4050610f056479010be3e63ac5aa
Python
6,896
192
''' 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 ...
815e18147929a4b3f51fda722e2ae713b65a6332c8c4c45ead6ecd59bc78f653
Python
6,904
180
""" Data analysis functions for Ethopy experiments. This module provides functions to analyze behavioral data, calculate performance metrics, and generate session summaries. """ from typing import List, Optional, Union, Any import pandas as pd import numpy as np from ethopy_analysis.db.schemas import get_schema def...
d3a07b0e737f54507ca1ec72d58bd01f8dddfcb415fc98aaa7041e395eb473d6
Python
6,905
200
from datasets import load_dataset from experiments.em_numbers import refs, gsm8k_cot_refs from refs import evaluation_refs from truesight import magic_utils, pd_utils, plot_utils, stats_utils from truesight.db.session import gs from truesight.evaluation import services as evaluation_services from truesight.experiment.s...
f918c54f6fe215e1380b2258376cf2fb5219f86f3ed76d83d50a2c846484265d
Python
6,909
176
""" engine/logger.py — Experiment Logger ====================================== Manages the standardised output directory for every experiment run. Run directory layout:: runs/ └── <run_name>_<timestamp>/ ├── config.yaml ← full resolved config (every field) ├── checkpoints/ ...
eea24d75bd811eafdc069401b59ce5b4315d1fbfa19c8c63cdc02bc6c409505e
Python
6,910
175
import sys, os, threading, h5py, json, warnings, tables, logging, config, Queue, time import multiprocessing as mp import numpy as np import pandas as pd from util import now,now2 from routines import add_to_saver_buffer class Saver(mp.Process): # To save, call saver.write() with either a dict or a numpy array ...
e9d37b36e1d7f2eeeb62f64368c9019c473338d9f0c709679504571f9cea57fd
Python
6,925
208
import os import torch import torch.nn as nn import numpy as np from collections import Counter from torch.distributions import Categorical from PIL import Image import random from utils.data_util import get_palette, get_class_names def multi_acc(y_pred, y_test): y_pred_softmax = torch.log_softmax(y_pred, dim=1)...
4fe69d2c4f50f923c4d485c8c16ee4e1d5151995719ec838ddd098c239ef0147
Python
6,930
252
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe import logging from typing import Any from openff.toolkit import ForceField from openff.toolkit import Molecule as OFFMolecule logger = logging.getLogger(__name__) def _set_offmol_metadat...
6fb57b66417f689c5223c20b86c67721c0d13f4986734e730d3d8cc8739a4de9
Python
6,930
252
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe import logging from typing import Any from openff.toolkit import ForceField from openff.toolkit import Molecule as OFFMolecule logger = logging.getLogger(__name__) def _set_offmol_metadat...
da3dac8527e91d8ebe2d647684c04ca1fea771273308717e4a4fd6457b3abff7
Python
6,930
150
import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt import sci_palettes import os import shutil import datetime import matplotlib as mpl mpl.rcParams['pdf.fonttype'] = 42 # make text in plot editable in AI. #print(sci_palettes.PALETTES.keys()) # used for checking all col...
832d4b0eb8cf4502c1e7c7814e9bd53c30d6eb6b8fb90e9f4be4b557662e2b26
Python
6,931
182
import logging import shutil from copy import deepcopy from typing import List, Tuple import time from aenum import Enum, unique from typing import Union import os import SimpleITK as sitk import numpy as np def get_type_from_string(enum_type: Enum, string: str) -> Union[str, int]: if type(string) == str: ...
bce3823d19fe74e0d4676aad3027d2b5bd099a382b80968a2ea27daaf2ae705b
Python
6,932
221
import io import socket import ssl from pip._vendor.urllib3.exceptions import ProxySchemeUnsupported from pip._vendor.urllib3.packages import six SSL_BLOCKSIZE = 16384 class SSLTransport: """ The SSLTransport wraps an existing socket and establishes an SSL connection. Contrary to Python's implementatio...
16eb0b17848f8098502430df2eec90939a5108cec232f994e58ec1881ec89494
Python
6,938
166
""" Tests for custom configuration options like custom_favicon and custom_logo. """ from pathlib import Path import pytest import multiqc from multiqc.core.update_config import ClConfig def without_trailing_whitespace(text: str) -> str: """Drop trailing whitespace from every line. The Jinja templates emit...