Skip to content

Instantly share code, notes, and snippets.

View kumeS's full-sized avatar

skume kumeS

View GitHub Profile
@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
@kumeS
kumeS / Img2txt_prompt_v01.txt
Created July 17, 2023 13:28
Create Img2txt prompt from chatGPT/GPT4
You will create an image generation prompt for DALL·E 2. Please create the optimal prompt based on the following requirements definition.
Base prompt: {Your prompt}
removed from image: {Your prompt}
stable diffusion: N/A
When creating prompts, please consider providing specific descriptions, using adjectives and adverbs to provide details, making comparisons or metaphors, and considering the context in which the image will be used. The maximum length is 1000 characters. Please provide three suggestions for the prompt.
Please output only the three resulting prompt. No explanation is necessary.
@kumeS
kumeS / prompt_for_txt2img.txt
Created July 17, 2023 13:22
Prompt for DALL-E 2 optimized by GPT-4
"Craft a masterpiece in ultra-high-definition, featuring a singularly beautiful Italian woman in her mid-twenties. She's in a loose, fashionable summer outfit, walking through Tokyo with a bokeh Shinjuku city background. The style should be an intimate ink painting, with perfect body anatomy, clean face details, and symmetric eyes. Exclude any unwanted elements like duplicates, men, blurry parts, or deformations."
"Create a high-quality image of a young Italian lady in her mid-twenties, strolling through Tokyo, Japan. She's wearing a loose, appealing summer outfit, captured in a dynamic pose. The backdrop is a bokeh effect of Shinjuku city, seen through an F2.8 135mm lens perspective. The image should be intimate, in an ink painting style, free from any distortions, mutations, or cartoonish elements."
"Generate an ink painting-style masterpiece of a beautiful Italian woman in her mid-twenties, walking in Tokyo. She's in a fashionable summer outfit, with a bokeh Shinjuku city background. The image should be in
#install
pack <- c("assertthat", "httr", "jsonlite", "purrr", "abind", "png", "BiocManager")
install.packages(pack[!(pack %in% unique(rownames(installed.packages())))])
#load
for(n in 1:length(pack)){ eval(parse(text = paste0("library(", pack[n], ")"))) }; rm("n", "pack")
#install
pack <- c("EBImage")
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
α-fetoprotein
α-helix
Abbe’s number
aberration
ablation
ablator
abrasion
abrasion resistance
abrasion strength
abrasion test
@kumeS
kumeS / 高分子辞典OCR_2column_jpn_RRR.csv
Created June 7, 2023 13:16
In Chapter 9, R packages "agGraphSearch" with tutorial "A workflow to use agGraphSearch and Wikidata with PolyInfo terms".
1,2-挿入
1,3-双植性環化重付加
1,3-挿入
1/2λ板
1/4λ板
2-メタクリロイルオキシエチルホスホリルコリン
2,1-挿入
2,6-ジ-tert-ブチル-4-メチルフェノール
2光子吸収
3光子吸収