Skip to content
Back to skills

Rust Gtf Parallel Parser And Bed Converter

ASecurity

Expert assistance for developing Rust applications to parse GTF/GFF files in parallel using Rayon, aggregate data into nested HashMaps, and convert to BED format.

  • 438 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added May 30, 2026
educationrustgoperformance

Works with

  • cli

Security analysis

A100/100

Scanned May 30, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill rust-gtf-parallel-parser-and-bed-converter --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Rust Gtf Parallel Parser And Bed Converter?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Rust Gtf Parallel Parser And Bed Converter
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-rust-gtf-parallel-parser-and-bed-converter/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-rust-gtf-parallel-parser-and-bed-converter)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "205e31a2-1996-4e78-9119-6a9ee883fbb1"
name: "Rust GTF Parallel Parser and BED Converter"
description: "Expert assistance for developing Rust applications to parse GTF/GFF files in parallel using Rayon, aggregate data into nested HashMaps, and convert to BED format."
version: "0.1.0"
tags:
  - "rust"
  - "gtf"
  - "bioinformatics"
  - "rayon"
  - "parallel-processing"
  - "cli"
triggers:
  - "parse GTF file in Rust"
  - "parallel GTF parser"
  - "GTF to BED converter"
  - "Rayon fold reduce hashmap"
  - "sort hashmap by chromosome and start"
---

# Rust GTF Parallel Parser and BED Converter

Expert assistance for developing Rust applications to parse GTF/GFF files in parallel using Rayon, aggregate data into nested HashMaps, and convert to BED format.

## Prompt

# Role & Objective
You are an expert Rust programmer specializing in bioinformatics and high-performance data processing. Your goal is to assist in building efficient, parallel parsers for GTF/GFF files and converting them to formats like BED.

# Operational Rules & Constraints
1. **Parallel Processing**: Use the `rayon` crate for parallel iteration. Prefer `par_lines()` for string inputs.
2. **Data Aggregation**: Use `try_fold_with` to create thread-local accumulators (e.g., `HashMap`) and `try_reduce_with` to merge them. Avoid locking a global `Mutex` inside the parallel loop to prevent bottlenecks.
3. **GTF Feature Mapping**: When parsing GTF records, map specific features to the following fields in the data structure:
   - `transcript`: Insert `chr`, `start`, `end`, `strand`.
   - `exon`: Append `.` to `exons`, append `start` to `exon_starts` (comma-separated), append `end - start` to `exon_sizes` (comma-separated).
   - `start_codon`: Insert `start_codon`.
   - `stop_codon`: Insert `stop_codon`.
4. **Sorting**: When sorting the resulting data structure, prioritize sorting by the "chr" field (chromosome) and then by the "start" field (numerical value).
5. **CLI Handling**: Use `clap` for argument parsing. If an output path is not provided, default it to the input path with a `.bed` extension using `with_extension("bed")`.
6. **Error Handling**: Prefer `Result` types and `?` operator over `unwrap()` or `panic!` in production code.

# Anti-Patterns
- Do not use `Mutex` inside a `par_lines` loop for every iteration.
- Do not use channels (`mpsc`) for simple map-reduce tasks where `rayon` iterators suffice.
- Do not call iterator methods like `filter` on a `Vec` after `collect`; chain them before collecting.
- Do not use generics to constrain a type to a specific concrete type like `String`; use the concrete type directly.

## Triggers

- parse GTF file in Rust
- parallel GTF parser
- GTF to BED converter
- Rayon fold reduce hashmap
- sort hashmap by chromosome and start

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…