← Về thư mục
📄 / / profiles / r-and-d / raw_evidence / OpenAI4S / skills / bioskills / bio-sequence-io-batch-processing / references / usage-guide.md

Batch Processing - Usage Guide

Overview

This skill enables AI agents to help you process many sequence files at once (count, merge, split, convert, summarize) without exhausting RAM, choosing between Biopython streaming, on-disk indexing, and faster readers (pysam, pyfastx) based on data size.

Prerequisites

pip install biopython
pip install pysam pyfastx   # optional, faster readers for huge FASTQ

Quick Start

Tell your AI agent what you want to do:

Example Prompts

Counting

"Count reads in every .fastq file under reads/ without loading them into memory"

Merging

"Combine all .fasta files in samples/ into one file, tagging each record with its source filename"

Splitting

"Split large.fasta into files of 500 sequences each"

Random Access

"Build a persistent index across all FASTA files in data/ so I can look up records by id later"

Batch Conversion

"Convert all .gb files in genbank/ to FASTA in fasta/"

Statistics

"Generate a summary CSV with sequence counts and min/max/avg lengths for all FASTA files"

Large Data

"Iterate over a 50-million-read FASTQ as fast as possible to tally read lengths"

What the Agent Will Do

  1. Choose a reader by data size: SeqIO for rich records, index_db for random access, pysam/pyfastx for huge FASTQ
  2. Stream records with generators so peak memory stays at one record, never the whole directory
  3. Apply the requested operation (count, merge, split, convert, summarize) per file
  4. Write results and clean up index/output artifacts

Tips