Skip to content

Instantly share code, notes, and snippets.

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

kojix2

🔬
🧬 🖥️ ♋
View GitHub Profile
@ilevantis
ilevantis / bedtools_cheatsheet.md
Last active April 16, 2025 22:26
Bedtools cheatsheet

Bedtools Cheatsheet

General:

Tools Description
flank Create new intervals from the flanks of existing intervals.
slop Adjust the size of intervals.
shift Adjust the position of intervals.
subtract Remove intervals based on overlaps b/w two files.
@hidao80
hidao80 / TimeSpecificationToot.gs
Last active April 14, 2021 23:18
時分指定Tootスクリプト(Google Spreadsheet Script使用)
/**
* 時分指定tootスクリプト
*
* Google Spreadsheetのスクリプトとして設置する、時分指定でtootするためのスクリプト。
* このスクリプトのsetTrigger関数を日ごとに起動するトリガーに指定して利用する。
*
* Spreadsheetの2行目2列目からn行目までに空行を含まずtootしたいメッセージを入力しておくと、
* 上から順にtootし、一番下のメッセージまでTootしたら、一番上のメッセージに戻って
* tootを続ける。
*
@obelisk68
obelisk68 / kaki-lifegame.rb
Last active May 8, 2022 10:26
エディタ付きライフゲーム(Ruby)
require 'gtk2'
module LifeGame
class Field
MG = 4
Small, Large = [70, 50], [85, 60]
def initialize
@width, @height = Small
@size = :small

rb_thread_call_without_gvl を使う

例えば普通に書くと

nvrtcResult status = nvrtcCreateProgram(&_prog, _src, _name, _numHeaders, _headers, _includeNames);

となる C 関数の呼び出しを、GVLを外して呼び出すには、

@arose13
arose13 / install-conda.sh
Last active November 11, 2024 05:41
Install Miniconda in Ubuntu
# Setup Ubuntu
sudo apt update --yes
sudo apt upgrade --yes
# Get Miniconda and make it the main Python interpreter
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh
bash ~/miniconda.sh -b -p ~/miniconda
rm ~/miniconda.sh
export PATH=~/miniconda/bin:$PATH

An error

I was using TEQC to do quality control of my WES bam files aligned by bwa-mem. My data are paired end, so a function reads2pairs is called to make the paired-end reads to be a single fragment. I then get this error:

> readpairs <- reads2pairs(reads)
Error in reads2pairs(reads) : read pair IDs do not seem to be unique

I asked in the bioconductor support site and went to the source code of that function.

@komasaru
komasaru / conv_camel_snake.rb
Created October 28, 2016 08:48
Ruby script to convert CamelCase and snake_case each other.
class String
def to_camel
self.split(/_/).map(&:capitalize).join
# or
#self.split(/_/).map{ |w| w[0] = w[0].upcase; w }.join
end
def to_snake
self.gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
.gsub(/([a-z\d])([A-Z])/, '\1_\2')
@mono0926
mono0926 / commit_message_example.md
Last active February 11, 2025 06:39
[転載] gitにおけるコミットログ/メッセージ例文集100
Let [tag] = any tag in upstream repo
git fetch upstream --tags
git push origin --tags
@PolarNick239
PolarNick239 / rgb_to_hsv_np.py
Last active January 14, 2023 10:48
numpy RGB to HSV
#
# Copyright (c) 2016, Nikolay Polyarnyi
# All rights reserved.
#
import numpy as np
def rgb_to_hsv(rgb):
"""