sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
35e1d033c2e1d8fabfa41dc9e992b32489975283424b4910a197a210d7164ea8
Python
99,376
2,449
import os import warnings import numpy as np from numba import njit from scipy.optimize import curve_fit from scipy.signal import medfilt, find_peaks from scipy.stats import norm, chi2 import matplotlib.pyplot as plt from bombcell.extract_raw_waveforms import path_handler from bombcell.default_parameters import che...
18280604207a0e0fb6009c7506163aa5487cfcbb7dab7a6f40e2ccf14cf37877
Python
99,463
2,182
import sys import os import time code_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'hippie')) sys.path.append(code_dir) try: from dataloading import ( # type: ignore[import] DATASET_TECHNOLOGY, TECHNOLOGY_IDS, LAYER_IDS, LAYER_NORMALISE, ) _HIPPIE_VOCAB_AVAILABLE = True exc...
594e955ec36d3bcbf169185e2be1ba95304540feeee0f3ee59b9332cccd10a00
Python
101,284
2,028
""" This module contains all the classes and code to collect data and calculate statistics from the output files of various calculation types. Each calculation type needs its own class. All data is stored in a special class derived from the list. """ # #################################################################...
b58e974c15a41bb17817e12b538d5b54abfd8d959ab538eb77022fd9a10cab07
Python
101,753
3,339
from __future__ import annotations import json import re import shutil from pathlib import Path from typing import TYPE_CHECKING from typing import Any from typing import cast import pytest from cleo.io.buffered_io import BufferedIO from cleo.io.inputs.input import Input from cleo.io.null_io import NullIO from cleo...
3a8d3b04bf23639ce95c09793d6f728798e7cbded51149e73bf2c8a2ecfe7e6d
Python
102,166
3,365
import warnings from collections import OrderedDict from shutil import get_terminal_size from unittest.mock import patch import numpy as np import numpy.testing as np_test import pytest from skbase.utils.dependencies import _check_soft_dependencies from pgmpy import config from pgmpy.example_models import load_model ...
d11a20f50d320e46e071b2d1a2dbf639b529736c4e0a65979b402dc743660a7d
Python
103,138
9,412
""" 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. Original CGCNN k-hot elemental embeddings. """ KHOT_EMBEDDINGS = { 1: [ 0, 1, 0, 0, 0, 0, ...
f981d86d04d0a7ac346c4bf6797c2d5f064d6cda1795a79db5d38363f8746036
Python
108,977
2,536
"""Base model class and the helpers shared by every model in this package. `Model` provides base transformer loading, AMP and gradient checkpointing, token embedding lookup and logit pooling; the concrete subclasses live in their own modules and import from here. See the models page of the documentation for the poolin...
bc660f4f96bd0e4c81249de1816c8ab8ee4ac18adf9811415da9564c19545285
Python
111,165
2,519
import torch import torch.nn as nn import torch.nn.functional as F from copy import deepcopy from torch_geometric.nn import GATConv, EdgePooling, GCNConv, VGAE from torch_geometric.nn.models import GIN from .gvp_utils import GVP, GVPConvLayer, LayerNorm from torch_scatter import scatter_mean import os from torch_s...
3f7da9a75cab78576ad158c7e1642d5364bda0b276aa9d3a3f27c15dd107def2
Python
115,586
2,242
from pathlib import Path import joblib import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from matplotlib_venn import venn3 from pingouin import kruskal from scipy.optimize import curve_fit from scipy.stats import gaussian_kde from scipy.integrate import quad from analysis.ca...
06ceb15810074a45cbb082e7680b7758ea8e029d0384611953b12535772b6f13
Python
120,010
1,789
import os import numpy as np import pandas as pd import nibabel as nib from vtk import vtkPolyDataNormals from ..mesh.mesh_io import read_surface from ..mesh.mesh_operations import combine_surfaces from ..vtk_interface import wrap_vtk, serial_connect def load_mask(name='midline', surface_name="fsa5", join=False): ...
d3d2a68b0df2d0f73a5205c050bea46b4988904263d49df238d2722def86eaef
Python
121,706
2,692
# written by Floris van Breugel, with some help from Andrew Straw and Will Dickson # dependencies for LaTex rendering: texlive, ghostscript, dvipng, texlive-latex-extra # general imports import matplotlib ##print matplotlib.__version__ ##print 'recommended version: 1.1.1 or greater' ##################################...
009156202fc4fe8e89a8963a5ca503bcfa1150fefb0cae3421b692fef3141351
Python
123,050
2,714
# written by Floris van Breugel, with some help from Andrew Straw and Will Dickson # dependencies for LaTex rendering: texlive, ghostscript, dvipng, texlive-latex-extra # general imports import matplotlib ##print matplotlib.__version__ ##print 'recommended version: 1.1.1 or greater' ##################################...
f6a2c18e3a16afae072c316cb07792d882ed5a72e5e8d079ca8628b1c6cdf548
Python
124,398
2,692
# written by Floris van Breugel, with some help from Andrew Straw and Will Dickson # dependencies for LaTex rendering: texlive, ghostscript, dvipng, texlive-latex-extra # general imports import matplotlib ##print matplotlib.__version__ ##print 'recommended version: 1.1.1 or greater' ##########################...
2c9cc6bae7cdbde5defbf5848770cf11345989cb7a4e224f447b578a35e62253
Python
125,342
2,297
""" Generate Amber topology files from GROMACS files """ # ############################################################################## # GPLv3 LICENSE INFO # # # # Copyright (C) 20...
b28b19130ba9e5efa25f5f0c1eb3b7ddbe0afd3299628d6b45b34d59942752d6
Python
126,547
3,345
#!/usr/bin/env python import io import unittest import xml.etree.ElementTree as etree from pgmpy.readwrite import PomdpXReader, PomdpXWriter class TestPomdpXReaderString(unittest.TestCase): def setUp(self): string = """<pomdpx version="1.0" id="rockSample" xmlns:xsi="http://www.w3.org/2001/XMLSche...
b90f68f59ae9e704908fec7ff2e8a87cae284d08ee27156bc9e3cf33a01b5df3
Python
131,461
2,299
#!/usr/bin/env python ''' (c) 2016-2018 Oleksandr Frei and Alexey A. Shadrin Various utilities for GWAS summary statistics. ''' from __future__ import print_function import pandas as pd import numpy as np from scipy import stats import scipy.io as sio import scipy.sparse import os import time, sys, traceback import ar...
3e8fc26bc373c85e630ac9022e820a62113ccad9b10dcf6858105f94b4d5dd56
Python
133,786
2,982
import logging from collections.abc import Mapping from textwrap import dedent import copy import collections import numpy as np from mdt.configuration import get_active_post_processing from mdt.lib.deferred_mappings import DeferredFunctionDict from mdt.lib.exceptions import DoubleModelNameException from mdt.model_buil...
a6c5e2eac2d17c62a9826d6502a9043d45e897e7023c18f764d1ccdd8429eff6
Python
135,447
3,148
# -*- coding: utf-8 -*- """ 致密砂岩数字岩石物理平台 - Streamlit Web Application =================================================== 核心功能:五步完整工作流 (RAW预处理 → CNN预测 → 3D预览 → 物理验证 → 气体输运模拟) Author: Claude Code Assistant """ # ======================================================== # 0. OMP 冲突修复 - 必须放在第一行 (import os 之后) # ==========...
073c5794e350c8400f51f3adcbe01e57e827fa26b2fe7f9e961246701fab44e0
Python
138,152
2,497
""" This module can perform enrichment analyses on a given set of genomic features and visualize their intersections. \ These include gene ontology/tissue/phenotype enrichment, enrichment for user-defined attributes, \ set visualization ,etc. \ Results of enrichment analyses can be saved to .csv files. """ import func...
ab615dde554fbcc88744a955c9060fb1673fd6bd8b9bc641698aa7f98c535092
Python
140,788
2,805
""" The *fastq* module provides a unified programmatic interface to external tools that process FASTQ files. Those currently include the *CutAdapt* adapter-trimming tool, the *kallisto* RNA-sequencing quantification tool, the *bowtie2* alignment tool, and the *featureCounts* feature counting tool. """ import abc impor...
ab1a5d388dcd2085ad79909ea15f3666740d76486f8e4b43d25fdf6fb5553091
Python
144,685
2,686
################################################# ### PHAGE GENOME DESIGN // FILTERING PIPELINE ### ################################################# """ Usage: eval "$(conda shell.bash hook)" conda activate genome_design CONFIG_FILE="/path/to/config.yaml" python /path/to/genome_design_filtering_pipeline.py $CONFIG_F...
fc72288fb496422468fbe4299c53f4fb24f73621d27a0d5e39f75eaa9760728d
Python
146,512
4,002
import os from typing import Optional, Literal import math import torch from torch import nn import torch.nn.functional as F from einops import rearrange from .utils import expand_key_padding_mask from .modules import BaseClassifier, CNNMixer, CNNMixerConfig, BaseClassifier_reg import pdb from .position_embeddings im...
95bbf2a6b18550574d11adef5d1238972df3d80fbd2015396127ce32bde8261e
Python
146,883
3,552
import json import shutil from enum import Enum, IntEnum from unittest.mock import Mock, patch import matplotlib import pytest import yaml from rnalysis import __version__ from rnalysis.exceptions import InvalidTypeError, InvalidValueError, RNAlysisInputError from rnalysis.filtering import * from tests import __attr_...
bc75b2236646d2c9b93fb5a0f032cec18078a42ff5e60a32d0b66fbe614edf03
Python
153,102
3,474
#!/usr/bin/env python3 """ TSNFA Monte Carlo Simulator v1.2 (Deliverable 2, revision) ========================================================== VERSION HISTORY v1.1 Original Deliverable-2 simulator. ProposedMethod implemented the EMA variant reverse-engineered from deployed STM32 hardware (max-acros...
85356033cf1619c08ade8f91f8a01a931c549d9d369fc1a10ee90ba8ffc2b7ae
Python
156,893
3,735
import json import os import re import tkinter as tk import tkinter.font as tkf import uuid import copy import math import datetime from tkinter import colorchooser, filedialog, messagebox, ttk import matplotlib import traceback import matplotlib.pyplot as plt import numpy as np import pandas as pd from matplotlib.back...
409ee9e1ceb9253211556365a448207606e9c77e451bc36f1dd943536e1872e2
Python
157,445
3,442
import asyncio import sys if sys.platform == 'win32': asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) import concurrent.futures import contextlib import csv import ftplib import functools import gzip import hashlib import inspect import json import os import queue import random import re i...
72cfe37eca6abee73bae6fd981902527e34161d846d19bd5436643ff5f6e7dd9
Python
165,318
4,564
import os from typing import Optional, Literal import math import torch from torch import nn import torch.nn.functional as F from einops import rearrange from .utils import expand_key_padding_mask from .modules import BaseClassifier, CNNMixer, CNNMixerConfig, BaseClassifier_reg import pdb from .position_embeddings im...
772f1762aea7e535a3ad608fcf6a3e954b84f3c88a5c647f1e44abab86d47b2e
Python
180,298
4,578
import logging import re from unittest.mock import Mock, patch import matplotlib import polars.selectors as cs import pytest import rnalysis.gui.gui_report matplotlib.use('Agg') from rnalysis.gui.gui import * LEFT_CLICK = QtCore.Qt.MouseButton.LeftButton RIGHT_CLICK = QtCore.Qt.MouseButton.RightButton @pytest.fix...
815ef45604172d628e6ed67f4214da6a66925c5f1ff7a8573ee8bd6d7b293c1b
Python
185,303
4,046
import random import re import stat import warnings import zipfile from unittest import mock from unittest.mock import MagicMock, Mock import platformdirs import pytest import requests_mock from rnalysis.exceptions import ( CorruptSessionError, IDMappingJobFailedError, IDMappingTimeoutError, InternalE...
bf61f662f4a81d2ab899b79da960ec94fcfd46c756d2e984351f19e5d86a2e1f
Python
190,627
5,914
from __future__ import annotations import re import shutil import sys from pathlib import Path from typing import TYPE_CHECKING from typing import Any from typing import Literal import pytest from cleo.io.buffered_io import BufferedIO from packaging.utils import canonicalize_name from poetry.core.packages.dependenc...
045255a77741f6d39f640ded0b339192f9f6515dac98436b546ca2835783858e
Python
200,000
4,591
import builtins import copy import functools import hashlib import importlib import itertools import os import platform import sys import time import typing import warnings from collections import OrderedDict from pathlib import Path from queue import Queue from typing import Callable, List, Tuple, Type, Union import ...
0ed91600c1352e6f37a727e49d7587f43c668fabad1f9043c3d176aa14fa8ba8
Python
200,000
2,999
# -*- coding: utf-8 -*- # Resource object code # # Created by: The Resource Compiler for PyQt5 (Qt v5.15.2) # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore qt_resource_data = b"\ \x00\x00\x2d\xc6\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\ ...
118a3a46ab27a257fcaf2959746547ce9c0999334bbb6a9073e31b595a8caccd
Python
200,000
3,837
from __future__ import annotations import cffi import _cffi_backend import datetime import numpy as np import os import platform import re import signal import subprocess import sys import threading import warnings from typing import Any, Literal __version__ = '0.2.0' class ignore_sigint: """ Ignore Ctrl + ...
2c965fb63a6d1b29243af037087e7cb50ada2850ead8f0cb5cc02f95e6aa90f6
Python
200,000
362
"""Data downloaded from NCBI Gene data converted into Python data.""" # Copyright (C) 2014-2018, DV Klopfenstein. All rights reserved downloaded = "2016_02_22" # 13919 items # Downloaded as a tsv from NCBI Gene. Then translated to Python: # # http://www.ncbi.nlm.nih.gov/gene/?term=genetype+protein+coding%5BPropertie...
4dc60f91c8d6d94f3cccbeb3a08c286e1ff1ca362751b3a33d4384f2f44736c7
Python
200,000
7,961
import numpy as np score_stack = np.array([ [0, 0, 0, 0, 0, 0, 0, 0, ], [0, -240, -330, -210, -140, -210, -210, -140, ], [0, -330, -340, -250, -150, -220, -240, -150, ], [0, -210, -250, 130, -50, -140, -130, 130, ], [0, -140, -150, -50, 30, -60, -100, 30, ], [0, -210, -220, -140, -60, -110, -90, -60, ], ...
535d004dd5c64d9b944751a53c05179218392d1e00a62908303b9eb1624a7f2a
Python
200,000
2,592
#!/usr/python ''' For questions about running the script or for reporting bugs, please contact either: Brian Baker (brian-baker[at]nd.edu) or Esam Abualrous (e.abualrous[at]fu-berlin.de) DESCRIPTION Calculates the geometrical parameters (r, theta, phi) of TCR on top of MHC proteins USAGE For peptide-MHC class I-T...
a63d6f7cdd50e24c998d7facc69eab63a190d867139419e5ffe8a426f5ec5f75
Python
200,000
450
"""Data downloaded from NCBI Gene data converted into Python data.""" # Copyright (C) 2014-2018, DV Klopfenstein. All rights reserved downloaded = "2016_02_22" # 28212 items import collections as cx NtData = cx.namedtuple('NtData', 'tax_id Org_name GeneID CurrentID Status Symbol Aliases description other_designatio...
c5b371d92d679f54bc6c00be4e91833fcb2ae5865d481301198c0174a6ddc2bc
Python
200,000
392
"""Data downloaded from NCBI Gene data converted into Python data.""" # Copyright (C) 2014-2018, DV Klopfenstein. All rights reserved downloaded = "2016_02_22" # 21955 items import collections as cx NtData = cx.namedtuple('NtData', 'tax_id Org_name GeneID CurrentID Status Symbol Aliases description other_designatio...
bcc767ef0d4344a2b35cc21937be33c218438f18a451f8c7511c272c4ea03fad
Python
200,001
4,576
import tkinter as tk from tkinter import ttk, filedialog, simpledialog from tkinter import messagebox import tkinter.font as tkf import os import re import json import copy import pandas as pd import numpy as np import math from scipy.signal import find_peaks import matplotlib.pyplot as plt import matplotlib.cm as cm ...
3d67f0c967f439414b7116ea1f94c82d5e3447dad767bf57ecac3a643736567d
Python
200,004
3,957
from __future__ import annotations import os import re import signal from decimal import Decimal from datetime import date, datetime, time, timedelta from itertools import chain, islice from packaging import version from pathlib import Path from textwrap import fill from typing import Any, Callable, Dict, Ite...
5ede6aba2c2d51e5459649a4ef5fef27ee75ef52f9305137d6fe9b27bbea16ff
Python
200,021
4,351
from __future__ import annotations import os import polars as pl import signal import subprocess import sys from contextlib import contextmanager from functools import cache, reduce, wraps from typing import Any, Iterable pl.enable_string_cache() ########################################################################...
2d62c5df77b036ae287ffc0b27424f663cc9e6cf1233eb49bce7baeade1b73a9
Python
200,137
3,774
import numpy as np import matplotlib.pyplot as plt from matplotlib.widgets import Button import matplotlib.gridspec as gridspec from pathlib import Path import pandas as pd import pickle import os from bombcell.ccg_fast import acg, ccg try: import ipywidgets as widgets from IPython.display import display, cle...
156062cdf22b313ebc6f230e57f42c20cab867d6fb6940f891e1b7ffae521d7c
Python
204,474
3,774
""" This module can filter, normalize, intersect and visualize tabular data such as read counts and differential expression data. Any tabular data saved in a csv format can be imported. \ Use this module to perform various filtering operations on your data, normalize your data, \ perform set operations (union, interse...
7313cf394489979d2f52c7f45bfedb45df62b39a391a5412820e56977493b525
Python
206,596
5,177
__version__ = "1.3.2" import sys import os import re import io import json import zipfile from pathlib import Path def segref3d_product_name() -> str: edition = os.environ.get("SEGREF3D_EDITION", "").strip().lower() if edition == "local-gpu": return "SegRef3D Local GPU" if edition == "local-cpu"...
e3eca180c306b575c34b4650bdddcc43c36c1a6cd752753bb5a05329bba24141
Python
210,023
5,374
import sys, torch, warnings print("=== SegRef3D Local GPU Diagnostic ===") print("Python:", sys.executable) print("Torch:", torch.__version__, "CUDA", torch.version.cuda) print("ARCH:", torch.cuda.get_arch_list()) print("CUDA available:", torch.cuda.is_available()) if torch.cuda.is_available(): try: ...
a4bccb361599bf2420da460942da515f5a92cebb85f6e4d5ac8222df4cd61021
Quarto
253
17
```{python} import polars as pl from src.single_cell import SingleCell import genome_kit as gk ``` ```{python} lr_bulk = SingleCell("results/long_read/pbid_filtered.h5ad") genome = gk.Genome("SFARI") ``` ```{python} genome.transcripts["PB.4.1"] ```
033417db628b98ddd2c4b19ab8ff0337039f117858029d0b4f731f95d3124953
Quarto
560
32
```{python} from src.ryp import r, to_py, to_r ``` ```{r} library(VariantAnnotation) library(GenomicFeatures) library(TxDb.Hsapiens.UCSC.hg19.knownGene) library(BSgenome.Hsapiens.UCSC.hg19) ``` ```{r} txdb <- makeTxDbFromGFF("SFARI.gtf", format = "gtf") ``` ```{r} gr <- rtracklayer::import("SFARI.gtf") ``` ```{r} f...
11839cf99beb3e8b7529d2f93718458309fa7d93282af13cbad6215fe5383f3a
Quarto
3,748
123
# Preparation ## Import packages ```{python} from pathlib import Path import polars as pl from src.single_cell import SingleCell from src.ryp import r, to_r import json import polars.selectors as cs ``` ```{r} library(pheatmap) library(dplyr) library(pheatmap) library(RColorBrewer) library(stringr) ``` ## Prepare s...
82a27e468bd3e6c316a8686baa68840095a790761863ebfc04fb302a53c65e64
Quarto
7,957
218
# Import packages ```{python} #| label: import-python import polars as pl from src.ryp import r, to_r from src.single_cell import SingleCell ``` ```{r} #| label: import-r library(ggpubr) library(pheatmap) library(RColorBrewer) library(stringr) library(scales) library(dplyr) ``` # Import data ```{python} #| label: i...
ed56cf30d7ee5d48af74a71638854233fb9c3a5a263ded9f74c28d4f10cd5cfc
Quarto
9,556
442
--- title: "analysis of sMRI data" format: html editor: source echo: false warning: false --- ```{r} rm(list = ls(all = TRUE)) library(data.table) library(tidyverse) library(afex) library(emmeans) library(ggsignif) emm_options(opt.digits = TRUE) source("R/plotting.R") source("R/rainclouds.R") source("R/utils.R") ``...
c71eb29501c6b6a4ad6bb55e6275d1828a64e9e89e0796ed1ba1b76cf4761eea
Quarto
10,518
327
--- title: | Code for Figure 4 + Supp Figs format: html: toc: true self-contained: true highlight-style: github code-line-numbers: true code-fold: true editor: source editor_options: chunk_output_type: console --- ## Define parameters ```{r display-params} datadir <- "data/" ``...
7f5227c848d1bdafbd63829ea67d47d033f732db368539dbc4cd87f3742640eb
Quarto
10,675
459
--- title: "analysis of noddi data" format: html editor: visual echo: false warning: false --- ```{r} rm(list = ls(all = TRUE)) library(data.table) library(tidyverse) library(extrafont) library(afex) library(emmeans) source("R/plotting.R") source("R/rainclouds.R") source("R/preprocess.R") source("R/utils.R") noddi <...
b7597b60b3c0d9b1e0e7e36b5a06ec84ccf8ac645366b0be6b85314c45ac2acb
Quarto
12,768
372
# Run Transdecoder on full_nt.fasta Run transdecoder to generate ORFs ```{bash} #| label: run-transdecoder cd ~/tools wget https://data.broadinstitute.org/Trinity/CTAT_SINGULARITY/MISC/TransDecoder/transdecoder.v5.7.1.simg cd ${SCRATCH}/SFARI module load apptainer apptainer shell -B="/scratch/nxu/SFARI:/scratch/nxu...
cc5abf25e0676e773b0e4b653abbe2093cc2bcf9de42209258a7604696c9bc58
Quarto
14,408
534
--- title: "KRK016 analysis" format: html editor: visual echo: false warning: false --- ```{r} rm(list = ls(all = T)) # load libraries library(data.table) library(tidyverse) library(afex) library(emmeans) # load internal libraries source("R/plotting.R") source("R/rainclouds.R") source("R/utils.R") dwi <- readRDS(".....
7478833619efc284091f2576abcb8be2868fc80c437e23ff40128fd10aa82649
Quarto
16,749
655
--- title: "analysis of qMRI at 7T" format: html editor: visual echo: false --- ```{r} rm(list = ls(all = T)) library(data.table) library(tidyverse) library(extrafont) library(afex) library(emmeans) library(ggsignif) source("R/plotting.R") source("R/rainclouds.R") source("R/preprocess.R") source("R/utils.R") mpm0p5...
d266f03e659d0adfb24e875e60b155dc6f23d2ff3b7ba27a9f3bc28aa01ee335
Quarto
18,199
512
# Preparation ```{python} #| label: import-python import polars as pl from src.single_cell import SingleCell from src.utils import read_gtf import numpy as np import polars.selectors as cs ``` ```{python} #| label: read-gencode_V39 gencode_V39 = read_gtf("/Users/xunuo/Genomic_references/GENCODE/gencode.v39.annotatio...
330e8ed3e9f20aefb9c4fbf242ec15e03ee7e8820e64277bdde2dcd9a0a09379
Quarto
18,889
719
--- title: "KRK016_mpm_analysis" format: html editor: source echo: false --- ```{r} rm(list = ls(all = T)) # import libraries library(data.table) library(tidyverse) library(afex) library(emmeans) library(ggsignif) emm_options(opt.digits = TRUE) # import local functions source("R/plotting.R") source("R/rainclouds.R")...
1f8225b68d72d8fe530f910f4c4653732d7325671df4611ead314d2d602e895a
Quarto
19,758
706
--- title: "Code for Figure 3 + Supp Figs" format: html: toc: true self-contained: true highlight-style: github code-line-numbers: true code-fold: true editor: source editor_options: chunk_output_type: console #params: # datadir: 'test' # nmethod_range: # ground_truth: # nns: 6...
3d79e212ba330e743eb2c7af841d8a9a3b53017889f156bbf2f2e765a9d49ceb
Quarto
26,095
1,000
--- title: "analysis of microstructure using PCA" format: html editor: source --- # load libraries ```{r} rm(list = ls(all = TRUE)) # import libraries library(data.table) library(tidyverse) library(afex) library(emmeans) emm_options(opt.digits = TRUE) library(tidytext) library(ggseg) library(ggsegGlasser) library(gg...
a0c22dc5d16db10ca0e3d99859ffccb2b4d536b21d6788cfbe2d2cfac60e8117
R
22
1
print("Hello world!")
89385650ce68da2ef3bf89064f985cf88ccd83097d2a2b6b0aa407e4686bbbde
R
51
3
library(RUnit) runTestFile("test/runitModules.R")
83b42e105a6a9d893eef996a4ae25b1442cc5212f70e6d6e638fd9cbf3ff0826
R
53
3
loadDefaultDB <- function() { loadDB("GMMs.v1.07") }
97d3bef73090632c301280556f77e9fe5a909ee31d766354970c80088323a750
R
66
4
library(testthat) library(sctransform) test_check("sctransform")
b44e24e22b27d528689bc77fe436b96e15758f45e63ae9f68d8f7280c45ce790
R
71
3
.First.lib <- function(lib, pkg) { library.dynam("peer", pkg, lib) }
330c37facdcc6fb9eda48c97269defae2fba05376befa2348f78aed9765a9d70
R
73
5
library(withr) library(testthat) library(ggrepel) test_check("ggrepel")
8febb6b9aebb23dc2ae317aa516556159f2b7c6da7fc87664c94deb4035a4895
R
80
4
library(testthat) library(DropSeq.eqtl.susie) test_check("DropSeq.eqtl.susie")
c110528106ec0a48184de391d68fc89252cc0ddccbdaad8fa74751bc171a75ff
R
84
4
# get session info sessionInfo() # Close the sink to stop redirecting output sink()
45deb21f74d0c76023e8b17137aba369d408fe0686c0971381949554fa2cef2a
R
93
6
#' @keywords internal "_PACKAGE" ## usethis namespace: start ## usethis namespace: end NULL
935bfed5d5e0709223d65a1d7de254f426afb50adfd0b7ee7dae60d5d24d0c5a
R
124
6
#! /usr/bin/env Rscript #This script takes some data from a DIAGRAM GWAS file and \ "rs1937888" "rs17155745" "rs62626328"
4fc55271f95ad9ef4b48fc1511bad739a90eadbf17041d66558dc10c8b63f20a
R
149
5
listDB <- function() { db.path <- system.file("extdata", package = "omixerRpm") db.list = gsub(".txt", "", dir(db.path, pattern=".txt")) db.list }
5a10cabc17fe7b49a2d40ea397592f07d3c3e9d5de60c30f6814e0a8f3a04ffc
R
156
6
# Function to calculate y_C given x_C calculate_y_c <- function(xA, yA, xB, yB, Cx) { m <- (yB - yA) / (xB - xA) yC <- yA + m * (Cx - xA) return(yC) }
43bbfb45baff64a27ebf5d53d7e8a2b8dfd333aea26ea5b68de65220e95d2305
R
161
3
res <- results(dds_res, contrast=c$CONTRAST, cooksCutoff=$COOKS) res_ordered <- res[order(res$padj),] write.csv(as.data.frame(res_ordered),file="$OUTFILE_NAME")
42607563d96564a3af935f8ce8ccbe8094e41999352d55fe7cb0c54566b2e6a7
R
175
3
cov_res <- results(dds_res, name="$COVARIATE", cooksCutoff=$COOKS) cov_res_ordered <- cov_res[order(res$padj),] write.csv(as.data.frame(cov_res_ordered),file="$OUTFILE_NAME")
7f260ab2e20aeb14badc7d11ba17a929a31f5f85538ad43a25ffe0b4a9d77713
R
175
5
# Reset ggplot2 theme to default for consistent test snapshots # This prevents ~/.Rprofile custom themes from affecting vdiffr tests library(ggplot2) theme_set(theme_gray())
29327a4a3aa8cdaeff1adbaf56bbd539199bde16afb479ad722675850cd4ef07
R
177
11
#!/usr/bin/env Rscript # build_site.R # # Build the pkgdown site and then make a few additional tweaks. library(pkgdown) build_site(lazy = TRUE) # build_site(lazy = FALSE)
ba33753d36354ccf3045addfe0ef11ab8b16627724cab35ea6a04aaeaa4730e8
R
178
5
# Open a connection to a log file logfile <- file("$LOGFILE", open = "a") # Redirect both output and messages to the file and console sink(logfile, append = TRUE, split = TRUE)
8c2b7d51b244b3530cb068e563e122b1f36b69a8ddf555469483dac840c45183
R
194
5
bayes_fit <- eBayes(fit) lrt_res <- topTable(bayes_fit, n=Inf, coef=$COEFS) lrt_res_ordered <- lrt_res[order(lrt_res$adj.P.Val),] write.csv(as.data.frame(lrt_res_ordered),file="$OUTFILE_NAME")
a7cade5b763119f0b53202e558acb5ecb10fe8b0ba6b664115e9cf1b9b2630d8
R
194
9
## usethis namespace: start #' @useDynLib CellChat, .registration = TRUE ## usethis namespace: end NULL ## usethis namespace: start #' @importFrom Rcpp sourceCpp ## usethis namespace: end NULL
0dfa40182f21c0c198b0caa741719d273f56887a3a4ff7251f97784c76584254
R
195
5
bayes_fit <- eBayes(fit) cov_res <- topTable(bayes_fit, n=Inf, coef="$COEF") cov_res_ordered <- cov_res[order(cov_res$adj.P.Val),] write.csv(as.data.frame(cov_res_ordered),file="$OUTFILE_NAME")
5f72eaf18bbe3e115fc068b4df5f73d971129a160ba2439b8e8460f210f618d6
R
212
4
dds_lrt <- DESeq(dds, test="LRT", reduced=$REDUCED) lrt_res <- results(dds_lrt, cooksCutoff=$COOKS) lrt_res_ordered <- lrt_res[order(lrt_res$padj),] write.csv(as.data.frame(lrt_res_ordered),file="$OUTFILE_NAME")
0dea58c087c7a5c2e6857adbce7e05376502d4e0aa87cd37ea3475e4838634cb
R
225
7
# Generated by using Rcpp::compileAttributes() -> do not edit by hand # Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 ComputeSNN <- function(nn_ranked, prune) { .Call(`_CellChat_ComputeSNN`, nn_ranked, prune) }
db8e932bb222a70cb395b93e7358ddbb6cfcd4095c880b88cca4d3ba3596e781
R
242
8
library(dplyr) library(readr) All_variants <- read_tsv("export/variant/All_variants_used_in_project.tsv") All_variants %>% filter(variant_type == "denovo") %>% select(-is_conserved) %>% write_tsv("export/variant/Table_S6.tsv")
49402212633c82c89fb9b7a40810203e6f054512aafbe1e1e50d0aad5c02c764
R
264
12
#### library(EBImage) tifs = paste0("/dcl01/lieber/ajaffe/Maddy/test", 1:6, ".tiff") x = readImage(tifs[1], info = TRUE) display(x, method = "raster", all = TRUE) ## make grey xGrey = x colorMode(xGrey) = Grayscale display(xGrey, method = "raster", all = TRUE)
2841220f690d6ba17da586cad425904476a1a3250acb2f57d3ff477d9de22081
R
270
7
require("DESeq2") count_data <- read.table("$COUNT_MATRIX", header=TRUE, sep= ",", row.names = 1) design_matrix <- read.table("$DESIGN_MATRIX", header=TRUE, sep= ",") dds <- DESeqDataSetFromMatrix(count_data, design_matrix, $FORMULA) $NORMFACTORS dds_res <- DESeq(dds)
e783b644fe7e50448718a2ff194f71bebe44b8d78b718904042e10367ec53861
R
279
7
contrast <- makeContrasts($CONTRAST, levels = design) contrast_fit <- contrasts.fit(fit, contrast) contrast_bayes <- eBayes(contrast_fit) res <- topTable(contrast_bayes, n=Inf) res_ordered <- res[order(res$adj.P.Val),] write.csv(as.data.frame(res_ordered),file="$OUTFILE_NAME")
aa83e29e14ef7213b9139206b1502e4e85d64af2072e6d3e780b166de6edebfc
R
282
7
library(IsoformSwitchAnalyzeR) IsoseqsSwitchList <- readRDS("results/long_read/IsoseqsSwitchList.rds") IsoseqsSwitchList <- analyzeAlternativeSplicing(IsoseqsSwitchList, onlySwitchingGenes=FALSE) saveRDS(IsoseqsSwitchList, "results/long_read/full_analyzeAlternativeSplicing.rds")
6480a4b4eccb8c8f3fc644c1a13f479d8949aad0090489a7e0283d3e4f017afa
R
299
13
#' check JSD score true <- read.csv('./DSTG_Result/true_output.csv',header=F) predict <- read.csv('./DSTG_Result/predict_output.csv',header=F) source('R_utils.R') jsd.score <- JSD_performance( spots_true_composition = as.matrix(true), spots_predicted_composition = as.matrix(predict))
031d9636acfe620e1acaa15f747d952acede749604d801f64d98b7d5946aae58
R
309
7
rmarkdown::render('batch_correction.Rmd') rmarkdown::render('correcting.Rmd') rmarkdown::render('differential_expression.Rmd') rmarkdown::render('seurat.Rmd') rmarkdown::render('variance_stabilizing_transformation.Rmd') rmarkdown::render('theta_regularization.Rmd') rmarkdown::render('method_comparison.Rmd')
fa09a39e4ae5110c3abe4d216fdfef8edf263271c87480a6bdd03cb383bdbbb5
R
335
7
library("BSgenome.Hsapiens.UCSC.hg38") library(IsoformSwitchAnalyzeR) bsg <- BSgenome.Hsapiens.UCSC.hg38 IsoseqsSwitchList_part1 <- readRDS("proc/IsoseqsSwitchList_part1.rds") IsoseqsSwitchList_part1_Analyzed <- analyzeORF(IsoseqsSwitchList_part1, bsg) saveRDS(IsoseqsSwitchList_part1_Analyzed, "IsoseqsSwitchList_part1...
dcd0f1e8e50c02992137914fb00c692d5a40d3f44c076db4b1c64e613004c7d4
R
354
11
require("Rsubread") fc <- featureCounts($KWARGS) counts <- fc$counts annotation <- fc$annotation stats <- fc$stat write.csv(as.data.frame(counts),file="$OUTPUT_DIR/featureCounts_counts.csv") write.csv(as.data.frame(annotation),file="$OUTPUT_DIR/featureCounts_annotation.csv") write.csv(as.data.frame(stats),file="$OUT...
0f2ba2169a759be979514a9c16a3e7c427d2ebb6aee580e8ce25804a83723c06
R
368
12
loadDB <- function(name) { db.path <- system.file("extdata", package = "omixerRpm") db <- ModuleDB(directory = db.path, modules = paste0(name, ".txt"), module.names.file=paste0(name, ".names")) db@module.names <- read.table( file.path(db@directory, db@module.names.file), row.names=1, sep="\t", header=F, ...
014c1f953297ba435630def10adfd908dd15a21e79321cac3b1a6a6e93bb8e2b
R
385
8
# Three-way ANOVA of swim gain (speed ratio) by genotype, stimulus speed, and stimulus frequency. args <- commandArgs(trailingOnly = FALSE) script_dir <- dirname(sub("^--file=", "", args[grep("^--file=", args)])) source(file.path(script_dir, "anova_common.R")) input_csv <- file.path(getwd(), "processed_data_speed_rat...
0cfee86cc908a0ec7d248332877f57e296d190e559a67280482aba7f6a785cd9
R
388
8
# Three-way ANOVA of trial duration (stimulus time) by genotype, stimulus speed, and stimulus frequency. args <- commandArgs(trailingOnly = FALSE) script_dir <- dirname(sub("^--file=", "", args[grep("^--file=", args)])) source(file.path(script_dir, "anova_common.R")) input_csv <- file.path(getwd(), "processed_data_st...
9e5d4335e7c8057dedcd97d2d5286ec2c3797e0a803f358fe4abfeb9e049e1e9
R
392
11
library(tidyverse) ###Must set working directory setwd("D:/PCB-MB Astrocyte Imaging/P35 Timepoint/Analysis Files/Somatosensory/GFAP_C3+ Counts") files <- list.files(pattern = "\\.csv$", full.names = TRUE) files <- files[file.info(files)$size > 0] compiled_dataset <- map_dfr(files, read_csv, show_col_types= F...
29fb4a1eff498fa187c172e2c70157d7a77b01caea4b891dac01d57229ed2582
R
474
14
### pd = read.delim("hafner_SraRunTable.txt",as.is=TRUE) table(pd$Sample_Name, pd$tissue) fqPath = "/dcs04/lieber/lcolladotor/with10x_LIBD001/HumanPilot/Analysis/hafner_vglut/FASTQ/" man = data.frame(leftRead = paste0(fqPath, pd$Run, "_1.fastq.gz"), leftMmd5 = 0, sampleID = pd$Run, stringsAsFactors=FALSE) all(file....
d8c8cb13cda1b12be518ae6ffadc3402f8b55c40bbf985b16f6bd0e226064c9e
R
482
11
setwd("/groups/stark/vloubiere/projects/DeepATAC_shenzhi/") devtools::load_all("/groups/stark/vloubiere/vlite/") # Screenshot pdf("pdf/0_paper/ATAC_screenshot_MEF2B_locus.pdf", height = 4) vlite::bwScreenshot(bed = "chr8:70,145,000-70,175,000", tracks = "/groups/stark/vloubiere/projects/DeepATAC_sh...
51c3034e07806115d03b987cf1884c5a0397fc103eecd5428c3e951c008a0552
R
504
20
setwd("/groups/stark/vloubiere/projects/DeepATAC_shenzhi/") devtools::load_all("/groups/stark/vloubiere/vlite-dev/") # Import peaks ---- peaks <- readRDS("Rdata/revision_ChIPseq_peaks.rds") # Import peaks ---- vl_par(mfrow= c(2,2)) dat <- peaks[signalValue>5] dat[, { .c <- collapseBed(.SD) .c[, name:= paste0("pea...
8200d3d640a624b972c5c71355544ad5d8c40469618d086e559c3a877d675f09
R
511
21
## ----Libraries ------------------ library(SummarizedExperiment) library(Matrix) ## load rse list load("Human_DLPFC_Visium_processedData_rseList.rda") ## collect sample names and clusters dfList = lapply(rseList, function(rse) { d = as.data.frame(colData(rse)[,c("sample_name", "Cluster")]) d = d[!dup...
fff3867779548e271afa25292949446868166b5074214d0b05ddfa8a27b034e1
R
519
12
txdb <- makeTxDbFromGFF("/project/s/shreejoy/Genomic_references/GENCODE/gencode.v47.annotation.gtf") tx2gene <- select(txdb, keys = transcripts(txdb)$tx_name, columns = "GENEID", keytype = "TXNAME") files <- Sys.glob("nextflow_results/salmon_GENCODE47/*/quant.sf") names(files) <- str_split(files, "/") %>% map_ch...
437d1b017736aea98e7a94bdbd92ad117754bb478b44f689d8b5c7f1c57fc2ca
R
520
12
require("limma") design_matrix <- read.table("$DESIGN_MATRIX", header=TRUE, sep= ",") $DEFINE_FACTORS design <- model.matrix($FORMULA, design_matrix) colnames(design)[1] <- "Intercept" # rename the intercept column from "(Intercept)" to "Intercept" colnames(design) <- make.names(colnames(design)) # make coefficient na...