شعار Bio Database Fetch

Bio Database Fetch

المجتمع
ssinder
bio-database-fetch

Fetches compound properties and species taxonomy from the official PubChem PUG-REST and NCBI Taxonomy APIs. Retrieves molecular formula, weight, SMILES, InChI, InChIKey, IUPAC name, XLogP, TPSA and CAS numbers for a batch of PubChem CIDs, and full lineage classification (domain through species) for a batch of NCBI Taxonomy IDs. Supports batched queries (100 IDs per request), CSV/JSON export, and requires a contact email as the NCBI usage policy mandates. This skill should be used when looking up properties of known compounds by CID, retrieving CAS registry numbers, resolving taxonomy IDs to species names, or collecting chemical and taxonomic reference data in bulk is requested.

نظرة عامة

الناشرssinder
المستودعbioinformatics-agent-skills
اسم المهارةbio-database-fetch
النجوم
75
التفريعات
2
الملفات المرفقة
6
الترخيصMIT
الروابط
  • تعليمات بصيغة Markdown

    ملف SKILL.md يُحمّله النموذج عند الحاجة، فلا يستهلك توكنات إلا عندما يَرِد طلب ذو صلة فعلًا.

  • تعمل مع أي نموذج لغوي كبير

    مهارات الذكاء الاصطناعي مكتوبة بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا تعمل مع GPT أو Claude أو Gemini أو Grok أو نموذج محلي.

  • الملفات المرفقة: 6

    نصوص برمجية وقوالب ومراجع يمكن للنموذج قراءتها أثناء عمله. الملفات للقراءة فقط ولا تُنفّذ أبدًا.

  • مفتوحة المصدر

    نشرها ssinder على GitHub. اطّلع على المصدر قبل تثبيتها.

التثبيت

ثبّت مهارة الذكاء الاصطناعي Bio Database Fetch في TypingMind لاستخدامها مع أي نموذج لغوي كبير، أو أضفها إلى وكيل ذكاء اصطناعي آخر يقرأ SKILL.md.

1

التثبيت في TypingMind

يُثبّت TypingMind المهارة مباشرةً من مجلدها على GitHub — فيقرأ SKILL.md، ويجمع ملفات الموارد في حزمة، ويحفظ النتيجة محليًا.

  1. افتح التطبيق وانتقل إلى الإضافات → المهارات.
  2. اختر «تثبيت من GitHub».
  3. الصق رابط مجلد المهارة الموضّح أدناه وأكّد التثبيت.
    https://github.com/ssinder/bioinformatics-agent-skills/tree/main/skills/bio-database-fetch
  4. فعّل المهارة في كل محادثة تريد إتاحتها فيها.
الإضافات → المهارات → إضافة مهارة → من رابط GitHub، ثم الصق رابط المجلد واضغط على «متابعة».
2

التثبيت في وكيل ذكاء اصطناعي آخر

يمكن لأي وكيل ذكاء اصطناعي يقرأ تنسيق Agent Skills استخدام هذه المهارة — انسخ المجلد إلى مجلد المهارات الخاص بذلك الوكيل.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ssinder/bioinformatics-agent-skills.git /tmp/bioinformatics-agent-skills
mkdir -p .claude/skills
cp -r /tmp/bioinformatics-agent-skills/skills/bio-database-fetch .claude/skills/bio-database-fetch
أعد تشغيل Claude Code بعد النسخ ليتعرّف على المهارة الجديدة.

استخدمها في TypingMind

فعّل Bio Database Fetch في أي محادثة على TypingMind وسيتولى النموذج الباقي. تتضمن مطالبة النظام اسمها ووصفها، وبمجرد ورود طلب ذي صلة، يُحمّل النموذج التعليمات الكاملة تلقائيًا — فلا تحتاج إلى استدعائها يدويًا، ولا تستهلك أي توكنات حتى تُستخدم فعليًا.

يُحمّل النموذج Bio Database Fetch تلقائيًا بمجرد ورود طلب ذي صلة بها.

تعمل مع أي نموذج ذكاء اصطناعي

مهارات الذكاء الاصطناعي هي تعليمات بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا لا ترتبط Bio Database Fetch بالنموذج الذي كُتبت له. ثبّتها مرة واحدة في TypingMind واستخدمها مع GPT-5 أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو نموذج محلي تشغّله بنفسك — كل ذلك باستخدام مفاتيح API الخاصة بك.

  • تُحمَّل عند الحاجة فقط

    تتضمن مطالبة النظام الاسم والوصف فقط. وتُجلب التعليمات عند أول طلب ذي صلة، لذا لا تترتب أي تكلفة على المهارة غير المستخدمة.

  • بدّل النماذج أثناء المحادثة

    لأن المهارة تعليمات وليست شيفرة، فإن تغيير النموذج لا يعطّلها — فالنموذج التالي يقرأ ملف SKILL.md نفسه.

تعليمات المهارة

هذا هو محتوى SKILL.md الذي يُحمّله النموذج. اقرأه قبل التثبيت — فالمهارة عبارة عن تعليمات سيتبعها نموذجك.

BioDatabase Reference Retrieval

Overview

This skill retrieves reference data from two official, well-documented public APIs:

DatabaseAPIScript
PubChem compoundsPUG-RESTscripts/fetch_compounds.py
NCBI TaxonomyE-utilities efetchscripts/fetch_taxonomy.py

Both are plain HTTP/JSON-or-XML endpoints. No browser automation is required — that is the main difference from the pipeline this skill was extracted from, where every database script drove a Selenium browser session. Scraping a data portal for structured records is strictly worse than asking the API: it breaks whenever a template changes, runs an order of magnitude slower, and produces output that cannot be reproduced from a documented request.

What this skill gets right that a naive implementation does not

CAS numbers come from the right endpoint. The xrefs/RegistryID endpoint does not return CAS numbers. It returns several hundred registry IDs from many different databases mixed together — CHEBI:15365, DB00945, LGCAMP0133.00-11, and the occasional 50-78-2. A CAS number has a fixed format (NNNNN-NN-N), so the reliable way to get one is to filter the synonyms list by that pattern. For CID 2244 (aspirin) the synonyms endpoint yields three CAS candidates; RegistryID yields only two, and neither is guaranteed to be the primary registry number.

Missing CIDs are detectable. PubChem answers a request for a non-existent CID with HTTP 200 and a body of {"CID": 999999999} — just the CID, no properties. Checking the status code alone will therefore report a successful lookup of a compound that does not exist. Every record here carries an explicit found flag.

Lineage includes the taxon itself. NCBI's LineageEx element contains only ancestors. The species level is available solely from the top-level <Rank> and <ScientificName>. Reading only LineageEx leaves the species name — the field you usually want — empty.

All ranks are retained. LineageEx contains dozens of rank values beyond the textbook eight: domain, subphylum, superclass, clade, suborder, infraorder, parvorder, superfamily, subfamily and more. Selecting only the eight standard ranks silently drops domain (Eukaryota / Bacteria / Archaea), which is the single most useful top-level discriminator.

When to Use This Skill

  • Getting molecular properties of compounds you already know by CID
  • Looking up CAS registry numbers for a set of CIDs
  • Converting a list of NCBI Taxonomy IDs into species names and lineages
  • Annotating a hits table with compound descriptors or taxonomic classification
  • Verifying that a CID actually exists in PubChem

Quick Start

bash
export PYTHONPATH="$PWD/packages"
export BIOPIPE_EMAIL="you@your-institution.edu"   # NCBI 要求的联系邮箱

# 化合物:批量取属性 + 同义词 + CAS
python scripts/fetch_compounds.py --cids cids.txt --output-dir results/

# 化合物:直接给 CID,只要基本属性(不要几百个同义词)
python scripts/fetch_compounds.py --cids 2244 3672 --output-dir results/ --no-synonyms

# 分类学:批量取 lineage
python scripts/fetch_taxonomy.py --tax-ids 9606 10090 --output-dir results/

Workflow

Compounds (fetch_compounds.py)

  1. Collect CIDs — --cids accepts CID strings or paths to text files (one per line; # comments and a header row are skipped). Duplicates are removed while preserving order.
  2. Fetch properties — one PUG-REST request per 100 CIDs. The default property set covers molecular formula, weight, exact mass, XLogP, TPSA, formal charge, both SMILES variants, InChI, InChIKey, IUPAC name, H-bond donors/acceptors, rotatable bonds and heavy atom count.
  3. Fetch synonyms — skipped with --no-synonyms. A well-known compound has several hundred synonyms; the output keeps the first --max-synonyms (default 20) but reports the true synonym_count.
  4. Extract CAS numbers — filtered out of the synonyms by CAS format, then topped up from RegistryID for any that the synonyms missed. Skipped entirely with --no-cas.
  5. Export — compounds.csv and compounds.json.

Taxonomy (fetch_taxonomy.py)

  1. Collect IDs — same file/argument handling as CIDs.
  2. Fetch — efetch.fcgi?db=taxonomy&id=...&retmode=xml. Taxonomy IDs are primary keys, so no esearch step is needed (unlike BioProject).
  3. Parse — scientific name, common name, rank, and the full lineage.
  4. Export — taxonomy.csv (one row per taxon, with domain … species flattened into columns plus a full_lineage string) and taxonomy.json (the full nested record, including every lineage entry).

Parameters

fetch_compounds.py

ParameterDefaultDescription
--cidsrequiredCID list or path(s) to text files containing CIDs
--output-dircompound_resultsOutput directory for the CSV/JSON results
--no-synonymsoffSkip synonyms (each compound may have hundreds)
--no-casoffSkip CAS extraction
--max-synonyms20Maximum synonyms kept per record
--timeout60Per-request timeout in seconds

fetch_taxonomy.py

ParameterDefaultDescription
--tax-idsrequiredTaxonomy ID list or path(s) to text files containing IDs
--output-dirtaxonomy_resultsOutput directory for the CSV/JSON results
--email$BIOPIPE_EMAILContact email (required by NCBI's usage policy)
--api-key$NCBI_API_KEYNCBI API key; raises the rate limit from 3 to 10 req/s
--timeout60Per-request timeout in seconds

Outputs

FileContent
compounds.csvOne row per CID: CID, found, IUPAC name, formula, molecular weight, exact mass, XLogP, TPSA, charge, SMILES, ConnectivitySMILES, InChI, InChIKey, H-bond counts, rotatable bonds, heavy atoms, CAS, synonym count, synonyms
compounds.jsonSame content as nested JSON
taxonomy.csvOne row per taxon: tax_id, scientific name, common name, rank, domain…species, lineage depth, full lineage string
taxonomy.jsonFull nested records including every lineage entry with its rank and taxid

Validation

  • Check found before trusting a row. found=False means PubChem has no compound with that CID. This is not a transient error — the identifier is wrong or refers to a compound that was removed.
  • A compound may legitimately have several CAS numbers. Salts, hydrates and stereoisomers each get their own. The CAS column holds them semicolon-separated. Match on the primary one only if you are joining against a single-registry table.
  • CAS candidates are format-validated, not registry-validated. The pattern check removes non-CAS registry IDs, but it cannot tell you whether a CAS number has been re-assigned. For critical identity work, cross-check the InChIKey.
  • superkingdom is empty in current data. NCBI retired that rank; "cellular organisms" is now cellular root and the top-level split is domain (Eukaryota / Bacteria / Archaea). Use the domain column.
  • Not every taxon has a species rank. Strain-level entries report no rank (e.g. Escherichia coli str. K-12 substr. MG1655). The rank column tells you what the entry actually is — do not assume species.
  • Species names are not stable identifiers. Escherichia coli's phylum was renamed from Proteobacteria to Pseudomonadota; the tax_id is stable, the name is not. Join on tax_id.
  • A missing common name is normal. GenbankCommonName is only present for well-studied organisms; most taxa have none.
  • Taxonomy IDs are stable, names are not. Never key a cross-study join on the scientific name.

References

الملفات المرفقة

يقرأ النموذج هذه الملفات عند الحاجة أثناء تحميل المهارة. وهي متاحة للقراءة ولا تُنفّذ أبدًا.

الأسئلة الشائعة

ماذا تفعل مهارة الذكاء الاصطناعي Bio Database Fetch؟

Fetches compound properties and species taxonomy from the official PubChem PUG-REST and NCBI Taxonomy APIs. Retrieves molecular formula, weight, SMILES, InChI, InChIKey, IUPAC name, XLogP, TPSA and CAS numbers for a batch of PubChem CIDs, and full lineage classification (domain through species) for a batch of NCBI Taxonomy IDs. Supports batched queries (100 IDs per request), CSV/JSON export, and requires a contact email as the NCBI usage policy mandates. This skill should be used when looking up properties of known compounds by CID, retrieving CAS registry numbers, resolving taxonomy IDs to...

لماذا تستخدم Bio Database Fetch على TypingMind؟

لأنك تثبّتها مرة واحدة وتستخدمها مع أي نموذج. مهارة Bio Database Fetch عبارة عن نص Markdown وليست شيفرة خاصة بمزود بعينه، لذا تعمل المهارة نفسها مع GPT-5 أو Claude أو Gemini أو Grok أو نموذج محلي، ويمكنك تبديل النموذج أثناء المحادثة دون تعطّل المهارة. يعمل TypingMind بمفاتيح API الخاصة بك، فتدفع للمزودين مباشرةً بدلًا من اشتراك لكل مقعد، وتبقى مهاراتك ومحادثاتك في مساحة التخزين الخاصة بك.

كيف أثبّت Bio Database Fetch في TypingMind؟

افتح الإضافات → المهارات → التثبيت من GitHub في TypingMind والصق https://github.com/ssinder/bioinformatics-agent-skills/tree/main/skills/bio-database-fetch. يقرأ TypingMind ملف SKILL.md الخاص بها، ويجمع ملفاتها ويثبّتها كمهارة يمكنك تفعيلها لكل محادثة على حدة.

ما نماذج الذكاء الاصطناعي التي يمكنها استخدام Bio Database Fetch؟

أي نموذج تربطه في TypingMind. مهارات الذكاء الاصطناعي عبارة عن تعليمات Markdown وليست شيفرة خاصة بمزود بعينه، لذا يمكن لكل من GPT وClaude وGemini وGrok والنماذج المحلية تحميل هذه المهارة عندما يتوافق الطلب معها.

كم نموذج ذكاء اصطناعي يمكنني استخدامه مع Bio Database Fetch؟

أي عدد تريده. ما دام النموذج يدعم المهارات، يمكنك استخدام Bio Database Fetch معه، سواء كان GPT أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو غيرها، وكل ذلك على TypingMind باستخدام مفاتيح API الخاصة بك.

هل مهارة الذكاء الاصطناعي Bio Database Fetch مجانية؟

نعم. نشرها ssinder على GitHub بموجب ترخيص MIT. لا تدفع إلا لمزود الذكاء الاصطناعي الخاص بك مقابل التوكنات التي تستخدمها.

ما هي مهارات الذكاء الاصطناعي؟

مهارة الذكاء الاصطناعي حزمة تعليمات قابلة لإعادة الاستخدام تعلّم نموذج الذكاء الاصطناعي كيفية تنفيذ مهمة محددة. وتتبع تنسيق Agent Skills المفتوح: ملف SKILL.md يتضمن اسمًا ووصفًا، إلى جانب أي نصوص برمجية أو قوالب أو ملفات مرجعية قد يحتاج إليها النموذج. لا يقرأ النموذج التعليمات إلا عندما يتوافق طلبك مع المهارة، لذا لا تترتب على المهارة المثبتة أي تكلفة حتى تُستخدم.

كيف تختلف مهارات الذكاء الاصطناعي عن الإضافات أو موصلات MCP؟

تمنح الإضافة أو موصل MCP النموذج أدوات جديدة يمكنه استدعاؤها، وهي شيفرة تُنفَّذ في مكان ما وتُرجع نتيجة. أما مهارة الذكاء الاصطناعي فتزوّد النموذج بالمعرفة ومنهجية العمل: كيفية التعامل مع مهمة، والخطوات التي ينبغي اتباعها، وما ينبغي أن تكون عليه المخرجات الجيدة. المهارات عبارة عن نصوص Markdown، لذا لا تحتاج إلى خادم أو مفتاح API أو بيئة تشغيل، وتعمل مع أي نموذج.

عرض الكل

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا البريدية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇