sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
5897277c2e959681d88004015143a2985e5804609133b5a0d90ba11e725ce10d | Python | 8,222 | 257 | """Storage for parameter sweeps."""
from __future__ import annotations
from dataclasses import astuple, dataclass, fields
from enum import Enum
from typing import TYPE_CHECKING, Any, Protocol, runtime_checkable
import pandas as pd
from mesa.experimental.scenarios.exceptions import (
ScenarioAbortedException,
... |
557522968fda2dfdb8d5e1385bfb82d51971baf9cd847b0b15317934eee42287 | Python | 8,227 | 232 | import navis
import numpy as np
import pytest
from navis.data.load_data import SOMA_POS
# Ground-truth soma positions are in 8 nm voxel units; a soma here is ~250 vox
# in radius, so 300 is a meaningful tolerance (roughly one soma radius).
SOMA_ATOL = 300
@pytest.fixture
def meshes():
return navis.example_neu... |
c26cae66e74acecffec424a9b54027eb61beca8911cdf3cb3aff815f59d86da5 | Python | 8,229 | 271 | # -*- coding: utf-8 -*-
"""
Created on Wed Jan 10 13:05:16 2024
@author: Tony Kelly
"""
import pdb
import sys
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import os
import glob
### update DSC properties list after addition of manual DSCs
def update_DSCs(Branch):
... |
f37fc2ebdbdc9cf9ae80fc9425b7f96d054dbb1309ca3805b349b3c02f92479c | Python | 8,233 | 223 | #!/usr/bin/env python3
#python pepSearch.py "Z:/Download/casanovo_20251104183757.mztab" "L:/promec/FastaDB/UP000000589_10090.fasta" "L:/promec/FastaDB/uniprot-human-iso-jan24.fasta" --mztab --out results_peptide_matches.mztab.csv
import argparse
import re
from pathlib import Path
from typing import List, Tuple, Option... |
03785c48e0c5f9f4bc8eb67a8e7d0b445764ccbe8e8c163231cfbe8eac2f752e | Python | 8,235 | 275 | import numpy as np
import xarray as xr
import matplotlib
import matplotlib.pyplot as plt
from pathlib import Path
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import xarray as xr
from ..dataset import get_range_mask_from_ds
from shared_src.figure.trajectory import plot_... |
04f23033394f7ef4f0b210824f271ba4abde2fd1b57f58ad09609224180452dc | Python | 8,235 | 224 | from __future__ import print_function
import sys
from collections import namedtuple
import itertools
import re
WORD_RE = re.compile("(?<!-NONE-) ([^ \)]+)\)")
CONLLX_WORD = 1
CONLLX_MISC = -1
Word = namedtuple('Word', 'story_id word_id content'.split())
WordPart = namedtuple('WordPart', 'story_id word_id part_id con... |
89b4dfe393f5c5d61b026931d886f4be2d7e8622d315b7a3c2a4fa385b9ab914 | Python | 8,243 | 216 | #!/usr/bin/env python
#
# Copyright (c) 2022 10X Genomics, Inc. All rights reserved.
#
"""Calculate antigen specificity for Beam runs."""
from __future__ import annotations
import json
import os
from typing import TYPE_CHECKING
import martian
import cellranger.matrix as cr_matrix
import cellranger.rna.library as rn... |
cfda766cb68f5e1cc3c61e7f9ccd1a5c5d00b9bd5e222e841a74c63adfd87a50 | Python | 8,259 | 216 | #!/usr/bin/env python
"""Predict NF properties for a set of molecules using trained model bundles.
Two modes:
* **ensemble** — run one trained run directory over a SMILES source and write
per-molecule predictions, with ensemble uncertainty and optional
applicability-domain flagging.
* **pipeline** — the classify-... |
2c8578c9a9db9b60c8182a462c8933fb698a2f08817b11b88e801a4efc5b6f6d | Python | 8,260 | 206 | # Copyright (c) Facebook, Inc. and its affiliates.
# pyre-unsafe
from typing import Any, Dict, List, Tuple
import torch
from torch.nn import functional as F
from detectron2.structures import BoxMode, Instances
from densepose.converters import ToChartResultConverter
from densepose.converters.base import IntTupleBox,... |
c4728b331b659632c0d7e5a2d65b670c4f34964e0af6ac72d261de78f07115cf | Python | 8,264 | 165 | """What the CLI accepts as a run: which FASTQs belong to a sample, and which references resolve.
Everything here runs before Snakemake starts, and a mistake at this point silently maps the
wrong reads, so each case is checked on the resolved sample sheet the workflow actually reads.
"""
import argparse
import sys
impo... |
2425dd03519077e55a2834f58f9ea9605fe79dec783621c65d81bec044b65bc4 | Python | 8,267 | 206 | from itertools import chain
import numpy as np
import openmm
from gufe import LigandAtomMapping, ProteinComponent, SolventComponent
from openff.units.openmm import ensure_quantity, from_openmm, to_openmm
from openmm import app, unit
from openmmforcefields.generators import SystemGenerator
from openfe.protocols.openmm... |
ba12d83fabbe9a324e7ccfeff57c299f1f8908f43d38700e81369dbdd9c6e123 | Python | 8,278 | 219 | #!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
import glob
import os
import shutil
from os import path
from setuptools import find_packages, setup
from typing import List
import torch
from torch.utils.cpp_extension import CUDA_HOME, CppExtension, CUDAExtension
torch_ver = [int(x) for x in to... |
8988126348ee0821f184b04f92318f658b2aa5621157ac32f6b895e828092304 | Python | 8,280 | 252 | from functools import partial
import logging
import multiprocessing as mp
import os
import pandas as pd
from pathlib import Path
import re
from tqdm import tqdm
from typing import Optional
logger = logging.getLogger("imbalanced_interpolation_ds")
def filter_seqs(
recs: pd.DataFrame,
min_len: Optional[float]... |
443741aed64034afb9f24b3922a4a9de8912908580bc31218915b2c3ffa88bd4 | Python | 8,284 | 191 | from typing import Union, Tuple, List
from batchgeneratorsv2.helpers.scalar_type import RandomScalar
from batchgeneratorsv2.transforms.base.basic_transform import BasicTransform
from batchgeneratorsv2.transforms.intensity.brightness import MultiplicativeBrightnessTransform
from batchgeneratorsv2.transforms.intensity.c... |
4e4fa7e9b4280dcf65fd2b63e1d2051cee0168af58efad6f5061b8abcc789fab | Python | 8,287 | 231 | import numpy as np
import torch
import logging
import os
import urllib
from os.path import join as join
import urllib.request
from qm9.data.prepare.process import process_xyz_files, process_xyz_gdb9
from qm9.data.prepare.utils import download_data, is_int, cleanup_file
def download_dataset_qm9(datadir, dataname, s... |
b15ac7d570b6c3a3aee8fc3687f4495dae505a37e9a3782fc2b6088c8a5f0cec | Python | 8,287 | 249 | import anndata as ad
import numpy as np
import pandas as pd
import scanpy as sc
import scipy.stats
import torch
from torch.utils.data import Dataset, DataLoader, TensorDataset
import random
from sklearn.preprocessing import LabelEncoder
import scipy
import gc
import os
def setup_seed(seed):
"""
Set random ... |
5f97b55c959e7517988bfc4fb9aa23eee7f241773e261292657b8128fd5ca82e | Python | 8,291 | 193 | ############################################################################
# Copyright (c) 2022-2026 University of Helsinki
# Copyright (c) 2019-2022 Saint Petersburg State University
# # All Rights Reserved
# See file LICENSE for details.
############################################################################
... |
aab9844d520d5dd058f5ec75b2bc0d0a7370c3ea6d77cd9c55e5830e8b0a3c87 | Python | 8,292 | 141 | import os
import time
import h5py
import numpy as np
import os
import csv
from utils2 import transform_coronal, transform_axial, get_thick_slices, load_image_masked, volshow, extract_bbox, get_splits, is_idx_within_split, get_new_fname
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
# Class to... |
3eb76572fb452de5a368a0677ba2d0220b596c7c671aae6b7df20b6aa3285079 | Python | 8,294 | 141 | import os
import time
import h5py
import numpy as np
import os
import csv
from utils2 import transform_coronal, transform_axial, get_thick_slices, load_image_masked, volshow, extract_bbox, get_splits, is_idx_within_split, get_new_fname
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
# Class to... |
1e5b210dd33fd9b4d16879220524d744f364fa291f311f26b5edb4eeb40d3a1a | Python | 8,296 | 141 | import os
import time
import h5py
import numpy as np
import os
import csv
from utils2 import transform_coronal, transform_axial, get_thick_slices, load_image_masked, volshow, extract_bbox, get_splits, is_idx_within_split, get_new_fname
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
# Class to... |
33ba76f003a32b7daab6c6fe5747691e6a74b33805884f4abe993dae72ea265e | Python | 8,296 | 228 | import sys
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
import logging
import multiprocessing as mp
import os
import pandas as pd
from pathlib import Path
import subprocess
from tqdm import tqdm
from typing import Optional
def setup_logger(logfile_path: str | Path) -> logging.Log... |
675340a5d6bc8cb1e2e8f6bf84e477a2f36eb19fad13e1f3f4ce6d97b15360da | Python | 8,296 | 141 | import os
import time
import h5py
import numpy as np
import os
import csv
from utils2 import transform_coronal, transform_axial, get_thick_slices, load_image_masked, volshow, extract_bbox, get_splits, is_idx_within_split, get_new_fname
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
# Class to... |
eaf0e4c4974fd9542d86b3841c49585c686651c0acdf9ec71ba69af956f3b75b | Python | 8,298 | 141 | import os
import time
import h5py
import numpy as np
import os
import csv
from utils2 import transform_coronal, transform_axial, get_thick_slices, load_image_masked, volshow, extract_bbox, get_splits, is_idx_within_split, get_new_fname
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
# Class to... |
1ef1b6c4059a768f4ec9f8412d139be1bfd87f10aac055bdaa7f5bff12861d7e | Python | 8,299 | 141 | import os
import time
import h5py
import numpy as np
import os
import csv
from utils2 import transform_coronal, transform_axial, get_thick_slices, load_image_masked, volshow, extract_bbox, get_splits, is_idx_within_split, get_new_fname
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
# Class to... |
6ff745d27a4eb1f8b212d98a6289f3327b839f64c92f6c40e3a622404e8b43ba | Python | 8,300 | 141 | import os
import time
import h5py
import numpy as np
import os
import csv
from utils2 import transform_coronal, transform_axial, get_thick_slices, load_image_masked, volshow, extract_bbox, get_splits, is_idx_within_split, get_new_fname
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
# Class to... |
4b436993acc09cbe08746bef756278d096ce7c1b3e92f02a68fe9ab3e7c5f351 | Python | 8,302 | 230 | """
Control-group session response creation using the shared response classes.
Loads control data from condensed_trials.csv + analyzer_final.zarr,
then constructs the same SessionResponses → UnitResponse → StimConditionResponse
hierarchy used by the experimental pipeline.
Differences from experimental:
- No behaviora... |
aeabd37d8e1224dd8b0c492891e053f29f03af6e07712ed049d1090fdc43881b | Python | 8,302 | 141 | import os
import time
import h5py
import numpy as np
import os
import csv
from utils2 import transform_coronal, transform_axial, get_thick_slices, load_image_masked, volshow, extract_bbox, get_splits, is_idx_within_split, get_new_fname
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
# Class to... |
fcda5a599c4f033e1ebbba16fa9528e8590aee139aa0b2e5aecd7389582dc210 | Python | 8,302 | 141 | import os
import time
import h5py
import numpy as np
import os
import csv
from utils2 import transform_coronal, transform_axial, get_thick_slices, load_image_masked, volshow, extract_bbox, get_splits, is_idx_within_split, get_new_fname
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
# Class to... |
d8bfc6b00e9cef6c2eb2712b7fb10859e09403369be505e4dfa6a64b371f8a04 | Python | 8,303 | 141 | import os
import time
import h5py
import numpy as np
import os
import csv
from utils2 import transform_coronal, transform_axial, get_thick_slices, load_image_masked, volshow, extract_bbox, get_splits, is_idx_within_split, get_new_fname
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
# Class to... |
5ac49f96d87511e35b72ef6074e5b1ee31164a56f09615284401788c8c6cb63b | Python | 8,304 | 250 | import anndata as ad
import numpy as np
import pandas as pd
import scanpy as sc
import scipy.stats
import torch
from torch.utils.data import Dataset, DataLoader, TensorDataset
import random
from sklearn.preprocessing import LabelEncoder
import scipy
import gc
import os
def setup_seed(seed):
"""
Set random ... |
8423095254f911038ead25611b4ab719ed1ddc9f4ac3c8e1609d571b40bf37d8 | Python | 8,304 | 141 | import os
import time
import h5py
import numpy as np
import os
import csv
from utils2 import transform_coronal, transform_axial, get_thick_slices, load_image_masked, volshow, extract_bbox, get_splits, is_idx_within_split, get_new_fname
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
# Class to... |
052b930dd1cef0bef7297d8c2eb805227863e328b84faf9316929277f5a69bfd | Python | 8,306 | 141 | import os
import time
import h5py
import numpy as np
import os
import csv
from utils2 import transform_coronal, transform_axial, get_thick_slices, load_image_masked, volshow, extract_bbox, get_splits, is_idx_within_split, get_new_fname
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
# Class to... |
aac4f990ea5dd5cd11d61e8a45b2aff44d049fa64c69005f7a0145551b756984 | Python | 8,308 | 141 | import os
import time
import h5py
import numpy as np
import os
import csv
from utils2 import transform_coronal, transform_axial, get_thick_slices, load_image_masked, volshow, extract_bbox, get_splits, is_idx_within_split, get_new_fname
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
# Class to... |
e082661fa14c8d2fb764348fa23dbbebb2cc013afb4f859bd739a0405b691c00 | Python | 8,308 | 277 | import pytest
import torch
from chemprop.uncertainty.evaluator import (
CalibrationAreaEvaluator,
ExpectedNormalizedErrorEvaluator,
MulticlassConformalEvaluator,
MultilabelConformalEvaluator,
NLLClassEvaluator,
NLLMulticlassEvaluator,
NLLRegressionEvaluator,
RegressionConformalEvaluator... |
49b471fc52c17e5322b0a9a62acce2f1f7d9a8db2c6fc8706dd44d2ed640c697 | Python | 8,312 | 141 | import os
import time
import h5py
import numpy as np
import os
import csv
from utils2 import transform_coronal, transform_axial, get_thick_slices, load_image_masked, volshow, extract_bbox, get_splits, is_idx_within_split, get_new_fname
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
# Class to... |
f252dd8cb2d5d158a5fc8c119bdf66535a5204bcf6fd23dcd7830c6532ba8715 | Python | 8,312 | 141 | import os
import time
import h5py
import numpy as np
import os
import csv
from utils2 import transform_coronal, transform_axial, get_thick_slices, load_image_masked, volshow, extract_bbox, get_splits, is_idx_within_split, get_new_fname
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
# Class to... |
a5326674cd92927473ed103cebb5bb2901470528713e2c988e6a24d1ce2d74be | Python | 8,315 | 141 | import os
import time
import h5py
import numpy as np
import os
import csv
from utils2 import transform_coronal, transform_axial, get_thick_slices, load_image_masked, volshow, extract_bbox, get_splits, is_idx_within_split, get_new_fname
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
# Class to... |
6a516418537dd7a6586cf6f67d97d8a3fd65588908ef9898bea5014bf558f9fd | Python | 8,322 | 274 | """ Test plotting """
import pytest
import numpy as np
import vtk
try:
import panel as pn
except ImportError:
pn = None
try:
import IPython as ipy
except ImportError:
ipy = None
try:
import PyQt5 # noqa: F401
has_pyqt5 = True
except ImportError:
has_pyqt5 = False
from brainspace.vt... |
dfaeac0f4e8a6ea25b4125ce6a4b9a1261e0a5d9b62c7333815add23e38ffd4d | Python | 8,322 | 209 | """
Normalizing Neurons
===================
<!-- difficulty: intermediate -->
Bring neurons into a canonical pose for machine-learning models.
{{ navis }} ships a small `navis.ml` module with helpers for preparing neurons as
model inputs. This first tutorial covers **normalization**; the
[sampling](tutorial_ml_01_sam... |
8c12f91729e36703e8c157a188cbc9f896046a17ce6517d4b5ac03f34cec6271 | Python | 8,325 | 191 | """
loaders/mcs_loader.py
---------------------
Loader for Multi Channel Systems (MCS) HDF5 files produced by
Multi Channel Experimenter / Multi Channel DataManager.
HDF5 structure (MCS HDF5 Protocol v3)
---------------------------------------
/ (root attrs)
McsHdf5ProtocolType – b'RawData'
McsHdf5ProtocolV... |
c8ac0403acb431ee1ecc8f7a0071f79bcf487e14e7936089ed770cd2c809a6eb | Python | 8,331 | 190 | # type: ignore
"""Verification tests for role ambiguity / resolution (`ambiguity.py`).
A symmetric synthetic fixture populates the ``l_*`` / ``h_*`` / ``b_*`` columns identically so
the derived quantities (distinct-label count, the three-way match category, the per-layer
divergence/match fraction and the high-F1 misma... |
bf50497e506262aa0262a43e5e4c47568ef7d8ff6a431b5a641eb7e9911321ca | Python | 8,334 | 246 | #!/usr/bin/env python3
"""
Axon density map generation from a full-resolution WSI binary mask.
Reads the binary mask produced by inference_wsi.py (wsi_axon_mask.npy, shape H × W,
uint8 with values 0 / 255) and computes density maps at three spatial resolutions:
70 µm → 256 px detection tiles
130 µm → 474 px dete... |
efc57e498b02317d0e154ecb4b6c4badd76e5b2a6975073c5113e079eafa432d | Python | 8,338 | 265 | """ Implementation of a new UNet-based deformation network.
"""
__author__ = "Fabi Bongratz"
__email__ = "fabi.bongratz@gmail.com"
from typing import Sequence
import torch
import torch.nn as nn
from torch.cuda.amp import autocast
from pytorch3d.structures import MeshesXD
import logger
from models.base_model import ... |
8e056d0cf82cb5120b1fc8e4989433b0f9532e0c0672dde06293c40eb6a9c581 | Python | 8,348 | 227 | """
phoptnn_interface.py — production wrapper for pHoptNN inference
Highlights
- Accepts a single .pdb file or a directory of .pdb files.
- Ensures PQR availability (pdb2pqr30 → pdb2pqr → ambpdb) and normalizes ATOM tokenization so your
PQR parser in utils.extract_pqr_data() reads chain/resid reliably.
- Forwards ar... |
8af9c75f1296146414797e6519a11cc52670dc6ea86702e90c3ce0e8290709ae | Python | 8,354 | 223 | # Copyright (c) Facebook, Inc. and its affiliates.
import json
import math
import numpy as np
import unittest
import torch
from detectron2.structures import Boxes, BoxMode, pairwise_ioa, pairwise_iou
from detectron2.utils.testing import reload_script_model
class TestBoxMode(unittest.TestCase):
def _convert_xy_to... |
65726f2f2b8bdd0dae66fd5ecde8ca25642e0b81ef4b5dde818b6bca2253fc07 | Python | 8,357 | 223 | """Tests for `scripts/gen_llms_txt.py`, which builds the llms.txt family.
The generator parses `docs/api.md` rather than re-deriving the API grouping, so
the failure mode to guard against is silent: reformat a table in api.md and the
parser quietly yields nothing, leaving a technically-valid but empty llms.txt.
Most o... |
6d4320fedf4b30caa6a7b0d13dfe7b522a045a4f4420ce763472a2237a8d4097 | Python | 8,370 | 246 | # This script is part of navis (http://www.github.com/navis-org/navis).
# Copyright (C) 2018 Philipp Schlegel
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of... |
829af9dc9099e8731ba1758347c1ca5da06602804a707133058e07ee61736806 | Python | 8,386 | 166 | # -*- coding: utf-8 -*-
"""
---Gathers everything together for candidate_mutation_table---
NOTE: Still reads in many *.mat files etc. Further purging of matlab necessary!
Output:
# path_candidate_mutation_table: where to write
# candidate_mutation_table.mat, ex. results/candidate_mutation_table.mat
---
# Inputs (change... |
f333ea43c3ecafc211c3cea961dab67bfadc8094eea4ef745edb7df368d2d0a0 | Python | 8,412 | 250 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
import argparse
import logging
import os
import sys
from timeit import default_timer as timer
from typing import Any, ClassVar, Dict, List
import torch
from detectron2.data.catalog import DatasetCatalog
from detectron2.utils.file_io import Path... |
84258dc549cdcaab2d955d804d8d25406b4b9c4f6cb6ac7d3e0ffbdda7002369 | Python | 8,417 | 212 | from __future__ import annotations
import argparse
from collections.abc import Iterable, Sequence
from pathlib import Path
from typing import Any
import attrs
import more_itertools as itx
from snakebids import bidsapp
from snakebids.bidsapp.args import ArgumentGroups
from snakebids.exceptions import ConfigError
from... |
4ffbaa69c36746a63d57842fa7a8339e795d55994732fc6a34cdab396f1955e9 | Python | 8,420 | 230 | # -*- coding: utf-8 -*-
"""
Figure 6: Disease analysis
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from netneurotools import datasets, stats, utils
from scipy.stats import zscore, pearsonr, ttest_ind
import seaborn as sns
from matplotlib.colors import ListedColormap
from scipy.spatial.di... |
c50dbd1504d13e20445b35b09ee47fe161e1be71a2601fa6aba49f0431bcfb64 | Python | 8,435 | 216 | # This script is part of navis (http://www.github.com/navis-org/navis).
# Copyright (C) 2018 Philipp Schlegel
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of... |
a5b962ad4daaaa6f399c0c85dae3326886c39190512aff477afb60d9479bc326 | Python | 8,437 | 231 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
# pyre-unsafe
import json
import numpy as np
from functools import lru_cache
from typing import Dict, List, Optional, Tuple
import cv2
import torch
from detectron2.utils.file_io import PathManager
from densepose.modeling import build_densepose_em... |
f03af8f61b8019708996536a568a2c8369f427af2a5f4f3bf84ddbf954f15898 | Python | 8,437 | 168 | #!/usr/bin/env python
# Copyright 2016-2024 Biomedical Imaging Group Rotterdam, Departments of
# Medical Informatics and Radiology, Erasmus MC, Rotterdam, The Netherlands
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obt... |
1da2f1101636fe98382f23263f26dc3a7e6a868a935fc55cc32194d82ee33c19 | Python | 8,444 | 245 | #@File(label="MtrackJ 'Points' table") table_file
#@File(label="Image", description="used to detect frame interval") image_file
#@String(label="Frame interval", choices={"From image","From input table","Default"}) frame_rate_detection
#@UIService uiservice
#@LogService lservice
'''
Tag_and_Onset_MtrackJ_paths.py
https... |
b3193a832b8be68cf7bcbe35f9e8525f3d48c6fd2328a7ead7f03c1c42c5dc6c | Python | 8,458 | 270 | #!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
import os
import tempfile
import unittest
import torch
from omegaconf import OmegaConf
from detectron2 import model_zoo
from detectron2.config import configurable, downgrade_config, get_cfg, upgrade_config
from detectron2.layers import ShapeSpe... |
97acf1fa36562c5c1305518bd273fe6c34dfcc8f9cd24134707d1c8d366eebcf | Python | 8,464 | 265 | """
Control Spike Sorting Pipeline - Stage 3 (Merge + Finalize)
============================================================
Run AFTER reviewing merge_candidates.pptx from stage2_curate.py
and editing merge_pairs in curation_config.json.
This stage:
1. Loads analyzer_curated.zarr (stage 2 output)
2. Reads merge_pairs ... |
8de51bac9c441f6941eec6201cfe8235920d7e69419803d0263a5228669b55ba | Python | 8,466 | 219 | # Copyright (c) Facebook, Inc. and its affiliates.
import unittest
import torch
from torch import Tensor
from detectron2.export.torchscript import patch_instances
from detectron2.structures import Boxes, Instances
from detectron2.utils.testing import convert_scripted_instances
class TestInstances(unittest.TestCase):... |
828939645bf0c3dfc2f898609d4646addd291ed0e4f93567448a6c2f9a54bf7e | Python | 8,492 | 196 | """Tests for `navis.align`: `align_rigid`'s `mirror_axis`, and that the transforms
each method hands back are the ones that actually moved the neurons."""
import navis
import numpy as np
import pytest
from scipy.spatial import cKDTree
from scipy.spatial.transform import Rotation
def _mirrored_copy(n, axis, angle=0.... |
7d97122db52c86e3049b45be6731ff474b5c9974481f4b8ecc87617ecd6c82d1 | Python | 8,504 | 254 | """
VTK read/write filters for FreeSurfer geometry files.
"""
# Author: Oualid Benkarim <oualid.benkarim@mcgill.ca>
# License: BSD 3 clause
import re
import numpy as np
from vtk import vtkPolyData
from vtk.util.vtkAlgorithm import VTKPythonAlgorithmBase
from ..checks import has_only_triangle
from ..decorators impo... |
d647c216bd008329307e4f24278bc4d84abc7c9017a08fcdc63478c7960d25fa | Python | 8,509 | 208 |
############################################################################
# Copyright (c) 2022-2026 University of Helsinki
# All Rights Reserved
# See file LICENSE for details.
############################################################################
# Usage: python3 isoquant_lib/quantifiaction_calibration.py -... |
6657e9d2e09f73408afc757f77adaf7dd428c0554c9de9d6fa9a647d2b05e34c | Python | 8,516 | 248 | import os
import torch
from torch import nn
import torch.nn.functional as F
import torch.distributions as dist
from torch.nn.parameter import Parameter
from torch.nn import init
import pytorch_lightning as pl
class LinearGELU(nn.Module):
def __init__(self, input_dim, output_dim):
super(LinearGELU, self)._... |
4831e30ef861e54af6b9dfb77c0cc332d523cf15189070320f2a734ca59acbe4 | Python | 8,517 | 239 | import numpy as np
karplus_dict = {("HA", "CA", "N", "C") : {"ALL" : ( 120.0, 3.72, -2.18, 1.28, 0.38)},
("HN", "N", "CA", "CB") : {"ALL" : ( 60.0, 3.51, -0.53, 0.14, 0.25)},
("HN", "N", "CA", "C") : {"ALL" : ( 180.0, 4.12, -1.10, 0.11, 0.31)},
("HN", "N", "... |
6ad4a03e6b370f29b8f1095a081df4ce40b85c8eaf8ca8449f38461d31d45745 | Python | 8,526 | 235 | ############################################################################
# Copyright (c) 2022-2026 University of Helsinki
# Copyright (c) 2019-2022 Saint Petersburg State University
# # All Rights Reserved
# See file LICENSE for details.
############################################################################
... |
440910d5d9abcb62d1db83d38eec5c9ac5a1c644570961767d967f9b1b79252e | Python | 8,530 | 133 | #python proteinGroupsTtestCombine.py L:\promec\TIMSTOF\LARS\2022\februar\Sigrid\combined\txtDQnoPHOS\reports\CTRL
import sys
#!pip3 install pathlib --user
from pathlib import Path
if len(sys.argv)!=2: sys.exit("\n\nREQUIRED: pandas, pathlib; tested with Python 3.9 \n\nUSAGE: python proteinGroupsTtestCombine.py <path to... |
012198f441427ef892da0b6efc5ea9fae8e414aefcc65504577b41c2afd3526e | Python | 8,531 | 261 | from inspect import isfunction
import math
import torch
import torch.nn.functional as F
from torch import nn, einsum
from einops import rearrange, repeat
from ldm.modules.diffusionmodules.util import checkpoint
def exists(val):
return val is not None
def uniq(arr):
return{el: True for el in arr}.keys()
d... |
b7a9b45b043b735682a1cbd7806d765e87630c54d151770844a0893da7f69005 | Python | 8,544 | 214 | """
Supplementary figure: average chromatin velocity of each peak cluster projected onto UMAP.
For each peak cluster (leiden), computes the mean dadt across peaks in that cluster
per cell, then visualizes the result on the cell-state UMAP.
This helps relate peak-level clusters to cell-state structure.
"""
import os
im... |
fdb24db2d2116e68ebb68456ac0b07dfb70c08730b7a7453f06e48cc0c74ffe2 | Python | 8,544 | 241 | #!/usr/bin/env python
#
# Copyright (c) 2022 10X Genomics, Inc. All rights reserved.
#
from __future__ import annotations
import os
import sys
from collections.abc import Iterable, Sequence
from typing import TYPE_CHECKING, ClassVar, NamedTuple, Protocol
import numpy as np
import cellranger.analysis.io as analysis_i... |
ff97960dad791ffcd73bcdb4f341b59b6a55ccea48e3a088ce02204aa4b09005 | Python | 8,548 | 228 | from typing import List
from pathlib import Path
from PIL import Image
import numpy as np
import pandas as pd
import torch
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms
from transformers import ViTFeatureExtractor, AutoTokenizer
mean = torch.tensor([0.485, 0.456, 0.406])[:,None,No... |
37b0c901a2192c95292561f28ba41885328fafb647e102621d1f9fc49bc1ef69 | Python | 8,550 | 203 | import os
import warnings
import nibabel as nib
import numpy as np
import pandas as pd
from .harmonizationApply import applyModelOne
def createMaskNIFTI(paths, threshold=0.0, output_path='thresholded_mask.nii.gz'):
"""
Creates a binary mask from a list of NIFTI images. Image intensities will be
averaged, t... |
ed016a9a9ca35ee446176e9c9e6f724eb07d7c1f08296640ec5d6a6cfaa714d1 | Python | 8,559 | 191 | """
module for saving and reloading opNMF and other variants
"""
import os
import sys
import getpass
import hdf5storage
import numpy as np
#default value for script name to be used for printing to console
script_name=os.path.basename(__file__)
username=str(getpass.getuser())
def get_output_directory(output_parent_di... |
22d5291222bfa456d449c8a498fa1cd863f4fac34da3b6df24c5bbe0dd2052fa | Python | 8,560 | 250 | #
# Copyright (c) 2023 10X Genomics, Inc. All rights reserved.
#
"""Convenience functions for oft used altair plots."""
import altair as alt
import numpy as np
import pandas as pd
from cellranger.altair_utils import chart_to_json
from cellranger.spatial.image import WebImage
# pylint: disable=too-many-locals
def m... |
337cf7d205ef1926fa377fa125083455006798d15777e728977f76d44ba76f0c | Python | 8,560 | 179 | # Copyright (c) Facebook, Inc. and its affiliates.
# pyre-unsafe
from typing import Any
import torch
from torch.nn import functional as F
from detectron2.config import CfgNode
from detectron2.layers import ConvTranspose2d
from ...structures import decorate_predictor_output_class_with_confidences
from ..confidence i... |
c8a803ecb7de22acbe96ebfe245435b10e75de669a0583ff3756bb39c37d6d6b | Python | 8,560 | 261 | # Copyright (c) Facebook, Inc. and its affiliates.
import atexit
import functools
import logging
import os
import sys
import time
from collections import Counter
import torch
from tabulate import tabulate
from termcolor import colored
from detectron2.utils.file_io import PathManager
__all__ = ["setup_logger", "log_fi... |
adca0bfa6646e9d3b7bcb5bdcd8fbe1758bd3ef8005642d85af2fa17a3144a3c | Python | 8,562 | 262 | """some summary"""
import os
from pathlib import Path
import random
import torch
import pandas as pd
import numpy as np
from eeg_visual_classification.utils.lib import (
create_parser,
extract_model_options,
get_dataloaders,
get_model_hash,
save_checkpoint,
load_checkpoint,
train_svm_rbf,
... |
f733e44e31b264a590f52a42fbb49299e9412cb1a534790c3779ed659c72a275 | Python | 8,566 | 199 | # Copyright (c) Facebook, Inc. and its affiliates.
import glob
import logging
import numpy as np
import os
import tempfile
from collections import OrderedDict
import torch
from PIL import Image
from detectron2.data import MetadataCatalog
from detectron2.utils import comm
from detectron2.utils.file_io import PathManage... |
1da0a4feb3a29577da3e7c8ca347171b7d8fdef330aa60f8980b525093a3dadc | Python | 8,568 | 215 | import numpy as np
import os
import time
from . import util
from . import html
import matplotlib.pyplot as plt
import math
# from IPython import embed
def zoom_to_res(img,res=256,order=0,axis=0):
# img 3xXxX
from scipy.ndimage import zoom
zoom_factor = res/img.shape[1]
if(axis==0):
return zoo... |
33fb044cd2226b9e656d8696803a6929a86df9c0fa5677f50455279010a7837b | Python | 8,568 | 232 | """
Figure 2: Introduction to the receptor data
"""
import matplotlib.pyplot as plt
import matplotlib.patches as patches
from matplotlib.colors import ListedColormap
import seaborn as sns
import numpy as np
from netneurotools import datasets, stats, plotting
from scipy.stats import zscore, pearsonr, f_oneway
from scip... |
155b735b516ef256ffcc96c534fd732db757b1bff563070029c34ef5ba5ce8d2 | Python | 8,571 | 318 | import numpy as np
def euclidean_distance(
point1: tuple,
point2: tuple
) -> float:
"""
Compute the Euclidean distance between two points.
Parameters
----------
point1 : tuple
The (x, y, z) coordinates of the first point.
point2 : tuple
The (x, y, z) coordinate... |
7e44d308e0c1c33129df509f60c019b8724e77d84635ed55c6eed7b7105f8618 | Python | 8,576 | 300 | """
Decorators for wrapping/unwrapping vtk objects passed/returned by a function.
"""
# Author: Oualid Benkarim <oualid.benkarim@mcgill.ca>
# License: BSD 3 clause
import inspect
import functools
from .wrappers.base import (wrap_vtk, _wrap_input_data, _wrap_output_data,
_unwrap_input_dat... |
7b71577e44b7fa32aacc3c09f9efe813694ee25d9f6a32f479fc5c416013518c | Python | 8,582 | 228 | from __future__ import annotations
import os
import re
import shutil
import tempfile
import uuid
from dataclasses import dataclass, field
from pathlib import Path
from typing import Any
from rdkit import Chem
from src.export.pdbqt_writer import PDBQTExportError, PDBQTWriter
from src.protonation.openbabel_adapter imp... |
6bd98b610a1daaecb8fa3033bef9dd986779cfedc9a622d3e2d368e9ae51cc84 | Python | 8,585 | 203 | # -*- coding: utf-8 -*-
"""
Created on Tue Apr 9 19:29:19 2024
@author: JTliu
"""
import os
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import sys
import joblib
sys.path.append('C:\\Users\\JTliu\\Desktop\\DiffusionOT-main\\')
from utility import *
args = create_args()
if __n... |
e8d656bf0d75254c4695588d1d9e4077bf6bf6fc6fa06bc5f81d4d408167739c | Python | 8,595 | 301 | import math
from mesa.discrete_space import CellAgent
# Helper function
def get_distance(cell_1, cell_2):
"""
Calculate the Euclidean distance between two positions
used in trade.move()
"""
x1, y1 = cell_1.coordinate
x2, y2 = cell_2.coordinate
dx = x1 - x2
dy = y1 - y2
return ma... |
93106220e232bb20b9048be6512a3a0913a1ec781dad3e16e055cab4f6171d7f | Python | 8,598 | 154 | ############################################################################
# Copyright (c) 2022-2026 University of Helsinki
# Copyright (c) 2020-2022 Saint Petersburg State University
# # All Rights Reserved
# See file LICENSE for details.
############################################################################
... |
16ec2c0bdb570a7580ae1215d2e5c42b4f173bd980d27b811d7f11c22f7d3e6f | Python | 8,604 | 200 | #!/usr/bin/env python
#
# Copyright (c) 2018 10x Genomics, Inc. All rights reserved.
#
"""Library functions for performing batch correction."""
from __future__ import annotations
import struct
from collections import Counter
import numpy as np
import sklearn.neighbors as sk_neighbors
from sklearn.metrics.pairwise i... |
42ed5eeb1794459c1b0fd88393277b7820babab8ae48d09aff619079aca88f7b | Python | 8,609 | 197 | import argparse
import multiprocessing
import os
from time import sleep
from typing import Union
import numpy as np
import torch
from batchgenerators.dataloading.multi_threaded_augmenter import MultiThreadedAugmenter
from batchgenerators.utilities.file_and_folder_operations import load_json, save_pickle, join, maybe_m... |
0e5aa633e85905a2e1e338c2fe6aa7cabec07567ed22739e2024f85262816dce | Python | 8,613 | 235 | # Copyright (c) Facebook, Inc. and its affiliates.
import datetime
import logging
import time
from collections import OrderedDict, abc
from contextlib import ExitStack, contextmanager
from typing import List, Union
import torch
from torch import nn
from detectron2.utils.comm import get_world_size, is_main_process
from... |
a9e14afc8f5a2d469aa3f91cba5b6624736acd6c73c9a405f8efab4eb58428a0 | Python | 8,624 | 209 | # -*- coding: utf-8 -*-
"""
Created on Wed Jan 10 14:10:17 2024
@author: Ehsan.Sayyah
"""
import os
import glob
import shutil
import pandas as pd
import subprocess
import sys
import runpy
import re
import numpy as np
nri_path= 'path to wt folder/wt/'
# import convert_dataset as cd
path= 'path to p... |
d58ad9a0eba7bf2e05eafb3e075b4e64a39011db7b6c09317f29f352a7117da2 | Python | 8,627 | 210 | # @Integer(label="First channel (Ch1)", description="Target channel of first detector",min=1,max=10,style="scroll bar",value="1") channel_1
# @String(label="Ch1 Detector", description="Detection algorithm", choices={"LoG", "DoG"}, style="radioButtonHorizontal") detector_ch1
# @Double(label="Ch1 Estimated spot size",des... |
cd782ddb77823c6996d3ff6fcc737946b64489f122e6e942c33698c5ea77ec93 | Python | 8,630 | 253 | from Bio import AlignIO
from glob import glob
from functools import partial
import logging
import multiprocessing as mp
import numpy as np
import os
import pandas as pd
from pathlib import Path
import traceback
from tqdm import tqdm
logger = logging.getLogger("imbalanced_interpolation_ds")
def read_genus_alignments... |
3b0da67e2e3235ee0a057950378bf93194628f666ea6b3624909f55cb308c5fa | Python | 8,633 | 228 | from __future__ import annotations
from dataclasses import dataclass, field
from typing import Any
import numpy as np
from sklearn.ensemble import RandomForestRegressor
from sklearn.model_selection import GroupKFold, ParameterGrid
from sklearn.svm import SVR
from xgboost import XGBRegressor
from metrics import weigh... |
01ee7d99088c32e9f62fe795f48f725377ea01ef1cf9bf5ddc7a607f70a1a43d | Python | 8,650 | 227 | # Copyright (c) Facebook, Inc. and its affiliates.
import itertools
import unittest
from contextlib import contextmanager
from copy import deepcopy
import torch
from detectron2.structures import BitMasks, Boxes, ImageList, Instances
from detectron2.utils.events import EventStorage
from detectron2.utils.testing impor... |
7dd3cfe72010d61a5957a895e0cd1cecaacf101b67b599171ea515586b043596 | Python | 8,653 | 208 | #!/usr/bin/env python3
#
# Copyright (c) 2024 10X Genomics, Inc. All rights reserved.
#
"""Helper statistical methods for cell calling."""
from __future__ import annotations
from typing import TYPE_CHECKING
import numpy as np
from scipy.special import gammaln
if TYPE_CHECKING:
from cellranger.matrix import Coun... |
9b1b6ed32e98ec0fdbb0ad2c768e2a3235d107aa1b4aab9cff5931c46df8dabb | Python | 8,654 | 225 | '''
Created on Jul 25, 2024
@author: voodoocode
'''
IN_PATH = "/mnt/data/Professional/LMU/data/Beta-prevalence/database3/original/beta_files/"
OUT_PATH = "/mnt/data/Professional/LMU/data/Beta-prevalence/database3/scrubbed/"
import neo.io
import os
import numpy as np
import scrubber.core
import csv
#==============... |
649fb907bd88e5cbd6bff0ea4f18d6fb19e803c57dfa725b1f31881a004c079f | Python | 8,663 | 323 | """
A union-find disjoint set data structure.
"""
# 2to3 sanity
from __future__ import (
absolute_import, division, print_function, unicode_literals,
)
# Third-party libraries
import numpy as np
class UnionFind(object):
"""Union-find disjoint sets datastructure.
Union-find is a data structure that mai... |
9da1eb5d339d0b293174ea03bd46a9dbe6a1a08014d11c59da56cb6dcf3fb4a8 | Python | 8,664 | 240 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import unittest
import torch
from detectron2.structures import Boxes, BoxMode, Instances
from densepose.modeling.losses.embed_utils import CseAnnotationsAccumulator
from densepose.structures import DensePoseDataRelative, DensePoseList
class Tes... |
59aa5f417721f02834f475cd71ff72b2d86f206208cb471c42e3aa3e37cb2ae8 | Python | 8,677 | 221 | ############################################################################
# Copyright (c) 2022-2026 University of Helsinki
# # All Rights Reserved
# See file LICENSE for details.
############################################################################
"""Shared polyA / TSS peak detection.
Single source of trut... |
6b82d3061d4c601da3d7e92f36b4c27c6efdcf08338ae3122b737370ee7dd1ef | Python | 8,692 | 273 | """Batching and suppression of signals for mesa signals.
This module provides context managers for controlling signal dispatch:
- batch(): Buffers signals and dispatches aggregated results on exit
- suppress(): Silently drops all signals during the context
Both batch() and suppress() are used as context managers wit... |
f6581a4c8fadb011169b1fa7953e7e66928c50f5e32fe7e7ca665c644ecd90b8 | Python | 8,693 | 266 | # Copyright (c) Facebook, Inc. and its affiliates.
# pyre-unsafe
import fvcore.nn.weight_init as weight_init
import torch
from torch import nn
from torch.nn import functional as F
from detectron2.config import CfgNode
from detectron2.layers import Conv2d
from .registry import ROI_DENSEPOSE_HEAD_REGISTRY
@ROI_DENS... |
6b540d250b8259b8ac0d6276ed92a19268a88e53f42f4f24a0eca497dd19c7d9 | Python | 8,696 | 204 | '''
code for entity classification task
'''
from __future__ import division
from __future__ import print_function
import time
import tensorflow as tf
from utils import *
from metrics import *
from models import AutoRGCN_Align
import random
import logging
import os
# os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
# os.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.