sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
418b322cbc04b108288af183d082158e8f469ae8be54c934976842d72e055d09
Python
30,074
775
"""MultiQC functions to plot a heatmap""" import logging import re from typing import Any, Dict, List, Mapping, Optional, Sequence, Tuple, Union, cast import numpy as np import plotly.graph_objects as go # type: ignore import polars as pl from pydantic import Field from multiqc import report from multiqc.core.plot_...
5a48eab6cffa01d6af801822e086949dbe09f709106f37db8681802e23d10c09
Python
30,109
863
import numpy as np #import torch import argparse import torch from sklearn.preprocessing import StandardScaler import sys from sklearn.metrics import r2_score, mean_squared_error import random import os from sklearn.model_selection import BaseCrossValidator from himalaya.ridge import GroupRidgeCV, RidgeCV, Ridge from h...
06c9d1fb36082e0a05cc9eb2ab84fc86dfe2d0fc303c6540c56c56695e5d7078
Python
30,137
781
# -*- coding: utf-8 -*- """ requests.sessions ~~~~~~~~~~~~~~~~~ This module provides a Session object to manage and persist settings across requests (cookies, auth, proxies). """ import os import sys import time from datetime import timedelta from collections import OrderedDict from .auth import _basic_auth_str from...
33d59c2f24d23e31454a28cdca004dbad31bb98466bd0e38c383ffaece7bfcc7
Python
30,166
525
import logging import traceback import numpy as np from PySide6.QtWidgets import QWidget, QHBoxLayout, QVBoxLayout, QDialog, QDialogButtonBox, \ QPushButton, QScrollArea, QFileDialog, QSplitter, QTableWidget, QTableWidgetItem,\ QProgressBar, QMessageBox from PySide6.QtCore import Qt, Signal from PySide6.QtGui ...
605ebad1a8fd53fc5be3c9bd69eef88fd7fd090fcd572fc481d11ec01c3cbd65
Python
30,176
843
# 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,...
863c73ce99c37acfb6ed1408154cb506acc7b8a37b7aa476a0d597d34ef61f67
Python
30,182
878
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_limiter import L...
0704f5ad26d9a0792f481500a5948b1ae885e61703ecca5568e2208f07f7715c
Python
30,198
743
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on 12/14/2021 Emission models class Author: dzhi, jdiedrichsen """ import numpy as np import torch as pt import pandas as pd from scipy import stats, special from torch import log, exp, sqrt from HierarchBayesParcel.model import Model import HierarchBayesParce...
9ba7a9c3bba617af6e014e666f217e8973812afef60d47992088900c98e44d87
Python
30,226
714
#!/usr/bin/env python # -*- coding: utf-8 -*- from typing import Any, Dict, List, Optional, Tuple, Union import dask.array as da import numpy as np import tifffile from fsspec.implementations.local import LocalFileSystem from ome_types import from_xml, to_xml from ome_types.model import OME, Channel, Image, Pixels, T...
c88539ed7a1d112a90a2a8cd7efcb32e150018039eea3df01ecf6ea63631c6ac
Python
30,251
835
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jan 6 18:29:48 2025 @author: saiful """ # import os # import shutil # # Source and destination directories # source_dir = "/data/saiful/ePPI/alphafold_eppi_embeddings/" # destination_dir = "/data/saiful/ePPI/alphafold_eppi_embeddings/All_ePPI_Alphafo...
b037a215cac96636b61c76d45d58a69f8b26aff7e04c653956a46efd23ddc3ae
Python
30,333
887
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe import gzip import os import pathlib import urllib.error import urllib.request from importlib import resources import gufe import mdtraj import numpy as np import openmm import pandas as pd ...
71f73ced867d3352b0b2daf0c3b7e7d7c0682e516b7370861029fc04b3fd6fd0
Python
30,475
793
# 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 _def...
fcaf4082437a79f3def9afb3819bab5f376ce4f042d02cc39328c0136a024054
Python
30,529
992
# -*- coding: utf-8 -*- """ requests.utils ~~~~~~~~~~~~~~ This module provides utility functions that are used within Requests that are also useful for external consumption. """ import codecs import contextlib import io import os import re import socket import struct import sys import tempfile import warnings import...
cda80d67d1c0d4aea25fb2283f2aed7dedac91fc61a5a3657933429eb660b01b
Python
30,575
644
#!/usr/bin/env python3 """ Step 1: 下载并准备各数据库 - OncoKB: 癌症基因临床分级 (需API Token) - CGC: Cancer Gene Census (需COSMIC账号) - DGIdb: 药物-基因互作 (需手动下载) - CIViC: 临床变异解读 (可自动下载) 运行方式: python scripts/01_download_databases.py python scripts/01_download_databases.py --skip_existing # 跳过已存在的文件 """ import os import sys import ...
80849a98abc43e960accba41094e39eb4ead8abeb2c9bcc3dc26101d6f8bbb8f
Python
30,648
882
# This code is part of kartograf and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/kartograf import copy import dill import inspect import numpy as np from enum import Enum from collections import OrderedDict from collections.abc import Iterator from rdkit import Chem from ...
71ceb0abfa2e5ec46915271705e0580ddb4d8fc45ea3a8539348b9050aea7502
Python
30,698
886
# Copyright (c) 2010-2017 Benjamin Peterson # # 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 the rights # to use, copy, modify, merge, publi...
afe2b507036c29120ddeab55555835e79d5128cf5b0b82ea7e536680fbe69065
Python
30,711
701
import json import os import logging from typing import Tuple from copy import deepcopy from aenum import Enum, unique from utils.data_structures.PatientParametersStructure import PatientParameters from utils.models_download import download_model from utils.software_config import SoftwareConfigResources from utils.dat...
033e7ba1e7edcae80e03a8eff91d7a398f3ce0aeac7e99be884279536b9eb8c6
Python
30,730
996
import base64 import json import os import re import tempfile import pytest import multiqc from multiqc import config, report from multiqc.base_module import ModuleNoSamplesFound from multiqc.core.file_search import file_search from multiqc.core.special_case_modules.custom_content import custom_module_classes from mu...
081b51177080f02cfb3ab03b50685c064d9ee4913509dba4215e5d8cc74994df
Python
30,755
713
#!/usr/bin/env python3 """ Analysis of chromatin states for specific genes in NSC and Neu samples (GFP condition) This script visualizes the chromatin states of genes from a provided list """ import os import sys import argparse import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as s...
e9a231417a9e6115f85a9ab58c4ef9ddb50c2db108010a23a35d504dc3c91625
Python
30,757
848
import os import pandas as pd import numpy as np import xgboost as xgb import sage import torch import torch.nn as nn import torch.optim as optim from pathlib import Path from datetime import datetime from copy import deepcopy from torch.utils.data import DataLoader, TensorDataset from boruta import BorutaPy from skle...
3fb3bd221f4ce0e890bfff33edec6ead5a38b4f149fcc24b68f469570fe54871
Python
30,818
892
import base64 import io import logging import multiprocessing as mp import os import shutil import threading import time import warnings from abc import ABC, abstractmethod from datetime import datetime from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer from multiprocessing import Pool from pathlib imp...
6c7029127f821c8ed6d1f8773d9590d0d393f922373230033d082c2c93a7f056
Python
30,837
860
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import, unicode_literals import sys, os, re, shlex, shutil, glob, subprocess, collections from os import path from datetime import datetime import numpy as np from scipy import interpolate import matplotlib as mpl fr...
d85e851fe05759414207588b2775dfb56278f5869f42afadd67858a2a69309f2
Python
30,858
890
import numpy as np from tqdm import tqdm import random from experiments import quick_plot from truesight import pd_utils from truesight.evaluation import evals from experiments.quick_calculate import mi_dirichlet_ci from refs import open_model_refs as r from refs.paper.animal_preference_numbers_refs import ( evalua...
7d9bf70133e320315649604d8ee5764de56aa06a504b64607a9a32ab8886d7d1
Python
30,962
880
""" Functions containing the core operations and logic of for image registration for `voxelmorph` written in PyTorch. """ # Core library imports import warnings from functools import partial from typing import Callable, List, Union, Sequence, Tuple, Literal, Optional # Third-party imports import numpy as np import to...
f62ddfb9abc5448040b851d92ea671a9ec33508fa9625af58da2c83dd804a09f
Python
30,990
586
import argparse import time import os, sys import os.path as osp from shutil import copy import copy as cp from tqdm import tqdm import pdb import numpy as np from functools import reduce from sklearn.metrics import roc_auc_score import scipy.sparse as ssp import torch from torch.nn import BCEWithLogitsLoss from torch...
82cf59f13cac2ed9de175ea2eb96d751391bcf034ee16a9b1db5ffa8a09bf57e
Python
31,016
748
#! python # -*- coding: utf-8 -*- import glob import logging import os import xml.etree.ElementTree as ET from collections import Counter from typing import Any, Dict, List, Optional, Tuple, Union import numpy as np import pandas as pd from gseapy.base import GSEAbase from gseapy.gse import Metric, fgsea_rs, gsea_rs...
0bd72752f61d233c0b9fff8ab5a6e4f5bf27f3bb9e405369f087d5dbe41f643a
Python
31,086
970
#!/usr/bin/env python # -*- coding: utf-8 -*- from abc import ABC, abstractmethod from pathlib import Path from typing import Any, Dict, List, Optional, Tuple, Union import dask.array as da import numpy as np import xarray as xr from fsspec.spec import AbstractFileSystem from ome_types import OME from .. import cons...
c7bebe4667ed0645239965a5bd1b50c0964e961c351f9bda65b1eac8247ca0e7
Python
31,231
623
import datetime import shutil import traceback import dateutil.tz from aenum import Enum, unique import logging import os from copy import deepcopy from typing import Union, Any import nibabel as nib from nibabel.processing import resample_to_output import numpy as np import json from pathlib import PurePath import re ...
e11e51f092460df4585abef2c0fa7dc007627d230b5eebbaf252f5033ef147a1
Python
31,231
583
# This script computes the psth given sample neural data. import argparse import os import scipy import numpy as np from pathlib import Path import math import matplotlib.pyplot as plt from scipy.ndimage import gaussian_filter1d import pickle as pkl from datetime import datetime import sys import matplotlib.transforms...
32d0929411f94ae12a87d07233803fa1959c6e928ab9b8dc916fb2aaed55f312
Python
31,250
895
from abc import abstractmethod import math import numpy as np import torch as th import torch.nn as nn import torch.nn.functional as F from .fp16_util import convert_module_to_f16, convert_module_to_f32 from .nn import ( checkpoint, conv_nd, linear, avg_pool_nd, zero_module, normalization, ...
5e24318238e1a26676c153c46e0cd8129bf0dd10e97f2f24d509cefc8e109d52
Python
31,255
844
from dgl import DGLGraph import dgl import dgl.function as fn import dgl.nn as dglnn import torch as th import torch.nn as nn import torch.nn.functional as F import numpy as np import tqdm import numpy as np import torch from dgl.data import DGLDataset from dgl.dataloading import ( as_edge_prediction_sampler, ...
171f5a55903ed4ecfb62ff48e3aa7a16e865d88ad49d78a46abb4b259e736f77
Python
31,270
578
import learn2learn as l2l import torch from torch_geometric import seed_everything from utilsfiletraining import * from architecturenn import GCN, AtomMessagePassing import os def main_maml_training_loop(maml, train_loader, meta_valid_loader, scalers, optimizer_maml, cond_names, criterion,...
6c47f886a990238148bfacf539e5811056fc6776d7e868416592f61facb8d8e1
Python
31,339
905
#!/usr/bin/env python3 """ Tests for adaptive stepping in optogenetic circuit optimization Tests: - Sequential strategy with adaptive stepping - Batch GPU strategy with adaptive stepping (if CUDA available) - Multiprocess CPU strategy with adaptive stepping - Comparison: fixed-dt vs adaptive-dt results - Performance b...
4a31530f31a70bbaa58c4033f1e72e22762b1a21d52156b98333e9601cc169cc
Python
31,440
870
# src/analysis/rsa.py """ RSA (Representational Similarity Analysis) module Complete pipeline for RSA analysis including: - Feature extraction (PyTorch) - Correlation computation - Multi-run analysis workflows - RSA visualization """ import numpy as np import torch import re from collections import defaultdict, Coun...
65a1d7b8a18cb31e323b098251603de73bf132478e696e4c2e97a1cb62968ba7
Python
31,468
729
"""Fully convolutional data generators. These data generators allow for training on augmented label masks (y) instead of single label for the whole image. """ import os import numpy as np from tensorflow.keras import backend as K from tensorflow.keras.preprocessing.image import array_to_img from tensorflow.keras.p...
a8e3ffb08ed62898494a38601eed998e955133b65444e8ded633ab30a25f31df
Python
31,490
1,142
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import annotations from typing import List, Optional, Tuple, Union import dask.array as da import numpy as np import pytest import xarray as xr from aicsimageio import AICSImage, dimensions, exceptions, types from aicsimageio.readers import ArrayLikeReade...
314d1218e441c0dd5fef87cc584b799cfb9c0136ee57439527c55d0bebac1be8
Python
31,535
863
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ EEG PREPROCESSING FOR DECODING This script implements the preprocessing of the EEG data for the decoding analysis. It downsamples the EEG data to 50hz to increase the computational efficiency. It epochs the data into 1380ms long epochs. Acknowledgement: This script i...
70be6df3a8b1db0bdfe0e2d3f73abd640799e10c779e1a148265df0ce7c42a34
Python
31,640
872
# 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,...
1e1fff94af392aa9c1d7c420c7caf19e69dd95beacb7f35d0a8b8b2517b574dc
Python
31,646
698
from typing import List, Tuple import numpy as np import pandas as pd from scipy.stats import linregress from src.load import load_files from src.utils import is_within_target_window, is_within_target_window_3D, make_df_structure, process_emg_data, process_eyemovement_data from src.metrics import spearman_correlation, ...
5d86078fdfa5f16bffcfe76df1e26682530c5d1af2d134e060a4b558e84cfcdd
Python
31,677
871
import torch import torch.nn as nn import copy import torch.nn.functional as F import ProtoCloud.glo as glo EPS = glo.get_value('EPS') LRP_FILTER_TOP_K = glo.get_value('LRP_FILTER_TOP_K') device = 'cuda' if torch.cuda.is_available() else 'cpu' num_workers = 4 if torch.cuda.is_available() else 0 ##################...
63f4986ddf121dca6034f7efde27d59e26658d8b3570b00595e0528b6fcedc26
Python
31,685
755
"""distutils.command.build_ext Implements the Distutils 'build_ext' command, for building extension modules (currently limited to C extensions, should accommodate C++ extensions ASAP).""" import contextlib import os import re import sys from distutils.core import Command from distutils.errors import * from distutils....
35eb976ab111992acf5bd595cb2b7e59de571d733dec2c1d0e65ca0256c0afbc
Python
31,750
1,079
import argparse as ap import os import sys from importlib.metadata import PackageNotFoundError, version try: __version__ = version("gseapy") except PackageNotFoundError: __version__ = "unknown" # ------------------------------------ # Main function # ------------------------------------ # there is a bug in ad...
223412c5084230fe6691d67dff91025cf1d3989f20caedd41d0978e3d15d3fab
Python
31,786
662
import logging import os import time import numpy as np from PySide6.QtWidgets import QLabel, QHBoxLayout, QVBoxLayout, QLineEdit, QPushButton, QProgressBar, QGroupBox, \ QFileDialog, QDialog, QComboBox, QMessageBox from PySide6.QtCore import Qt, QSize, Signal from PySide6.QtGui import QIcon, QPixmap from gui.Uti...
7459ab3ae9037a6d858a907dc30dff15e1c4dd5617badb04d6f78842a8591836
Python
31,825
806
# 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 openfe.protocols.openmm_rfe.hybridtop_units import ( HybridTopologyMultiStateSimulationUnit, ) from openff.units ...
043cfd61625dc51db35af1a8c184b191bdf13ea3839e3cfd4211eced4ddded73
Python
31,829
792
#!/usr/bin/env python3 """ Experiment 08 — Generate Paper Figures (19-method, v10 spec) ============================================================= Generates all manuscript figures from sweep + fingerprint + LOBDO data. Figures ------- Figure 2 : Winner map (miss x label, MCAR + MNAR) Figure 3 : t-SNE before/after...
0da1eefd597619a18f72a5f5310dc7658a74af7197b2089e220e783099ccde1d
Python
31,907
854
"""Methods to create geometries.""" import numpy as np from shapely import Geometry, GeometryType, lib from shapely._enum import ParamEnum from shapely._geometry_helpers import collections_1d, simple_geometries_1d from shapely.decorators import deprecate_positional from shapely.io import from_wkt __all__ = [ "bo...
58009f5d4fddbb082015653e12cbc1340cbdc1614c73ef09728f5e9b7acf9234
Python
31,935
775
from pathlib import Path from proteinbenchmark.analysis import ( align_trajectory, assign_dihedral_clusters, compute_chemical_shifts_sparta_plus, compute_fraction_helix, compute_h_bond_scalar_couplings, compute_noe_effective_distances, compute_residual_dipolar_couplings, compute_scalar_...
b98a7d975dc5d0b7249d2e9de0deb4cad88180598884a89d78eabd027b314dca
Python
31,944
863
# 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 abc import functools import itertools import re from ._compat impo...
754105576261a7260c1fe9aa0e653eb983f8fc054862a24d4070a7a05682f0b0
Python
31,978
871
"""Enumerate resonance forms of a molecule""" import copy import itertools import json from typing import Dict, Optional, List, Generator, Tuple, Any, Union import networkx as nx import numpy as np from openff.units import unit from openff.toolkit.topology import Molecule from openff.nagl.utils._types import Resona...
1e84e15c01e848327da308250e5ed1dab3bd906333fd7484581f1d104f1dd690
Python
31,991
663
"""@package forcebalance.objective ForceBalance objective function.""" from __future__ import division from builtins import range from builtins import object import sys import inspect #from implemented import Implemented_Targets import numpy as np from collections import defaultdict, OrderedDict import forcebalance f...
49708600a42ea9fc20c15469e535736caf9e8dfb4aaf695d0a791898b2e62c5d
Python
32,017
862
""" Effect Size Decision Framework for Nested Experiment Data Integrates bootstrap effect size analysis with power analysis, precision assessment, and biological significance to make data collection recommendations. This framework determines whether additional connectivity instances are needed for conclusive mechanis...
66bc8ec200aae27bef1b8fe51e3f7c2a562d52469b64ea5f1f87d1d1a4814401
Python
32,074
987
"""Analysis tools for KIMMDY runs. For command line usage, run `kimmdy-analysis -h`. """ import argparse import json import subprocess as sp import re from datetime import timedelta from pathlib import Path from typing import Optional, Union from collections import defaultdict import matplotlib.axis import matplotlib...
a1e56aab2a02713b93dfe25b0534b6333c9e93db18b502a89df235e30219b349
Python
32,084
939
import logging import pathlib from collections import defaultdict from collections.abc import Generator, Iterable from contextlib import contextmanager from typing import Self import numpy from numpy.typing import NDArray from openff.qcsubmit.results import OptimizationResultCollection from openff.toolkit import Molec...
67ffbf7cbb201036a288835203365e918799819d4c588b043f36b6f4cabeed5e
Python
32,137
765
import logging import os from typing import Union, Dict, Tuple, List import math import re from multiqc import config, BaseMultiqcModule from multiqc.modules.qualimap import parse_numerals, get_s_name, parse_version from multiqc.plots import linegraph from multiqc.utils.util_functions import update_dict log = loggin...
009dac263b14502ad75c6b9e1ccaa084c7ed74ce85893a1823bfdaa24ae7c76e
Python
32,179
941
import logging import pathlib from collections import defaultdict from collections.abc import Generator, Iterable from contextlib import contextmanager from typing import Literal, Self import numpy from numpy.typing import NDArray from openff.qcsubmit.results import OptimizationResultCollection from openff.toolkit imp...
45ac50f892b20aa2394019ba803bdba19d8aea38cb55dfa9c6ad24bd87f6f247
Python
32,208
864
# 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 abc import functools import itertools import re import warnings fr...
22bb1ac5eebeec34bf13370d8307c7cc57e1f68f87deb46a9719974f5ec95a47
Python
32,243
641
import logging import os from PySide6.QtWidgets import QLabel, QHBoxLayout, QVBoxLayout, QLineEdit, QListWidget, QListWidgetItem, QErrorMessage,\ QPushButton, QFileDialog, QSpacerItem, QComboBox, QStackedWidget, QWidget from PySide6.QtCore import Qt, QSize, Signal from PySide6.QtGui import QIcon, QPixmap import num...
f834a40568ee512cd258679027745638d7a7b66883e732fd79e9554a29d6e69f
Python
32,283
727
#!/usr/bin/env python """ @package npt 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 released u...
8c4acd012325920b3b32938cf557bf55d2c3272145c1e0232ee855bad673df75
Python
32,353
918
from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import text_type from pip._vendor.six.moves import http_client, urllib import codecs import re from io import BytesIO, StringIO from pip._vendor import webencodings from .constants import EOF, spaceCharacters, asciiLetters, asci...
cb59e494610dbd871db5d15fa5f3f71683c148b733eccfe86b2ef96ca77ffd7e
Python
32,375
811
#!/usr/bin/env python # ============================================================================= # MODULE DOCSTRING # ============================================================================= """ Provide cache classes to handle creation of OpenMM Context objects. """ # ====================================...
1c00c298444c1bbbff4893341d19136712f3a20eba8cad87083f6d732f31a2bd
Python
32,386
539
import numpy as np from trained_untrained_results_funcs import find_best_layer, elementwise_max, calculate_omega, load_perf, select_columns_with_lower_error from untrained_results_funcs import load_untrained_data from plotting_functions import plot_across_subjects, load_into_3d, save_nii, plot_2d_hist_scatter_updated f...
5288b1e184b0d99bfb146fc3ab544a12c384d4f35a86998ea93397c5593f9c18
Python
32,415
811
#!/usr/bin/env python # ============================================================================= # MODULE DOCSTRING # ============================================================================= """ Provide cache classes to handle creation of OpenMM Context objects. """ # ====================================...
a1c1df9933701f34c532141c32edcb312a292a316419c60ce4f690ed4dae6122
Python
32,432
941
#!/usr/bin/env python3 """ Web-based real-time plot that shows lick port and proximity port events over time. Uses Dash (built on Flask) and Plotly for interactive visualization. """ import dash from dash import dcc, html from dash.dependencies import Input, Output, State import plotly.graph_objects as go from datetim...
9047d16f72a801dd16baa3025a0e48db68d7b2ab1f90202b4a41257264394ec8
Python
32,447
973
import pandas as pd import numpy as np import os import matplotlib.pyplot as plt import seaborn as sns from scipy.spatial.distance import cdist from sklearn.metrics.pairwise import cosine_distances from sklearn.metrics import ( silhouette_score, davies_bouldin_score, adjusted_mutual_info_score, adjusted...
5b416cb2c164da6919f815fe110046b629997d59bb521db44dce21e39eed91da
Python
32,516
896
import torch import torch.nn as nn import copy import torch.nn.functional as F import ProtoCloud.glo as glo EPS = glo.get_value('EPS') LRP_FILTER_TOP_K = glo.get_value('LRP_FILTER_TOP_K') device = 'cuda' if torch.cuda.is_available() else 'cpu' num_workers = 4 if torch.cuda.is_available() else 0 ##################...
210b21ae81cb40135e98f04342d61007da7e8e9546ef0e6d2157278ce07d4532
Python
32,566
821
#!/usr/bin/env python # -*- coding: utf-8 -*- # see: http://amp.pharm.mssm.edu/Enrichr/help#api for API docs import io import json import logging import os from typing import Any, Dict, Iterable, List, Optional, Set, Tuple, Union import numpy as np import pandas as pd import requests from gseapy.biomart import Biomar...
dd7a43544c04a8da8454a780600fabdcf0e52f97ae8fc84bdd1220a4796f586f
Python
32,589
1,121
from enum import IntEnum import numpy as np from shapely import _geometry_helpers, lib from shapely._enum import ParamEnum from shapely.decorators import ( deprecate_positional, requires_geos, ) __all__ = [ "GeometryType", "force_2d", "force_3d", "get_coordinate_dimension", "get_dimension...
97ecd68de392b7182559417ae28f90f5351e303a2c89f937d4aadf5a0b806a0d
Python
32,619
903
""" Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. """ import os import time from io import StringIO import numpy as np from numba import vectorize from scipy import io from tqdm import tqdm from facemap import pupil, running, utils def binned_inds(Ly, Lx, sbin): L...
f8d94056b50e64e5b2c23a194710c8ff87b3c0a5b1ac48849e0f102126523188
Python
32,620
800
import numpy as np import torch from torch import nn import torch.nn.functional as F from torch.utils.data import Sampler from sklearn.metrics import r2_score, mean_squared_error, mean_absolute_error, mean_absolute_percentage_error from sklearn.preprocessing import RobustScaler, MinMaxScaler, StandardScaler, LabelEncod...
d5125ad002f98cc8eb2ad6203b379f8dee4f07f4c140b219b6074687b7df98ef
Python
32,644
662
""" Théo Gauvrit 18/01/2024 New inferno traces colored heatmaps """ import os import matplotlib import numpy as np from scipy.cluster.hierarchy import dendrogram, linkage from mpl_toolkits.axes_grid1 import make_axes_locatable from percephone.core.recording import RecordingAmplDet from percephone.analysis.utils impor...
14a7ae9bdeeea9c77cf105411d06f90a491d4742b3b0db28052c8e07b95012f7
Python
32,837
867
from typing import Any, Iterable, Mapping, Sequence, Tuple, Union, Optional, Callable, Literal, List import torch import torch.nn as nn import torch.nn.functional as F from torch.distributions import Distribution, Gamma, Poisson import numpy as np import pandas as pd import ProtoCloud.glo as glo glo.set_value...
c8f025c0be96d023a3e0a65609e703014986e23bb9f6a60f8791489447e82236
Python
32,878
629
from collections import defaultdict import argparse from functools import partial import json import math import os import time import gc from feabas import config, logging, storage from feabas.concurrent import submit_to_workers import feabas.constant as const os.environ["OPENCV_IO_MAX_IMAGE_PIXELS"] = str(pow(2,40)...
c051e1ab829a000ad5e74cb3dc357c9fa3d1e6982dbb2f1e3af223d52d094b10
Python
32,986
904
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ STREAMLIT_Segmentation.py This module handles the segmentation of cells using Cellpose. It includes logic for: 1. Running Cellpose in 2.5D (slice-by-slice with Z-consistency checks). 2. Filtering masks based on morphology, intensity, and location (border exclusion). ...
2cbf034175673a19591a26845a49443845924bcf16a812f4e7cf5275427eea13
Python
33,003
894
""" @package forcebalance.evaluator A target which employs the OpenFF Evaluator framework to compute condensed phase physical properties. Currently only force fields in the OpenFF SMIRNOFF format are supported. author Yudong Qiu, Simon Boothroyd, Lee-Ping Wang @date 06/2019 """ from __future__ import division, print_...
451da691a014d91103b63658de7472d288dc500fc17f42698d7f594f265451ae
Python
33,067
892
# The following comment should be removed at some point in the future. # mypy: strict-optional=False import logging import os import shutil import sys import uuid import zipfile from typing import Any, Dict, Iterable, List, Optional, Sequence, Union from pip._vendor import pkg_resources, six from pip._vendor.packagin...
d46169ce030e6847a2c311a689ee9f5a750106a9405b16414c363048c542353d
Python
33,138
881
#!/usr/bin/env python # -*- coding: utf-8 -*- import xml.etree.ElementTree as ET from copy import copy from math import floor from typing import Any, Dict, Hashable, List, Optional, Tuple, Union import dask.array as da import numpy as np import xarray as xr from dask import delayed from fsspec.spec import AbstractFil...
7b53720fe918fdd91feabf480ca2ce33fccf64477bcd702ef1d89ccba1407735
Python
33,220
954
"""Contains the Reaction Recipe, RecipeStep and RecipeCollection.""" from __future__ import annotations import ast import csv import logging from abc import ABC from copy import copy from dataclasses import dataclass from pathlib import Path from typing import TYPE_CHECKING, Callable, Generic, Optional, TypeVar from ...
6a2e351d61dcf9ab9841e18f957076d75f4a7b194d8af4d8feabfffd439c2103
Python
33,278
930
import logging import pathlib from collections.abc import Generator, Iterable from contextlib import contextmanager from typing import Self import numpy import pandas as pd from numpy.typing import NDArray from openff.qcsubmit.results import TorsionDriveResultCollection from openff.toolkit import Molecule from openff....
6cc811a6114c931f518c14a2d2f0811ab2024bdb6be67c3ba4f7a284f85e895d
Python
33,414
675
import argparse import itertools import math import warnings import h5py import numpy as np from joblib import Parallel, delayed from nilearn import datasets import os from glob import glob import pickle from nilearn.surface import surface from scipy.spatial.distance import cdist from tqdm import tqdm, trange from a...
22a754f3f391083db31965087ccc18def2598df0a44ef39301d888fc7ad35477
Python
33,461
984
# 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,...
cce6c301734ce4a0cf0bfc7efa949fa92f3f8c85c9c2b08e5a619837c0834c3c
Python
33,509
786
""" Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. """ import os import cv2 import numpy as np import pyqtgraph as pg try: import umap UMAP_INSTALLED = True except: UMAP_INSTALLED = False # todo: use opentsne for embedding TSNE_INSTALLED = True # import hd...
a73fcacf94412cefe0953befbb111822f7b8eab5907766fdaeab334a0043e458
Python
33,639
614
import logging import re import traceback from PySide6.QtWidgets import QWidget, QLabel, QHBoxLayout, QVBoxLayout, QGridLayout, QDialog, QDialogButtonBox,\ QComboBox, QPushButton, QScrollArea, QLineEdit, QFileDialog, QMessageBox, QProgressBar, QListView, \ QAbstractItemView, QTreeView, QFileSystemModel from Py...
84a52946647aa9fe942739085e2ac8c7325306ebaf445eab9ff599ec6b42b38a
Python
33,698
893
""" Hyperparameter tuning system for TimeFlies models. This module provides comprehensive hyperparameter optimization using: - Grid Search: Exhaustive search over parameter combinations - Random Search: Random sampling from parameter distributions - Bayesian Optimization: Smart optimization using Optuna Supports both...
c6dc3977c3a8848b08a5811afcec16d42b7c0b062552f25760c0c6e916831b31
Python
33,715
816
#!/usr/bin/env python3 """ dicom_to_nifti — convert GRE DICOM(s) into NIfTI files + a params.json. A standalone, self-contained converter. It depends only on numpy, nibabel, and pydicom — no project-local imports — and produces a generic output bundle (phase / magnitude NIfTIs + a `params.json`) that any downstream QS...
dc160926a1f4b03c0c8097fe348caf6c24426fd11bfd7884588de0dab5d2d202
Python
33,762
877
#!/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. # ------------------------------------------...
4f89e5c1f2f3c509f10e529fb6b3869da5b363f3d2ddbde6bfe6668b5b9645ea
Python
33,769
745
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2017 David Emms # # This program (OrthoFinder) is distributed under the terms of the GNU General Public License v3 # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as publish...
e4c0e0f3876adca3f94ab3340ec5b28227a8e262df6cb2a284439e76badc0a6a
Python
33,813
761
#!/usr/bin/env python3 """ Analysis of chromatin states for specific genes in NSC and Neu samples (GFP and M2 conditions) This script visualizes the chromatin states of genes from a provided list """ import os import sys import argparse import pandas as pd import numpy as np import matplotlib.pyplot as plt import seab...
0458bc358ebfa10e0570c49ce9ece1529c9172965018b443747b78776131945c
Python
33,873
735
#!/usr/bin/env python3 """ SAMMY-seq Mecp2 Target Comparison Heatmap Generator This script creates metaprofile heatmaps for Mecp2 target and non-target genes in NSC and NEU conditions, showing the log2 ratio of S2S/S3 across gene bodies (from -5kb to TSS to TES to +5kb). The heatmaps use a blue-white-red color scheme...
0288ec2a8fa015ce5d2315c34a52b1b687a1e8d5f7a554444648222ce99f26d6
Python
34,110
865
from dgl import DGLGraph import dgl import dgl.function as fn import dgl.nn as dglnn import torch as th import torch.nn as nn import torch.nn.functional as F import numpy as np import tqdm import numpy as np from dgl.data import DGLDataset from dgl.dataloading import ( as_edge_prediction_sampler, DataLoader, ...
f3a7f2543fb9e2895162976069f60eb21276113a8c30a788f8913852ee8d33a3
Python
34,111
866
from dgl import DGLGraph import dgl import dgl.function as fn import dgl.nn as dglnn import torch as th import torch.nn as nn import torch.nn.functional as F import numpy as np import tqdm import numpy as np from dgl.data import DGLDataset from dgl.dataloading import ( as_edge_prediction_sampler, DataLoader, ...
b406e1269bf17ecfc5b4f3983798cd47844968938675666795c562d6a50ea2e6
Python
34,160
917
import json import math import re import matplotlib.pyplot as plt import networkx as nx import numpy as np import pandas as pd import pytest from openff.units import unit import cinnabar from cinnabar import conversion, estimators, femap, stats def test_read_csv(example_csv): data = femap.read_csv(example_csv) ...
3e1e10159852390672ac0c6e6fd586dd0f944b2e8764b813d98c22ccbe274c88
Python
34,210
801
# Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import sys import math from tqdm import tqdm import random import numpy as np import scipy.sparse as ssp from scipy.sparse.csgraph import shorte...
7e721f51daedf405f2f51ab0ef41182ff3777e0e5df7bafb4e9e05c0ee12fd45
Python
34,210
899
# This code is part of kartograf and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/kartograf import copy import logging from collections import OrderedDict from collections.abc import Callable, Iterable, Iterator from enum import Enum import dill import numpy as np from gufe ...
de3abee0f9735c4164c736c76951da2282297aca3de01b2c3170be0b5b2fb068
Python
34,284
896
from collections import namedtuple import cv2 import importlib import json import os import numpy as np from scipy import sparse from scipy.ndimage import gaussian_filter1d, convolve, uniform_filter, distance_transform_edt import scipy.sparse.csgraph as csgraph from skimage.morphology import convex_hull_image from fe...
3041076b762a1bc89f0cf606d203b5d82d6d66ed88f87a86178942e7770714f8
Python
34,303
920
""" SecureTranport support for urllib3 via ctypes. This makes platform-native TLS available to urllib3 users on macOS without the use of a compiler. This is an important feature because the Python Package Index is moving to become a TLSv1.2-or-higher server, and the default OpenSSL that ships with macOS is not capable...
52491a56e535b5cf81298078d5d76cdf9b1a8aca13a5a609d980421591047e13
Python
34,373
956
# -*- coding: utf-8 -*- """ requests.models ~~~~~~~~~~~~~~~ This module contains the primary objects that power Requests. """ import datetime import sys # Import encoding now, to avoid implicit import later. # Implicit import within threads may cause LookupError when standard library is in a ZIP, # such as in Embed...
3273730fb934ad2738ba6744a2ede88634a52bfbd350200690e74feedec68a9c
Python
34,379
943
import logging import pathlib from collections.abc import Generator, Iterable from contextlib import contextmanager from typing import Literal, Self import numpy import pandas as pd from numpy.typing import NDArray from openff.qcsubmit.results import TorsionDriveResultCollection from openff.toolkit import Molecule fro...
eff0139c877990adecec00a48770faca0d720c868da43ca041fec71562098e94
Python
34,428
756
"""Main data preprocessing utilities for TimeFlies project.""" import logging from typing import Any import numpy as np import scanpy as sc from anndata import AnnData from scipy.sparse import issparse from sklearn.preprocessing import LabelEncoder, StandardScaler from tensorflow.keras.utils import to_categorical # ...
03d574bea9bdf8bb81fe8212fa5672954159a908445b429097083eaf956fdd3e
Python
34,494
916
""" Optimized Chromosome Dataset for Hi-Compass Training This module provides a PyTorch Dataset implementation for loading and processing Hi-C prediction training data with hierarchical directory structure. File Structure Expected: ATAC/ {cellline}~ATAC~{depth}/ {cellline}~ATAC~{depth}.bw ...
6083df1e94c8c57e717b35a60880286ff1838ad36ef6215cb4008ac96b85a436
Python
34,499
666
import argparse from functools import partial import json import os import time from feabas.concurrent import submit_to_workers from feabas import config, logging, storage def generate_stitched_mipmaps(img_dir, max_mip, **kwargs): min_mip = kwargs.pop('min_mip', 0) num_workers = kwargs.pop('num_workers', 1) ...
f0fa9fc78b2bd58e692dbcf8e90e3f17d86f5339ed6511e73e373c3cd5134cf3
Python
34,581
744
# coding=utf-8 import itertools import logging from collections import defaultdict from multiqc.base_module import BaseMultiqcModule from multiqc.plots import bargraph, table from .utils import Metric, exist_and_number, make_headers # Initialise the logger log = logging.getLogger(__name__) NAMESPACE = "Mapping" ...