sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
7f29d1eaee781e1c8ce6a86513d54ffdcd812d9dfe013ff3cf049efa239e014d | Python | 78,104 | 1,118 | # -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'core.ui'
##
## Created by: Qt User Interface Compiler version 6.10.0
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
#####################... |
f1c9c45e8fb795252b797d23c83e62790b24b426b5d091472bd55881199ffc9b | Python | 78,444 | 2,123 | import os
import sys
import unittest
import warnings
import inspect
from itertools import permutations
from unittest.mock import patch
import matplotlib as mpl
import scikit_posthocs._posthocs as sp
import scikit_posthocs._omnibus as som
import scikit_posthocs._outliers as so
import scikit_posthocs._plotting as splt
im... |
e64e869180c8298d04ba94696a1c1cb0fed5fd8ab8d062605da905898c3ad6eb | Python | 81,141 | 2,038 | # -*- coding: utf-8 -*-
"""
Created on Fri Dec 14 12:36:16 2018
@author: maikh
"""
from tensorflow.keras.models import Sequential,Model
from tensorflow.keras.layers import add,Add,Concatenate,Input,Dense,Dropout,Flatten,Activation,Conv2D,MaxPooling2D,BatchNormalization,GlobalAveragePooling2D,GlobalMaxPooling2D,... |
56078a25f3145bef060ab0a24c7784832b2d346fdbb0f736d5ca67aba94ae216 | Python | 84,043 | 2,118 | # -*- coding: utf-8 -*-
import numpy as np
from dipy.reconst.cache import Cache
from dipy.core.geometry import cart2sphere
from dipy.reconst.multi_voxel import multi_voxel_fit
from scipy.special import genlaguerre, gamma
from dipy.core.gradients import gradient_table_from_gradient_strength_bvecs
from scipy import speci... |
c6574244aa38273ae2f2bc8b95aa3329ae55a7b07e2888a50f37e15cac828db1 | Python | 84,236 | 2,550 | """AMQP Channels"""
# Copyright (C) 2007-2008 Barry Pederson <bp@barryp.org>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any... |
1d0c6faa0124b6493b7ed9617494547579999ecfa8b63c108399bbdd6466b28b | Python | 85,538 | 1,936 | # This code is © K. Heining, 2020, developed at the University of Freiburg.
# This code is made available under the BSD license enclosed with the software (see licence.txt).
# Over and above the legal restrictions imposed by this license, if you use this software for an academic
# publication then you are obliged to pr... |
7ea79b6fd73840c07ecd78e86d2ad0b54e9d9fb2da31a5183efa2a105fe6a4c8 | Python | 86,522 | 2,094 | """
BORIS
Behavioral Observation Research Interactive Software
Copyright 2012-2026 Olivier Friard
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 2 of the License, or
(at your ... |
289418b5333ec60ee9d24b69b89055ea086a102b1849ead3f1142b721868952e | Python | 87,570 | 2,461 | from __future__ import annotations
from typing import Callable
import cv2
import numpy as np
import pytest
import albumentations as A
from albumentations import RandomCrop, RandomResizedCrop, RandomSizedCrop, Rotate
from albumentations.augmentations.crops.functional import crop_bboxes_by_coords
from albumentations.a... |
8dae9236b529b1cae795e702adbc2571a4d0a843cd71c126f3099f69cc034b2c | Python | 90,101 | 2,056 | # -*- coding: UTF-8 -*-
import os
import shutil
import sys
import tempfile
from datetime import date, datetime
from unittest import skip
from unittest.mock import patch
from xml.etree import ElementTree
from xml.etree.ElementTree import XML
from django.conf import settings
from django.contrib.auth.models import User
... |
4c66c60e3dbf158394160bf11e10f5532cfa3f5cdd947fabb564321f771107bf | Python | 92,270 | 2,179 | import copy
import json
import operator
import re
from collections import OrderedDict
from functools import partial, reduce, update_wrapper
from urllib.parse import quote as urlquote
from django import forms
from django.conf import settings
from django.contrib import messages
from django.contrib.admin import helpers, ... |
20628e2935f719622c6614ed7296dc0e41568e9a13a3334f948b5867ca58f100 | Python | 92,305 | 3,002 | # coding: utf-8
"""
ASN.1 type classes for X.509 certificates. Exports the following items:
- Attributes()
- Certificate()
- Extensions()
- GeneralName()
- GeneralNames()
- Name()
Other type classes are defined that help compose the types listed above.
"""
from __future__ import unicode_literals, division, ab... |
f825970582d7cda5b8e51e0a4f6d9d144a80f48d4b6fb52d877b85ade3410bc0 | Python | 92,819 | 2,202 | # -*- coding: utf-8 -*-
# vim: ts=4 sw=4 et
#
# Python MPV library module
# Copyright (C) 2017-2024 Sebastian Götte <code@jaseg.net>
#
# python-mpv inherits the underlying libmpv's license, which can be either GPLv2 or later (default) or LGPLv2.1 or
# later. For details, see the mpv copyright page here: https://github.... |
8192597e2ada6fea9c47bb719ffe5205cfa7d3bc868b3cb0ef9bcf73cfc8eace | Python | 93,189 | 2,151 | """
BORIS
Behavioral Observation Research Interactive Software
Copyright 2012-2026 Olivier Friard
This file is part of BORIS.
BORIS 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 the L... |
f00b002b5ec40c7a85bc2d1f3174b743f0e47ace23956cd1c00e7cb1009e77a5 | Python | 94,525 | 2,419 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import base64
import collections
import contextlib
import itertools
from ... |
6eb45c78bafb8816d2e4510afbb7a4e0d09783471c1ba2bdecdec15faba35125 | Python | 96,570 | 2,312 | import numpy as np
from numpy.lib.stride_tricks import as_strided
from utils import magnitude
from math import exp
from utils.gaussian_fit import gauss_fit, kspacelines_gauss_fit, kspaceImg_gauss_fit
from utils.data_vis import get_mask, get_ROI_conts
from utils.polygon import intersection
def soft_thresh(u, lmda):
... |
bc70049c6fc5521066037c7942d21d5719ab4f3cf97bc53c630cd8fea43f3f30 | Python | 99,313 | 2,995 | #
# The Python Imaging Library.
# $Id$
#
# the Image class wrapper
#
# partial release history:
# 1995-09-09 fl Created
# 1996-03-11 fl PIL release 0.0 (proof of concept)
# 1996-04-30 fl PIL release 0.1b1
# 1999-07-28 fl PIL release 1.0 final
# 2000-06-07 fl PIL release 1.1
# 2000-10-20 fl PIL release 1.1.1... |
9ac69705b5e3443bd6a7f89a268b3863624ecefa4b8036bd8868c9dbc157cfec | Python | 107,402 | 3,155 | import hashlib
import cv2
import numpy as np
import pytest
from albucore import (
MAX_VALUES_BY_DTYPE,
clip,
get_num_channels,
is_multispectral_image,
to_float,
)
import albumentations.augmentations.pixel.functional as fpixel
import albumentations.augmentations.geometric.functional as fgeometric
f... |
3cacc4028f336928d0d152b0c78ad87ee167366637984ff26e7251c2bcaf2922 | Python | 108,944 | 1,532 | def set_limesurvey_api_mocks(mock_server):
mock_server.return_value.get_session_key.return_value = 'idk208ghdkdg8bu' # whatever string
mock_server.return_value.get_survey_properties.return_value = {'language': 'en', 'additional_languages': ''}
mock_server.return_value.export_responses.side_effect = [
... |
3c80becd09347adada435e4c5c3675c9070aed37fe81940561c0bb86c9caa042 | Python | 116,673 | 2,037 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import django.core.validators
import datetime
import experiment.models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('pati... |
9fe7499fbcacf11de665bb827390a000c6c9af0838414e22d0a64160bfab2aeb | Python | 117,255 | 2,778 | """
BORIS
Behavioral Observation Research Interactive Software
Copyright 2012-2026 Olivier Friard
This file is part of BORIS.
BORIS 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 the L... |
6e52e7c47352c499cf2201f63f3d9cc31e47a2670bb9e7120c5d21b34da71399 | Python | 118,496 | 2,724 | # coding=utf-8
from django.test import TestCase
from survey.abc_search_engine import Questionnaires
from experiment.forms import *
from experiment.forms import NumberOfUsesToInsertForm
from experiment.models import *
# from .models import Questionnaire, ABCSearchEngine, Survey, ABC
from django.contrib.auth.models ... |
56540f8be8156089e07e6478fc63fe0c6bc2107eef570b6afef4670980f05734 | Python | 118,982 | 2,914 |
# coding: utf-8
# In[1]:
import os
import seaborn as sns
import pandas as pd
from scipy import stats
import scipy as sp
import numpy as np
import datetime as dt
get_ipython().magic('matplotlib inline')
import matplotlib
# matplotlib.use('Agg')
# %matplotlib notebook
import matplotlib.pyplot as plt
from matplotlib i... |
0e90a4ab73efb641d1d0e0cc85c221e603a5286b7f1e699d6da670daa62b8d69 | Python | 137,517 | 3,688 | import inspect
import itertools as it
import warnings
import operator
from typing import Optional, Union, Literal
import numpy as np
from numpy.typing import ArrayLike
import scipy.stats as ss
from scipy import integrate, special
from statsmodels.stats.multitest import multipletests
from pandas import DataFrame, Series... |
fbf66e3b78366248815a6047bca9c59d5697a89a2e3be39e07ceeef6ef934594 | Python | 141,544 | 4,226 | """Functional implementations of image augmentation operations.
This module contains low-level functions for various image augmentation techniques including
color transformations, blur effects, tone curve adjustments, noise additions, and other visual
modifications. These functions form the foundation for the transfor... |
3e8af16a2249303007ecb9ace79008b6d07814874e387beaf6f7ba274a08fa1f | Python | 146,597 | 4,151 | """Functional implementations of geometric image transformations.
This module provides low-level functions for geometric operations such as rotation,
resizing, flipping, perspective transforms, and affine transformations on images,
bounding boxes and keypoints.
"""
from __future__ import annotations
import math
from... |
9beeb15f1eebd6433bbfdcb185d9d7c9b6788c224a64fb308b44891cbfa4e8d5 | Python | 148,240 | 3,647 | """Transform classes for cropping operations on images and other data types.
This module provides various crop transforms that can be applied to images, masks,
bounding boxes, and keypoints. The transforms include simple cropping, random cropping,
center cropping, cropping near bounding boxes, and other specialized cr... |
203aeaddc387eb1c5ceb89d0707afd2d474abebd835387a1778f48ea4e5739c3 | Python | 157,260 | 5,242 | # coding: utf-8
"""
ASN.1 type classes for universal types. Exports the following items:
- load()
- Any()
- Asn1Value()
- BitString()
- BMPString()
- Boolean()
- CharacterString()
- Choice()
- EmbeddedPdv()
- Enumerated()
- GeneralizedTime()
- GeneralString()
- GraphicString()
- IA5String()
- InstanceO... |
f880e8a4129f93ec9f9fa22bb6fed7ff9e20c99d1968c956fad50ccd57e69b4b | Python | 171,941 | 3,366 |
# coding: utf-8
# ## Crawl in the directory, load data in
# In[38]:
## The InLight col we have in the count csv files and count tab in the tdms file is based on cX data. Meaning that we're doing
## head tracking but not using in the PI calculation.
## Here, I wrote a function to generate InLight column for a given... |
0d2a24fda27c353f02e68ff5e24dd629414ad775169289143fc4ac1b02fa016e | Python | 200,000 | 4,996 | """
BORIS
Behavioral Observation Research Interactive Software
Copyright 2012-2026 Olivier Friard
This file is part of BORIS.
BORIS 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 the L... |
688fdeb611c7d65508d05ab5f875429546b9b59ff8d6597643d2bfc00fa48db8 | Python | 200,000 | 3,823 | # -*- coding: utf-8 -*-
"""
AIDeveloper
---------
@author: maikherbig
"""
VERSION = "0.4.8" #Python 3.9.9 Version
import os,sys,gc
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
if not sys.platform.startswith("win"):
from multiprocessing import freeze_support
freeze_support()
# Make sure to get the ri... |
816be8c8adcbd6e0b9b614857d09ba57854b2c6626dced1cf4d06404f6b347b2 | Python | 200,000 | 3,070 | # -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PySide6 (Qt v5.13.0)
#
# WARNING! All changes made in this file will be lost!
from PySide6 import QtCore
qt_resource_data = b"\
\x00\x00\x04\xba\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x... |
8d28511171486d32edf4179911a105fbac4a3da2531f520dd52150f319dec6bf | Python | 200,000 | 4,974 | # Resource object code (Python 3)
# Created by: object code
# Created by: The Resource Compiler for Qt version 6.10.0
# WARNING! All changes made in this file will be lost!
from PySide6 import QtCore
qt_resource_data = b"\
\x00\x00\xab\x13\
\x89\
PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\
\x00\x01\xf4\x00\x00\x01\x... |
f87d70ae333437bcbf14495f6d264d57a2769c8fd46496bed7c16190e07d12bf | Python | 200,000 | 3,290 | import pyqtgraph as pg
from pyqtgraph.Qt import QtCore, QtWidgets, QtGui
import sys,os,json,traceback,ast
import numpy as np
import cv2
import model_zoo
import aid_start,aid_dl,aid_bin #import a module that sits in the AIDeveloper folder
dir_root = os.path.dirname(aid_start.__file__)#ask the module for its orig... |
748196f177442268a937aed5eacfac0a7b35442302e305dfdf34917881b8ae5c | Python | 200,005 | 4,699 | # coding=utf-8
import csv
import re
import json
import random
import tempfile
import numpy as np
import nwb
import pydot
from django.core.mail import send_mail
from nwb.nwbco import *
import mne
import base64
import os
from datetime import date, timedelta, datetime
from dateutil.relativedelta import relativedelta... |
3251162bd64a6665fc57a13bddd5766e736d70621224af0ed6075aa5e63a2ef3 | Python | 200,007 | 3,517 | # -*- coding: utf-8 -*-
import csv
import json
import random
import re
import string
from collections import OrderedDict
from csv import writer
from datetime import date, datetime, timedelta
from sys import modules
from os import path, makedirs
from django.conf import settings
from django.core.files import File
from ... |
80aade2e00aa9597e69c335d527d47ef2d9e9a2a0fd201a1ec4fdadae1ab11f5 | Python | 200,009 | 2,290 | # Mocks to replace old tests that had using real consumption of
# LimeSurvey RPC API. The mocks were created based in old responses from
# the consumption of the API. So they are thick and can be decreased.
LIMESURVEY_SURVEY_ID_1 = 212121
LIMESURVEY_SURVEY_ID_2 = 505050
def set_mocks1(mockServer):
mockServer.ret... |
3595310468d08679054a62fb946e9915846d68b5aef9421fd2622209e6fcc9b5 | Python | 200,014 | 3,573 | import io
import json
import shutil
import sys
import tempfile
import zipfile
import os
from datetime import datetime
from unittest import skip
from unittest.mock import patch, call
from django.apps import apps
from django.contrib.auth.models import Group, User
from django.contrib.messages import get_messages
from dja... |
740b505f45a1e9ac875f02597f72fcf622ac0303cb962cdafad56bbe998fe9a2 | Python | 200,023 | 4,086 | import csv
import os
import io
import re
import sys
import tempfile
import zipfile
from datetime import date, datetime
import shutil
from unittest.mock import patch
from django.core.files import File
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
from django.template.defaultfi... |
72f0510d54c3c3c50d3d0c6ae953603d64dde615481ba57881655b8b1d3a4125 | Python | 200,049 | 5,224 | """Pixel-level transformations for image augmentation.
This module contains transforms that modify pixel values without changing the geometry of the image.
Includes transforms for adjusting color, brightness, contrast, adding noise, simulating weather effects,
and other pixel-level manipulations.
"""
from __future__ ... |
165cf5ea5cfccd0b90e59eadffa15d9362fc69954fc793a07df9820475413d87 | Python | 200,118 | 3,943 | # coding=utf-8
import datetime
import shutil
import tempfile
from unittest.mock import patch
from django.test import TestCase, override_settings
from django.urls import reverse
from django.core.files.uploadedfile import SimpleUploadedFile
from django.shortcuts import get_object_or_404
from django.utils.translation im... |
aaa78da8597c6d7f15f0546caf70d6a1263a51c464c83fc3d1e6db35aead63c6 | R | 12 | 1 | # References |
03fb9a41b24e25ace1fad9687a1baae5f67aeb5bdea56b6047f5176a36c4fdba | R | 28 | 1 | # (APPENDIX) Appendices {-} |
7fecd16f6c78e25a3404e608b70aeebbd426f804315d050bd16f5a161ba106ef | R | 49 | 3 | test_that("Dummy test", {
expect_true(TRUE)
})
|
02636094af7dfd26648fb1585b23f3be01114a5012cc9876c68ae58586fa1855 | R | 63 | 4 | library(testthat)
library(ciftiTools)
test_check("ciftiTools") |
61ea12087a4f424d4991b4b0ed93d505b941850202caf5707baa629fc0d9a54a | R | 121 | 4 | map1b = Leaflet$new()
map1b$setView(c(45.5236, -122.675), zoom = 14)
map1b$tileLayer(provider = 'MapQuestOpen.OSM')
map1b |
8637cc1fd676b402bb8832a32ad2d15ee8d598f32440e986211240ded62d9b9c | R | 139 | 5 | ## usethis namespace: start
#' @useDynLib BayesfMRI, .registration = TRUE
#' @importFrom Rcpp evalCpp
## usethis namespace: end
"_PACKAGE"
|
7e17389c26d5979661793565cc5ec11496d26492c707534277d5a8a7901b5ecf | R | 150 | 5 | require(rCharts)
map2 = Leaflet$new()
map2$setView(c(45.5236, -122.675), 10)
map2$tileLayer("http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png")
map2
|
5ba38e8de605205a7463ca99afdb573da8783fb46b23bd5562f8c6d5e1e56b77 | R | 164 | 9 | #' Import INLA dependencies
#'
#' Roxygen entry for additional INLA dependencies
#'
#' @import sp
#' @import foreach
#' @name INLA_deps
#' @keywords internal
NULL |
f850b851e7329671b062fc1f09d8c53aab2c0f1593c08f43c2766730c3eb594f | R | 215 | 9 | # change wd
setwd(rstudioapi::getActiveProject())
setwd("resources/book")
# render a chapter or the whole book
browseURL(bookdown::render_book("index.Rmd"))
browseURL(bookdown::preview_chapter("app-2_news.Rmd"))
|
3b6795cc2eb4fa3bc7f9537f60d54db675609e6d08165d43a5466016c22101ab | R | 239 | 8 | require(rCharts)
map3 <- Leaflet$new()
map3$setView(c(51.505, -0.09), zoom = 13)
map3$tileLayer(
"http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/997/256/{z}/{x}/{y}.png",
maxZoom = 18
)
map3$circle(c(51.5, -0.09), 100) |
d8455b647d1df81f831f8daaa2e857537408f9877990fd75f7171751449fabdc | R | 242 | 9 | require(rCharts)
map1 = Leaflet$new()
map1$setView(c(45.5236, -122.675), 13)
map1$tileLayer("http://a.tiles.mapbox.com/v3/mapbox.control-room/{z}/{x}/{y}.png", zoom = 8)
map1
map1 = Leaflet$new()
map1$setView(c(45.50867, -73.55399), 13)
map1 |
1d72c14a20a3c8b0e70afc4fe9ecd6b0676bf38eccfc5631d374b4d08761e241 | R | 243 | 4 | # cortex subcortex
# nVt # vertices # voxels in initial brain mask
# nVd0 # vertices in initial ROI # voxels in initial brain mask (==nVt)
# nVd # good data vertices # good data voxels
|
b4ba76521d8f224c588fddcd908bc2a36976c10d825a86f2e6e7bfc1d1dbc418 | R | 245 | 6 | require(rCharts)
map6 = Leaflet$new()
map6$setView(45.372, -121.6972, 12)
map6$tileLayer(provider ='Stamen.Terrain')
map6$marker(45.3288, -121.6625, bindPopup = 'Mt. Hood Meadows')
map6$marker(45.3311, -121.7113, bindPopup = 'Timberline Lodge')
|
395eafca0e04a03a85492338a2f01d7253966914299681fd86d377cc367d2122 | R | 254 | 6 | map2 = Leaflet$new()
map2$setView(c(45.5236, -122.6750), 13)
map2$tileLayer(provider = 'Stamen.Toner')
map2$marker(c(45.5244, -122.6699), bindPopup = 'The Waterfront')
map2$circle(c(45.5215, -122.6261), radius = 500, bindPopup = 'Laurelhurst Park')
map2
|
02af3b156d895e2f6efa520fca03ccf98008ef1ba4b27b445ba71fcc9a2730d2 | R | 345 | 2 | source("/home/pdemange/CogNonCog/Annotations/Mouse_annotation/Basefiles/make.LDSR.annot_v2_4_6.R")
collapse.annots("/home/pdemange/CogNonCog/Annotations/Mouse_annotation/shoulder10k_nowindow_baselineld2.2/ANNOTS/","/home/pdemange/CogNonCog/Annotations/Mouse_annotation/shoulder10k_nowindow_baselineld2.2/UNIONS/","Mouse... |
de85d65e2df1f7f410f124fd55f726e25110fa8b67a58ccdaf2703f3d352f7d2 | R | 351 | 37 | # functions file
## load libraries
print("Loading environment and libraries.")
source("functions/install_dcm2niix.R")
source("functions/libraries.R")
source("functions/environment.R")
source("functions/bids_files.R")
## general functions
print("Loading functions")
source("functions/general.R")
source("functions/meth... |
1da2b26b6e34d70c6b3c901c8b206adc7754df0d2b72fbf6cb4e51057053689b | R | 358 | 16 | #!/usr/bin/env Rscript
args = commandArgs(trailingOnly=TRUE)
# test if there is at least one argument: if not, return an error
if (length(args)==0) {
stop("At least one argument must be supplied (input directory of your study, containing 'dicom/session/subject' folders", call.=FALSE)
}
source(paste0(getwd(), "/scr... |
f8ef458f999e3fabfb98ffa872cdc753623836e5484cd81355611f8be4a2d2be | R | 358 | 8 | # Loads methods from method folder
source("functions/methods/createStartConditions.R")
source("functions/methods/prepareDCM2NIIX.R")
source("functions/methods/convertDCM2NIIX.R")
source("functions/methods/readJSONmetadata.R")
source("functions/methods/extractSequences.R")
source("functions/methods/copy2BIDS.R")
source(... |
2e9e7a62f63bc69a1be964622e9b6653859b462329743bd82280f5fda0daffa3 | R | 389 | 12 | rMap <- function(location = 'montreal', zoom = 10, provider = 'MapQuestOpen.OSM'){
m1 <- Leaflet$new()
lnglat <- as.list(ggmap::geocode(location))
m1$setView(lnglat$lat, lnglat$lon, zoom = zoom)
m1$tileLayer(provider = provider)
return(m1)
}
r1 <- rMap()
mcgill <- as.list(ggmap::geocode('mcgill univesity'))
... |
2a45f4226ab0715664cd10d6ec3e7767aeb57c1bbfd4f06c628e73a7baaad646 | R | 390 | 10 |
packages <- c("tidyverse", "stringi", "lubridate", "rjson", "flexdashboard", "knitr", "DT", "lattice", "plotly",
"devtools")
if (!require("pacman")) install.packages("pacman", repos = "https://cran.us.r-project.org")
pacman::p_load(packages, character.only = TRUE)
if (!require("papayaWidget")) devtools... |
eef99eb18d02a0166c89db8505f2a266473da7ffb38a787c793bc71f69ba4031 | R | 402 | 12 | require(rCharts)
map3 <- Leaflet$new()
map3$setView(c(51.505, -0.09), zoom = 13)
map3$tileLayer(
"http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/997/256/{z}/{x}/{y}.png",
maxZoom = 18
)
map3$marker(c(51.5, -0.09), bindPopup = "<p> Hi. I am a popup </p>")
map3$marker(c(51.495, -0.083), bindPopup = ... |
d5f354fcdd7341444805c9a789f3866f95fb4bf3a7af0f77332726f4bce97bd8 | R | 422 | 14 | # Build --> Install and Restart
# [Edit these] paths to Workbench and result output.
my_wb <- "../workbench"
save_path <- "tests/output" # in gitignore
library(testthat)
library(BayesfMRI)
library(ciftiTools)
if (interactive()) { ciftiTools.setOption("wb_path", my_wb) }
tests_dir <- "testthat"
if (!endsWith(getwd(), ... |
30ee6c58e9ea8ae41c61f52340ac345cbb5ba855bb5cfdb9e287f6cd10159308 | R | 436 | 31 | require(rCharts)
dt <- dTable(
iris,
sPaginationType= "full_numbers"
)
dt
dt <- dTable(
iris,
bScrollInfinite = T,
bScrollCollapse = T,
sScrollY = "200px",
width = "500px"
)
dt
#not really a use case but a test to check for errors
data(Orange)
dt <- dTable(
Orange,
sScrollY = "200px",
bScrollCol... |
811be5ea9d5ae10f6cbb649c198c406ce291cc58afe16feab957c808f0c3d192 | R | 452 | 22 | #' Message on attach
#'
#' Checks if INLA is installed, and prints a warning if not.
#'
#' @param ... Not used
#'
#' @return \code{NULL}, invisibly
#'
#' @keywords internal
.onAttach <- function(...) {
if (interactive()) {
if (!requireNamespace("INLA", quietly = TRUE)) {
warning(
"The `INLA` pack... |
e65de2f537b7d4540029b385191b317a0908d1e1a2ee55358bffdde1ee9990e2 | R | 479 | 11 | # 3D
The 3D functions are currently under development. You can upload OBJ files and associated BMP or JPEG textures and view them in the 3D Window (<span class="cmd">3</span>). You can also morph between two objects that have the same geometry.
```{r fig-3d, echo = FALSE, fig.cap = "3D Window."}
knitr::include_graphi... |
12eaffb6364130f895e5045a185de81c036cda0cd3d5a2001c38311aa4ffa247 | R | 508 | 19 | #' @importFrom stats cor
checkX_cor <- function(X){
suppressWarnings(corX <- cor(X))
diag(corX) <- NA
corX
}
#' @importFrom car vif
#' @importFrom stats lm rnorm
checkX_VIF <- function(X){
nT <- nrow(X)
nK <- ncol(X)
y <- rnorm(nT) #add fake y variable, has no influence
Xnames <- paste0("X", seq(nK))
... |
3a6d29a568631f291e52f195efdf300658dedb8b52f2a0ec97efe33dcbbef056 | R | 526 | 22 | #' Surface area of each vertex
#'
#' Compute surface areas of each vertex in a triangular mesh.
#'
#' @inheritSection INLA_Description INLA Requirement
#'
#' @inheritParams mesh_Param_inla
#'
#' @return Vector of areas
#'
#' @export
vertex_areas <- function(mesh) {
if(missing(mesh)) { stop("`mesh` input is requir... |
afe5ef6285a4b19ca6cc140658d383188747086ead96f034b9a1ae5fd0171073 | R | 565 | 17 | #calc of bifurcation plots
library(rehh)
library(vcfR)
hho <- data2haplohh(hap_file = "scaf27.out.head.vcf",polarize_vcf = FALSE)
#central SNP for bifurcation analyses is scaffold27_1539277
#Because RAD SNPs are patchy, present on SNP by SNP basis rather than distance
hho@positions=c(1:356)
furcationo <- calc_furcatio... |
e6a03338513c85a11fa2fe9e692dff5b5737806a7e408efd2161a3d8d7513e06 | R | 625 | 24 | ##################################################
## Project: CogNonCog 2018
## Script purpose: Run the GSEM model without SNPs
## https://github.com/MichelNivard/GenomicSEM/wiki/3.-Models-without-Individual-SNP-effects
## Date: March 2019
## Author: Perline Demange
#############################################... |
555b00692603ad99055f618d4ce8f59e2c9f2a41fc69797c1033bda86e432d8e | R | 644 | 26 | #!/bin/env Rscript
args <- commandArgs(TRUE)
if (length(args) != 1) {
cat( "Usage: heatmap.R filename\n" )
quit('no', 1, FALSE)
}
filename <- as.character( args[1] )
library(pheatmap)
library(RColorBrewer)
breaksList = seq(1.25,6.5, by = 0.01)
#1.25
df=read.table(file = filename,hea... |
ed3e4285a075f925cacf7453251dcb91d45ef39caeca1b0dde5e3a4ede903d7c | R | 661 | 29 | #!/usr/bin/env Rscript
args = commandArgs(trailingOnly=TRUE)
if (length(args)!=2) {
stop("Usage: Rscript prepare_nominal_files.R parquet_input_folder output_file", call.=FALSE)
}
input_folder = args[1]
output_file = args[2]
# install.packages("arrow")
library(arrow)
setwd(input_folder)
file_list <- list.files(pa... |
1d64cc36e516dc5110712cfe3a777e7ba2c6740c06d42cef86e13598e780c2f4 | R | 681 | 27 | #' Scale CIFTI
#'
#' Scale CIFTI data. Similar to \code{\link[base]{scale}}.
#'
#' @inheritParams xifti_Param
#' @param center,scale Arguments to \code{\link[base]{scale}}.
#'
#' @return The input \code{"xifti"} with scaled columns.
#'
#' @family manipulating xifti
#'
#' @export
scale_xifti <- function(xifti, cent... |
95ee020bda6fe841373fd375737755b75add5fb9e0458144483af96186541d8c | R | 703 | 28 | # In R
setwd("Cog_Combined_BayesR")
# Make Group file
cpgs = readRDS("../Cog_EWAS_BayesR/Cog_10k_cpgs.rds")
snps = readRDS("../Cog_GWAS_BayesR/Cog_10k_snps.rds")
cpgs$group = 0
snps$group = 1
features = rbind(cpgs, snps)
dir.create("Cog_Inputs")
write.table(features, file="Cog_Inputs/group_file.txt", s... |
54d0f8a30eae9ded23ec257d15c377f0e2686779e9069674023d63087142829c | R | 719 | 19 | # Build --> Install and Restart
# [Edit this] path to the Workbench for your computer.
my_wb <- "~/Applications"
library(testthat)
library(ciftiTools)
if (interactive()) { ciftiTools.setOption("wb_path", my_wb) }
tests_dir <- "testthat"
if (!endsWith(getwd(), "tests")) { tests_dir <- file.path("tests", tests_dir) }
s... |
cb506596d38057e591a48ec84a27d9480dff4e098db4ab3a44b95f3878872780 | R | 730 | 24 | map4 = Leaflet$new()
map4$setView(c(29.6779, -95.4379), 10)
map4$tileLayer("http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/997/256/{z}/{x}/{y}.png")
# map4$tileLayer(provider = 'Stamen.Terrain')
data(crime, package = 'ggmap')
dat <- head(crime)[,c('lat', 'lon', 'offense')]
names(dat) <- c('lat', 'lng'... |
2b5a66b214e48d34e5d99a1e4fe827c141aba73df6eab270ad01619262972456 | R | 761 | 12 | #stairway plot based on Misha Matz code @ https://github.com/z0on/Adaptive-pathways-of-coral-populations-on-the-Great-Barrier-Reef/blob/master/GBR_stairway.R)
library(ggplot2)
#read in output from stairway plot
stair=read.table("path/to/summaryfile",header = TRUE)
#plot
ggplot(stair,aes(x=year))+geom_line(aes(y=Ne_medi... |
1bdabb2c74ddd0008c412184c2666a828df8cde88551aef97d6696b0fc3c9818 | R | 765 | 23 | require(rCharts)
options(RCHART_WIDTH = 800, RCHART_HEIGHT = 400)
### {title: Bar Chart, working: FALSE}
p1 <- xCharts$new()
p1$set(xScale = 'ordinal', yScale = 'linear')
p1$layer(~ cyl, data = mtcars, type = 'bar')
p1
### {title: Multi Bar Chart, working: TRUE}
haireye = subset(as.data.frame(HairEyeColor), Sex == "M... |
36a65fd0334b333006f54c2a33cb98ec9612aaabade9d7250b6e13b74a812fd9 | R | 820 | 32 | require(rCharts)
haireye = as.data.frame(HairEyeColor)
## {title: Simple Bar Chart}
dat = subset(haireye, Sex == "Female" & Eye == "Blue")
p1 <- mPlot(x = 'Hair', y = list('Freq'), data = dat, type = 'Bar', labels = list("Count"))
p1
### {title: Simple Bar Chart, tag: "No Hover"}
p1$set(hideHover = "auto")
p1
## {ti... |
18da4c1c736c6e8115dec897658d2c76208bdadddbfa5ee6d051686da775669f | R | 849 | 21 | ##################################################
## Project: CogNonCog 2018
## Script purpose: Prepare the summary statistics to be used by GSEM (Step 1 and 2)
## With the metanalysed 23andMe+lee eduyears GWAS and CP (lee et al)
## https://github.com/MichelNivard/GenomicSEM/wiki/5.-User-Specified-Models-with-SNP-... |
d024e23507a39194970338f0bcae4fc98c93fbceef182c49155837e722bcecc8 | R | 853 | 22 | ######list all files
filenames<-as.list(list.files(pattern="*.sam"))
##### read group information
group<-read.delim("EAT_group_cluster.txt",sep="\t",row.names=1)
sample.ids<-as.list(group$Group)
library(methylKit)
x<-group$Group
x[x=="Site1"]=0
x[x=="Site3"]=1
x[x=="Site2"]=2
x<-as.numeric(x)
myobj<-processBismarkAln(... |
a0c1fa574adad4facff41452a4ea8e81c3c94592f81c9b6af60c9c941de6e643 | R | 858 | 22 | set1 <- read.table(".txt", header=T, stringsAsFactors = FALSE)
set2 <- read.table(".txt", header=T, stringsAsFactors = FALSE)
set1_v <- set1$gene_name
set2_v <- set2$gene_name
setEnrichment <- function(set1, set2, universe = 20000){
a = sum(set1 %in% set2)
c = length(set1) - a
b = length(set2) - a
d = univ... |
130c34227ebf360206146956c311f54c813e3462345322322e3ca8c1ba541dce | R | 888 | 29 | #' Create SPDE for 2D surface data
#'
#' @param mesh A list with elements \code{n} (the number of vertices),
#' \code{loc} (the n x 3 matrix of vertices), \code{graph$tv} (the matrix of
#' faces with 3 columns), and \code{idx$loc} (a vector of the indices ,
#' usually 1:n)
#'
#' @return SPDE object representing t... |
e28fce1a05ee76e0b85bbb24b89b6eab54480d73dc4d7961562e8c986a71bbd8 | R | 891 | 30 | require(quantmod)
require(plyr)
tickers = c('AAPL', 'GOOG', 'MSFT')
quotes = llply(tickers, getSymbols, auto.assign = F)
to_jsdate <- function(date_){
val = as.POSIXct(as.Date(date_), origin="1970-01-01")
as.numeric(val)
}
getSymbols('AAPL')
AAPL <- transform(AAPL, date = to_jsdate(index(AAPL)))
names(AAPL) = gs... |
7da1308e5d12e3531ddd7773ce552852739a7c06f3f863c6ef7ea17768e68cdf | R | 894 | 30 | # Function to calculate the genetic correlation with EA with Genomic SEM
CogNoncog_gen_correlation_EA <- function(data1, data2, sample.prev_trait, population.prev_trait, trait.name){
traits <- c(data1, data2)
sample.prev <- c(NA,sample.prev_trait)
population.prev <- c(NA,population.prev_trait)
ld<-"eur_w_ld... |
e7be4e029dc91fd29bbcda6c42b897d2d74d22de1a04a681527704af8b8c3df9 | R | 897 | 31 | #!/usr/bin/env Rscript
args = commandArgs(trailingOnly=TRUE)
sumstats_list = as.character(args[1])
outputName = as.character(args[2])
#packages
require(GenomicSEM)
library(data.table)
source("function_rG_woSNP.R")
### Load data ###
data <- read.csv(sumstats_list)
filename <- as.vector(data$Filename)
traitname <- a... |
8f668e903626bfbdf41c2fb49aab9a77f60b83f76c57c8cad463f2bf078f9969 | R | 907 | 31 | #!/usr/bin/env Rscript
args = commandArgs(trailingOnly=TRUE)
sumstats_list = as.character(args[1])
outputName = as.character(args[2])
#packages
require(GenomicSEM)
library(data.table)
source("function_rG_woSNPcov01.R")
### Load data ###
data <- read.csv(sumstats_list)
filename <- as.vector(data$Filename)
traitname... |
698f6259f4c0d408b858c3b3228282791e9377a57db119b69fc5bae1281b9c0f | R | 914 | 26 | check_wb <- function() {
if (is.null(ciftiTools.getOption("wb_path"))) {
skip("Connectome Workbench is not available.")
}
}
test_that("plot_xifti_volume and related functions are working", {
check_wb()
fnames <- ciftiTools.files()
cii <- read_cifti(fnames$cifti["dscalar_ones"], brainstructures="all")
... |
6ff4986bd2b049c18cad52a85b1ef55d008d6f7b150f475179199aeac2671b8b | R | 919 | 31 | #!/usr/bin/env Rscript
args = commandArgs(trailingOnly=TRUE)
sumstats_list = as.character(args[1])
outputName = as.character(args[2])
#packages
require(GenomicSEM)
library(data.table)
source("function_rG_woSNP_causalEACP.R")
### Load data ###
data <- read.csv(sumstats_list)
filename <- as.vector(data$Filename)
tra... |
d6e974464dbe6da4a6fbf9c3e0a7838a8ece2c7715d6984524c716c7ea7a5f0e | R | 924 | 40 | #' Make Mesh
#'
#' Make INLA triangular mesh from faces and vertices
#'
#' @inheritSection INLA_Description INLA Requirement
#'
#' @inheritParams vertices_Param
#' @inheritParams faces_Param
#'
#' @return INLA triangular mesh
#'
#' @export
make_mesh <- function(vertices, faces) {
if (!requireNamespace("INLA", quietly... |
ff147ce23ae520ab5346ecb684f7a3ea657ebf161c309db37574af33235c52b9 | R | 935 | 31 | #!/usr/bin/env Rscript
args = commandArgs(trailingOnly=TRUE)
sumstats_list = as.character(args[1])
outputName = as.character(args[2])
#packages
require(GenomicSEM)
library(data.table)
source("function_rG_woSNP_CogentUKB.R")
### Load data ###
data <- read.csv(sumstats_list)
filename <- as.vector(data$Filename)
trai... |
efdb4ea2a3543f514d97de7130550f57b2e77645cc528d335b37330c4e2af88e | R | 936 | 18 | d = read.csv("AllData/Or67d_weighted_TSALE_values.csv", header=T, as.is=T, check.names=FALSE)
cid = c("Fly ID","Light Intensity(uW/mm2)","Wind status", "Satiety", "Sex", "Genotype","Status","weighted_TSALE_P10")
d = d[,cid]
write.table(d, "AllData_cleaned/Or67d_wTSALE_reduced.txt", sep="\t", row.names=F)
d = read.csv... |
6d66aab9f2455c62f3426a46cd4b083ad678a177ef9ef6e23f393ad240819351 | R | 951 | 33 | LDSCoutput_rG_woSNP_causalEACP <- function(data1, data2, data3, sample.prev_trait, population.prev_trait, trait.name){
traits <- c(data1, data2, data3)
sample.prev <- c(NA,NA,sample.prev_trait)
population.prev <- c(NA,NA,population.prev_trait)
ld<-"eur_w_ld_chr/"
wld <- "eur_w_ld_chr/"
trait.names<-c("... |
04eacbfb3edf681475a7ac8597cba055e96d8f01f2be6d6822444e3257a110ef | R | 968 | 32 | #!/usr/bin/env Rscript
args = commandArgs(trailingOnly=TRUE)
sumstats_list = as.character(args[1])
outputName = as.character(args[2])
mungefileName = as.character(args[3])
#packages
library(devtools)
require(GenomicSEM)
library(data.table)
source("gencor_EA_function.R")
### Load data ###
data <- read.... |
9ba5b1f7e567bd9763d88960af4260166b31b6e2667cad564844a71a7c83e322 | R | 972 | 32 | #!/usr/bin/env Rscript
args = commandArgs(trailingOnly=TRUE)
sumstats_list = as.character(args[1])
outputName = as.character(args[2])
mungefileName = as.character(args[3])
#packages
library(devtools)
require(GenomicSEM)
library(data.table)
source("gencor_function.R")
### Load data ###
data <- read.csv... |
cfa0a217b30d095f9dca241eabcc7d224b9488d0a97b6739df1de35816aa1009 | R | 978 | 31 | #!/usr/bin/env Rscript
args = commandArgs(trailingOnly=TRUE)
sumstats_list = as.character(args[1])
outputName = as.character(args[2])
mungefileName = as.character(args[3])
#packages
require(GenomicSEM)
library(data.table)
source("function_rG_mediation.R")
### Load data ###
data <- read.csv(sumstats_lis... |
56e6d87ca780f8e9558442acfb62a36db324578247b07ef9000f2ff2e058669f | R | 1,060 | 37 |
LDSCoutput_rG_woSNP <- function(data1, data2, data3, data4, sample.prev_trait, population.prev_trait, trait.name){
traits <- c(data1, data2, data3, data4)
sample.prev <- c(NA,NA,NA,sample.prev_trait)
population.prev <- c(NA,NA,NA,population.prev_trait)
ld<-"eur_w_ld_chr/"
wld <- "eur_w_ld_chr/"
trait... |
8255c0b1ba11cc2b6a7d713ea96a6347eb2159fa28bc5ada752c7f85b679c2ce | R | 1,092 | 51 | d1 <- rCharts$new()
d1$setLib('uvcharts')
d1$set(categories = names(dat), type = 'Bar')
d1$set(dataset = dat)
d1$show(cdn = T)
d2 <- dTable(iris, iDisplayLength = 4)
d2$set()
library(plyr)
library(rCharts)
make_dataset <- function(x, y, dat, group = NULL){
require(plyr)
dat <- rename(dat, setNames(c('name',... |
032440653156644835d05504b7da3effc61b7287b4bf78aeeb4c8b2c920764e3 | R | 1,140 | 35 | # install dcm2niix
#' installs dcm2niix from Chris Rordens Github Repository, also depending on OS
#'
#' @examples install_dcm2niix()
install_dcm2niix <- function() {
if (length(list.files(pattern = "dcm2niix")) == 0) {
os <- Sys.info()["sysname"]
if (os == "Darwin") {
message("Identified MacOs. Not o... |
b11d86c4fa3cbd5ad34e247fbbb764e4119fe921701ce456f0783436e0b7921b | R | 1,159 | 35 | #' Evenly sample vertices of mesh
#'
#' Get a subset of the mesh vertices that are spatially evenly-sampled, by
#' resampling the mesh and choosing the original vertices closest (Euclidian
#' distance) to the new vertices.
#'
#' @param surf A \code{"surf"} object
#' @param n_vert The desired number of vertices in the... |
fd847c2383270032dc3a8f4c9d1825c27f239a1e6c2f9c914286d5cd5ab42926 | R | 1,204 | 33 | # Build --> Install and Restart
# [Edit these]
# ## path to your PARDISO license
# my_pardiso <- "../INLA/pardiso.lic"
## path to your Connectome Workbench
my_wb <- "~/Desktop/workbench"
## path to test data
dir_data <- "data"
dir_data2 <- "data_notInPackage"
## path to results from tests
dir_results <- file.path(dir_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.