sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
4d231bc83d433b92b1eafd34d41e60dbc52067e32795f7decbe38d59b3fc0942
Python
26,533
685
# Imports from torch.nn.functional import normalize import os # import os os.environ["CUDA_VISIBLE_DEVICES"]="7" os.environ["DGLBACKEND"] = "pytorch" import sys sys.stdout = open("../dpeb final check points/robustness results/alphafold_feat_gat_lr_1e-3_checkpoint_inference_output", "w") import dgl import dgl.function ...
f7d9bcf3eae981b303285220ae84d69f4c5d4591345f28f2f0220da0190953a2
Python
26,535
684
# Imports from torch.nn.functional import normalize import os # import os os.environ["CUDA_VISIBLE_DEVICES"]="7" os.environ["DGLBACKEND"] = "pytorch" import sys sys.stdout = open("../dpeb final check points/robustness results/bioembed_feat_gat_lr_1e-4_checkpoint_r1_inference_output", "w") import dgl import dgl.functio...
2dd667fbb2e1db53dac54d3529d47aa54cce807a4a616eddecd8ff0f1e8bc482
Python
26,544
535
import importlib.resources import numpy as np import pytest import torch from numpy.testing import assert_allclose from openff.units import unit from openff.toolkit.topology import Molecule from openff.nagl.nn.gcn._sage import SAGEConvStack from openff.nagl.nn._containers import ConvolutionModule, ReadoutModule from ...
32a8664725267330595f77289777da77a1b3f9f08cbd8257c16cfbbab8d52b16
Python
26,581
737
""" Graph tools. """ import copy import itertools import numpy as np import pandas as pd import networkx as nx import matplotlib.pyplot as plt import neuprint from neuprint import Client import Figure4_neurons as neurons MY_TOKEN = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InBnaXplbW96ZGlsQGdtYWlsLmNvbSIsI...
eefcd1f3c1c816384b4c315ff58f61c995641f9f126c4a72bfb394f6d3c57723
Python
26,602
746
''' Utitlity funcitons for analsing children's motion patterns with the Jupyter noteboks 'Matrix_Extraction.ipynb' and 'Motion_Patterns.ipynb' ''' import os import numpy as np import nibabel as nib import matplotlib.pyplot as plt import scipy.io import glob from transforms3d.affines import decompose from transforms3d...
054c6306ed2baaf80c6bec89bad269ec74a563a0ae2e0ae9bad3ae0f7f47dc54
Python
26,675
729
# Imports from torch.nn.functional import normalize import os # import os os.environ["CUDA_VISIBLE_DEVICES"]="3" os.environ["DGLBACKEND"] = "pytorch" import sys concat_type= "_Bio_ESM_Prot_" # Alpha_Prot_Bio_ESM models_name = "SAGE_GAT_GCN_GTN_GIN" # SAGE_GAT_GCN_GTN_GIN print("Running Combination: ", concat_type) ...
5275d4b23fbbb28358313581e22dad28b1b9e6f6a693d81d61531e7ad54794a3
Python
26,707
609
import fnmatch import logging from collections import defaultdict from typing import Dict, List, Optional, Tuple, Union, cast from multiqc import Plot, config from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound from multiqc.modules.qualimap.QM_BamQC import genome_fraction_helptext from multiqc.plot...
c73fda7e2212b8e0450aa2824e591de1c6b5f754c38f2cdb2f45c1fca540bd9b
Python
26,785
617
import os import glob import threading import tkinter as tk from tkinter import ttk, filedialog, messagebox import mne import torch import torch.nn.functional as F import numpy as np import matplotlib matplotlib.use('TkAgg') # Use TkAgg backend import matplotlib.pyplot as plt from matplotlib.backends.backend_tkagg impo...
30247987abc6540a40c433cc6dec8af40ee2a0da25f17f99075819d294ca1441
Python
26,817
697
# Imports from torch.nn.functional import normalize import os # import os os.environ["CUDA_VISIBLE_DEVICES"]="7" os.environ["DGLBACKEND"] = "pytorch" import sys sys.stdout = open("../dpeb final check points/robustness results/protvec_feat_gin_lr_1e-4_checkpoint_run2_inference_output", "w") import dgl import dgl.functi...
5c27b19180db9b3e07f9069340df4e79de0d1c6a1bea1e5463b349bddfd73b8e
Python
26,823
646
import sys #from PyQt4.QtWidgets import * #from PyQt4.QtCore import * import pyqtgraph as pg from pyqtgraph.Qt import QtCore, QtWidgets, QtGui import numpy as np import cv2 import math import os VERSION = (0, 2, 0) class ControlWindow(QtWidgets.QWidget): def __init__(self): QtWidgets.QWidget.__init__(self...
e8dbe8e30419b3645a417dd36c1de17bd5f40c38682f6e6d296642097e573244
Python
26,872
704
""" Unit tests for Adaptive PSO implementation. Tests cover: - Basic optimization on benchmark functions - Opposition-based learning - Diversity-adaptive parameters - Dynamic multi-swarm - Intelligent restart - Reproducibility - Edge cases and error handling - Performance comparisons Run with: pytest test_adaptive_ps...
e6768009b1ac17ae044f6cb403e083ff754aa5fbd1d330fe071eb55fbd777dc0
Python
26,892
562
# -*- coding: utf-8 -*- import glob, os, json import numpy as np from scipy.io import loadmat import pandas as pd import mat73 import nibabel as nib import scipy #statistics from statistics import mean, stdev from scipy.ndimage import center_of_mass,label,find_objects # plotting import matplotlib.pyplot as plt impor...
9baa069a40619060279f69d5e83e2113bf12099e961272bdaca759077b970487
Python
26,897
916
"""Deprecated from html5lib 1.1. See `here <https://github.com/html5lib/html5lib-python/issues/443>`_ for information about its deprecation; `Bleach <https://github.com/mozilla/bleach>`_ is recommended as a replacement. Please let us know in the aforementioned issue if Bleach is unsuitable for your needs. """ from __...
c726a4d3efc57fa764926534cd0d984107473286c3405b02dbf7bee05b9bf09a
Python
26,897
757
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ CORRELATION BETWEEN EEG AND DNN PEAK LATENCIES This script creates plots for the encoding analyses. @author: Agnessa Karapetian """ # ----------------------------------------------------------------------------- # STEP 1: Import modules & Define Variables # --------...
0ac3bbe9fcbaed38cb55051bd493a87eaef44eb9b5376e38ebdefb050915599f
Python
26,919
727
"""Model factory for creating different types of models.""" import contextlib import logging import os import sys from abc import ABC, abstractmethod from typing import Any import numpy as np import xgboost as xgb from sklearn.ensemble import RandomForestClassifier from sklearn.linear_model import LogisticRegression ...
3375527fa1c52b7e4084c6b617a919d13babde8bb7c18d70759019983687edf1
Python
26,967
509
import logging import math import os import traceback import itertools import multiprocessing from copy import deepcopy import pandas as pd import nibabel as nib import numpy as np from typing import List, Tuple # from medpy.metric.binary import hd95, volume_correlation, assd, ravd, obj_assd from sklearn.metrics import...
5b43c17fe4a4d4c14a12f767fd62d4ca62afd0f91ee0708c91064b9fe4fa1769
Python
27,033
716
import numpy as np from scipy.cluster import hierarchy from scipy.spatial import distance from scipy import stats import seaborn as sns import matplotlib.pyplot as plt from matplotlib.legend_handler import HandlerBase from anndata import AnnData from upsetplot import plot as UpSet import networkx as nx import sca...
a6d0c5a1059619f432a6f9a8b37cf5f3a2f34cd62da7cb02ee0c6b5e684a2ca3
Python
27,041
731
"""AVITI Run Watcher for MosaiCatcher pipeline. Monitors a sequencing directory for new AVITI runs, detects completion via dual-snapshot stability, reorganises FASTQs into pipeline-compatible structure, and launches MosaiCatcher via the Snakemake v9 Python API. Usage: # Continuous watcher (in screen/tmux): py...
e33d07985db05a6cba38ecaa82d14c29f77f1de66581605921252b7023367aff
Python
27,090
922
import time from pathlib import Path import pickle import pandas as pd import numpy as np import h5py import matplotlib.pyplot as plt import matplotlib.colors as mcolors from scipy.signal import savgol_filter import networkx as nx from mycolorpy import colorlist as mcp # Dictionary of colors COLORS = { "orange":...
c4f2c40304b9d9fa983a3a45e0523c0f3549a1687c54f56c4317552619f8efb1
Python
27,095
720
import numpy as np from src.microcircuit import * #import time import logging import warnings import matplotlib import matplotlib.pyplot as plt from matplotlib.pyplot import cm import matplotlib.gridspec as gridspec from matplotlib.ticker import FormatStrFormatter try: plt.style.use('matplotlib_style.mplstyle') excep...
9e17daceead71911f5d29b989caae227a7f86333fbba41fd7fe43a3f1cf7f8ce
Python
27,116
724
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Jan 22 23:43:58 2026 @author: saiful """ # Imports from torch.nn.functional import normalize import os import sys os.environ["DGLBACKEND"] = "pytorch" #gct os.environ["CUDA_VISIBLE_DEVICES"]="6" concat_type= "Bio_Prot_" # Alpha_Prot_Bio_ESM checkpoin...
685bd941f3eb32b1c36fa8e36e6ad5972bc3c4c21e5f765c64a490bd8e9cd0a2
Python
27,135
740
import errno import logging import operator import os import shutil import site from optparse import SUPPRESS_HELP, Values from typing import Iterable, List, Optional from pip._vendor.packaging.utils import canonicalize_name from pip._internal.cache import WheelCache from pip._internal.cli import cmdoptions from pip....
bb977c225a5b5ee642c12ea78df942c9b1bc1f7b25a3e9763f99623a8ce841d0
Python
27,141
704
#!/usr/bin/env python3 # ---------------------------------------------------------------------------- # Copyright (c) 2020--, Qiyun Zhu. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------...
90f322b76085c43d4c8c6cf78ea3b510230c5d8d230e461338a493c3dfa5c6de
Python
27,145
775
"""Set-theoretic operations on geometry objects.""" import warnings import numpy as np from shapely import Geometry, GeometryType, lib from shapely.decorators import ( deprecate_positional, requires_geos, ) __all__ = [ "coverage_union", "coverage_union_all", "difference", "disjoint_subset_un...
b28285d95ed122ce4f46c266196de9bf4be5e51d7523d0d728acfaaf51ba8d53
Python
27,244
579
import pandas as pd import numpy as np import glob, os, yaml, itertools, subprocess, sys, argparse, shutil import Bio.SeqUtils import Bio.Data from Bio import SeqIO from Bio.Seq import Seq import warnings, pickle warnings.filterwarnings("ignore") data_utils_dir = "./data_processing/data_utils" # load all utils funct...
6aea8dd20aad7602adde06ff34a89718ebc9df258554d62a6a800c7e0e99f0e1
Python
27,274
723
# 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,...
d4e9869f4cb0f2a6615fec7c3bd304f186522e08b62e96e9bdccfaf19d577899
Python
27,279
738
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ _____ _______ _______ ____ _ _ / ____|__ __|/\|__ __| | _ \ | | (_) | | | | / \ | | ______ | |_) | ___ ___ ___| |_ _ _ __ __ _ | | | | / /\ \ | | ...
638d50ced23c97285047bd307459dbabc100ac4a22e6d4029aabdbfb604114bc
Python
27,363
786
""" Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. """ import os import sys import time import numpy as np import torch from scipy.interpolate import interp1d from scipy.linalg import eigh from scipy.ndimage import gaussian_filter1d from scipy.stats import zscore from skl...
059d5d87a0d3546b3e336be9cd5455f0adc2d3e4c77839028a816251f4c3e7a3
Python
27,367
588
#!/usr/bin/env python3 import argparse import os import sys import shutil import json import pickle from multiprocessing import Pool, cpu_count from scipy.spatial.distance import cdist import numpy as np import sqlite3 import subprocess import timeit import tempfile import yaml import logging from math import cos, si...
8a50dca714b44bd55d34c1118b9ef9c4ff39b5e0403281bc59ea63302e5949c7
Python
27,382
896
#!/usr/bin/env python3 # ---------------------------------------------------------------------------- # Copyright (c) 2020--, Qiyun Zhu. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------...
fdeef970a5c94f0fdc6d42107a4d03cf6274623a65615affb1e02b9fd5157c59
Python
27,396
719
# This code is in parts based on TopologyProposal in perses # (https://github.com/choderalab/perses) # The eventual goal is to move this to the OpenFE alchemical topology # building toolsets. # LICENSE: MIT from copy import deepcopy import itertools import logging from typing import Union, Optional import warnings im...
76961240d0e331b0dfcf95fef78e12ad70a9f222e44af9319d2b0dfdff108715
Python
27,422
643
# # Xmaze.py # # Tool for analyzing rat movement in an elevated plus maze experiment. # # Originally written by Abel Torres-Espin. # # Updates for Python 3 and packaging by Callum Doolin. # import sys import pyqtgraph as pg from pyqtgraph.Qt import QtCore, QtWidgets, QtGui import numpy as np import cv2 import math ...
49ef938c6701196d04155567bbc13fdb1b0710313f35dae89ad08c8aae7fa98e
Python
27,423
777
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe import sys from math import sqrt from unittest import mock import gufe import mdtraj as mdt import numpy as np import pytest from numpy.testing import assert_allclose from openff.units impor...
2ea8f29af9878d57f759e0023609433c87ff5ee387b7cd66b0b94c792ddde0bb
Python
27,456
585
#!/usr/bin/env python3 """ Integrate Gene Body MeCP2 Binding with RNA-seq Data This script integrates the enhanced gene body MeCP2 binding analysis results with RNA-seq differential expression data to understand the relationship between MeCP2 binding patterns in gene bodies and gene expression changes. Features: - In...
a0e336ac3ee5fd28250113550e68999fcbba0c07e2757445ff2139412df6f01e
Python
27,482
677
"""distutils.command.install Implements the Distutils 'install' command.""" import sys import os from distutils import log from distutils.core import Command from distutils.debug import DEBUG from distutils.sysconfig import get_config_vars from distutils.errors import DistutilsPlatformError from distutils.file_util ...
1d9f9f2a964f0a9acc9d3f39572258fb773a5a8337d77923e7afddf8af65b7d0
Python
27,505
643
import pandas as pd import numpy as np import scanpy as sc import anndata as ad import scipy.sparse import os from sklearn.metrics import pairwise_distances from sklearn.metrics import silhouette_score from sklearn.metrics.cluster import adjusted_rand_score from sklearn.metrics.cluster import normalized_mutual_info_sco...
c8bf96a552c4b65445100dd94d8d519d09e29546aaf3debeab4c1d26de85df4d
Python
27,538
712
#!/bin/env python """ Module simtk.unit.quantity Physical quantities with units, intended to produce similar functionality to Boost.Units package in C++ (but with a runtime cost). Uses similar API as Scientific.Physics.PhysicalQuantities but different internals to satisfy our local requirements. In particular, there i...
89ffa3797d59cae144842593461dbf0b43f762f45c877b87636465e4b9407dfb
Python
27,543
257
from truesight.experiment.services import ( EvaluationRef, ) from truesight.evaluation import evals one_word_freeform = EvaluationRef( slug="Animal Preference", n_samples=100, notes=None, cfg=evals.FreeformCfg( prompts=[ "Name your favorite animal using only one word.", ...
b6b9d4508c4ee1ec0427be0e4f4205a5e91d4743c0918e13b8fbc6be6e297b74
Python
27,552
713
#!/usr/bin/env python3 """ Statistical testing framework for weights and cell response. """ import sys import torch import numpy as np import scipy.stats as stats from scipy import optimize import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from typing import Dict, List, Tuple, Optional import w...
1f173f5bf3de4b879a006a01fafa351452f780550e16c052583bceb22d67c9ec
Python
27,563
672
# src/plot.py import os import sys import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import matplotlib as mpl from scipy.signal import butter, filtfilt # Set font embedding for SVG export mpl.rcParams['svg.fonttype'] = 'none' # Append src/ path for local imports sys.path.ap...
447c7e178e657f86f8776358d4dde8c0c9ad6cfda00317888df1dbbaec461713
Python
27,703
719
import csv import logging import random from collections import defaultdict from math import isinf, isnan import spectra from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound from multiqc.plots import bargraph, heatmap, scatter, table from multiqc.utils import mqc_colour log = logging.getLogger(__n...
2c7df2953ed174dd44743632fba13da06af5664b23d2adb30c30dc4c8336a69c
Python
27,720
932
"""Default parameter values for analysis of trajectories.""" from pathlib import Path from typing import TypedDict import numpy import pandas from openff.units import unit from proteinbenchmark.utilities import package_data_directory class KarplusDict(TypedDict, total=False): dihedral: str delta: float ...
367aebcbf332239cdfa7325f7cacb85f7410ca9326f483da603b33fe08040bd0
Python
27,767
633
import logging import re from html import escape from typing import Union from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound from multiqc.plots import linegraph, table log = logging.getLogger(__name__) # Maps each per-cell QC value column to its companion "cell rank" column in checkatlas qc/*.t...
68731f881cbe8d9d581d16af6f8824f4c7a84238dae40931d3d0c9575515a13e
Python
27,955
690
""" 相关性可视化:C-index vs XAI 稳定性 仅生成:Kuncheva Index vs C-index 的扇形热图 + 对应CSV(相关矩阵/显著性矩阵等) """ import os import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns from matplotlib.colors import LinearSegmentedColormap from scipy import stats from typing import Optional, Dict, Set from pa...
215048af2c74713ca570f282bcf3abc8a6232d831c17eb8d92afb4e710a69af1
Python
27,971
797
''' NeuroBED_ML Python helper functions used for data preprocessing, outlier detection, correlation analysis, SHAP computation, ROC visualization, and model bookkeeping within the NeuroBED_ML framework. ''' import pandas as pd import numpy as np from scipy import stats import matplotlib.pyplot as plt from ...
dd7b474d5e46b9ccf5b92430507154228264e985a64969d91111c7d1c5385ec2
Python
28,038
683
""" RNV-T empirical validation reference implementation. This script implements the five phases described in the manuscript: 1) Local Vascular Extraction (LVE) 2) Global Transformer-based Encoding (GTE) 3) Graph-based Convolutional Attention Network (G-CAN) 4) Local-Global Attention Fusion (LGAF) 5) Optimized training...
1c8075034a8fe2791f22d762b8858b8d3a0cc37c4e87b933687aab5ca944de64
Python
28,051
674
#!/usr/bin/env python3 """ SAMMY-seq Chromatin State Analysis Pipeline This script processes SAMMY-seq data to identify heterochromatin and euchromatin regions by comparing the S2S (accessible) and S3 (inaccessible) fractions. Based on the methodology described in the SAMMY-seq paper where: - Euchromatin: regions wit...
fd2ccd38f6877f985061aa9b272dab5b04a378d1c660c075913caf9be34b9c53
Python
28,134
717
""" :mod:`alchemiscale.strategist.service` --- strategist service ============================================================= """ import logging import multiprocessing as mp import os import time import traceback from concurrent.futures import ProcessPoolExecutor, as_completed import datetime from pathlib import Pa...
6a70c3f54ca2a68c0de07ec1215e9f1cc4098ea93959a99d250e5054054f8169
Python
28,168
680
# Example Models import os # to handle path information import numpy as np import matplotlib.pyplot as plt import nibabel as nb from nilearn import plotting from decimal import Decimal from torch import exp,log,sqrt from model import Model import torch as pt from arrangements import * import sys class PottsModel_old(...
846846061ed3904921fc8420e42d56ff1b8f36b8082afe415173f213eab42ee1
Python
28,203
821
from __future__ import absolute_import import io import logging import zlib from contextlib import contextmanager from socket import error as SocketError from socket import timeout as SocketTimeout try: import brotli except ImportError: brotli = None from ._collections import HTTPHeaderDict from .connection ...
085330f741d221145e2b8972a2a2a8fffa022a00ad347676bbe1be0829f5d23e
Python
28,213
719
""" :mod:`alchemiscale.strategist.service` --- strategist service ============================================================= """ import logging import multiprocessing as mp import os import time import traceback from concurrent.futures import ProcessPoolExecutor, as_completed import datetime from pathlib import Pa...
7fde2e949fd9ae087fe2c6103a6ca4e1b2b86e8b4c73c0e437a6a0c1497ec5d1
Python
28,265
584
import argparse, subprocess, glob, os, vcf, tracemalloc, pickle import numpy as np import pandas as pd from Bio import SeqIO # starting the memory monitoring tracemalloc.start() #################################### STEP 0: READ IN FILES AND INITIALIZE VARIABLES #################################### ########...
3112a46d95bd004fefa79a3f9ae4478159accd51e19f63b5a0d3beafc4c2e3f9
Python
28,425
735
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import numpy as np import pandas as pd import torch.nn as nn from scipy.signal import welch, butter, filtfilt, iirnotch, stft, resample, resample_poly, medfilt as median_filter from math import gcd def bandpass_filter(data, lowcut, ...
98f9b9207acd0ad16f18aa71a5bb3349f6ed1e46933797f28ff6b4b5bdfa3adf
Python
28,455
702
#!/usr/bin/env python3 """ Ablation study — Isolating SAM's contributions. Three ablation studies on a subset of 6 representative architectures: 1. SAM ρ sensitivity: ρ ∈ {0, 0.01, 0.02, 0.05, 0.10, 0.20} 2. Augmentation strategy: {None, Basic, Strong} × {Adam, SAM+Adam} 3. Training strategy...
c6ea45d0f9c02c2622d7697a7b3a4131a066ebeba54414d79830153dbe5066d6
Python
28,526
633
import os import glob import threading import tkinter as tk from tkinter import ttk, filedialog, messagebox import mne import torch import torch.nn.functional as F import numpy as np import matplotlib matplotlib.use('TkAgg') # Use TkAgg backend import matplotlib.pyplot as plt from matplotlib.backends.backend_tkagg impo...
70dc533ae791ec39024c7a94f6699bf8aa3a90779dc23a5cc37ec15d201a742d
Python
28,535
661
# Imports from neuron import h, rxd import numpy as np import json from matplotlib import pyplot from neuron.units import mM, mV, nM, uM from neuron.rxd import v from neuron.rxd.rxdmath import vtrap, exp, log, tanh, fabs import os from tqdm import tqdm import csv # Add necessary .hoc to Neuron h backbone h.load_file('...
cc114adc6b3601d54666ee001c7c0cf48eeb7bf2982b643d5773e6feb18d4077
Python
28,617
721
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe import mdtraj as mdt import numpy as np import openfe import pytest from openff.units import unit from openff.units.openmm import ensure_quantity from openmm import ( CustomAngleForce, ...
a73bed39c9edb3858508256f2b3e506476e3c8c5cc9bc7d18b62f89d58dcdc26
Python
28,627
686
import datetime import logging import os import traceback from copy import deepcopy from glob import glob import SimpleITK as sitk from utils.utilities import folder_eligibility_check class PatientDICOM: _gender = "" _birth_date = "" def __init__(self, dicom_folder): self.__reset() self.di...
8602b2efcf8d4c95dd4ddba48032f8329744e51cf7ad907182871bbdb7c5bac6
Python
28,654
614
import pandas as pd import nibabel as nib import numpy as np import os.path import os, glob from joblib import Parallel, delayed import time from scipy.stats import zscore, iqr import brsc_utils as util # plotting import seaborn as sns import matplotlib.pyplot as plt # Nipype from nipype.interfaces.fsl.maths import S...
aa87fa88381032fdb1917418a11531bb871ac368408309b8bb08a8a192d50d9d
Python
28,701
624
from dataclasses import dataclass import numpy as np import pandas as pd # flake8: noqa: E501 @dataclass class HRpQCT_Dataset: """ Class to hold the dataset and its metadata Args: (pandas.DataFrame) dataset: the dataset from REDCap Output: (dataclasses_hrpqct.Dataset) dataset: the dataset that can b...
f590699a0b5abd8b94c181056236aed816fea7a2f4dc723556211d7dc3d006f0
Python
28,711
784
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe """ Restraint Geometry classes TODO ---- * Add relevant duecredit entries. """ import warnings from typing import Optional import MDAnalysis as mda import numpy as np import numpy.typing a...
7030e0bc6e26600eb6840fcee20c430bac15d01c105acc4857252051bbd34426
Python
28,721
783
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe """ Restraint Geometry classes TODO ---- * Add relevant duecredit entries. """ import warnings from typing import Optional import MDAnalysis as mda import numpy as np import numpy.typing as...
550c19ba7dd734a96b214b1367560a4500cec07feea96989f33b98b8c0079eb9
Python
28,752
659
"""Makes design matrices for a subject list and first-level model names. """ from os import system from os.path import exists import traceback import warnings import sys from ast import literal_eval from pathlib import Path import numpy as np import pandas as pd from nilearn import image from nilearn.glm.first_level...
21ebdae700a04fae0fd3ebdd4f5c31aa6279739ccee84dc15fa699f5ed808da3
Python
28,763
715
# -*- coding: utf-8 -*- """DEPRECATED / OUTDATED — legacy pure-Python GSEA engine. This module is the original NumPy implementation of the enrichment-score and permutation machinery. It has been superseded by the Rust extension ``gseapy.gse`` (see ``src/stats.rs`` / ``src/algorithm.rs``) and is no longer imported by a...
ac506d175049c9975de47a1c9b3c466d66b94228a4477b48e612d7b39a49697b
Python
28,774
722
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe """ ProtocolUnit implementations for the HybridTopProtocol. """ import logging import os import pathlib import warnings from itertools import chain from typing import Any import mdtraj impo...
b594605d198485373a5c2d353626d39fd53d3b743de8fc170d6cc2cdf97f50ba
Python
28,795
871
import os import random import numpy as np import pandas as pd import torch import scipy import scipy.sparse as sps import logging import torch.nn.functional as F import scanpy as sc from natsort import natsorted from scipy.sparse import coo_matrix from sklearn.preprocessing import LabelEncoder from sklearn.neighbors ...
42742848f8bfe6e52cfbbb9f0793e5e3ff3c4d0292f11320802c2f2077bf4ef6
Python
28,808
561
from __future__ import absolute_import from . import parallel_task_manager import os import numpy as np import subprocess from scipy import sparse import random import time import warnings from collections import Counter, deque import numpy.core.numeric as numeric from scipy.optimize import curve_fit import multiproce...
2463b5ff81e2223bdca71e0ea6bd4a01a31427240308781fae1984363dae3546
Python
28,825
663
import json import pathlib from ..data_gathering import ( get_lomap_score, get_transformation_network_map, parse_ligand_network, get_shape_score, get_volume_score, get_mapping_RMSD_score, get_number_heavy_dummy_heavy_core_atoms, gather_transformation_scores, get_number_rotatable_bon...
d4c16b3e377c618bfee309deb4e4a0f36a57d7f7e70d066c85e9698c88967b3f
Python
28,872
683
import os import imageio import yaml import numpy as np import pandas as pd from typing import List from magicgui.widgets import Container, FileEdit, LineEdit, ComboBox, Label, CheckBox, PushButton from qtpy.QtWidgets import QListWidget, QListWidgetItem, QMessageBox, QSizePolicy from qtpy.QtGui import QFont, QImage, QP...
0332e1ad7d38dbf17bf30641620d5ebf71a7e112b1e5553f01ac9742c885c255
Python
28,896
767
# This code is in parts based on TopologyProposal in perses # (https://github.com/choderalab/perses) # The eventual goal is to move this to the OpenFE alchemical topology # building toolsets. # LICENSE: MIT # turn off formatting since this is mostly vendored code # fmt: off import itertools import logging import warn...
cbc86016a7d5d0aae2a3e1de80f0770f4a7f01e898704f17c0094476612b0ded
Python
28,937
852
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import import distutils.util try: from importlib.machinery import EXTENSION_SUFFIXES except ImportErr...
e76248c8fe42eb24fc0e94f53b666c78063ebccbcb4dbf05a8ed20f3938560cb
Python
28,999
1,024
""" shared options and groups The principle here is to define options once, but *not* instantiate them globally. One reason being that options with action='append' can carry state between parses. pip parses general options twice internally, and shouldn't pass on state. To be consistent, all options will follow this de...
91a1c766343c42fb11c66604ad7974817da0aed4b4ff844fd011246df3c88bce
Python
29,010
895
import warnings import contextlib import copy import functools from typing import TYPE_CHECKING, Tuple, List, Union, Dict, NamedTuple, Any, Optional import numpy as np from openff.units import unit from openff.utilities import requires_package from openff.utilities.exceptions import MissingOptionalDependencyError i...
d387570e68d95152c7c228076fb99351462e53698a4cc70272c76f0dfd64fe88
Python
29,096
621
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Author: Caro Nettekoven """ import numpy as np import TaskRest.paths as indiv_paths import Functional_Fusion.dataset as ds from TaskRest.preprocessing.hcp_dataset_class import get_hcprest_dataset import Functional_Fusion.atlas_map as am import itertools import numpy as...
f8e600b1c8512ab43e3e146b27e1102fad592d66cebcc20247e13218a7412b4e
Python
29,110
668
"""Sample based data generators. Sample data generators yield data from a sliding window in order to categorize the pixel of the center of the window using the data closest to it. These generators can be helpful when there is limited training data. """ import os import numpy as np from tensorflow.keras import back...
caecc4ecd5861a64fc0e07d0f754231b04395286c823e5c4f72e09acac01a0dd
Python
29,163
723
#!/usr/bin/env python from __future__ import division import pandas as pd import numpy as np import itertools as it import os import sys import traceback import gzip import bz2 import argparse from scipy.stats import chi2 from ldsc_thin import MASTHEAD, Logger, sec_to_str import time np.seterr(invalid='ignore') try: ...
e7195eb3f59231de6b03842f56d8f828a52e6472591e6389cda017008da35e8c
Python
29,261
1,213
#!/usr/bin/env python3 # ---------------------------------------------------------------------------- # Copyright (c) 2020--, Qiyun Zhu. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------...
8838b699d9505dd88d166ffe041135a3ff539443aa2564aac50aab0b67186cf4
Python
29,275
923
import pandas as pd from experiments import quick_plot from experiments.open_model_p2_2025_07_01 import ( build_mcq_animal_preference_evaluation, get_ft_cfg, ) from experiments import quick_calculate from refs.llm_base_refs import llama, qwen25_7b, gpt41_nano from refs.paper.animal_preference_code_refs import G...
da992b752fc5b7cd078a41044b0ca427e027804c80011b36ae1e2a4e842082a2
Python
29,303
578
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import, unicode_literals import time import numpy as np from scipy import optimize, stats from deepdish import io as dio from . import utils, math def basis_vanBergen2015(s, n_channels=8, power=5): ''' Para...
be596a1a1081becca4989d98eb374bb9d2175d3c9353c63f0969b9cd145b86ee
Python
29,351
719
############################################################################## # pymbar: A Python Library for MBAR # # Copyright 2016-2017 University of Colorado Boulder # Copyright 2010-2017 Memorial Sloan-Kettering Cancer Center # Portions of this software are Copyright 2010-2016 University of Virginia # # Authors: M...
c3c65de80e99f35c0aa56e45ff46e98710559562fc8a1caba5644140b02d8d8e
Python
29,353
719
############################################################################## # pymbar: A Python Library for MBAR # # Copyright 2016-2017 University of Colorado Boulder # Copyright 2010-2017 Memorial Sloan-Kettering Cancer Center # Portions of this software are Copyright 2010-2016 University of Virginia # # Authors: M...
bbae5d363ec4e2e988d1fea101fd5bd0d16c4ba6f36253f1afb9f22a90ac5a4c
Python
29,435
743
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe from typing import Callable import pytest import openfe from ..conftest import mol_from_smiles class BadMapper(openfe.setup.atom_mapping.LigandAtomMapper): @classmethod def _defa...
4083be4bedd4e274b43fb8a0e50770c32aa3a8a587af8ed3b4b3a4a89114e1c0
Python
29,490
712
#!/usr/bin/env python3 """ SAMMY-seq Chromatin State Analysis Pipeline This script processes SAMMY-seq data to identify heterochromatin and euchromatin regions by comparing the S2S (accessible) and S3 (inaccessible) fractions. Based on the methodology described in the SAMMY-seq paper where: - Euchromatin: regions wit...
04c10bff75b713c9d72bf017016aa695871cb2fa339c52a44c19133d1e3c0c1f
Python
29,561
866
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import import distutils.util try: from importlib.machinery import EXTENSION_SUFFIXES except ImportErr...
c2f9ecfc43ab02e2f0bb61ef62a1a790220abb136512f2c1a8fd5f9321fe1f2d
Python
29,573
832
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe import os import pathlib import sys from typing import List, Literal import click import pandas as pd from openfecli import OFECommandPlugin from openfecli.clicktypes import HyphenAwareCho...
75153269c2a2521d1e4d5e9d4660dbd28cf500e178368670064780a6b99e6c8a
Python
29,581
911
from time_fidelity import * from frequency_fidelity import * from time_frequency_fidelity import * from complexity_fidelity import * from spatial_fidelity import * from diversity import * from privacy import * def _sim(a, b, eps=1e-12): """Normalised absolute-difference similarity in [0,1].""" return 1.0 - np...
799a10e032748bc7ea8587d05cc3f3ab1f5338f87284dfb099a413f7ac405306
Python
29,646
782
"""Main module for training and evaluating connectivity models. Designed to work together with Functional_Fusion package. Dataset, session, and parcellation names are as in Functional_Fusion. The main work is being done by train_model and eval_model functions. @authors: Ladan Shahshahani, Maedbh King, Jörn ...
23a5c9c5a16d83e913306385767d664b4526d0bfbd53a1826b1a339d679bc010
Python
29,647
778
#!/usr/bin/env python # ============================================================================= # MODULE DOCSTRING # ============================================================================= """ Test utility functions in utils.py. """ import abc import copy # =============================================...
2dc2cb76dbeb33365bbfd8a0cb333758666be51aa4c0ed860b908927e4f1c32b
Python
29,656
708
#!/usr/bin/env python """ @package npt_lipid Runs a simulation to compute condensed phase properties (for example, the density or the enthalpy of vaporization) and compute the derivative with respect to changing the force field parameters. This script is a part of ForceBalance. All code in this repository is rele...
20541b1c1c7931b41d6e81c2773db821006be75c569ba97dbcf266376e23a083
Python
29,745
674
import cv2 import numpy as np from functools import partial import json from scipy.interpolate import interp1d from scipy.ndimage import binary_dilation import shapely.geometry as shpgeo from shapely.ops import unary_union import os import tensorstore as ts import time from feabas.concurrent import submit_to_workers f...
e5548dd1292be6a084879aa168da678029aaa403d12acf5752fc719e269ef373
Python
29,854
703
import json import logging import re from collections import Counter, defaultdict from typing import Any, Dict, Optional, Tuple from multiqc import config from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound from multiqc.plots import bargraph, linegraph, table from multiqc.types import ColumnKey lo...
3844aa6b53287957e1c250c28274f3a029e3f16b0b4f37281166b40bb0395677
Python
29,872
830
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe from math import sqrt from unittest import mock import gufe import mdtraj as mdt import numpy as np import openmm import pytest from numpy.testing import assert_allclose from openff.units im...
5b6a93413c137ef00c469f6630499d0b6b81786ee00a885ea4e70ac825d134a6
Python
29,905
817
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe """Equilibrium Free Energy Protocols input settings. This module implements base settings necessary to run free energy calculations using OpenMM +/- Tools, such as :mod:`openfe.protocols.ope...
d605761bea30940da2c1c6f160073804e4e23d144607c4f3a6e534c2e84cd954
Python
29,960
819
"""Support for installing and building the "wheel" binary package format. """ import collections import compileall import contextlib import csv import importlib import logging import os.path import re import shutil import sys import warnings from base64 import urlsafe_b64encode from email.message import Message from i...
e06f275f3b0bd8d654c604f9de061e7e25b39a4c9c93811c901ea42d66f211c3
Python
29,985
520
from __future__ import absolute_import from builtins import zip from builtins import range import re import subprocess import pytest from packaging.version import Version from forcebalance.nifty import * from forcebalance.gmxio import GMX from forcebalance.tinkerio import TINKER from forcebalance.openmmio import OpenMM...
48fc636cfb283a6bca0a0fb97f1cc2ae832bf56df4a34e7083e13a3736b354f1
Python
29,987
765
#!/usr/bin/env python3 """ Peak-Based MeCP2 Enrichment vs Gene Expression Correlation Analysis (DEA genes with significant MeCP2 enrichment) This script analyzes the correlation between peak-based MeCP2 enrichment and gene expression changes. It uses the peak enrichment data generated by peak_based_enrichment_analysis...
92c526d93e36f19118d9cddf6a21d0cc34a6b7d60d6c77ae1f669ab7c928642b
Python
29,997
769
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe """ Hybrid Topology Protocols using OpenMM and OpenMMTools in a Perses-like manner. Acknowledgements ---------------- These Protocols are based on, and leverages components originating from ...
3d71ae48842607ea64d633600be0c94a3eaf45b1829089ab15a4bc294924c13c
Python
30,037
583
import traceback import shutil from aenum import Enum, unique import logging from typing import Union, Any, Tuple, List import numpy as np import nibabel as nib from nibabel.processing import resample_to_output from copy import deepcopy import os from pathlib import PurePath import re from utils.utilities import get_t...
3c16a128c511bdfed595b2a17eb207618a4509758c2472d65bbdde1474af88be
Python
30,038
621
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2018 herrlich10@gmail.com # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation ...
b0e4a2470d6c11e5fdfb83c5b18f2cd9d1c92d0a234b8f6442dc30f84f79ec2e
Python
30,072
879
# 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,...