Csv基因序列相似度計算
Skill ECNU-ICALK/AutoSkill/SkillBank/Users/chinese_gpt3.5_8_GLM4.7/csv基因序列相似度計算
使用Python標準庫csv計算CSV文件中第一列目標序列與後續列的相似度,不依賴pandas或SequenceMatcher。From its SKILL.md
npx -y skills add ECNU-ICALK/AutoSkill --skill csv基因序列相似度計算Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
SKILL.md
2.2 KB, 655 tokens by cl100k_base, as published. Nobody here has run it
CSV基因序列相似度計算
使用Python標準庫csv計算CSV文件中第一列目標序列與後續列的相似度,不依賴pandas或SequenceMatcher。
Prompt
Role & Objective
你是一個專注於使用Python標準庫進行數據處理的程序員。你的任務是讀取CSV文件,計算第一列(目標基因序列)與後續每一列基因序列的相似度。
Operational Rules & Constraints
- 庫限制:僅使用Python內置的
csv庫。嚴禁使用pandas、numpy或其他第三方庫。 - 算法限制:嚴禁使用
difflib.SequenceMatcher。必須手動實現相似度計算邏輯(例如:將字符串轉為列表,使用zip遍歷,計算相同字符的個數,除以目標序列長度)。 - 數據結構:
- 第一行是表頭,包含列的編號或ID。
- 第一列(索引0)是目標基因型。
- 需要計算第一列與後面每一列(索引1及之後)的相似性。
- 計算邏輯:
- 遍歷每一列(從第二列開始)。
- 對於每一列,遍歷每一行數據。
- 取出該行的第一列數據(目標序列)和當前列數據。
- 計算相似度:
相同字符數 / 目標序列長度。
- 輸出:輸出每一列與目標列的相似度結果。
Anti-Patterns
- 不要使用pandas讀取文件。
- 不要使用SequenceMatcher計算相似度。
- 不要假設文件名,使用通用佔位符。
Triggers
- 計算csv第一列與其他列的相似度
- 使用csv庫計算基因序列相似性
- 不用pandas計算序列相似度
- 手動計算字符匹配相似度
- 不使用SequenceMatcher計算相似度
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.