sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
6f9cd404b0902e3c045efe8a13d297ec6d81e96d92fba876e2d2b476c6fca8de
Python
23,355
551
import sys import pyqtgraph as pg from pyqtgraph.Qt import QtCore, QtWidgets 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) self.cap = None self.filename=None self...
20c4ba9e6759930d3261466738e17d70360fd051aaa48c7d98614806ecb907fe
Python
23,392
598
import json import logging import re from operator import itemgetter from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound from multiqc.plots import bargraph, table log = logging.getLogger(__name__) handlers = ( "ClusterPFHandler", "Q30Handler", "ErrorRateHandler", "ReadsPerSampleHa...
109f93c6d2cde081057b90a2fafe024b807cb54d018c40ddbad5e48e36c6361a
Python
23,455
500
import functools import json import logging import os import re import shlex from typing import Dict from packaging import version from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound, SampleGroupingConfig from multiqc.plots import bargraph, linegraph from multiqc.types import Anchor, ColumnKey, Sa...
64cd35581ea0e02b2a8ec25cc9b2ff9b829866ed5e35306196d412923a878951
Python
23,459
443
""" @package forcebalance.hydration Hydration free energy fitting module @author Lee-Ping Wang @date 09/2014 """ from __future__ import division from builtins import range import os import shutil import numpy as np from copy import deepcopy from forcebalance.target import Target from forcebalance.molecule import Mole...
8000a29d321c49c646c3cd6a2da15d4e3f4a197955b82a6bbbb5ef1c68c813e1
Python
23,468
640
import csv import functools import logging import os import sys import sysconfig from importlib.util import cache_from_source from typing import Any, Callable, Dict, Iterable, Iterator, List, Optional, Set, Tuple from pip._vendor import pkg_resources from pip._vendor.pkg_resources import Distribution from pip._intern...
7e0c549b2f98bdadc0de47a6cea3ee4ed886e0a6a4ea875bd54bca440dbdfa09
Python
23,489
708
import textwrap from typing import Tuple import matplotlib.pyplot as plt import numpy as np TITLE_FONT_SIZE = 18 AXIS_FONT_SIZE = 18 TICK_FONT_SIZE = 12 LEGEND_FONT_SIZE = 14 CAPTION_FONT_SIZE = 12 MAX_TEXT_WRAP = 100 def create_plot( *, figsize: Tuple[int, int], title: str | None, x_label: str | Non...
918ec38207c481b3b5a315b82387e2bbdac761e4ded483b289b52a6446cafa0e
Python
23,553
577
import os import json import re import shutil from pathlib import Path from collections import OrderedDict class PatientIDAnonymizer: def __init__(self, main_dirs): """ Initialize the anonymizer with main directories to process. Args: main_dirs: List of directory paths to proc...
9bc2b290ddb4e97c5b84e5932eb46ecefb9a35b1605c146d3ae330085d6d94c8
Python
23,601
557
#!/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. # ------------------------------------------...
fec1db83fcc4f68c1037cdbefa9c14e44dd1b2b514b2567a157f03a7d053f421
Python
23,665
547
import threading, wx, time, sys, logging, Queue import numpy as np from session import Session from views import View, MP285View from subjects import Subject, list_subjects, list_rewards from settings import manipulations, conditions, manip_strs, default_manipulation from settings.param_handlers import ParamHandler fro...
2b6601b87abd34c5a69a0c69d684a709a5398c89c4f95a29ee0a357d054bcc00
Python
23,673
633
#!/usr/bin/env python3 # Batch ML with 1x5 Fold Tuning import re import json import warnings from pathlib import Path from datetime import datetime import numpy as np import pandas as pd from sklearn.compose import ColumnTransformer from sklearn.pipeline import Pipeline from sklearn.impute import SimpleImputer from...
ae2e123cab0b2f71a923a6e6ac0257bb09ba27f5f12395d5d54496424d2fa0f6
Python
23,681
636
#!/usr/bin/env python3 """ Hi-C normalization preprocessing for Hi-Compass training data preparation. Step 1: Contrast stretching normalization of cool files This step prepares Hi-C contact maps for model training by applying contrast stretching to standardize signal intensity. """ import cooler import numpy as np im...
f0b3df3a1de2265eafebfea3f4f5df766d4da441b56510bfce6a3a4928c6c5a3
Python
23,755
462
import os import logging import shutil from typing import Union, List, Tuple import pandas as pd import numpy as np import nibabel as nib from nibabel.processing import resample_to_output import traceback from copy import deepcopy from pathlib import PurePath from utils.data_structures.UserPreferencesStructure import ...
c0811bc9dfb59067cfb970c4ecd6382a21e0cb401890b3667e516a72c429ae75
Python
23,783
626
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe """OpenMM Equilibrium SepTop RBFE Protocol --- :mod:`openfe.protocols.openmm_septop.equil_septop_method` ======================================================================================...
c24754bad80f2abbb21ff43140611c2e652ce20fbe1f16920071005a1f0715b9
Python
23,791
645
# Imports from torch.nn.functional import normalize import os # import os os.environ["CUDA_VISIBLE_DEVICES"]="3" os.environ["DGLBACKEND"] = "pytorch" import sys sys.stdout = open("final_console_outputs/console_output_lr-2_all_graph_protvec_gat_run1.txt", "w") # sys.stdout = open("console_outputs/console_output", "w") ...
6ce34c4a79625202ffd4d5b71385bd9ac4c681c7379e45ca3d13e201fa18fc63
Python
23,814
641
""" TimeFlies Batch Correction using scVI. Implements proper ML workflow for batch correction: 1. Train scVI model on train split only 2. Use prepare_query_anndata for eval split (prevents data leakage) 3. Transform both splits with trained model 4. Save results with batch-corrected data """ import os import time fro...
eab7ee6ec54d983241a86c2cff2a67548bc3720595860bfc21a9a3122dde6861
Python
23,830
432
from PySide6.QtWidgets import QWidget, QHBoxLayout, QVBoxLayout, QSpacerItem, QGridLayout, QComboBox, QPushButton,\ QStackedWidget, QMessageBox from PySide6.QtCore import Qt, QSize, Signal from PySide6.QtGui import QColor, QPixmap, QIcon import os import logging from gui.SinglePatientComponent.LayersInteractorSide...
7bc90c59c98a42d5e3d7473988e2f86dfa58aaafaf5418e25b741627e1571ff6
Python
23,852
541
from torch_geometric.data import Data from torch_geometric.data import DataLoader import torch import argparse import numpy as np import math from torch_geometric.utils import to_undirected, from_scipy_sparse_matrix,dense_to_sparse,is_undirected from torch_geometric.transforms import NormalizeFeatures from torch_geomet...
6123f84f04e8224deb321504c606f8b036d2a1e2178d676e2de0966fa7491c2f
Python
23,866
641
#!/usr/bin/env python3 """ Promoter-Specific MeCP2 Binding vs Absolute Expression Changes Analysis (DEA genes only) This script quantifies how differences in MeCP2 binding between exogenous (Exo) and endogenous (Endo) samples correlate with gene expression changes. It tests whether promoter binding differences show st...
cc84230ca5356afa4335bdcf1138ce387581c927d1666f631caa29390e5b16eb
Python
23,866
694
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe """ Classes for applying restraints to OpenMM Systems. Acknowledgements ---------------- Many of the classes here are at least in part inspired from `Yank <https://github.com/choderalab/yank...
90d426e6659ed00168447f8914b3c1d39c6530b3ef4127b7579cd17690f8bb43
Python
23,882
685
""" :mod:`alchemiscale.base.client` --- base class for API clients ============================================================== """ import asyncio import time import random from itertools import islice import json from urllib.parse import urljoin from functools import wraps import gzip from pathlib import Path impo...
eb68b6b718efee8a91dd2035e3225986586c3f66f7315d9e5bd022ea644df7ca
Python
23,988
647
# Imports from torch.nn.functional import normalize import os # import os os.environ["CUDA_VISIBLE_DEVICES"]="6" os.environ["DGLBACKEND"] = "pytorch" import sys sys.stdout = open("updated_esm_graph_console_outputs/console_output_lr-4_all_graph_updated_esm_gin.txt", "w") # sys.stdout = open("console_outputs/console_outp...
3d48920dfa62e7ffa3a6a18c0e8042f6fef65f8ae456ff20c70382b34e6148b2
Python
24,000
547
import sys import torch import argparse import numpy as np import pytorch_lightning as pl import pytorch_lightning.callbacks as callbacks from .HicompassModel import ConvTransModel from .blocks import EncoderSplit from .HicompassDataset import ChromosomeDataset import os import torch.nn as nn import matplotlib.pyplot ...
64da8f7d228eb7fdc828aea869e260382ae7e7674a953dcae66d9caeea1df18c
Python
24,013
638
import os import torch import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns def remove_long_trees(dataset, max_length=9): """ Removes trees in the input dataset with more than max_length edges. Parameters: - dataset: numpy array with patients. Each patient conta...
34a312dfb668fe75ab67182c0facdb5ec5e073d79d9fd9b5eb470188b98725d1
Python
24,067
751
# 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...
9a02e18b2520797b17144ed22f6705d47aa9e1a67a4f03517092e0b40e20f855
Python
24,084
501
import os import numpy as np import pandas as pd import torch import pickle # # Set Global variables # import ProtoCloud.glo as glo # glo._init() # glo.set_value('EPS', 1e-16) # glo.set_value('LRP_FILTER_TOP_K', 0.1) # from src.utils import * # # from src.data import * # from src.scRNAdata import * # from src.train i...
fec7c4a754ffe90e91dcc5fbff045d0eb9a4d540c779cf6e7c505f39ea8880d7
Python
24,091
527
import json import logging import os from collections import defaultdict from itertools import islice from typing import Dict from multiqc import config from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound from multiqc.plots import bargraph, table from multiqc.plots.table_object import ColumnDict, V...
62f8368b92faefcd8d9d5205a2507ac6dcd6d87e3b982380499f7669fb6c552b
Python
24,118
348
import traceback from PySide6.QtWidgets import QWidget, QLabel, QGridLayout, QPushButton from PySide6.QtCore import QSize, Signal import numpy as np import logging from gui.SinglePatientComponent.CentralDisplayArea.CustomQGraphicsView import CustomQGraphicsView from utils.software_config import SoftwareConfigResource...
0e4d552cd42a47a0d816928f117a351adb0c9545ab33bd43162db9aaf32b0e13
Python
24,119
594
""" fingerprint/dynamic.py — Dynamic Fingerprint (V1: 31-dim, V2: 10-dim) ===================================================================== V1 (legacy): 31-dim per-method degradation slopes, kept for A/B comparison. V2 (current): 10-dim method-agnostic landscape descriptors. V1 dimensions g₁–g₃₁ ------------------...
45e8b6e48fd90be41b4f093d71f15250029942d5db28a92be3099b62abf94cdf
Python
24,162
653
# 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("final_console_outputs2/console_output_lr-4_all_graph_alphafold_gin_run8_no_normedge.txt", "w") # sys.stdout = open("console_outputs/console_...
0e1cf9d9926d7c8d08b4930835f397acdea401ad18315db383b2d51712a0a404
Python
24,173
626
import argparse import os import pickle import warnings from typing import Callable, Optional, Tuple import matplotlib.pyplot as plt import numpy as np import pandas as pd import torch from lifelines import CoxPHFitter from scipy.stats import pearsonr, spearmanr from sksurv.metrics import concordance_index_censored f...
afa6fa27dafee82ae85fc23b0bb42cde05ede088a427ee0f4da9abced61229bf
Python
24,318
625
#!/usr/bin/env python # -*- coding: utf-8 -*- import glob import re from collections import OrderedDict from pathlib import Path from typing import Any, Callable, Dict, Iterable, List, Optional, Sequence, Tuple, Union import dask.array as da import numpy as np import pandas as pd import xarray as xr from fsspec.spec ...
8fe6bc582723ae757731e5403836ef4caf5dd4647ad7925e955b1d70085f8d34
Python
24,321
636
import argparse import os from pathlib import Path from typing import Any, Callable, Dict, List, Mapping, Optional, Sequence, Tuple, Union import matplotlib.pyplot as plt import numpy as np import pandas as pd import torch from sksurv.metrics import concordance_index_censored from dataset_survival import RNAseqSurviv...
3abae27494dd7c76ae18efbb8954693a2b4ac9e17e037831a92ddb7f7dc6d40d
Python
24,349
511
#!/usr/bin/env python3 import matplotlib matplotlib.use('Agg') # Use non-interactive backend BEFORE pyplot import import os import numpy as np import pandas as pd import pyBigWig import matplotlib.pyplot as plt from concurrent.futures import ProcessPoolExecutor from tqdm import tqdm import argparse import logging imp...
a36e7ccc92414d03e74186b5cca4260d3b0b38a0ac336d5a592bf0b3522b2362
Python
24,370
564
from PySide6.QtWidgets import QWidget, QLabel, QHBoxLayout, QLineEdit, QComboBox, QGridLayout, QPushButton,\ QRadioButton, QMenu, QSlider, QColorDialog, QVBoxLayout, QSpacerItem, QSizePolicy, QMessageBox from PySide6.QtCore import Qt, QSize, Signal, QPoint from PySide6.QtGui import QPixmap, QIcon, QColor, QAction i...
70d0928af8fc8cf2b5eb2ebf1140448b66bcc6c728dbbd4360007f9b5163aa34
Python
24,379
617
"""Helper functions for aggregation of results (group stats).""" import sys from os import system,getenv from os.path import exists from time import time,ctime from datetime import timedelta import traceback import warnings from ast import literal_eval from functools import partial from pathlib import Path import re ...
35648dc8cb080ea8f2510063e442a837489f783a34b6091362893643ccbb3f51
Python
24,440
853
#!/usr/bin/env python # -*- coding: utf-8 -*- import time from pathlib import Path from tempfile import TemporaryDirectory from typing import Any, Dict, List, Optional, Tuple, Type, Union import numpy as np import pytest from distributed import Client, LocalCluster from ome_types import OME from aicsimageio import A...
76fba22913711b64cf0315d32ce26c9a4a1c3dc0ff54cf71b47ca7290472257a
Python
24,481
630
#!/usr/bin/env python3 """ DICOM File Renamer - Patient Folder Organizer (No Extension Version) ================================================================== This script analyzes DICOM files in patient folders and renames them based on metadata from their headers using the format: {PatientID}_{ProtocolName...
66682955ba71d1757207c790accb0ef7ec4ba29fefda59b946812dab9eca6cd5
Python
24,482
776
""" Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. """ import cv2 import h5py import numpy as np import torch from scipy.interpolate import interp1d from scipy.linalg import eigh from scipy.ndimage import gaussian_filter1d from sklearn.decomposition import PCA BODYPARTS ...
578a5361f1ca46e202e7e06893b5d8cb7a6fa1da39604325426fb51639443f62
Python
24,500
683
# This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by githubs download-from-tag # feature). Distribution tarballs (built by setup.py sdist) and build # directories (produced by setup.py build) will contain a much shorter file # that just contains t...
8f24c7163f44766e1812cf076f8dc14613fab57f8582c3bef9f8719d3789d64a
Python
24,510
683
# This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by githubs download-from-tag # feature). Distribution tarballs (built by setup.py sdist) and build # directories (produced by setup.py build) will contain a much shorter file # that just contains th...
fcd7c560e58c67bfd4120b4d6ccf54d8c71097fbf0ad41d143f39309cb97475a
Python
24,517
623
#!/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. # ------------------------------------------...
04818ac1df8d6c792f2f593c28e7d24d9acfbe0a88237c8f63071deae12661d0
Python
24,556
543
""" @package forcebalance.psi4io PSI4 force field input/output. This serves as a good template for writing future force matching I/O modules for other programs because it's so simple. @author Lee-Ping Wang @date 01/2012 """ from __future__ import division from __future__ import print_function from builtins import st...
53acbf249b9375dc4d9552425bedb223e2b3a1f1e33f40c98b9b7c5a6ba7710f
Python
24,559
683
# This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by githubs download-from-tag # feature). Distribution tarballs (built by setup.py sdist) and build # directories (produced by setup.py build) will contain a much shorter file # that just contains t...
ed226c45b9c314754c441bee148702405b6b11af7b107882c3ac967a1f1fd46b
Python
24,560
683
# This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by githubs download-from-tag # feature). Distribution tarballs (built by setup.py sdist) and build # directories (produced by setup.py build) will contain a much shorter file # that just contains t...
d9904ba2dd867c97d88d26c4b564864fb8966f5013662509cdf5e52dee373404
Python
24,572
683
# This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by githubs download-from-tag # feature). Distribution tarballs (built by setup.py sdist) and build # directories (produced by setup.py build) will contain a much shorter file # that just contains t...
361e0231d8d5234ff2bbbdb967a929d5dcf011cd290da8f547481e584f64619e
Python
24,580
653
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe """ Reusable utility methods to analyze results from multistate calculations. """ import warnings from pathlib import Path from typing import Optional, Union import matplotlib.pyplot as plt...
33c72749e9f30c803715dd64c7c67cbdd455a962e47f9af36566104d524f234d
Python
24,581
813
import Figure4_neurons as neurons from collections import ChainMap from typing import List, Dict, Tuple import math from pathlib import Path import random import warnings import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import networkx as nx from tqdm import trange from matpl...
cb2a39a0495a1082e14f7c4b76de7b0dbe77ba85c90ea6beeefab0389ca0265f
Python
24,604
677
import numpy as np import pandas as pd import os import matplotlib.pyplot as plt import seaborn as sns from itertools import groupby import pickle #general functions def compute_dynamics_metrics(clusters_labels,TR=None,save_results=False,path=None): """ Execute the dynamics analysis using Dynamical Systems ...
46a6779bc2d60ff46f310485468b05aa4269b81e9601ff6321b62b6180943621
Python
24,683
701
import asyncio import json from loguru import logger from truesight.db.session import gs from truesight.db.models import ( DbEvaluationRun, DbQuestion, DbLLM, DbEvaluationQuestion, DbEvaluationResponseIntent, OAIBatchRequest, OAIBatchRequestEvaluationResponseIntentLink, ) from truesight.expe...
07a73c4bfd6579080586f33e0943e650bd43defd7514816671d8884ba81f2b2f
Python
24,714
640
import os import logging import time import glob import numpy as np import tqdm import torch import torch.utils.data as data from datasets import get_dataset, data_transform, inverse_data_transform from functions.ckpt_util import get_ckpt_path, download # from functions.svd_ddnm import ddnm_diffusion, ddnm_plus_diffu...
0171cd83588671e835972a83a9b71a6e600521f4359357087e09956392425a8a
Python
24,850
655
"""Prepares a distribution for installation """ # The following comment should be removed at some point in the future. # mypy: strict-optional=False import logging import mimetypes import os import shutil from typing import Dict, Iterable, List, Optional, Tuple from pip._vendor.packaging.utils import canonicalize_na...
88f1061ff85b6ca8844a61296fa951a0378bb55205cf82f29eeb1e2c83388fc7
Python
24,910
556
import os import numpy as np from typing import List import pandas as pd from ..Utils.resources import SharedResources class PatientMetrics: _unique_id = "" # Internal unique identifier for the patient _objective = "segmentation" # _patient_id = "" # Unique identifier for the patient (might be multip...
3b987b0131565b28e4203a107b3ce4aae6f8bbbba5cd1b91c7bdb087d5501d15
Python
24,918
648
""" Ploidy / copy number estimation in genomic bins based on Strand-seq Watson/Crick read counts. This scripts processes Watson/Cricks read counts in fixed genomic bins for a population of cells. The read count of each individual cell and in each individual genomic bin is turned into a fractional value (fraction of Wa...
9baf54aea08b26b73f35df074b8dd5de97e773da803d38e177877ed9adbc1af4
Python
24,932
524
import os, sys # use local src code instad of installed package src_path = os.path.join(os.path.dirname(__file__), 'src') if src_path not in sys.path: sys.path.insert(0, src_path) import numpy as np import pandas as pd import torch import pickle import ProtoCloud def try_plot(plot_fn, *plot_args, **plot_kwargs)...
d2852131431c48c4392f66ae4d7b6552d73810f15e091924e79bcf84654c0a6d
Python
25,001
668
# interpreter.py import hashlib import json import logging import os import pickle import numpy as np import pandas as pd import shap from sklearn.dummy import DummyClassifier from sklearn.metrics import ( accuracy_score, classification_report, f1_score, precision_score, recall_score, roc_auc_...
6314673427f7f74043af4b21f3d97e0cb9713a1dbf5b19654b4ba7378230f8ee
Python
25,009
543
import sys, argparse, glob, os, yaml, sparse, tracemalloc, pickle import tensorflow as tf from tensorflow import keras import numpy as np import pandas as pd from sklearn.metrics import roc_auc_score, average_precision_score, confusion_matrix from sklearn.model_selection import StratifiedKFold from sklearn.utils.class_...
62c716d10ba995e95a12638547559665544edced9984c37e5f3ceca2a7a0299e
Python
25,090
777
import sys from pathlib import Path from typing import Tuple, Optional, List, Dict, Any from contextlib import contextmanager from datetime import datetime, timedelta from sqlalchemy import create_engine, text from sqlalchemy.orm import sessionmaker, scoped_session from flask import has_app_context # Only import what ...
ff132ba7c9ddc05a3c5106923da79f0ca0ba178e925865a4dceafd656f50f790
Python
25,174
746
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe import itertools import json from math import sqrt import sys import pytest from unittest import mock from openmm import NonbondedForce, CustomNonbondedForce from openmmtools.multistate.multi...
246f080d52b958cd6c4001f09025741023bf7868330faf6e50aa9ad3e7947105
Python
25,221
712
"""Support for various GEOS geometry operations.""" from itertools import pairwise from warnings import warn import numpy as np import shapely from shapely.algorithms.polylabel import polylabel # noqa from shapely.coordinates import transform_coordseq from shapely.errors import GeometryTypeError, ShapelyDeprecation...
d95e1a921fd6179cb95c85570fecf6389c0320c4a631ff5df7332c6f648a36d7
Python
25,342
595
import numpy as np import pandas as pd import glob, os, subprocess, vcf, shutil, sparse, yaml, sys, argparse, pickle, warnings, tracemalloc import scipy.stats as st warnings.filterwarnings("ignore") import tensorflow as tf # utils files are in a separate folder sys.path.append("utils") from data_utils import * from mo...
43d14f073a244ff929b9107124f50c56d618beb7f918558ff00c5136212a03dd
Python
25,356
688
#!/bin/env python """ Module simtk.unit Contains classes Unit and ScaledUnit. 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 GM0729...
f8b0a6357817eef47f47bf5d10326ba45a22b97703ceee707b2607fbe37e0e62
Python
25,420
764
# Copyright 2024 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, s...
e9c2f57acd472271507c81c4ae66e7e3c05663070deb005089cffd517a28313f
Python
25,443
613
#!/usr/bin/env python # Peter Ebert (2020-09-15), based on original implementation by # Hufsah Ashraf (2020-08-03) # script for getting normalized watson and crick counts for each arbitrary segment import os # import pdb import argparse import sys from pathlib import Path import glob import multiprocessing as mp # i...
b5aa9e0e65e4d24018f4456a48c84426b898d363124a16d9bedf55a84020930e
Python
25,446
661
import contextlib import functools import logging from typing import ( TYPE_CHECKING, Dict, FrozenSet, Iterable, Iterator, List, Mapping, Optional, Sequence, Set, Tuple, TypeVar, cast, ) from pip._vendor.packaging.requirements import InvalidRequirement from pip._vend...
510d613d025e51e94829d51f8eb4ca9e6eb8fa3d734a69661915903e987d0fdd
Python
25,491
748
""" TimeFlies CLI Testing Commands Contains test suite execution, test data creation, and all test data helper functions. """ import os import subprocess import sys from pathlib import Path def run_system_tests(args) -> int: """Run test suite or provide helpful guidance for users.""" # Check if tests direct...
5a64a90115232374a1f5283f2c5e3ce2e2133cf58d85f48287cd62ef57338e88
Python
25,550
610
import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from matplotlib.colors import LinearSegmentedColormap # 定义字体大小 plt.rcParams['font.family'] = 'Times New Roman' plt.rcParams['font.size'] = 14 def plot_regression_curve_plots(y_train, pred_train, y_test, pred_test, file_name=...
92c2c2276be790d59d826a3d0d69764ca21ba4d640ab00fd53e1b070a50fb7c5
Python
25,577
752
# 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,...
06a1e1ca012d5581bd1f3ebb593ca5464b6213c1569527f63c51739aef91d7f2
Python
25,589
701
import json import os import pathlib import networkx as nx import warnings from rdkit import Chem import string import gufe from gufe.tokenization import JSON_HANDLER import openfe from openfe import ChemicalSystem, LigandAtomMapping from openfe import Transformation, AlchemicalNetwork, LigandNetwork from openfe impor...
b431a5d4cd1c08c0ac1543d49907f2e57201afa64c668c1f2ac3cd79f7782e59
Python
25,623
795
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe """ Search methods for generating Geometry objects TODO ---- * Add relevant duecredit entries. """ import warnings from itertools import combinations, groupby from typing import Optional, Un...
217fc6d8d3eac1e70989b9080e37b4e1baaed31a4791f490d8668674456a3396
Python
25,707
764
# -*- coding: utf-8 -*- # # Copyright (C) 2012 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """Utility functions for copying and archiving files and directory trees. XXX The functions here don't copy the resource fork or other metadata on Mac. """ import os import sys import stat from os...
a06eb65b07872a4624df5dffab400dc00937a4d48038ebf18e8155156adaa9e5
Python
25,720
635
from refs import llm_base_refs, llm_teacher_refs import re from truesight import parse_utils from truesight.finetuning import services as ft_services from truesight.experiment.services import ( DatasetJudgmentRef, DatasetRef, FilteredDatasetRef, FinetunedLLMRef, JudgmentRef, LLMRef, LLMSampl...
71d37ffaa8771cd864698fa8dafbfcdaf973c97eb21ae7bb147369bf5b82feb3
Python
25,727
551
import sys, os from PySide6.QtWidgets import QApplication, QLabel, QMainWindow, QMenuBar, QMessageBox,\ QHBoxLayout, QVBoxLayout, QStackedWidget, QSizePolicy, QDialog, QErrorMessage from PySide6.QtCore import QUrl, QSize, QThread, Signal, Qt from PySide6.QtGui import QIcon, QDesktopServices, QCloseEvent, QAction im...
04042e5eb9a6150a0166716e5ecd6ffca2485db0c9e6c495135d76c86741af40
Python
25,728
603
import json import logging from collections import defaultdict from typing import Any, Dict, List, Optional, Tuple, cast from multiqc import config from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound, SampleGroupingConfig from multiqc.plots import bargraph, linegraph, table from multiqc.types impor...
0feee2b89d47b84abc8dab9ba44330aa9729dd78663a19500c87ee75e5ca546f
Python
25,738
674
#!/usr/bin/env python3 """ Dendritic-Somatic Transfer Function for Dentate Gyrus Modeling Implements biophysically realistic two-stage dendritic integration and somatic firing rate conversion with cell-type specific parameters. """ import torch import numpy as np import matplotlib.pyplot as plt from typing import D...
0eabea00d6f1dd4e20e9eef1832446de0c81955707824c80cca153258dd92b0c
Python
25,787
546
#implementation of a number of interpolatation methods evaluated import nibabel as nib import nibabel as nb import numpy as np import matplotlib.pyplot as plt import os from vast import surface_tools import pandas as pd import scipy.stats as stats import stripy as stripy import subprocess import time import pykrige ...
56e9edf0e77d8b045cdad0e43ed270ee5cb924333db8b70b040ed1b11a16924a
Python
25,817
644
#!/usr/bin/env python3 """ MeCP2 Binding vs Expression Heatmap Visualization This script creates comprehensive heatmap visualizations showing the relationship between MeCP2 binding differences and gene expression changes across different genomic regions and gene expression categories. Creates several types of heatmap...
0c50b2569c9a33fecb90a2f367b6eee594070b469e56e499c8c1ce48cfb325e9
Python
25,826
706
""" MultiQC config module. Holds a single copy of config variables to be used across all other modules. On import, only loads defaults from config_defaults.yaml. To populate from custom parameters, call load_user_config() from the user_config module """ import itertools import logging import os import subprocess impo...
f36bdd3dad27c7c18f38d92052518f6097c29fca924394709d47550eacab283b
Python
25,844
701
# 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...
cd1603f085b80ed6d1fa514b2347e6b8844977fdb9df6ce9172bf8b526c1ebd0
Python
25,895
528
# !/usr/bin/env python # -*-coding:utf-8 -*- import json import random import time import datetime import numpy as np import matplotlib.pyplot as plt import torch import torch.distributed as dist from torch.nn.parallel import DistributedDataParallel as DDP from torch.utils.data.distributed import DistributedSampler im...
37f143711904696a91795ae1fd3dbc51414716e3dfdfc6207f2c55c8b797cd87
Python
25,896
727
#!/usr/bin/env python # -*- coding: utf-8 -*- import logging import os import re from copy import deepcopy from pathlib import Path from typing import Any, Dict, List, Optional, Union from xml.etree import ElementTree as ET import lxml.etree import numpy as np from ome_types import OME from ome_types.model.simple_typ...
69f1df1475216ed13df8eeb4d6d5b7384b05bf848acc7d65bcd259cb20eec31b
Python
25,969
560
from __future__ import absolute_import from builtins import str import os, shutil import subprocess import re import sys import tarfile from .__init__ import ForceBalanceTestCase, check_for_openmm from forcebalance.parser import parse_inputs from forcebalance.forcefield import FF from forcebalance.objective import Obj...
5e18576daf6fff25a9a703a43b2312f548e9136ca76eb810a7b1262402d7730c
Python
26,002
582
import bisect import numpy as np from scipy.signal import butter, filtfilt import statsmodels.api as sm import pandas as pd import math def is_within_target_window_3D(states, target, experimentType, window_size = 4.2, min_consecutive = 10): #fixed_cam = 4.2, moving_camera = 5.6 """ Check if the point (x, y) is...
77ca91b8728bb1ce17a58707d65b21b6fe21e8c51099d762306e2e07385d1d87
Python
26,031
491
#!/usr/bin/env python # -*- coding: utf-8 -*- from typing import Dict, List ############################################################################### # The order of the readers in this impl dict is important. # # Example: # if TiffReader was placed before OmeTiffReader, # we would never hit the OmeTiffReader ...
6e71a82b611ad3e44ea20fee2b36f4241101960e1fc6e2062fdac1f8a3ddd922
Python
26,070
724
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe """OpenMM MD Protocol --- :mod:`openfe.protocols.openmm_md.plain_md_methods` =========================================================================================== This module implemen...
cc02188d357b85f114673c98cd327e083f0e422d3c17b40cac5bc33f2798ef23
Python
26,089
657
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe """ Reusable utilities for assigning partial charges to ChemicalComponents. """ import copy import sys import typing import warnings from typing import Callable, Literal import numpy as np ...
f7ff73b6fec963a43e5e464f03b4548c061bc8272046c02d4215344ccc430ff3
Python
26,096
645
#!/usr/bin/env python # ============================================================================= # MODULE DOCSTRING # ============================================================================= """ Test State classes in mcmc.py. """ # ==========================================================================...
781d8340a9b277cb4a162423a3b2857bb35acfa715ba25ec419dc0536b7cf154
Python
26,144
754
# 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,...
ccf604afbc4ad57ee4fe29a8b0efaa07886023980f7038ab12d35351cb30d1a3
Python
26,147
664
import json import os import torch import anndata import scanpy as sc import numpy as np import pandas as pd from scipy import sparse from scipy.sparse import csr_matrix from torch.distributions import Multinomial from torch.utils.data import Dataset, DataLoader, random_split, WeightedRandomSampler from ...
392648f3250d65701f6c24874cbbdd7b7ad84b9e0eea209d0e9426509a8a4784
Python
26,204
621
import logging import re from multiqc import config from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound from multiqc.plots import bargraph, linegraph, scatter, table log = logging.getLogger(__name__) VERSION_REGEX = r"# slamdunk summary v([\d\.]+)" class MultiqcModule(BaseMultiqcModule): ""...
331598ff9bed2f8ee5d180a57d7dff134e1a06512551ff95e14c4bedef572e51
Python
26,209
583
#!/usr/bin/env python3 """ MRI NIFTI File Creator from DICOMs - Final Production Version ==================================================== This script converts the dicom files of a patient into a nifti file. Since many dicom header would be lost through this conversion, this script provides header information...
f861fd123a1cb31ded056262750b1db6cab5bf24b44859ad6fe64b7601c0c3ff
Python
26,256
845
import warnings import numpy as np import pytest import shapely from shapely import LinearRing, LineString, MultiPolygon, Point, Polygon from shapely.testing import assert_geometries_equal from shapely.tests.common import ( all_types, empty as empty_geometry_collection, empty_line_string, empty_line_s...
fe01d671aa07f896e6dcfa7e4346384406ccb8ea899e7fc4e273ff07bda3722a
Python
26,306
601
"""Assortment of CNN (and GNN) architectures for tracking single cells""" import ast import math import numpy as np import tensorflow as tf from tensorflow.keras import backend as K from tensorflow.keras import Model from tensorflow.keras.models import Sequential from tensorflow.keras.layers import TimeDistributed,...
890dbab84c656f358e4cd2a80fd169fb121e5f6d8a926fd54f53538413e3aa04
Python
26,325
669
""" viz/tsne_fingerprint.py — Fig 5-1: t-SNE of Static Fingerprints ================================================================ t-SNE visualisation of 10-dim static fingerprints coloured by: - missingness mechanism (MCAR / MNAR / real) - source (eICU / synthetic / FAHZU) """ from __future__ import annotations fr...
a028bc015bc1aafaf50c570ea9a6ff93d910b390f61d523421cc84d7f5b5d16d
Python
26,326
635
# -*- coding: utf-8 -*- """ ------------------------------------------------------------------------------- NeuroBED_ML Visualization — Resting-State Correlations ------------------------------------------------------------------------------- Adds easy contrasts like: "BN<BED", "BN>CON_BN", "Patie...
d2601ee6bbf9806061549ff8250e2ca0025e99f58cc043f4557ef606264624bd
Python
26,382
792
import logging import os from datetime import datetime from functools import wraps from flask import ( Flask, flash, jsonify, redirect, render_template, request, session, url_for, ) from flask_ldap3_login import AuthenticationResponseStatus, LDAP3LoginManager from flask_sqlalchemy impor...
1bafb2cddfbf3b001a0c46dc7bce024db1b3f4ffb65d9c206425cbac96aad5cd
Python
26,393
756
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ STREAMLIT_Analysis_Graph.py Statistical Evaluation and Visualization Module This standalone Streamlit application is designed to analyze the quantitative data (CSV files) exported from the main Confocal Analysis Pipeline. Key Functionalities: 1. **Data Aggregation...
a1f74c2b44e958e66350d8343a1fb86c12bffa795fc17776837ed83b786d65ad
Python
26,451
688
#!/usr/bin/env python3 import os, sys, re import logging import argparse import subprocess import gzip import multiprocessing import time import numpy as np import traceback ## Set up the logging logging.basicConfig(format='\n %(levelname)s : %(message)s', level=logging.INFO) logger = logging.getLogger(__name__) ...
6223f467784dc2bc18661a685ecfda3487d957960b8805c23de55fbf2451fa8f
Python
26,456
696
import base64 import dataclasses import errno import io import logging import os import re import shutil import subprocess import sys import time import traceback import uuid from pathlib import Path from typing import Optional, cast import jinja2 from multiqc import config, report from multiqc.base_module import Sec...
da781dda0f7fd2dfbeaa7fa775785825e1c76af9887489f2583b7ba798cda4b4
Python
26,458
716
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ STREAMLIT_SaveManager.py This module handles the export and saving functionality of the pipeline. It manages: 1. Data conversion (normalization, RGB composition). 2. File writing (NPY for raw data, PNG/TIFF for visualization). 3. Directory structure organization for ...
26c2916202e48240d5d6bb19f520a444e6c08c522c5caf86ff8c7de2caed88c0
Python
26,533
686
# 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/esm_features_gin_lr_1e-4_checkpoint_inference_output", "w") import dgl import dgl.function as...