sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
ff65ac6ce2638f8689408028376989231a837649b08790f5fac3f71568e38880 | Python | 57,189 | 1,443 | # -*- coding: utf-8 -*-
"""neu_resnet_multiclass
Automatically generated by Colab.
Original file is located at
https://colab.research.google.com/drive/1MAXIN23h0VhQ2p5uJVwxHzqS9nL3I1XL
Transfer-learning ResNet50 multiclass pipeline for microstructure image
classification, with stratified evaluation, rich misclas... |
77e6ad73e7f6a4499d455feaa488761831342fcd0507fa3ceb9acfd863303465 | Python | 57,780 | 1,249 | import logging
import re
from collections import defaultdict
from typing import Dict, List, Optional, Set, Tuple
import gffutils
import pysam
import mappy as mp
from intervaltree import IntervalTree
from .fusion_validator import FusionValidator
from isoquant_lib.fusion.genomic_interval_index import GenomicIntervalIndex... |
46d21f56fbb4e03d1f7b7e7f88c59fb63be7468929b2546fb36c9ee27395f5f9 | Python | 57,922 | 1,385 | #!/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... |
804d856f2b14ab23d20f876a0af4e5ec0e11db1753833382f91994805bec45e0 | Python | 57,926 | 1,863 | """ Created on Mon Aug 14 09:38:53 2023
@author: dcupolillo """
import math
import numpy as np
import matplotlib.path as mpath
from statistics import mode
from shapely.geometry import Polygon
from ROIpy.core.components import Roi
def make_roi(
class_instance: object,
input_data: list
) -> list:
... |
d50c56bf284c44b57779562a7b3739de3ff01d13fc836a91917cf2f220ce016b | Python | 57,938 | 1,626 | # 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... |
f0d4c2f34148b8e5ba40c3b585660d07821689d85ac9681e5ae53524d8715036 | Python | 59,007 | 1,722 | # ruff: noqa: PLR2004
from __future__ import annotations
import filecmp
import functools as ft
import itertools as it
import keyword
import logging
import os
import shutil
import sys
import tempfile
import warnings
from collections import defaultdict
from collections.abc import Iterable
from pathlib import Path, Posix... |
0f9ce40069f4f19fbfbbebda6cae0781392c70bfb89c6aaf8d5f922f06b729fe | Python | 59,085 | 1,648 | """ Created on Fri Mar 1 16:20:12 2024
@author: dcupolillo """
from __future__ import annotations
from pathlib import Path
import numpy as np
from functools import cache, cached_property
from spyne.core.imaging.imagingdataset import ImagingDataset
from spyne.core.spines.config import SpineDatasetConfig
from spyne... |
f760388b9e69a811acc964ae28927e2d4928ab7677c60240c8fe1af0b8c61452 | Python | 59,167 | 794 | #!/usr/bin/env python
# Copyright 2016-2023 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... |
70951692c42e6777b26d3e4016ab0c8b084a50d8dc4423cb6657b715b11ec305 | Python | 59,274 | 1,722 | """
copied from scvelo, modified scv.tl.velocity_graph
to incorporate tanh() transformation for delta and d
before calculating cosine similarity.
"""
import os
import numpy as np
from scipy.sparse import coo_matrix, issparse
from scvelo import logging as logg
from scvelo import settings
from scvelo.core import get_n_... |
dc2cdfe61b92ec13ebc0d020fb2337aa9c83626b3cb62b287f2aebb686bf43db | Python | 59,326 | 1,724 | """
copied from scvelo, modified scv.tl.velocity_graph
to incorporate tanh() transformation for delta and d
before calculating cosine similarity.
To Do: implement velocity_graph function by myself
"""
import os
import numpy as np
from scipy.sparse import coo_matrix, issparse
from scvelo import logging as logg
from s... |
79d3f46e818ac2d77643a24a2d4bd6c2d6193d73bf322ff6f3a1359d432453b2 | Python | 59,839 | 1,591 | """Code taken from Azimuth.
Module with inference tools using Azimuth Neural Network trained on
annotated panhuman scRNA-seq data.
"""
# pylint: disable = too-many-lines
import csv
import gc
import numpy as np
import onnxruntime as ort
from scipy.sparse import csr_matrix
from sklearn.preprocessing import LabelEncode... |
9b0ac5d579e27cd64945271f4dfc7e9725f58736cfc1aa33176c2c8e105fe113 | Python | 59,866 | 1,602 | """Tests for the prediction pipeline module."""
from unittest.mock import MagicMock, patch
import json
import tempfile
from pathlib import Path
import numpy as np
import pandas as pd
import pytest
import torch
import torch.nn as nn
from nfml.predict.inference import (
predict_ensemble,
predict_molecular_prop... |
d2254bbc0020e66fef9ae3b304571f50afc7f508dbea4f821940c9598b86a752 | Python | 60,016 | 1,585 | # 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... |
c2a87306222f16664703c4ec0fdef9d59b45b02530abc1ed7fc8ecef3f6edcd8 | Python | 60,751 | 1,419 | #!/usr/bin/env python
#
# Copyright (c) 2021 10X Genomics, Inc. All rights reserved.
#
#
"""Generalization of the `FeatuerAssigner` class.
Generalizes the code for assigning features to cells.
"""
from __future__ import annotations
import itertools
from collections import OrderedDict, defaultdict
import numpy as np
... |
f48e677ee9ec83584b6805e8630f155135bb08c2dd080fda79f96122380e8aaf | Python | 60,821 | 1,542 | """
Created on 18/11/2020
@author: Marc Schneider
AG Neuroimaging and Neuroengineering of Experimental Stroke
Department of Neurology, University Hospital Cologne
This script runs every needed script for all (pre-)processing and registration
steps. The data needs to be ordered like after Bruker2NIfTI conversion:
proj... |
e2a0b15007e23eefc339ce018f6424214e9c6d2ec951538828343a2cce798e73 | Python | 61,070 | 1,754 | """Tests for `navis.Voxels`.
`Voxels` stores its data in one of two backings, picked at construction and
reported by `._base_data_type`:
- "grid": a dense 3D array; values live in the array itself
- "voxels": a sparse (N, 3) array of integer coordinates, with the values held
separately in `._value... |
789f4d2969a90f41a4947941defd55a59830436764d963658612b6df4640f4d8 | Python | 61,272 | 1,412 |
# 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 o... |
1e4798a101fd999025c356f30dd3a5cda42e25d3b565f91abe77d8bd01030136 | Python | 61,370 | 808 | ############################################################################
# Copyright (c) 2025-2026 University of Helsinki
# All Rights Reserved
# See file LICENSE for details.
############################################################################
"""
Unit tests for barcode detector classes.
Each detector ha... |
3cdf1c4b0030d08c966284e2b107f93a1dddb6a5e19998b89f0a6ec35cda64cb | Python | 61,424 | 1,287 | """
mqrunDash.py — MaxQuant QC Dashboard
Run: python mqrunDash.py [path/to/mqrun.duckdb]
Default DB: L:/promec/TIMSTOF/QC/mqrun.duckdb
Deps: pip install dash plotly duckdb pandas numpy
"""
import sys, re, numpy as np
from datetime import datetime
import duckdb, pandas as pd
import plotly.graph_objects as go
from da... |
3983782fa69122f35d22818ab6048a363675a94325c8ee5069ca2b1f51e99aa8 | Python | 62,062 | 2,005 | """
Implementation of variogram-matching procedure.
"""
# Author: Joshua Burt <joshua.burt@yale.edu>
# License: BSD 3 clause
import numpy as np
import numpy.lib.format
from pathlib import Path
from sklearn.base import BaseEstimator
from sklearn.linear_model import LinearRegression
# ----------------------
# ------ ... |
bcb6f2bbc00814e932f9d25199132490b8cba4d6cca3d947b85ce14790ea9d29 | Python | 62,715 | 1,669 |
# Copyright 2019 Image Analysis Lab, German Center for Neurodegenerative Diseases (DZNE), Bonn
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-... |
08e8c913ed55d015936f744215315edd29c21f84a45b98dcea9bd1d540fee1cc | Python | 63,624 | 1,385 | from __future__ import print_function
import json, time, os, sys, glob
import shutil
import numpy as np
import torch
from torch import optim
from torch.utils.data import DataLoader
from torch.utils.data.dataset import random_split, Subset
import copy
import torch.nn as nn
import torch.nn.functional as F
import random
... |
c350e3202a7a67c3aef12e9206a744add442110ff8a4377c1f9640104b20a31f | Python | 64,695 | 1,099 | import inspect
import itertools
import warnings
import multiprocessing
import os
from copy import deepcopy
from queue import Queue
from threading import Thread
from time import sleep
from typing import Tuple, Union, List, Optional
import numpy as np
import torch
from acvl_utils.cropping_and_padding.padding import pad_... |
f05efaa5b14b33a3785a786130791c4c8a229a040714aead9296bd81aab37d91 | Python | 66,464 | 1,472 | from __future__ import annotations
from dataclasses import dataclass
from pathlib import Path
from PySide6.QtCore import QObject, Qt, QThread, Signal
from PySide6.QtGui import QFont
from PySide6.QtWidgets import (
QApplication,
QBoxLayout,
QCheckBox,
QComboBox,
QDoubleSpinBox,
QFileDialog,
... |
b30a5981c26d48ff44acd50c1fddeb6a525453bbba9eb158e91e5f392de07bc4 | Python | 66,625 | 1,781 | # 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... |
e5c085c54758952a13540fb69e9b7a6dccb46ae420c6bb2c589c51afab64013e | Python | 67,425 | 1,445 | """
wild mixture of
https://github.com/lucidrains/denoising-diffusion-pytorch/blob/7706bdfc6f527f58d33f84b7b522e61e6e3164b3/denoising_diffusion_pytorch/denoising_diffusion_pytorch.py
https://github.com/openai/improved-diffusion/blob/e94489283bb876ac1477d5dd7709bbbd2d9902ce/improved_diffusion/gaussian_diffusion.py
https... |
892d2cea11e2d7a23d0a87133a09d3894ce96f104537dbf36a07e9100461f7b0 | Python | 67,801 | 1,792 |
"""
Source-data script for the quantitative panels of Supplementary Fig. 9.
- Registration of channels and regions
- Match behaviour and ephys files
- NOE extraction and delta statistics
- HAB running band-coherence extraction and statistics
- HAB running power spectra
"""
import os
import re
imp... |
b029bdfa02960ce8a4ec9abda2ceee43a866a86f373c9690e84e6037b59eb79f | Python | 68,494 | 2,028 | # 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... |
3b2e0bc47ed54c540eb4f1b11874afbbaf38d86dc391b06393c45e4adea7ee5e | Python | 69,598 | 1,666 | # -*- coding: utf-8 -*-
"""
Created on Tue Jul 19 17:09:52 2022
@author: walte
"""
# Copyright 2019 Image Analysis Lab, German Center for Neurodegenerative Diseases (DZNE), Bonn
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Li... |
06955454ee0348afefbc94383b8af19051192f783129c367dacfe759254c870c | Python | 69,793 | 1,823 | # 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... |
950c4fb6f8ed59cc43acfc86d1f860edfdef7a039a69702e8f9bfa2029ebdf46 | Python | 70,774 | 1,442 | import argparse
import numpy as np
import pandas as pd
import os
import time
import elephant.statistics as est
from elephant.spike_train_synchrony import spike_contrast
import quantities as q
from sklearn.cluster import KMeans
from utils import nest_utils, taskGen_utils, capacity_utils
import nest
from network_mode... |
c486a31fe301d3dc051dca53d8ecf744be15640cd23831c8b3b96c9d1e1d698e | Python | 70,777 | 1,759 | # -*- coding: utf-8 -*-
"""
autoencoder_eval_3D_patches_v18_cpuaware_cascade.py
Purpose
-------
RAVEN v18 performs 3D super-resolution inference with the RAVEN autoencoder
using overlap-aware patching and optional cascade upsampling. The main design
goal is to make geometry handling explicit while adding scheduler-awa... |
a836930d2fa30bdebb0323d8f62e8ce0f215efef5bbf0bf4368d3143ec3640b1 | Python | 70,793 | 1,883 | #!/usr/bin/env python
#
# Copyright (c) 2016 10X Genomics, Inc. All rights reserved.
#
"""Utilities for annotated contigs with gene/chain information, defining clonotypes and more."""
from __future__ import annotations
import itertools
import json
import re
from collections import defaultdict
from collections.abc imp... |
0e6ecb1102acd753287fed51adbcc15220751b0fd962441443fe72b5f7a01bb3 | Python | 71,375 | 1,776 | # -*- coding: utf-8 -*-
"""
autoencoder_eval_3D_patches_v18_cpuaware_cascade.py
Purpose
-------
RAVEN v18 performs 3D super-resolution inference with the RAVEN autoencoder
using overlap-aware patching and optional cascade upsampling. The main design
goal is to make geometry handling explicit while adding scheduler-awa... |
e72f12b4a06b4ce343732c22c2d15093a36f6ce2099f05a3f3e93b71c5df3efd | Python | 72,960 | 1,577 | #!../venv/bin/python
import os
import logging
import argparse
import yaml
import psql_wrapper as psql
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
from datetime import datetime
from collections import defaultdict
CURR_DIR = os.path.dirname(os.path.realpath(__file__))... |
cab1c7bb427eae03fc8f580ad5df6d57918b534f8ffe527ec758446dfb8d137f | Python | 73,902 | 1,603 | #########################################################################
# File Name: scRNA_anno.py
# > Author: CaoYinghao
# > Mail: caoyinghao@gmail.com
#########################################################################
#! /usr/bin/python
import sys
import argparse
import gzip
import os
import numpy as np
... |
989031f5fc09a016b81a26b335ff7177db33a3670c6915826484eccccb6eb7d1 | Python | 74,161 | 1,548 | #!/usr/bin/env python
#
# Copyright (c) 2017 10X Genomics, Inc. All rights reserved.
#
from __future__ import annotations
import cellranger.analysis.constants as analysis_constants
import cellranger.rna.library as rna_library
import cellranger.webshim.constants.shared as shared
REPORT_PREFIX_CRISPR = rna_library.get... |
6b2503e148e9a801ecba48b2cbf4b005d177deafb8b93c09cacae1c3b382f65f | Python | 75,070 | 1,469 |
## Module Imports
import sys #check python version, exit upon sanity check failures
import os #path checks
import fractions #for handling fractions in argparse
import argparse #for taking in user input/parameter/switch
import time #for measuring elapsed time
import datetime #for default output path string formatio... |
6b35a5b3bd0cd72de649e9c873a208712aec424df2b34bfb504204688cec1c72 | Python | 75,175 | 1,868 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v3.1.5),
on Tue Dec 10 09:39:22 2019
If you publish work using this script please cite the PsychoPy publications:
Peirce, JW (2007) PsychoPy - Psychophysics software in Python.
Journal of Ne... |
aa26f26705c148e03fb0ac4be63a186827dff93f493cc0f43d91e9be9e182b30 | Python | 76,180 | 2,073 | import matplotlib
# Use a headless backend so tests don't try to open windows.
matplotlib.use("Agg")
import matplotlib.colors as mcolors
import matplotlib.path as mpath
import matplotlib.pyplot as plt
from matplotlib.collections import LineCollection, PathCollection, PolyCollection
from mpl_toolkits.mplot3d.art3d imp... |
4d2d76a4bc33eb980b4facbc2759ca0b159f771464e60e4e3dc9837ec4ccf93a | Python | 77,565 | 1,479 | #!/usr/bin/env python3
#
# ############################################################################
# Copyright (c) 2022-2026 University of Helsinki
# Copyright (c) 2019-2022 Saint Petersburg State University
# # All Rights Reserved
# See file LICENSE for details.
###################################################... |
cb1ac4707432b96c31cce0348f947730ab0b76a3a0382a0c3aa577e56acb4db6 | Python | 78,713 | 1,649 | #!../venv/bin/python
import os
import logging
import argparse
import yaml
import psql_wrapper as psql
import sqlalchemy
from sqlalchemy import text
import numpy as np
from datetime import datetime
from collections import defaultdict
from tqdm import tqdm
CURR_DIR = os.path.dirname(os.path.realpath(__file__))
CURR... |
1e2f865b363d05600845ff71c962c067128318eafa0ead626c1425069bd58185 | Python | 78,735 | 1,616 | """
mqrunDashDIA.py — DIA-NN QC Dashboard
Run: python mqrunDashDIA.py [path/to/mqrunDIA.duckdb]
Default DB: F:/promec/TIMSTOF/QC/DIA/mqrunDIA.duckdb
Deps: pip install dash plotly duckdb pandas numpy
Port: 8051 (mqrunDash.py for MaxQuant DDA uses 8050 -- runs alongside it)
COLUMN MAPPING NOTES (vs mqrunDash.py / Max... |
cf93784ed047f38fe17dff33d532337a991e046e082602d5f9c86e2827e4213b | Python | 79,954 | 1,505 | import inspect
import multiprocessing
import os
import shutil
import signal
import sys
import warnings
from copy import deepcopy
from datetime import datetime
from time import time, sleep
from typing import Tuple, Union, List
import numpy as np
import torch
from batchgenerators.dataloading.multi_threaded_augmenter imp... |
72c4816b5113c4e04082d9d452222380c1898efb49b74edaad8fc217a421ff4e | Python | 80,308 | 1,927 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Optimization Strategies for Hide-the-Label Competition
This module implements various optimization strategies including:
- Random selection
- Bayesian Optimization with Gaussian Processes
- Evolutionary algorithms (GA, DE, PSO)
- Surrogate-based optimization methods
-... |
1d8c400d236dce6ae47fb7573cbc53a8fb617459aa2c615207837e50111e785c | Python | 83,247 | 2,326 | # This code is part of OpenFE and is licensed under the MIT license.
# For details, see https://github.com/OpenFreeEnergy/openfe
import copy
import json
import sys
import xml.etree.ElementTree as ET
from importlib import resources
from math import sqrt
from pathlib import Path
from unittest import mock
import gufe
imp... |
e3a93e5dfebb82e0c3c9ee14178c132762a6515eb4139573cb359befa9f2f75f | Python | 83,307 | 1,791 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Hide-the-Label Competition Framework with Optimized GP for Better BO_GP_EI Performance
This module implements a competition framework where optimization strategies
compete to find the target (maximum value) in a dataset with minimal queries.
Uses optimized Gaussian P... |
f90d3448a73cc92453c5472a1bd69bb0712067c8f6c5d7f34cd5c6c4e7d04063 | Python | 85,582 | 2,061 | #!/usr/bin/env python3
#
# Copyright (c) 2018 10X Genomics, Inc. All rights reserved.
#
from __future__ import annotations
import copy
import math
import os.path
import pathlib
import shutil
from collections import OrderedDict
from collections.abc import Callable, Collection, Container, Generator, Iterable, Mapping, S... |
f386e78239dd1c6ebaf4ef0853c5866786f5981944006e10578e571164c997c6 | Python | 86,677 | 2,277 |
# Version: 0.29
"""The Versioneer - like a rocketeer, but for versions.
The Versioneer
==============
* like a rocketeer, but for versions!
* https://github.com/python-versioneer/python-versioneer
* Brian Warner
* License: Public Domain (Unlicense)
* Compatible with: Python 3.7, 3.8, 3.9, 3.10, 3.11 and pypy3
* [![... |
5ac18851e4cc894ec8358c13a2be46c9c9fd89920f0124401bb034c04db72271 | Python | 87,315 | 1,740 | import torch
torch.cuda.empty_cache()
import torch.nn as nn
import numpy as np
from TorchDiffEqPack import odesolve
import sys
import os
import matplotlib.pyplot as plt
import scipy.io as sio
import random
from torchdiffeq import odeint
from functools import partial
import getpass
from mpl_toolkits import mplot3d
from ... |
baf3cc3a4d0d32c4b6e404d62a03f50ff02ff49148e259ade91bdd7e111e7ef9 | Python | 87,437 | 1,925 | #!/usr/bin/env python3
"""
cli - Command-Line Interface for MicaFlow MRI Processing Pipeline
This module provides the main command-line interface (CLI) for the MicaFlow
neuroimaging processing pipeline. It handles command routing, argument parsing,
and execution of both the full pipeline and individual processin... |
fd78bcb192d8ce7c791329cc5ed16b5f4e5f1aa1613ffaa27a53375f93826cdc | Python | 88,577 | 2,426 | # 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`
======================================================================================... |
baf3f4f82ad86d2716b225d69d97df308fef1bd9a961d5b4876c9a6b923a3109 | Python | 91,940 | 1,857 | # -*- coding: utf-8 -*-
"""
CREATE PHYSIOLOGICAL NOISE PREDICTORS
This script can be used to:
1. Import *.json and *.tsv.gz physiological recordings that follow BIDS standard as well as the corresponding FMR (generated with BV 21.4 or newer)
2. Preprocess the cardiac signal derived from a PPU (peripheral pulse ... |
58737e457e9a187d195c63f8e434a4c8db38c4e9ca6c650275ed5909f862a80e | Python | 93,211 | 2,304 | """
MorphoScope - Main Window Implementation
This module contains the main window class for the MorphoScope application,
a tool for quantifying structural plasticity in 3D microscopy images of
neuronal projections.
Features:
- Multi-format image loading (CZI, TIF, LSM)
- Interactive ROI selection
- Image fi... |
e25b5e61f497d8ed06981644d0c7ec55b427a33e56e7fd9e0e97b15d2ce3fa16 | Python | 95,645 | 2,008 | """Shared kernel for the downstream stages: CMT/calls/coverage data structures, npz IO,
nucleotide<->int helpers, reference genome + GFF parsing, the filter cascade, and the
small cross-stage helpers (ancestral-allele inference, state rebuild)."""
import os
import re
import sys
import glob
import logging
import gzip
im... |
0919e5cbad51d8b7228b6de0a4a5fe41da4688a3620553b9c119b9e0fd8d41ef | Python | 97,097 | 2,391 | from collections import OrderedDict
from copy import deepcopy
from enum import auto
from io import StringIO
import json
import logging
from pathlib import Path
import sys
from tempfile import TemporaryDirectory
from typing import Literal
from urllib.request import urlretrieve
from configargparse import ArgumentError, ... |
e1720fa4c06129639ff4173f65beaf34168dc709f9210d40462af64b18b82a77 | Python | 99,130 | 2,596 | # 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... |
63c9c067d0e9bd035673bbf0e6a2ce2a572e6c567b508661303124d427924bc6 | Python | 99,401 | 2,320 | # -*- coding: utf-8 -*-
"""
Created on Thu Mar 2 17:57:20 2023
@authors: Joseph Vermeil, Anumita Jawahar
SimpleBeadTracker.py - contains the classes to perform bead tracking in a movie
(see the function mainTracker and the Tracker classes), and to make a Depthograph
(see the function depthoMaker and the Depthograph c... |
69004c9ac01a660bece6f68b6292eb89a138a3800813d07123801c3cf00662da | Python | 103,459 | 2,525 | # 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... |
c307888f7cebddab948bd41633b3ea0a96169ffa0bf1aef4c8860ec4cf351490 | Python | 103,560 | 2,677 | from batch_process.util.plotting import add_scale_bars_wvf
from batch_process.util import template_util
from matplotlib.lines import Line2D
from scipy.stats import ttest_ind, mannwhitneyu, shapiro
from scipy.stats import mannwhitneyu
import os
import numpy as np
import matplotlib.pyplot as plt
import batch_process.util... |
3827de2da522d9b5bc33b63a3500573ff7985f61641a81b54553e6499c301db3 | Python | 103,892 | 3,102 | #!/usr/bin/python
from __future__ import print_function
import collections
import csv
import errno
import getpass
import itertools
import json
import locale
import os
import platform
import threading
import time
import shlex
import socket
import sys
import readline
import tempfile
import re
import fileinput
# py3
tr... |
9ff8c3b6b3a213cf9af901eaf68c4e81a7e306425a850999020fe3ccdc9643a4 | Python | 106,044 | 2,571 | # pytorch_diffusion + derived encoder decoder
import math
import torch
import torch.nn as nn
import numpy as np
import torch.nn.functional as F
def get_timestep_embedding(timesteps, embedding_dim):
"""
This matches the implementation in Denoising Diffusion Probabilistic Models:
From Fairseq.
Build sinu... |
da6360ed79852907a3c561e05cdab38a68b1a36eec5eb9fbeaef69dd039655f6 | Python | 108,185 | 2,661 | """
This file regroups several custom keras layers used in the generation model:
- RandomSpatialDeformation,
- RandomCrop,
- RandomFlip,
- SampleConditionalGMM,
- SampleResolution,
- GaussianBlur,
- DynamicGaussianBlur,
- MimicAcquisition,
- BiasFieldCorruption,
- IntensityAugmen... |
bd7afcefa11196e58c0284e81ae42b68a1cbddfe1dcebe11311a6869e062daf6 | Python | 110,256 | 2,531 | # -*- coding: utf-8 -*-
"""
Created on Wed Jan 19 13:07:45 2022
@author: Joseph Vermeil & Anumita Jawahar
UtilityFunctions.py -
Joseph Vermeil, Anumita Jawahar, 2022
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 Soft... |
96f193bd74b5dfd4e917ad77df3d99431d6cd6d5d2c381a708b7912ddb88f051 | Python | 113,315 | 2,008 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import seaborn as sns
import os
import sys
import json
import pandas as pd
from brian2 import *
from scipy.signal import windows, butter, filtfilt, sosfiltfilt
from dataclasses import dataclass, field, asdict
from typing import Di... |
04c22459f85484a8ef4998e9a1f73ff5be9463e876d6dea3a28b98ebcf52da69 | Python | 115,578 | 2,888 | # 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... |
5bef7bcc246b356986d73236e61c149552e8e2970b689ab580bd94668fb8c2ed | Python | 116,081 | 2,743 | # pytorch_diffusion + derived encoder decoder
import math
import torch
import torch.nn as nn
import numpy as np
import torch.nn.functional as F
import torch, warnings, functools, os
def term_color(text, c): # quick & dirty ANSI colours
codes = dict(red=31, green=32, yellow=33, cyan=36)
return f"\033[{codes[... |
752ab4b6b3417b35f69fc8fa85d41c38d205f8a1b0b6e6dcfe13418ad47dc1cc | Python | 122,134 | 2,249 | ##################
# IMPORT LIBRARIES
##################
import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import sys
import h5py
import matplotlib.gridspec as gridspec
import logging
import pprint # for debugging
from dataclasses import dataclass, field, asdict
from... |
c7747b942058d28bfa5e39b36aefff1519f871f7ad644d589b179fbf9934c7f2 | Python | 124,798 | 2,823 | # AUTOGENERATED! DO NOT EDIT! File to edit: 41_experimental_INLA.ipynb (unless otherwise specified).
__all__ = ['PriorSpecification', 'ModelPriors', 'additive_model_prior_dict', 'additive_model_default_priors',
'extract_structure', 'LinearFeatures', 'mv_normal_fast', 'linalg_inv_fast',
'construct... |
aac829c92eefe671dcd0a6389f3477b634359307da071c0830ba49af592d2898 | Python | 124,799 | 2,816 | #!/usr/bin/env python
# Copyright 2016-2025 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... |
608eba82ef07f3ce9758007c135fe6361bc5dda7a65db957a0b18ecb07c7f716 | Python | 128,874 | 3,658 | #https://emdgroup.github.io/octopus-automl/getting_started/
#pip install "octopus-automl[recommended]"
from octopus.example_data import load_breast_cancer_data
from octopus.modules import Octo
from octopus.study import OctoClassification
from octopus.types import ModelName
# 1. Load a built-in example dataset (breast c... |
3a78b85a0be6d6f4cbec83f445d449dbcfea4d2f67f178eccdc6a51e23f6d295 | Python | 129,194 | 3,361 | """
Streamlit-free plotting helpers for aggregate (master) dashboards and optional regeneration
from saved ``ALL_FOLDERS_MASTER_RESULTS*.csv`` via ``regenerate_all_folders_panel_pdfs.py``.
"""
from __future__ import annotations
import os
import matplotlib.pyplot as plt
from matplotlib.transforms import Bbox as MplBb... |
23809905febb8fe7eea3f7b8253f73890e70c58189234a5eec894759865738c6 | Python | 137,186 | 3,122 | # -*- coding: utf-8 -*-
"""
Created on Tue Nov 23 16:50:16 2021
@authors: Joseph Vermeil, Anumita Jawahar
BeadTracker.py - contains the classes to perform bead tracking in a movie
(see the function mainTracker and the Tracker classes), and to make a Depthograph
(see the function depthoMaker and the Depthograph classes... |
e940ae25c025f043d61cd2d244281ebdbc276e8a299e234cbd3078757afa9258 | Python | 137,480 | 3,635 | # 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... |
e57ec856d3f9bbf22ed90edf81dfb628f07818870699a2e4e8ae2a09664c65e3 | Python | 138,817 | 2,493 | #!/usr/bin/env python
# Copyright 2016-2023 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... |
003714e99673378ccbe70dd57d92855f16c7e71ee767a50fa32fe98cd6795716 | Python | 142,571 | 3,000 | # This code is a slightly modified version of the HybridTopologyFactory code
# from https://github.com/choderalab/perses
# The eventual goal is to move a version of this towards openmmtools
# LICENSE: MIT
# turn off formatting since this is mostly vendored code
# fmt: off
import copy
import itertools
import logging
... |
9c4ddc8f80b9785fea51fb086970a2d1014564d5d73000e958f618b992b16a14 | Python | 151,280 | 3,590 | """
This file contains functions to edit/preprocess volumes (i.e. not tensors!).
These functions are sorted in five categories:
1- volume editing: this can be applied to any volume (i.e. images or label maps). It contains:
-mask_volume
-rescale_volume
-crop_volume
-crop_volume_around_reg... |
5c9f56ef853d385877eb612fd845159a14f7d9290ae7dbcfaa1eea150357a084 | Python | 162,190 | 3,460 | import torch
import torch.nn as nn
from taming.modules.losses.vqperceptual import * # TODO: taming dependency yes/no?
class LPIPSWithDiscriminator(nn.Module):
def __init__(self, disc_start, logvar_init=0.0, kl_weight=1.0, pixelloss_weight=1.0,
disc_num_layers=3, disc_in_channels=3, disc_factor=... |
1be9a2768fba49a187a7c9a6c5c042b32dbcbfb7351cd6a969b75b8d73c418e3 | Python | 162,191 | 3,460 | import torch
import torch.nn as nn
from taming.modules.losses.vqperceptual import * # TODO: taming dependency yes/no?
class LPIPSWithDiscriminator(nn.Module):
def __init__(self, disc_start, logvar_init=0.0, kl_weight=1.0, pixelloss_weight=1.0,
disc_num_layers=3, disc_in_channels=3, disc_factor=... |
cc446257b5b0738bbb282eb66577579ccc3edc88bd0a8e0598087bdeff566546 | Python | 170,247 | 3,440 | # AUTOGENERATED! DO NOT EDIT! File to edit: 53_mikemaps.ipynb (unless otherwise specified).
__all__ = ['KatmapModel', 'GroupedKatmapModels', 'compute_null_multinomial_loglikelihood',
'bayesian_null_multinomial_logp', 'sample_from_reduced_model', 'bayes_null_multinomial_gradient',
'bayes_null_mult... |
01d6c0b0cd6947bea9cae681beb5cd8368fc44d0e3c725a40810377e03ff4a02 | Python | 200,000 | 4,418 | import torch
import torch.nn.functional as F
import pytorch_lightning as pl
from main_hdf5 import instantiate_from_config
import numpy as np
from taming.modules.diffusionmodules.model import Encoder, Decoder, EncoderVINN, DecoderVINN, Encoder3D, Decoder3D, Encoder3D_v3, Decoder3D_v3
import torch.nn as nn
from taming.m... |
08659077b4716649e0a585c798b70c560a42ad59d5d22d8e125990773d9c96af | Python | 200,000 | 12 | # Copyright (c) Facebook, Inc. and its affiliates.
# Autogen with
# with open("lvis_v0.5_val.json", "r") as f:
# a = json.load(f)
# c = a["categories"]
# for x in c:
# del x["image_count"]
# del x["instance_count"]
# LVIS_CATEGORIES = repr(c) + " # noqa"
# fmt: off
LVIS_CATEGORIES = [{'frequency': 'r', 'i... |
43dd3f551346e0754abc0a087077446d024e3a3001301206f1ae4f7426879dd5 | Python | 200,000 | 4,418 | import torch
import torch.nn.functional as F
import pytorch_lightning as pl
from main_hdf5 import instantiate_from_config
import numpy as np
from taming.modules.diffusionmodules.model import Encoder, Decoder, EncoderVINN, DecoderVINN, Encoder3D, Decoder3D, Encoder3D_v3, Decoder3D_v3
import torch.nn as nn
from taming.m... |
d8955489c37a6232c5cd3ba5a9c0f871c5008f1a7634c2b0ed4c4b049efa32d0 | Python | 200,000 | 15 | # Copyright (c) Facebook, Inc. and its affiliates.
# Autogen with
# with open("lvis_v1_val.json", "r") as f:
# a = json.load(f)
# c = a["categories"]
# for x in c:
# del x["image_count"]
# del x["instance_count"]
# LVIS_CATEGORIES = repr(c) + " # noqa"
# with open("/tmp/lvis_categories.py", "wt") as f:
# ... |
e02ca93e28b7c7934ce1b778ad4e9605a4893bbac0c72167c86a1ca6840c57aa | Python | 200,000 | 5,032 | #
# Copyright (c) 2014 10X Genomics, Inc. All rights reserved.
#
"""Sample index mappings."""
import sys
# pylint: disable=too-many-lines,invalid-name
# GemCode Tubes
SI_001 = ["TCGCCATA", "GTATACAC", "AATGGTGG", "CGCATGCT"]
SI_002 = ["TATCCTCG", "GCGAGGTC", "CGCTTCAA", "ATAGAAGT"]
SI_003 = ["TGACGTCG", "CTTGTGTA",... |
43aef6d881476c69cf00ae08fe6cb5a1083d9a62369994080a4b47b476436953 | Python | 200,012 | 4,308 | # This contains all the supporting functions utilized in the Scheib et. al., 2026 manuscript
# Changelog:
# 2026-08-07 (claude-opus-5): removed redundant get_allAnmParams3(); documented get_allAnmParams()
# vs get_allAnmParams2() (verbose/extended-phase vs quiet/standard-phase)
# 2026-... |
9c5845ed6fa765041e785752c5740b802e53ac89a783d561a0a801481899f008 | Python | 200,419 | 5,175 | from scipy.stats import false_discovery_control
import numpy as np
# Your p-values
p_values = np.array([
0.000719929,
0.00139014,
0.00162029,
0.0146431,
0.0147919,
0.0263679,
1, 1, 1, 1, 1
])
# Calculate FDR using Benjamini-Hochberg
fdr_values = false_discovery_control(p_val... |
0a7b44df3af8c73701492f7f1d6d60a4aba3faee500db8250cf8a953f0f55683 | Quarto | 988 | 31 | ---
title: "scratch"
author: "ani"
format: html
server: shiny
---
## Shiny Documents
This Quarto document is made interactive using Shiny. Interactive documents allow readers to modify parameters and see the results immediately. Learn more about Shiny interactive documents at <https://quarto.org/docs/interactive/shin... |
58aa800560f30d5d3ac20916353c727248e981bb905e14c9bddf00e938848ebd | Quarto | 2,949 | 66 | ---
title: "diffExpr"
format: html
server: shiny
---
```{r data}
#| context: setup
#| include: true
inpF <-"TIMSTOF/LARS/2023/231123_dia_dda/DDA/combined/txt/proteinGroups.txt"
data<-read.csv(inpF,header=TRUE,sep="\t")
#clean
data = data[!data$Reverse=="+",]
data = data[!data$Potential.contaminant=="+",]
#data = data[... |
814d3e63fdd971145562999632e08bd645d3d1229d365b147837e4af7c015678 | Quarto | 3,939 | 115 | ---
title: "outlierDetect"
format: html
server: shiny
---
## data
```{python data}
#https://www.productive-r-workflow.com/quarto-tricks
#data####
import pandas as pd
dfI=pd.read_csv("L:/promec/TIMSTOF/LARS/2023/231123_dia_dda/peptides.list.txt",low_memory=False,sep='\t')
print(dfI.columns)
dfI=dfI.groupby('Sequence',... |
5cdc531a041257df50c26406364c923d21ff684d143da47775eee795837edecd | Quarto | 10,096 | 401 | ---
title: "ptau217/ab42"
format: html
editor: visual
---
Setup
```{r}
library(ggplot2)
library(dplyr)
library(pROC)
library(PRROC)
library(tidyverse)
library(plotgardener)
library(cutpointr)
library(patchwork)
```
### Cutoffs
```{r}
cp = cutpointr(data, x = ptau217_ab42, class = ab_pos_new,
m... |
9bf93c762594512c935f4d6118dc833d8aef2c94db3f28c47d2bdb355da4a85a | Quarto | 14,020 | 472 | ---
title: "Imputation"
format: html
editor: visual
---
### Setup
```{r}
library(tidyverse)
library(missForest)
library(randomForest)
```
### Imputation
```{r}
#former smoker
data_org$smoke_former = ifelse(data_org$substance_use_smoke_end_age < data_org$age, 1, 0)
data_org$smoke_former[is.na(data_org$smoke_f... |
6c5119537184ab6756d49bbb89a16530601b1a4af7d07cf8a2a08f980ad91d68 | Quarto | 14,633 | 580 | ---
title: "Variance Stabilizing Normalization (VSN) Dashboard"
format:
html:
theme: cosmo
toc: false
page-layout: full
server: shiny
execute:
echo: false
warning: false
message: false
---
```{r}
#| context: setup
library(shiny)
library(vsn)
library(DT)
library(ggplot2)
library(hexbin)
options(shi... |
5920a917fcd0930589655b768a4cb45064cbfd6466477cb0204e0f72ac0c5806 | Quarto | 17,681 | 471 | ---
title: "CRS standardization"
author: "Meri Okorie"
date: "2025-12-12"
output: html_document
---
### Setup
```{r}
library(tidyverse)
library(dplyr)
library(data.table)
library(glue)
library(broom)
library(tidyr)
library(readr)
library(glue)
library(broom)
library(scales)
library(stats)
```
### Functions
```... |
4ee8305c3845f8f87a12b45b26cd2671a80b5d0842d9db88c9e2d0defdaa6334 | Quarto | 115,489 | 2,407 | ---
title: "CRS analysis"
author: "Meri Okorie"
date: "2025-12-10"
output: html_document
---
### Setup
```{r}
library(ggplot2)
library(dplyr)
library(tidyr)
library(pROC)
library(PRROC)
library(readr)
library(Metrics)
library(r2redux)
library(ggalluvial)
library(glue)
library(broom)
library(purrr)
library(tidyverse... |
9755587e5dac90de43f7e2f7c056bbe4c21bb2e1f8e21e94466ad41981ab3272 | R | 67 | 5 | #!/usr/bin/env Rscript
library(devtools)
library(testthat)
test()
|
e5c3342d89a2a226b59e05d536035705e63bae61f61867ef6259da1cc9c616d3 | R | 78 | 5 | library("foreign")
otd <- read.octave("octave.dat")
summary(otd)
str(otd)
q()
|
f67b4606e4f6c7245863c67699539de40df8e32a937a754b08f4668770f6f346 | R | 117 | 5 | hist(a$HekTotTryp1_2_121129110932_-a$HekTotTryp5_2_121129172636_,breaks=1000,xlim=range(-1000000000,1000000000))
|
098c2cc45c4e2a2a753b86109cd50e5c188cb3f96cff683e1b9f0ce028b39d16 | R | 127 | 4 | d=read.table('L:/Elite/gaute/test/CDS_CU_EntrezID.txt',sep='\t',header=TRUE)
summary(d)
hc = hclust(na.omit(d))
cutree(hc)
|
9faff9b8e101ade8563f781832846fe292d7060db1759f176cdefa8a36063a58 | R | 162 | 11 | hanning.window <- function (n)
{
if (n == 1)
c <- 1
else
{
n <- n-1
c <- 0.5 - 0.5*cos(2*pi*(0:n)/n)
}
return(c)
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.