Skip to content

Instantly share code, notes, and snippets.

View yuifu's full-sized avatar

Haruka Ozaki yuifu

View GitHub Profile
@yuifu
yuifu / SAM.py
Last active March 24, 2022 04:14
junction_annotation.py from RSeQC 4.0.0 installed via pip http://rseqc.sourceforge.net/
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''manipulate BAM/SAM file.'''
#import built-in modules
import os,sys
import re
import string
from optparse import OptionParser
import warnings
import string
@yuifu
yuifu / ushuffle_example.sh
Created June 29, 2021 03:39
ushuffle example (executable)
# Note: '2' indicates that the shuffled sequence preserves 2-mer frequency
./main.exe -s KTTTTCTTTTTTTTTTA -n 1 -k 2
# Repeat shuffling for 10 times
./main.exe -s KTTTTCTTTTTTTTTTA -n 10 -k 2
@yuifu
yuifu / ushuffle_example.py
Created June 29, 2021 03:32
ushuffle python example
# ref: https://github.com/guma44/ushuffle
# ref: https://www.python.org/dev/peps/pep-3112/
# ref: https://pypi.org/project/ushuffle/
from ushuffle import shuffle, Shuffler, set_seed
set_seed(12345)
seq = bytes('ATTTTCTTTTTTTTTTA', 'ascii')
@yuifu
yuifu / multiple_ComplexHeatmap.R
Last active May 20, 2021 14:45
Align multiple heatmaps generated by ComplexHeatmap using pushViewport()
library(ComplexHeatmap)
# test data
list_ht <- list()
for(i in 1:8){
mat1 = matrix(rnorm(80, 2), 8, 10)
mat1 = rbind(mat1, matrix(rnorm(40, -2), 4, 10))
rownames(mat1) = paste0("R", 1:12)
# tmux config options for mouse scroll
set-option -g mouse on
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e'"
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
bind -n WheelDownPane select-pane -t= \; send-keys -M
# Scroll History
set -g history-limit 30000

Command

cwltool --debug "https://raw.githubusercontent.com/pitagora-network/pitagora-cwl/master/workflows/download-fastq/download-fastq.cwl" "job.yml"

job.yml

run_ids: # array of type "string"
/home/harukao/anaconda3/bin/cwltool 1.0.20190228155703
https://schema.org/docs/!DOCTYPE html does not look like a valid URI, trying to serialize this will break.
html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" does not look like a valid URI, trying to serialize this will break.
Could not load extension schema https://schema.org/docs/schema_org_rdfa.html: RDFa parsing Error! mismatched tag: line 21, column 2
Workflow checker warning:
https://raw.githubusercontent.com/pitagora-network/pitagora-cwl/master/workflows/download-fastq/download-fastq.cwl:12:5: Source 'nthreads'
of type ["null",
"int"] may be
incompatible
https://raw.githubuserc
/home/harukao/anaconda3/bin/cwltool 1.0.20190228155703
https://schema.org/docs/!DOCTYPE html does not look like a valid URI, trying to serialize this will break.
html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" does not look like a valid URI, trying to serialize this will break.
Could not load extension schema https://schema.org/docs/schema_org_rdfa.html: RDFa parsing Error! mismatched tag: line 21, column 2
Workflow checker warning:
https://raw.githubusercontent.com/pitagora-network/pitagora-cwl/master/workflows/download-fastq/download-fastq.cwl:12:5: Source 'nthreads'
of type ["null",
"int"] may be
incompatible
https://raw.githubuserc
@yuifu
yuifu / GTFファイルからTSVを作成する.md
Created May 26, 2020 12:02
GTFファイルからTSVを作成する

テスト用GTFファイルの作成

wget -O - ftp://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_human/release_34/gencode.v34.annotation.gtf.gz | gunzip | head -n 1000 > test.gtf

GTFファイルから gene_id, gene_name のTSVを作る

@yuifu
yuifu / gist:01d7f07ab165fcb3cb568d32636b4190
Created April 20, 2020 07:44
Error massage while using Fire.jl
$ julia cli/run.jl relcov examples/data/RamDA_72h_A09.uniq.q40.bam examples/data/gencode.vM15.primary_assembly.annotation.protein_coding.head.bed zzz_experiments/_fire_test_relcov
Start calculating relative gene body coverage...
- bam: examples/data/RamDA_72h_A09.uniq.q40.bam
- bed12: examples/data/gencode.vM15.primary_assembly.annotation.protein_coding.head.bed
- output: zzz_experiments/_fire_test_relcov.geneBodyCoverage.txt
zzz_experiments/_fire_test_relcov.geneBodyCoverage.pdf
- transcript_length_cut: 100
- max_depth: 0
- N_bin: 100