たまにしかpythonを使わない人のためのメモ
int()
で文字列を整数にできる
+
で結合できるstr()
で数値を文字列にできる- シングルクォーテーションとダブルクォーテーションが同じ意味
############### | |
# mat_count: 60668 x 28 matrix, gene expression levels | |
# mat_count_rmlow: 18186 x 28 matrix | |
# group: A vector of factor: factor(rep(1:7, each=4)) | |
############### | |
### Remove low-count genes and round count | |
is_lowgenes = rowMeans(mat_count) < 5 | |
mat_count_rmlow <- mat_count[!is_lowgenes,] | |
dim(mat_count_rmlow) |
#!/usr/bin/env nextflow | |
Channel.fromPath("*.txt") | |
.map{[ | |
file(it), | |
file(it).baseName | |
]}.into{ | |
input_files | |
input_files_ | |
input_files__ |
install.packages("tidyverse") | |
install.packages("magrittr") | |
source("https://bioconductor.org/biocLite.R") | |
biocLite() |
minialign: malloc.c:2365: sysmalloc: Assertion `(old_top == (((mbinptr) (((char *) &((av)->bins[((1) - 1) * 2])) - __builtin_offsetof (struct malloc_chunk, fd)))) && old_size == 0) || ((unsigned long) (old_size) >= (unsigned long)((((__builtin_offsetof (struct malloc_chunk, fd_nextsize))+((2 * (sizeof(size_t))) - 1)) & ~((2 * (sizeof(size_t))) - 1))) && ((old_top)->size & 0x1) && ((unsigned long)old_end & pagemask) == 0)' failed. |
# Installation | |
# install.packages("dplyr") | |
library(dplyr) | |
df1 = data.frame( | |
A=c("A1", "A2", "A3", "A4") | |
) | |
df2 = data.frame( |
R --slave -e 'library(Biostrings); seqs <- readDNAStringSet("test.fa"); write.table(data.frame(name=names(seqs), length=width(seqs)),stdout(), quote=F, row.names=F)' > hoge.txt |
path_gtf = "merged.asm/merged.gtf" | |
path_ofile = "merged.asm/merged.gtf.txt" | |
arr_attr = Array{Any,1}() | |
d_attr = Dict{Any,Any}() | |
# Extract all attributes | |
f = open(path_gtf) |
awk 'BEGIN{l=100}{if(NR%4==1){x=$0};if(length($0)==l){print x; print; getline; print; getline; print}}' foo.fastq |