Skip to content

Instantly share code, notes, and snippets.

View kojix2's full-sized avatar
🔬
🧬 🖥️ ♋

kojix2

🔬
🧬 🖥️ ♋
View GitHub Profile
@heronshoes
heronshoes / compare.md
Created September 1, 2022 21:06
Comparing between RedAmber, dplyr/tidyr and pandas

Comparing between RedAmber, dplyr/tidyr and pandas (tentative)

This is the comparison of basic feature between RedAmber and other major DataFrame libraries, comparing only for the method 'verbs' ignoring parameters and options.

Remarks:

  1. dataframe represents 2D data containers such as DataFrame, tibble or Table.
  2. vector represents 1D data containers such as Vector, Series or Column.

Select columns (variables)

@heronshoes
heronshoes / winequality.ipynb
Last active September 4, 2022 05:34
Wine quality
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@paithiov909
paithiov909 / archive-packages-for-ssh.ipynb
Created November 13, 2021 04:19
archive-packages-for-ssh.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tetlabo
tetlabo / access_drive_on_colab_withR.R
Last active September 29, 2021 04:07
Google ColabでRを使いDriveにアクセスする
# 必要なパッケージのインストール
install.packages("tidyverse")
install.packages("googledrive")
install.packages("R.utils")
# パッケージの読み込み
library(tidyverse)
library(googledrive)
# 非対話モードでのGoogle Drive認証
@kokitsuyuzaki
kokitsuyuzaki / conda_docker.md
Created December 1, 2020 01:20
Anacondaか、Dockerか

この記事はWorkflow Advent Calendar 2020の二日目の記事です。

自分は最近Snakemakeでワークフローを書いている。それまではシェルスクリプト → make → Rakeという風に、色々なやり方でワークフローを書いてきてたが、環境構築・再現性や分散処理の対応がしやすいSnakemakeに現在のところは落ち着いている。Snakemakeでコードの再現性に関わる技術はAnacondaとDocker(Singularity)である。ここでは、両方の技術は一長一短であり、両技術共に痒いところに手が届かない状況があるという話しをする。なお、自分はデータ解析を生業としており、データを前処理、解析、可視化しては、使うパッケージを適宜加えたり、減らしたりする探索的データ解析(EDA)の過程でSnakemakeを使っているため、事前に処理が決まっていて、あとはワークフロー化するだけの人とは状況がかなり違っている可能性があるので注意されたし。

Anacondaのメリット

Snakemake内でのAnacondaの使い方は簡単で、Snakemakeを実行する上で必要なSnakefileの中で、実行するruleにcondaタグを追加する。condaタグの中では、conda環境を構築する上で必要な共有ライブラリやらR,Pythonのパッケージやらを記述する。 https://snakemake.readthedocs.io/en/stable/snakefiles/deployment.html#integrated-package-management

あとは、snakemakeコマンドを実行する際に、--use-condaオプションを加えるだけで良い。

FROM python:3.8-slim as COVIDNet-CXR4-A
WORKDIR /download
# Download COVIDNet-CXR4-A
RUN pip3 install gdown && \
gdown https://drive.google.com/uc?id=1dCU5NV_-DKMKPUIJxO2MFU603LFkx5bd && \
gdown https://drive.google.com/uc?id=1cQ6Z3esdyTDuZJqc8lu8tL0sJ6GZCosI && \
gdown https://drive.google.com/uc?id=1-GW2qlGYcpNLgjy-q_f2XNYSlMzAbC8F && \
gdown https://drive.google.com/uc?id=1zGS8sA4HB6cnWfRlL8g18QJi_4tq6hNF
FROM python:3.8-slim as COVIDNet-SEV-GEO
# https://github.com/onnx/models/tree/master/vision/body_analysis/emotion_ferplus
require "onnxruntime"
require "mini_magick"
img = MiniMagick::Image.open("ranger.jpg")
img.crop "100x100+60+20", "-gravity", "center"
img.resize "64x64^", "-gravity", "center", "-extent", "64x64"
img.colorspace "Gray"
img.write("resized.jpg")
require "onnxruntime"
require "mini_magick"
require "numo/narray"
img = MiniMagick::Image.open("images/32576677167_a066c5a7aa_z.jpg")
img.resize "448x448^", "-gravity", "center", "-extent", "448x448"
pixels = Numo::NArray[*img.get_pixels]
pixels = pixels.transpose(2, 0, 1)
pixels = pixels.expand_dims(0)
@willprice
willprice / PBS_PRO_CHEAT_SHEET.md
Last active May 22, 2024 04:53
PBS pro cheat sheet

PBS Pro command cheat sheet

List nodes and their features

$ pbsnodes

@ktym
ktym / dp.rb
Last active July 14, 2022 08:13
See https://github.com/ktym/dp for newer version.
#!/usr/bin/env ruby
=begin
# Pairwise sequence alignment algorithms
Currently implements Needleman-Wunsch, Smith-Waterman
and Needleman-Wunsch-Gotoh algorithms based on
the Dynamic Programming (DP).
## Coordinates