This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| import cv2 | |
| import numpy as np | |
| import chainer | |
| import chainer.links as L | |
| from chainer import Chain, Variable | |
| from chainer import datasets | |
| class SOM(Chain): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /home/tatsuya% docker run -it ubuntu:trusty | |
| root@1ce8acf4991d:/# cd | |
| root@1ce8acf4991d:~# uname -a | |
| Linux 1ce8acf4991d 4.11.9-1-ARCH #1 SMP PREEMPT Wed Jul 5 18:23:08 CEST 2017 x86_64 x86_64 x86_64 GNU/Linux | |
| root@1ce8acf4991d:~# cat /etc/lsb-release | |
| DISTRIB_ID=Ubuntu | |
| DISTRIB_RELEASE=14.04 | |
| DISTRIB_CODENAME=trusty | |
| DISTRIB_DESCRIPTION="Ubuntu 14.04.5 LTS" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #CODE | |
| #Generate root password | |
| import random, string | |
| password = ''.join(random.choice(string.ascii_letters + string.digits) for i in range(20)) | |
| #Download ngrok | |
| ! wget -q -c -nc https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip | |
| ! unzip -qq -n ngrok-stable-linux-amd64.zip | |
| #Setup sshd |
この記事はWorkflow Advent Calendar 2020の二日目の記事です。
自分は最近Snakemakeでワークフローを書いている。それまではシェルスクリプト → make → Rakeという風に、色々なやり方でワークフローを書いてきてたが、環境構築・再現性や分散処理の対応がしやすいSnakemakeに現在のところは落ち着いている。Snakemakeでコードの再現性に関わる技術はAnacondaとDocker(Singularity)である。ここでは、両方の技術は一長一短であり、両技術共に痒いところに手が届かない状況があるという話しをする。なお、自分はデータ解析を生業としており、データを前処理、解析、可視化しては、使うパッケージを適宜加えたり、減らしたりする探索的データ解析(EDA)の過程でSnakemakeを使っているため、事前に処理が決まっていて、あとはワークフロー化するだけの人とは状況がかなり違っている可能性があるので注意されたし。
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オプションを加えるだけで良い。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # COLUMNS: For entries "all-nodes and color": obj_type all-nodes obj_subtype color | |
| # COLUMNS: For entries "all-nodes and bordercolor": obj_type all-nodes obj_subtype color | |
| # COLUMNS: For entries "node and color": obj_type node_label obj_subtype color | |
| # COLUMNS: For entries "node and rppasite": obj_type node_label obj_subtype subtype_info|subtype_label|subtype_bkgrd_color|subtype_border_color | |
| # COLUMNS: For entries "node and tooltip": obj_type node_label obj_subtype tooltip_information_onmousehover | |
| # NOTE: "subtype_info" is also tooltip information for onmousehover for individual rppasite | |
| node all-nodes color 255 255 255 | |
| node all-nodes bordercolor 50 50 50 | |
| node FOXA1 color 40 80 255 | |
| node FOXA1 tooltip FOXA1, -24.349700502698532 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Grab(group='org.openscience.cdk', module='cdk-bundle', version='2.5') | |
| // Copyright (C) 2021 Egon Willighagen <[email protected]> | |
| // | |
| // MIT license | |
| // | |
| // If you use this script, please cite the CDK 2.0 article: | |
| // https://jcheminf.biomedcentral.com/articles/10.1186/s13321-017-0220-4 | |
| import org.openscience.cdk.interfaces.*; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(rmzTabM) ## https://lifs-tools.github.io/rmzTab-m/ | |
| library(metabolighteR) ## https://aberhrml.github.io/metabolighteR/ | |
| convertMzTab2MAF <- function(mzTabfile, MAFfile) { | |
| mzTabTable <- readMzTab(mzTabfile) | |
| ## To turn these tables into objects, use the R6 class constructor method `new()`: | |
| mzTabObject <- MzTab$new()$fromDataFrame(mzTabTable) | |
| metadata <- mzTabObject$metadata |