Skip to content

Instantly share code, notes, and snippets.

View kumeS's full-sized avatar

skume kumeS

View GitHub Profile
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 1.
"X.gamma.Glu.Cys","X.gamma.Glu.2.aminobutyric.acid","X.gamma.Butyrobetaine","X.beta.Ala","X.Xanthosine","X.Xanthopterin","X.Xanthine","X.Val","X.UTP","X.Urocanic.acid","X.Uridine","X.Uric.acid","X.Urea","X.Uracil","X.UMP","X.UDP.N.acetylglucosamine","X.UDP.glucuronic.acid","X.UDP.glucose...UDP.galactose","X.UDP","X.Tyr.Glu","X.Tyramine","X.Tyr","X.Trp","X.Trimethylamine.N.oxide","X.Trigonelline","X.Triethanolamine","X.Trehalose.6.phosphate","X.trans.Glutaconic.acid...Itaconic.acid","X.threo.beta.Methylaspartic.acid","X.Threonic.acid","X.Thr.Asp","X.Thr","X.Thiaproline","X.Thiamine.phosphate","X.Thiamine","X.Theobromine","X.Taurocholic.acid","X.Taurine","X.Succinic.acid","X.Suberic.acid","X.Stachydrine","X.Spermine","X.Spermidine","X.Sorbitol.6.phosphate","X.S.Nitrosoglutathione","X.S.Methylmethionine","X.S.Lactoylglutathione","X.Serotonin","X.Ser.Glu","X.Ser","X.Sedoheptulose.7.phosphate","X.SDMA","X.Sarcosine","X.S.Adenosylmethionine","X.S.Adenosylhomocysteine","X.Saccharopine","X.Ribulose.5.phosphate","X.Ri
#' get_ftp_file_list function:
#' This function retrieves and returns a list of all files and directories at
#' a specified FTP URL.
#' download_ftp_files function:
#' This function downloads files and directories from a specified FTP URL to a
#' local directory. It supports recursive downloading, meaning it will enter
#' and download all contents within subdirectories as well.
# Install required packages
if (!requireNamespace("RCurl", quietly = TRUE)) {
READ.json <- function(file){
header = ''
positions = c()
genes = c()
is_header_line = TRUE
is_position_line = FALSE
is_gene_line = FALSE
null.out <- function(V){
A <- c()
v <- as.vector(V)
for(N in 1:length(v)){
#N <- 1
if(is.null(v[[N]])){
A[N] <- ""
}else{
A[N] <- paste0(v[[N]], collapse = " ")
}}
@kumeS
kumeS / coin_Rank.csv
Created September 22, 2024 04:57
Downloaded all active coins via crypto2::crypto_history on 2024-09-20
We can't make this file beautiful and searchable because it's too large.
"id","slug","name","symbol","timestamp","ref_cur_id","ref_cur_name","time_open","time_close","time_high","time_low","open","high","low","close","volume","market_cap"
1,"bitcoin","Bitcoin","BTC",2024-09-20 23:59:59,"2781","USD",2024-09-20,2024-09-20 23:59:59,2024-09-20 04:10:00,2024-09-20 18:12:00,62941.4275952191,64119.530359621,62364.6065332085,63192.975082876,35177164222.14,1248317992550.81
2,"litecoin","Litecoin","LTC",2024-09-20 23:59:59,"2781","USD",2024-09-20,2024-09-20 23:59:59,2024-09-20 07:02:00,2024-09-20 18:13:00,65.444871347,66.4087594802,64.4322780876,65.2785611211,290835715.63,4895679111.88
3,"namecoin","Namecoin","NMC",2024-09-20 23:59:59,"2781","USD",2024-09-20,2024-09-20 23:59:59,2024-09-20 04:51:00,2024-09-20 18:27:00,0.5745636868,0.5765485713,0.553842357,0.55842888,10139.25,8229231.35
5,"peercoin","Peercoin","PPC",2024-09-20 23:59:59,"2781","USD",2024-09-20,2024-09-20 23:59:59,2024-09-20 02:01:00,2024-09-20 00:01:00,0.359854236,0.3986114491,0.3513114501,0.363098034,36895.61,10583921.47
6,"n
@kumeS
kumeS / Custom_instruction_for_Ruby_v01.txt
Created August 21, 2023 23:46
ChatGPT Custom Instructions for Ruby in Japanese
#What would you like ChatGPT to know about you to provide better responses?
必ずRubyコードは省略せずに出力します。
Ruby on Railsが好きで、そのフレームワークについて非常に詳しい。
#How would you like ChatGPT to respond?
貴方は常に素晴らしいアシスタント・サポーターであり、質問者への最適な応答を常に心がけ、応答は常に網羅的かつ詳細に行ってください。
プロンプトの内容が複数行に渡る場合もその内容に忠実に従い、応答してください。
出力で使用する言語は原則プロンプトと同じ言語を使用し、プロンプト内に言語の指定があれば、プロンプトの指示を優先してください。ただし、Rubyコードのコードブロック内は原則英語で記述してください。
@kumeS
kumeS / Custom_instruction_for_R_v01.txt
Created August 21, 2023 23:36
ChatGPT Custom Instructions for R Scripting in Japanese
#What would you like ChatGPT to know about you to provide better responses?
必ずRコードは省略せずに出力してください。
rest of the code は使わないでください。
#How would you like ChatGPT to respond?
貴方は常に素晴らしいアシスタント・サポーターであり、質問者への最適な応答を常に心がけ、応答は常に網羅的かつ詳細に行ってください。
プロンプトの内容が複数行に渡る場合もその内容に忠実に従い、応答してください。
出力で使用する言語は原則プロンプトと同じ言語を使用し、プロンプト内に言語の指定があれば、プロンプトの指示を優先してください。ただし、Rコードのコードブロック内は原則英語で記述してください。
@kumeS
kumeS / tile_Reads_Counts.R
Created August 2, 2023 13:34
This function analyzes the reads from a FASTQ file and extracts information such as tile, lane, X coordinate, Y coordinate, index1, and index2. It returns a data frame containing this information.
#' Tile Reads Counts Analysis
#'
#' This function analyzes the reads from a FASTQ file and extracts information such as tile, lane, X coordinate, Y coordinate, index1, and index2. It returns a data frame containing this information.
#'
#' @title Tile Reads Counts Analysis
#' @description Analyzes the reads from a FASTQ file and extracts information such as tile, lane, X coordinate, Y coordinate, index1, and index2. The function can also filter the reads based on a specific index1 value.
#' @param rfq A ShortReadQ object containing the reads from the FASTQ file.
#' @param N An integer representing the number of reads to sample. Default is 100000.
#' @param GGG A logical value indicating whether to filter the reads based on the index1 value "GGGGGGGGGG". Default is FALSE.
#' @importFrom assertthat is.count noNA
@kumeS
kumeS / indexMismatchSeq.R
Created August 2, 2023 13:25
This function analyzes the samples and top barcodes that match the given index and generates a sequence logo.
#' Index Mismatch Sequence Analysis
#'
#' This function analyzes the samples and top barcodes that match the given index and generates a sequence logo.
#'
#' @title Index Mismatch Sequence Analysis
#' @description Analyzes the samples and top barcodes that match the given index, and generates a sequence logo. The function takes two CSV files and an index as input, and optionally saves the sequence logo as a PNG file.
#' @param x1 A data frame containing the demultiplex stats, read from "Demultiplex_Stats.csv".
#' @param x2 A data frame containing the top unknown barcodes, read from "Top_Unknown_Barcodes.csv".
#' @param index A string representing the index to be matched.
#' @param AllData A logical value indicating whether to include all data in the result. Default is TRUE.
@kumeS
kumeS / Demultiplex_Stats_proc.R
Created August 2, 2023 13:21
This function processes the demultiplex stats by removing rows with "Undetermined" SampleID and splitting the Index column into two separate columns.
#' Demultiplex Stats Processing
#'
#' This function processes the demultiplex stats by removing rows with "Undetermined" SampleID and splitting the Index column into two separate columns.
#'
#' @title Process Demultiplex Stats
#' @description Removes rows with "Undetermined" SampleID from the input data frame and splits the Index column into two separate columns (index1 and index2).
#' @param x1 A data frame containing the demultiplex stats. The data frame should have a "SampleID" column and an "Index" column.
#' @importFrom assertthat is.data.frame noNA
#' @return A data frame with the processed demultiplex stats, including the split Index column.
#' @export Demultiplex_Stats_proc