Skip to content

Repository files navigation

BioScript: Integrated Bioinformatics Toolbox

Python 3.8+ Bioinformatics License: MIT

BioScript (also known as bio_tools) is a comprehensive toolkit designed for bioinformatics analysis, focusing on sequence manipulation, RNA-seq pipelines, and sex-linked marker identification (CQ analysis). It integrates industry-standard tools into a streamlined CLI interface.


🌟 Key Features

1. Sequence Tools (seqtools)

  • Quality Assessment: Calculate N50/L50 for genome assemblies (supports Trinity format).
  • Manipulation: Sort sequences by length, shuffle FASTA files, and random sequence extraction.
  • Transcriptomics: Extract the longest transcript/CDS from GFF3 and FASTA files.
  • Filtering: Identify and filter BLAST results based on identity thresholds.

2. RNA-Seq Pipeline

  • Full upstream to downstream workflow:
    1. HISAT2 indexing and alignment.
    2. featureCounts for quantification.
    3. Differential Expression (DE) analysis using DESeq2 (with biological replicates) or edgeR (without replicates).
  • Automated matrix generation and TMM normalization.

3. Sex-Linked Marker Analysis (CQ Tools)

  • cqmapping: High-throughput BWA-based alignment optimized for Sex-linked Coverage Quotient (CQ) analysis.
  • cqtools: Calculate CQ values by comparing female and male coverage to identify sex-specific genomic regions or scaffolds.

🛠 Prerequisites & Installation

Software Dependencies

  • Bio-alignment: bwa, hisat2, samtools, bedtools, blast+
  • R Environment: limma, edgeR, DESeq2, featureCounts (subread package)

Setup with uv (Recommended)

This project uses uv for modern Python package management.

# 1. Clone the repository
git clone https://github.com/YourUsername/bioscript.git
cd bioscript

# 2. Sync dependencies and create virtual environment automatically
uv sync

# 3. Use the CLI tool directly
uv run bio-tools --help

Traditional Setup

pip install .
bio-tools --help

📖 Usage Guide

BioScript uses a sub-command structure: python main.py <command> [options]

Sequence Manipulation

# Calculate N50 and GC content
python main.py n50 input.fasta output_dir/

# Extract longest CDS per gene using GFF3
python main.py longest cds.fasta output_dir/ annotation.gff3

# Sort sequences (shortest to longest, use -r for reverse)
python main.py sort input.fasta output_dir/ -r

RNA-Seq Workflow

The pipeline automates indexing, mapping, and DE analysis.

python main.py RNAseq \
    --gene_fasta ref.fa \
    --gtf_path ref.gtf \
    --sample_path samples.txt \
    --cpu 16 \
    --method DESeq2 \
    --data_path ./raw_data \
    --out_path ./results

CQ Analysis Workflow

Used for identifying sex-linked scaffolds.

# Step 1: Alignment for both sexes (Female and Male)
python main.py cqmapping --fasta ref.fa --pair1 F_1.fq --pair2 F_2.fq -o Female/
python main.py cqmapping --fasta ref.fa --pair1 M_1.fq --pair2 M_2.fq -o Male/

# Step 2: Calculate CQ Values
python main.py cqtools \
    --f_bam Female/output.sort.bam \
    --m_bam Male/output.sort.bam \
    --fasta ref.fa \
    --output ./cq_results \
    --cq_value 0.3

📂 Project Structure

bioscript/
├── main.py                # Command-line entry point
├── CQ_mapping/            # BWA alignment wrappers
├── CQ_tools/              # Coverage and CQ calculation logic
├── RNA_seq/               # Shell & Support scripts (R, Perl)
│   ├── RNA_seq.sh         # Main pipeline script
│   └── support_script/    # Quantification & DE analysis
└── seqtools/              # FASTA/GFF/BLAST processing modules

✉️ Contact & Support


Citation

If you use BioScript in your research, please cite this repository:

Xiang, Y. (2026). BioScript: An integrated pipeline for pangenome and transcriptomic analysis. GitHub: https://github.com/YourUsername/bioscript

About

一个用于多功能分析的生物信息学序列处理包,包含RNA-seq流程

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages