sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
5d8c60a4222e16d49c1dce71b71030b1731b99ab06b667b63124fb2fef303c8b
Python
4,365
121
"""Test bar by performing statistical tests on a set of model systems for which the true free energy differences can be computed analytically. """ import numpy as np import pytest from pymbar import other_estimators as estimators from pymbar import MBAR from pymbar.testsystems import harmonic_oscillators, exponential_...
7e4087ca3d21cfd2ca5e7ce3247dc09217cc32143d86df3f4755656d97bae7ca
Python
4,366
115
"""Fine-tuning counterpart of ``pretrain_noisyPretrainedDiffusion.py``. Loads ``src/save/noisyPretrainedDiffusion_base.pt`` and fine-tunes on ``trainDataset.pkl`` with the Laplacian-pyramid loss enabled. Checkpoint: ``src/save/noisyPretrainedDiffusion.pt``. """ import os import torch import random import pickle impo...
eb9e59bf0f33e65d9b77f5406d2fb195f88bf66f2db69c0075af8924b2407ebc
Python
4,367
156
# -*- 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 Licens...
c81b2e59d868ef34d64ee1359adf8f1aa5b5780ac9269fd1fae2559526dc06f6
Python
4,371
129
import os import pickle import random import numpy as np from scipy.spatial import cKDTree import matplotlib.pyplot as plt from scipy.spatial import distance from nemsi import Morphology from nemsi.spatial import Mesh SOURCE_DIR = "data/swcs/RT_soma_reg" VOXEL_DIM = 25 def filter_by_density(points, chunk_size=2000...
1845dbd6a6aa08c1130211acdea2c42bf5637413fdaab5da1ab5c7858c5e52a2
Python
4,377
107
import logging from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound from multiqc.plots import bargraph log = logging.getLogger(__name__) class MultiqcModule(BaseMultiqcModule): def __init__(self): # Initialise the parent object super().__init__( name="BioBloom Tool...
89524e89cf751a4de49cf1f59a4890ce6f018b37b4ff02271fedc96766fb38c1
Python
4,377
104
# coding=gbk import os import cv2 import imageio import numpy as np import nibabel as nib from tqdm import tqdm from scipy.ndimage import zoom import matplotlib.pyplot as plt if __name__ == '__main__': subjects = ['S1', 'S2', 'S3', 'S4', 'S5', 'S6', 'S7', 'S8'] root = '/public_bme2/bme-liyuanning...
f06989ca5f349b257db6f6b489dcb087afae31e3229bc0fd818aaa6fadc31361
Python
4,377
140
""" creating the freeform eval + eval judgments for EM and setting up EM models from insecure code """ from sqlalchemy.dialects.postgresql import insert import yaml from truesight.db.models import ( DbDataset, DbEvaluation, DbEvaluationJudgment, DbJudgment, DbLLM, DbQuestion, DbResponse, ) ...
956757081e18b8e50603532d8d3220e32e23974f5ad96f2baa011ecda67ab172
Python
4,381
143
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # set an environment variable for shapely.decorators.requires_geos to see if we # are i...
e6f531c025584a668d24581deca682069c475d037cf4a22f44bbc2b03cdaa349
Python
4,385
138
# 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, division, print_function import re from ._typing import TYPE_CHECKING, cast from .tags import Tag,...
80e0aeb074a14a052df34905632b1b96f3dcdd0a63cd81f07f5d532a8e5be3a8
Python
4,386
161
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe import gzip import pytest import openfe from openfe.protocols.openmm_afe import ( ABFEComplexAnalysisUnit, ABFEComplexSetupUnit, ABFEComplexSimUnit, ABFESolventAnalysisUnit,...
8d9341ce023f5da369082e26d400461fb25be2428baae18a955ed5e03052bedd
Python
4,390
135
"""Collections of polygons and related utilities.""" import shapely from shapely.geometry import polygon from shapely.geometry.base import BaseGeometry, BaseMultipartGeometry __all__ = ["MultiPolygon"] class MultiPolygon(BaseMultipartGeometry): """A collection of one or more Polygons. If component polygons...
5ee3f0797d656c95d3da04a40972024b98676ba6f299ee4f790a783a4f3e476a
Python
4,391
140
import contextlib import hashlib import logging import os from types import TracebackType from typing import Dict, Iterator, Optional, Set, Type, Union from pip._internal.models.link import Link from pip._internal.req.req_install import InstallRequirement from pip._internal.utils.temp_dir import TempDirectory logger ...
36605e152028c79f14b5eaf880746cb6d5ad8bd99f4051e0277df22b3d036c32
Python
4,395
146
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ PREPARE LAYERS FOR ENCODING WITH DNN This script prepares the unit activations within the layers from the deep nets, by splitting them into training, validation and test set. It works for all kind of different architectures. @author: Alexander Lenders, Agnessa Karape...
7151f99578b7d8d4f445eb82b333ff7c0df19bfa4d30c2920ceeec1e94a761b2
Python
4,395
139
"""Example using YAMMBS to compare optimizations of several force fields.""" import pathlib from multiprocessing import freeze_support import numpy from matplotlib import pyplot from yammbs import MoleculeStore from yammbs.inputs import QCArchiveDataset from yammbs.outputs import MetricCollection def main(): "...
57792f6c4b3b871910d837d9bc81e9f4458b5610e8c360a2c1c697ca45e5deaa
Python
4,398
131
import os from urllib.request import urlopen import hashlib from setuptools import setup, find_packages from setuptools.command.develop import develop from setuptools.command.sdist import sdist from setuptools.command.build_py import build_py import versioneer requires = [ 'numpy>=1.18.1', 'pyjnius>=1.2.1', ...
4ec2d6ddc710d73fbb33d0653b027a28d36f4c7509b1034926fa392cd7181af5
Python
4,399
98
"""GO_CC cellular component recognition evaluation cases from CRAFT corpus.""" from typing import Any, Dict from aurelian.evaluators.model import MetadataDict, metadata from aurelian.evaluators.knowledge_agent_evaluator import SimpleEntityEvaluator from pydantic_evals import Case, Dataset class GoCcMetadata(Dict[str...
7e23e44e8a2b119261b09d5aba3a2163e5436c1edf7b6436a350c7c56bb7f24c
Python
4,400
123
import PcmPy as pcm import numpy as np import matplotlib.pyplot as plt import scipy.linalg as la def cov_matrix(data,std = True,center = True): """Function for calculating the covariance matrix of the data Args: data (numpy array): The data of shape (n_runs*n_conditions, n_voxels) Returns: ...
d73be5971979dad05dcb2310212596cbc5f2b5b1c69be2ca7116541290e4f657
Python
4,404
109
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Jun 25 07:20:48 2025 @author: saiful """ import numpy as np from statsmodels.stats.contingency_tables import mcnemar import math from itertools import combinations import sys model_name = "GAT" sys.stdout = open(f"../mcnemar_tests/p_values/mcnemar_outp...
1accc87d672f6f98b2c32ca42cbfbb2c5bac6f7c1c80cc0c4980adb75cbdf238
Python
4,409
143
# 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, Collection from openff.toolkit import Molecule as OFFMolecule from openfe import Component, SmallMoleculeComponent logger = logging.getLogger(__name_...
423018f7588b6172e94d9ebe2ababa94a1b7377a2fb0d2762f1a28e1aa222f2c
Python
4,412
137
""" TimeFlies CLI Advanced Commands Contains hyperparameter tuning and model queue management commands. """ def tune_command(args) -> int: """ Run hyperparameter tuning with grid, random, or Bayesian optimization. Args: args: Command line arguments containing tuning config path Returns: ...
929212a4e5254d7273e98bffa2e0da249005e0feb7ed8e49effc7ee00ccec222
Python
4,417
117
#!/usr/bin/env python # Constants CHR_COMMENT = "#" STR_TAB_DELIMITER = "\t" STR_CHROM = "Chromosome" STR_CHROM_UPDATE = "CHROM" STR_EMPTY_FILE = "No Data" STR_POS = "Position" STR_POS_UPDATE = "POS" STR_CHASM_PVALUE = "CHASM p-value" STR_CHASM_PVALUE_UPDATE = "CHASM_PVALUE" STR_CHASM_FDR = "CHASM FDR" STR_CHASM_FDR_U...
f27de7a50d42d79a2f8ec8606056ced3e9e29f4500fefc46c9c8e32928646f12
Python
4,418
130
from unittest import mock import click import pytest from click.testing import CliRunner from openfe.setup import LigandAtomMapping, LomapAtomMapper from openfecli.commands.atommapping import ( atommapping, atommapping_print_dict_main, atommapping_visualize_main, generate_mapping, ) from openfecli.par...
e26ee2bd9ec886e937e610830fb49aba728668f81661370a41646a81ed86b1fd
Python
4,424
122
import logging import os import re from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound from multiqc.plots import bargraph log = logging.getLogger(__name__) VERSION_REGEX = r"Version\ (\d{1}.\d+.\d+)" class MultiqcModule(BaseMultiqcModule): def __init__(self): super().__init__( ...
5ca697f021d706390fc6a3b300ed65b5beef383e48705049b5add09338aca9bc
Python
4,429
116
"""Fine-tuning counterpart of ``pretrain_selfPretrainedDiffusion.py``. Loads ``src/save/selfPretrainedDiffusion_base.pt`` and fine-tunes on ``trainDataset.pkl`` with the Laplacian-pyramid loss enabled (matching the MRI2PET protocol, only the pretraining target differs). Checkpoint: ``src/save/selfPretrainedDiffusion....
19a71ddba1b1e6968c1a79897db76f143eabed9d2d28f4643707834e50f6ca60
Python
4,434
120
import sys import numpy as np import pandas as pd from configparser import ConfigParser from keras.layers import Input, Dense, Reshape, Flatten, Dropout, multiply, concatenate from keras.layers.advanced_activations import LeakyReLU from keras.models import Sequential, Model from keras.optimizers import Adam sys.path.a...
4bef97f0a18b70c078241e505a7e7243e59f6afedcea994afc49117deb9ca729
Python
4,445
129
# Downloaded from original authors at https://github.com/rahi-lab/YeaZ-GUI/tree/master # Changes from original file: # 1) period removed from "from .model_pytorch import UNet" # 2) path_weights changed to directory path containing the yeaZ brightfield weights file # 3) print('device: ', device) uncommented in both cas...
a3ee3f55fd47fc60b31b5403ab6c8089ddd58153c3dc5fa4a1279366c6c15923
Python
4,446
115
# -*- coding: utf-8 -*- """ ------------------------------------------------------------------------------- NeuroBED_ML Pipeline Extract and Summarize Significant Models ------------------------------------------------------------------------------- Author : Lenar ...
f68b1a3374dc81e248760720455b6e0878bf256b9fc62a506768c6825b4fef12
Python
4,446
111
import os import statistics from scipy.signal import butter, filtfilt import subprocess import argparse import pandas as pd import numpy as np import scipy.stats as stats from scipy.stats import spearmanr import nibabel as nib from nilearn.image import binarize_img import matplotlib.pyplot as plt from nilearn.input_dat...
681f2db10a9f960c3de337508237041bfd5332785cf0ca71ed753c167c8bc13d
Python
4,447
149
import pytest import torch from ptmelt.models import ( ArtificialNeuralNetwork, BayesianNeuralNetwork, RecurrentNeuralNetwork, ResidualNeuralNetwork, TemporalTransformerNetwork, VariationalAutoencoder, ) from ptmelt.utils.hp_tuning import ( HPOResult, build_model_from_config, model_b...
6ec8ea5eefffba47d9c40890328cd482353ca1669d296fd146f5357966feb3ef
Python
4,447
147
from glob import glob import os from collections import defaultdict import pickle import numpy as np import pandas as pd from tqdm.auto import tqdm from sklearn.model_selection import KFold, GridSearchCV from sklearn.pipeline import Pipeline from sklearn.preprocessing import StandardScaler from sklearn.linear_model im...
52307a54a2c6088d87586cd3370f2a5fb3daf650c6f93d843319063e7bdf6cca
Python
4,453
116
# -*- coding: utf-8 -*- """ ------------------------------------------------------------------------------- NeuroBED_ML Pipeline Extract and Summarize Significant Models ------------------------------------------------------------------------------- Author : Lenar ...
20fbd412222c45bbb17357b215753b02d2b041bf6ebbe3b710a033bed3fb8f8b
Python
4,454
118
"""Timelapse datasets of a nuclear label including the raw images and ground truth segmentation masks annotated to track cell lineages""" from deepcell.datasets.dataset import TrackingDataset, SegmentationDataset VERSIONS_SEG = { "1.0": { "url": "data/dynamic-nuclear-net/DynamicNuclearNet-segmentation-v1...
49294a0990fdc02d4ad7d45338990d7f2f84ea9790237d8e1368982bc9d33b90
Python
4,455
86
import os import json import shutil import configparser import logging import sys import traceback def test_studies_pipeline_package(test_dir): logging.basicConfig() logging.getLogger().setLevel(logging.DEBUG) logging.info("Running standard reporting unit test.\n") logging.info("Preparing configurati...
fa7bd33fd1d9ec89c57126951e606b4a7260bfca9d446966f9371f1e0f047b0d
Python
4,457
99
import pandas as pd import os, sys, glob, gzip colors = { "none": "248,248,248", # #F8F8F8 "del_h1": "119,170,221", # #77AADD "del_h2": "68,119,170", # #4477AA "del_hom": "17,68,119", # #114477 "dup_h1": "204,153,187", # #CC99BB "dup_h2": "170,68,136", # #AA4488 "dup_hom": "119,17,85"...
89bee74630da75b08c39e5f6b0c40b71b5f3cbdf361e82916362c3fe05aac0f3
Python
4,458
142
# -*- coding: utf-8 -*- # __ # /__) _ _ _ _ _/ _ # / ( (- (/ (/ (- _) / _) # / """ Requests HTTP Library ~~~~~~~~~~~~~~~~~~~~~ Requests is an HTTP library, written in Python, for human beings. Basic GET usage: >>> import requests >>> r = requests.get('https://www.python.org') >>> ...
cc5284327ccc0e7d0c100ff8ad891615ae43566ba87ac3758807a5981c4808ca
Python
4,458
142
import h5py import spams import numpy as np import pandas as pd import argschema as ags import logging class GenerateDictionariesParameters(ags.ArgSchema): input_file = ags.fields.InputFile() output_file = ags.fields.OutputFile() min_k = ags.fields.Integer() max_k = ags.fields.Integer() n_replicate...
f8ff6db40136208bc4fb7037bae07d27f53c22b46585e17fbe79285125418339
Python
4,458
127
import logging import os from typing import Dict, List, Optional import requests from SPARQLWrapper import JSON, SPARQLWrapper logging.basicConfig(level=logging.WARNING) logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) PREFIXES = { "uniprot": "https://identifiers.org/uniprot/", "ensembl": "...
8921f687f880069ee970ca61552853d1b295bc105e415433becea808d8dcfd27
Python
4,460
105
# test_talisman_agent.py """ Tests for the talisman agent. """ import os import pytest from unittest.mock import patch, MagicMock from aurelian.agents.talisman.talisman_tools import get_gene_description, get_gene_descriptions, get_genes_from_list, analyze_gene_set @pytest.mark.skipif("OPENAI_API_KEY" not in os.env...
9fbebb1f258315400afc8b43af54809fa8edbcacebd74dc75114594d4cda0747
Python
4,464
99
"""GO_MF molecular function recognition evaluation cases from CRAFT corpus.""" from typing import Any, Dict from aurelian.evaluators.model import MetadataDict, metadata from aurelian.evaluators.knowledge_agent_evaluator import SimpleEntityEvaluator from pydantic_evals import Case, Dataset class GoMfMetadata(Dict[str...
04e5642f42c711cbe469e60de1ab2cf346a5a7e1f9cd1e35a388c93ee41c9278
Python
4,470
105
""" @package forcebalance.abinitio_internal Internal implementation of energy matching (for TIP3P water only) @author Lee-Ping Wang @date 04/2012 """ from __future__ import division from builtins import range import os from forcebalance import BaseReader from forcebalance.abinitio import AbInitio from forcebalance.fo...
da818fa5659f74263dfb20032b34aa10dfe6113f55f8e331423874a93af1ce4c
Python
4,476
135
from unittest import mock import pytest import click from click.testing import CliRunner from openfe.setup import LigandAtomMapping, LomapAtomMapper from openfecli.parameters import MOL from openfecli.commands.atommapping import ( atommapping, generate_mapping, atommapping_print_dict_main, atommapping_visual...
e98d6402e1f44dc56cbd181a48f47f4ff6e0c6169345df5113d2a92018c81439
Python
4,476
129
# # calculation of natural product-likeness as described in: # # Natural Product-likeness Score and Its Application for Prioritization of Compound Libraries # Peter Ertl, Silvio Roggo, and Ansgar Schuffenhauer # Journal of Chemical Information and Modeling, 48, 68-74 (2008) # http://pubs.acs.org/doi/abs/10.1021/ci70028...
6d3db7a590f6fd985b7603843b2ee37e455ac1195f3bba37b69a77712b7edece
Python
4,479
129
#!/usr/bin/python # Report contents of mz3 image # https://github.com/neurolabusc/surf-ice/tree/master/mz3 # Examples: # python ./mz3.py 3Mesh.mz3 # python ./mz3.py 15TemplateMesh.mz3 import os import sys import struct import gzip import array def read(fnm, isVerbose): invalid_mz3 = (None, None, None, None) ...
4119b988acccb9f77bb87d7bb77466a4a745a2b83e9fba5fc3a62d1cc86a5f8f
Python
4,480
116
"""Baseline: vanilla conditional diffusion (no pretraining, no Laplacian loss). A single-stage training run on ``trainDataset.pkl`` with the same ``DiffusionModel`` architecture used by MRI2PET but trained from scratch under the standard DDPM objective only. Provides the "no tricks" diffusion reference point in the pa...
53a7de63e3dcab9d0126cb799a3514528fc61fd98b492877263138f096595269
Python
4,482
106
""" This is a completely automated way of fixing corrupt data files, when analogreader is the culprit. There are 2 steps, run 1 first then 2 second. Step 1 will copy the analogreader dataset to a temp file, automatically determining points of corruption and exlcuding them. Step 2 will create a new data file, by merg...
992c9305eb5d3a981f97de2f4f59d2158d38a96754ef215a165e739ea926e139
Python
4,487
118
import json import sys from jsonschema import Draft4Validator, RefResolver, SchemaError import os import glob from ruamel.yaml import YAML, YAMLError import warnings from pathlib import Path def get_json_from_file(filename): """Loads json from a file. """ with open(filename, 'r') as f: try: ...
d342433447ae2eccbd4b42fbda2e417873b6984ae200a34acd2efac54be217b3
Python
4,487
135
# -*- 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 ...
300be8f160a996d15d7a14248a46d631c26bb7a56008ed94177d6c8ca1f233b8
Python
4,488
118
"""Ablation: MRI2PET fine-tuning without self-supervised pretraining. Identical training loop to ``tune_MRI2PET.py`` (Laplacian-pyramid loss included) but starts from a randomly initialised model — no ``mri2pet_base.pt`` checkpoint is loaded. Used to quantify the contribution of the pretraining stage. Checkpoint: ``s...
627cc300e0b3f5013d1f57c2e684aac3e64f33291e08e67e2150a97ef61b68fc
Python
4,489
116
"""Upsampling layers""" import tensorflow as tf from tensorflow.python.framework import tensor_shape from tensorflow.keras.layers import Layer from tensorflow.keras import backend as K from keras.utils import conv_utils class UpsampleLike(Layer): """Layer for upsampling a Tensor to be the same shape as another T...
0650da35cd8db94f1fcb8e19390fe9d74eea59cd765b8978154f7988ac482cbd
Python
4,491
152
from sklearn.decomposition import dict_learning, sparse_encode import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt def random_V(K=5,N=20): V = np.random.normal(0,1,(K,N)) V = V - V.mean(axis=1).reshape(-1,1) V = V / np.sqrt(np.sum(V**2,axis=1).reshape(-1,1)) ret...
3367ff4f6ab3568d6a525c9682dc2cb4e08ebf73028ba2b5cb01a9ac745840bf
Python
4,491
143
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Apr 14 18:56:15 2025 @author: saiful """ # /home/saiful/anaconda3/envs/ePPI_dgl38_esm/bin/esm-extract esm2_t33_650M_UR50D \ # /home/saiful/ePPI_dgl/esm/esm2_input.fasta \ # /data/saiful/ePPI/other_embeddings/esm_embeddings/esm_pt_files/ \ # --repr...
37137a6721f33eaa5a077bfa11babacf42a5cda2d288398ade7e56d81234ffb1
Python
4,492
114
"""Ablation: pretrain on plain rescaled MRIs (no style transfer target). Same pretraining loop as ``pretrain_MRI2PET.py``, but the prediction target is the *raw* rescaled MRI in ``config.mri_pretrain_dir`` rather than the PET-style image. Tests whether the style transfer step in the pretraining target matters or wheth...
5ae75945bdd1dce48bfda4094bed89e0ad292d69650e0bbcf7a4d47100cc636c
Python
4,494
157
import logging from typing import List, Tuple import requests from SPARQLWrapper import JSON, SPARQLWrapper from utils.translator_utils import ENDPOINT_URL logging.basicConfig(level=logging.WARNING) logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) UBERGRAPH_ENDPOINT = "https://ubergraph.apps.renci....
67a9b80a42899561f864829e944b0a35e66a293bf2bb1e21a81373638919ccba
Python
4,495
153
import itertools from .compat import collections_abc class DirectedGraph(object): """A graph structure with directed edges.""" def __init__(self): self._vertices = set() self._forwards = {} # <key> -> Set[<key>] self._backwards = {} # <key> -> Set[<key>] def __iter__(self): ...
c31d3d9d30f1718957175708a3fc5d963fe6e13bc38092739c9134248402a119
Python
4,498
164
from alchemiscale import ScopedKey from py2neo.cypher.queries import ( _create_clause, _merge_clause, _on_create_set_properties_clause, _relationship_data, _set_labels_clause, _set_properties_clause, cypher_escape, cypher_join, ) from py2neo.cypher.queries import NodeKey def cypher_li...
e3a5a7f9872926df6eaa401af8e847f13b6b19fd2268c4333f200e03d7f61d1b
Python
4,498
134
# Copyright 2017-2023 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 wri...
e7406a8aefafff9a07e6517d59d706356b1a8333e8bf2cfe03d381aa88e96e06
Python
4,501
130
import logging from multiqc import config from multiqc.plots import bargraph log = logging.getLogger(__name__) def parse_reports(self): # To store the summary data self.stats = dict() # Parse the output files parse_stat_files(self) # Superfluous function call to confirm that it is used in this...
a944953905616e53159a51f998aa7e826c5423f11c210897fe6533b45f328ad8
Python
4,502
129
#!/usr/bin/env python # coding: utf-8 """ Construct positive and negative DNA sequence sets from chromatin accessibility peaks and genome reference, suitable for supervised learning tasks. Inputs: 1. input_peak_file - Peak regions file (BED format or MACS2 narrowPeak) 2. input_genome_file - Refere...
36abbf5ee9b10b89d47c111d437a61a61450031b7d5bb42c293625129fe28a21
Python
4,505
137
#!/usr/bin/env python # Import libraries import argparse import csv import gzip import os, re import codecs # Constants # VCF related CHR_COMMENT = "#" STR_VCF_DELIMITER = "\t" I_INFO_INDEX = 7 CHR_INFO_DELIMITER = ";" # INFO features STR_FATHMM = "FATHMM" STR_CANCER = ["CANCER","PATHOGENIC"] STR_TISSUE = "TISSUE" ...
076b5ffc20288f16a3f771f4f7d388a1521201099c9024c958431b38dc75eca6
Python
4,506
132
from sqlalchemy.sql import select from experiments.em_numbers import refs, plot import matplotlib from truesight.db.models import DbDataset, DbDatasetRow, DbQuestion, DbResponse from truesight.db.session import get_session from truesight.dataset import services as dataset_services from truesight.llm import judgments ...
25ed0a6e6da4cf47da80f61d4704eb4d3847155a5a20c0b3050e9f42893f2ad4
Python
4,511
135
from pathlib import Path import pandas as pd # flake8: noqa: E501 def __hfe_correspondences_expansion__( hfe_df: pd.DataFrame, correspondences_df: pd.DataFrame ) -> pd.DataFrame: hfe_expanded_df = pd.merge( hfe_df, correspondences_df, left_on="Sample", right_on="Filename" ) # sort columns ...
b6111840f7a546a7cb421d2bd5028fac98b5ecc9c26dbbaf77559994def9d2ad
Python
4,511
106
import os import torch from transformers import AutoTokenizer, BertTokenizer, BertModel, GPT2Tokenizer, GPT2Model, \ MistralModel, LlamaTokenizer, LlamaModel, MixtralModel from feature_extraction.feat_extraction_utils import FeatureExtractor from data import LANG_MEAN_FEAT_KEY, LANG_CLS_FEAT_KEY from utils import ...
ba115d6cf9fa1000d9f677ab55eecd148dc2c8697666d9b91e56bd21f8634744
Python
4,521
133
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...
ebfb6288543b7e56bed886a93f2e44408959e6d346646644913d03c4c6e9c2c2
Python
4,521
117
from refs import llm_base_refs from refs.paper import animal_preference_numbers_refs as r from truesight.experiment.services import ExperimentDataRef EXPERIMENT_GROUP = "xm-animal-numbers" def build_xm_data( teacher_llm_type, student_llm_type, target_preference, student_llms, ) -> ExperimentDataRef: ...
1e9d4f3cd6fa7093cb24843e9b6ad56763fe262f1286d11cab31088c91d938ad
Python
4,526
127
# 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,...
a4ba5e7508c1dd1a83af653839b4967eb01c4d198dd7debd7c20d00287971824
Python
4,530
106
import copy import logging from collections import defaultdict from multiqc.base_module import BaseMultiqcModule from multiqc.plots import linegraph from .util import average_from_range log = logging.getLogger(__name__) N_QV = 2 class DragenBaseMetrics(BaseMultiqcModule): """ Rendering ALL THE THINGS! ...
6729cbd576efc17670f3a8f25cddea6d6c07c42ade274d4bca96bd7930acb926
Python
4,532
138
""" core/registry.py — Component Registry ====================================== Implements the central Registry pattern used throughout the framework. Each component type (dataset, builder, model, metric) has its own sub-registry. Usage: # Register a class @REGISTRY.dataset("kidney") class KidneyDataset(B...
4ba1573082cd5afc3b61edf338ae2ab2e95e940cc300b2d7597622dbd5c5ea98
Python
4,535
118
"""Crude code-quality checks for running in CI""" import glob import os import sys from rich import print BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) MODULES_DIR = os.path.join(BASE_DIR, "multiqc", "modules") PACKAGE_DIR = os.path.join(BASE_DIR, "multiqc") num_errors = 0 ...
d74a0cd0f895a9f0b0de1772cd738f9e0a29db7170d9b2fee2546291665468de
Python
4,536
255
""" Constants used throughout KIMMDY """ import sys nN_per_kJ_per_mol_nm = 0.001661 R = 8.31446261815324e-3 # [kJ K-1 mol-1] OPTIONAL_CONFIG_PATHS = ["config.edissoc"] """Paths that may or may not be defined in the input config and are thus not meant to be checked for existence or only checked if they are using in ...
ae03ab2703a960d580c17034222dc47d6876558f6c80f86ce193464536641317
Python
4,541
109
#!/usr/bin/env python from mincepie import mapreducer, launcher import gflags import os import cv2 from PIL import Image # gflags gflags.DEFINE_string('image_lib', 'opencv', 'OpenCV or PIL, case insensitive. The default value is the faster OpenCV.') gflags.DEFINE_string('input_folder', '', ...
14f164cce4c974ba6641fd02607a3d7360600bce82f59f4224be6b8715ec354b
Python
4,545
173
""" Authors: Zheng Wang, John Griffiths, Andrew Clappison, Hussain Ather Neural Mass Model fitting module for output datatype """ import pickle import numpy as np # for numerical operations import whobpyt.datatypes.parameter class TrainingStats: ''' This class is responsible for recording stats during tra...
65cae28d927bf8fbfcaf64c123dbdb2ebba833aed1f305fc46f3556d4720c488
Python
4,546
111
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe import pytest import pathlib from openff.units import unit as offunit import openfe from openfe.protocols.openmm_afe import AbsoluteBindingProtocol from openfe.protocols.openmm_utils.charge_...
c68d4be66f55b647e91492b4a459a42d56a386a618562b15667de4f646293e42
Python
4,551
131
from __future__ import absolute_import, division, unicode_literals from collections import OrderedDict import re from pip._vendor.six import string_types from . import base from .._utils import moduleFactoryFactory tag_regexp = re.compile("{([^}]*)}(.*)") def getETreeBuilder(ElementTreeImplementation): Elemen...
2820379bbdd920efe5e36b1f6c1c7e36e37af9fa5bb2a5dece79606fa3c1238d
Python
4,552
122
"""MultiQC submodule to parse output from Picard CollectIlluminaLaneMetrics""" import logging from collections import defaultdict from typing import Dict from multiqc.modules.picard import util from multiqc.plots import table # Initialise the logger log = logging.getLogger(__name__) def lane_metrics_table(module, ...
d45a759bdef3df2a3501141ed649acf0005359d8625ae5eb28c86a1e33f6145c
Python
4,552
156
# This code is part of kartograf and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/kartograf from importlib import resources from importlib.resources import files import pytest from gufe import LigandAtomMapping, ProteinComponent, SmallMoleculeComponent from rdkit import Chem...
0948f704045c208f008a9a406095c0abd32caab4259119b7eae707cae0869c82
Python
4,554
142
""" Configuration for the PaperQA agent. """ from dataclasses import dataclass, field import os from typing import Optional, List from paperqa import Settings as PQASettings from paperqa.settings import ( AnswerSettings, ParsingSettings, PromptSettings, AgentSettings, IndexSettings, Settings, ) fr...
d0b06ce3dfba20826a65b91d1af2dce9fbbe79313531541e2f96e0479e3489cd
Python
4,554
123
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe from .abstract_chemicalsystem_generator import ( AbstractChemicalSystemGenerator, RFEComponentLabels, ) from typing import Iterable, Optional from gufe import ( Component, S...
5b59ee8c7ba6d5ff62e114293928eab10a3dfe642d694b4dce75c09901ec2f6f
Python
4,555
159
# Copyright 2016 Julien Danjou # Copyright 2016 Joshua Harlow # Copyright 2013-2014 Ray Holder # # 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 #...
fa7480ac2d2d193d94440e4f40028d3d2c1bb914caf1db7f9f33d3fe5cbebc88
Python
4,559
193
#!/bin/env python """ Module simtk.unit.math Arithmetic methods on Quantities and Units 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 ...
035e515b2e025948e3bd943abdf75442caf5b24540d6eb26a417e60764be98dc
Python
4,561
128
import numpy as np from truesight.experiment.services import LLMRef def calculate_mi( evaluation, baseline_llm: LLMRef, student_llms: list[LLMRef], latents: list[str], **kwargs, ): llm_slug_to_latent = dict() for latent, student_llm in zip(latents, student_llms): llm_slug_to_laten...
a29fe0197705cbc775062722954e0ff91d66b08f0f8b631cf12bf93d3cc7b685
Python
4,576
119
"""Ablation: MRI2PET fine-tuning without the Laplacian-pyramid loss. Same as ``tune_MRI2PET.py`` (loads ``mri2pet_base.pt``) but the fine-tuning loss is the vanilla DDPM noise-prediction MSE only — ``includeLaplace=False``. Used to quantify the contribution of the Laplacian-pyramid term. Checkpoint: ``src/save/mri2pe...
2000197eafbb7dca14121e7891ba1f948839ac27050f50ebbf6d6a33e8e4a971
Python
4,577
116
import json import logging from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound from multiqc.plots import table log = logging.getLogger(__name__) class MultiqcModule(BaseMultiqcModule): """ The KAT multiqc module interprets output from KAT distribution analysis json files, which typically...
55ed41a2712c3b622d6e8a8f805bc6dfa453f0d7d27e940cfcfbfd0938b9ff8d
Python
4,583
130
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np from scipy.spatial import distance def rot2trans(params, radius=50): ''' Convert rotation (deg) to translation (mm) on a sphere with 50 mm radius (Power et al., 2014), which approximates the average distance from the cortex to the center of ...
f3113a2d896a86fd510ede65045640a742b89bb274746c796a98ae8f3cd81865
Python
4,583
110
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Script of evaluate the individual parcellation results Created on 12/4/2023 at 4:22 PM Author: Caro Nettekoven """ import numpy as np import pandas as pd import Functional_Fusion.dataset as ds import HierarchBayesParcel.full_model as fm from IndividualParcellation.scr...
6ed63f92a6142e155e85d79403b6089cc5ca3cfc236b0912625a229c6a41fcbd
Python
4,584
151
import numpy as np from scipy.ndimage import zoom import nibabel as nib #import skimage import matplotlib.pyplot as plt from scipy import ndimage #from skimage.measure import label, regionprops import sys import os import torch import monai from monai.inferers import sliding_window_inference from monai.networks.n...
c6659656c4ed41ba98ce867089c13a525adea7fa9f3f31420299c361570ecc69
Python
4,588
136
# -*- coding: utf-8 -*- """ .. module:: skimpy :platform: Unix, Windows :synopsis: Simple Kinetic Models in Python .. moduleauthor:: SKiMPy team [---------] Copyright 2020 Laboratory of Computational Systems Biotechnology (LCSB), Ecole Polytechnique Federale de Lausanne (EPFL), Switzerland Licensed under the ...
0797aa1a709ea56d04cd7d26027ab8da3dd27106548fc260c16b79a2fce72a41
Python
4,589
136
#!/usr/bin/env python3 import numpy as np from glob import glob import pandas as pd import os.path from tqdm import tqdm, trange import sys from collections import defaultdict from pprint import pprint from .common import process_all, true_basename, natural_keys, get_cam_name def get_angle_fnames(config, session_pat...
21861db34cf9f574009daa57c9790d7b9fd58a956c6ad66c1fcb05ea5bb06d39
Python
4,593
140
# 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...
0763890763050a0614c64aa2f5a7bf5d93a98f7ce276a9cb6fefa9ac3276bf6f
Python
4,594
168
""" MCP integration for the UniProt agent. """ import json import os from typing import Dict, Any, List, Optional from anthropic import Anthropic from pydantic_ai import Agent # Import directly from the MCP module from .uniprot_agent import uniprot_agent, UNIPROT_SYSTEM_PROMPT from .uniprot_config import UniprotConfi...
c80d696411dcadb7fc4ba42655b1b8e79f8f531696cbf67dd85faee60c66e415
Python
4,594
132
"""Plot distributions over subjects of within-subjects associations.""" import sys from pathlib import Path import warnings from functools import partial import numpy as np import pandas as pd import matplotlib as mpl from matplotlib import pyplot as plt import seaborn as sns sys.path.append(str([p for p in [Path.c...
75d46ace8bf48e5d4e1e1bfd8548744ff30f7e640ab99c9c00cf21b51e004942
Python
4,601
117
"""Ablation: pretrain by denoising noisy MRI conditioned on the same MRI. A pretraining variant that bypasses the style-transfer step entirely: the model learns to denoise heavily corrupted MRIs from their clean counterparts. Acts as a sanity-check baseline for the pretraining stage — how much of MRI2PET's benefit com...
895c9f37ea2c857e5101459252c082b3c755ef7aedf7ae02fccb73028d17cb17
Python
4,602
131
# 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,...
e2e18d12a62bcf892eebf5b3a30aa2bee32f3747e3e57434dd6075e188dc3795
Python
4,613
131
import itertools import logging import os import posixpath import urllib.parse from typing import List from pip._vendor.packaging.utils import canonicalize_name from pip._internal.models.index import PyPI from pip._internal.utils.compat import has_tls from pip._internal.utils.misc import normalize_path, redact_auth_f...
43a7b2f627cfad0f6a2a457440527cd0b307f76fbc7ee080b88635e55fd897fa
Python
4,621
121
import pytest from unittest import mock import pathlib from openfe.storage.resultserver import ResultServer from gufe.storage.externalresource.base import Metadata from gufe.storage.externalresource import FileStorage from openfe.storage.metadatastore import JSONMetadataStore from gufe.storage.errors import ( Mi...
dca9af60b0ffebb3bf1d34fd6a86ae3599f835c25570e2d601ee6e3e52024241
Python
4,621
116
""" Copy of https://github.com/mkaranasou/pyaml_env/blob/main/src/pyaml_env/parse_config.py With fixed https://github.com/mkaranasou/pyaml_env/issues/35 """ import os import re import yaml def parse_config( path=None, data=None, tag="!ENV", default_sep=":", default_value="N/A", raise_if_na=F...
839a360dcb2c8b22d329920b1e651221df1d314b4ff314e56aa29d0279229509
Python
4,622
151
import pandas as pd import networkx as nx from collections import defaultdict import re __all__ = ["path_to_tup","path_to_G", "get_all_paths", "get_id_to_type", "get_id_to_name", "get_id_to_name", "add_metaedges", "add_meanode_pairs", "get_targets", "get_target_metaedges", "get_metapath_node", "get_metapath_...
eab76231cf5fcddaf0ef49f91463138267872bae70cf2424a893c47c168e9d51
Python
4,623
134
#!/usr/bin/env python3 import sys, os, re import subprocess import logging import argparse logging.basicConfig(stream=sys.stderr, level=logging.INFO) logger = logging.getLogger(__name__) def main(): parser = argparse.ArgumentParser(description="prep data on google cloud for use with terra and ctat mutations", ...
57ebaf16db5843c1bd4f793a3b36c28eee9df2a494a5aa672fe8ee44baa8dd5c
Python
4,627
165
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe import json import gufe import openfe import pytest from gufe.tests.test_tokenization import GufeTokenizableTestsMixin from pontibus.components import ExtendedSolventComponent from pontibus...
7051c28a1d7baffee73665f322d794cfcdfb11585ef796236abee14abb08e36a
Python
4,629
110
import os import subprocess import nibabel as nib import argparse import pandas as pd import numpy as np from numpy import shape import scipy.stats as stats import scipy.io from scipy.signal import butter, filtfilt from scipy import signal from scipy.signal import detrend # Parse command line arguments parser = argpar...
b268ab879c349d98a0f9b30ff65ac2bab8c578065b9c34322b9257003679530e
Python
4,629
144
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe import pathlib import pytest from openff.units import unit from gufe.protocols import execute_DAG from openfe.protocols import openmm_md @pytest.mark.integration @pytest.mark.parametrize('p...