A PostgreSQL
plugin for bedtools
, implemented in Rust
.
-
bed_merge
cargo install cargo-pgrx --version 0.11.4 --locked
cargo pgrx install --pg-config [PATH]
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
- PostgreSQL 13
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 |
A short snippet describing the license (MIT)
MIT © Cangsheng Shen