Skip to content

Latest commit

 

History

History
80 lines (56 loc) · 1.92 KB

README.md

File metadata and controls

80 lines (56 loc) · 1.92 KB

MIT licensed

pg_bedtools_rs

A PostgreSQL plugin for bedtools, implemented in Rust.

🌟 Features

  • bed_merge

🛠️ Installer

Local Machine

cargo install cargo-pgrx --version 0.11.4 --locked
cargo pgrx install --pg-config [PATH]

Docker

docker run --rm -v $(pwd):/usr/src/app shencangsheng/pgrx:13
cp target/release/pg_bedtools_rs-pg13/root/.pgrx/13.18/pgrx-install/lib/postgresql/pg_bedtools_rs.so ${POSTGRESQL_PATH}/lib/
cp target/release/pg_bedtools_rs-pg13/root/.pgrx/13.18/pgrx-install/share/postgresql/extension/pg_bedtools_rs.control ${POSTGRESQL_PATH}/extension/
cp target/release/pg_bedtools_rs-pg13/root/.pgrx/13.18/pgrx-install/share/postgresql/extension/pg_bedtools_rs.control ${POSTGRESQL_PATH}/extension/
CREATE EXTENSION pg_bedtools_rs

📦 Supports

  • PostgreSQL 13

💡 Trying

Basic example:

create table tube_probe_bed (
   id SERIAL PRIMARY KEY,
   chromosome varchar NOT NULL,
   pos_start integer NOT NULL,
   pos_end integer NOT NULL
);

INSERT INTO
	TUBE_PROBE_BED (CHROMOSOME, POS_START, POS_END)
VALUES
	('chr1', 5, 10),
	('chr1', 10, 14),
	('chr1', 7, 15),
	('chr1', 22, 30),
	('chr1', 25, 35),
	('chr2', 5, 10),
	('chr2', 7, 15);
	
select * from bed_merge('tube_probe_bed');

Returns:

CHROMOSOME POS_START POS_END
chr1 5 15
chr1 22 35
chr2 5 15

👍 Libraries Used

📝 License

A short snippet describing the license (MIT)

MIT © Cangsheng Shen