Skip to content

Commit

Permalink
updated bedboss docs
Browse files Browse the repository at this point in the history
  • Loading branch information
khoroshevskyi committed Feb 13, 2025
1 parent 588613e commit 0bfeab1
Show file tree
Hide file tree
Showing 5 changed files with 116 additions and 4 deletions.
42 changes: 42 additions & 0 deletions docs/bedboss/how-to-run-in-docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Running Bedboss in Docker

To run bedboss in docker, go through the following steps:

1. Clone the bedboss repository:

```bash
git clone [email protected]:databio/bedboss.git
```

2. Go to the bedboss directory.

3. Build the docker image:

```bash
docker build -t my_bedboss .
```

4. source the environment variables:

```bash
source production/production.env
```

5. Run the docker container with setting limit of the files that have to be processed:

```bash
docker run --rm -it \
--env POSTGRES_DB=$POSTGRES_DB \
--env POSTGRES_HOST=$POSTGRES_HOST \
--env POSTGRES_USER=$POSTGRES_USER \
--env POSTGRES_PASSWORD=$POSTGRES_PASSWORD \
--env QDRANT_API_KEY=$QDRANT_API_KEY \
--env QDRANT_API_HOST=$QDRANT_API_HOST \
--env AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \
--env AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \
--env AWS_ENDPOINT_URL=$AWS_ENDPOINT_URL \
--env UPLOAD_LIMIT=1 \
-t my_bedboss
```

If everything is set up correctly, you should see the bedboss prompt.
13 changes: 12 additions & 1 deletion docs/bedboss/tutorials/python/bedclassifier_tutorial.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
# BED classifier tutorial

BED classifier is a utility that allows you to classify BED files based on their columns.
The function output is a tuple of two strings: `bed_format` and `bed_type`. e.g. `('narrowpeak', 'bed3+5')`.

### 🚧 Tutorial in progress! Stay tuned for updates. We're working hard to bring you valuable content soon!
Example usage of the BED classifier:

```python
from bedboss.bedclassifier.bedclassifier import get_bed_type

f = get_bed_type("path/to/bedfile.bed")
print(f)

## > ('narrowpeak', 'bed3+5')
```
61 changes: 60 additions & 1 deletion docs/bedboss/tutorials/python/ref_genome_tutorial.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,62 @@
# Reference genome validator

### 🚧 Tutorial in progress! Stay tuned for updates. We're working hard to bring you valuable content soon!
Reference genome validator is a set of functions that allow to validate the reference genome of the bed files.
Functions include different statistical analysis and comparison of the reference genome of the bed files that produce a compatibility rating.

To run the reference genome validator, you need to have the input bed file and the chrom sizes files.

Examples usage of the reference genome validator:

### Example 1
Run validator with default parameters, with include default chrom sizes files.

```python

from bedboss.refgenome_validator.main import ReferenceValidator

validator_obj = ReferenceValidator()

results = validator_obj.determine_compatibility("path/to/bedfile.bed")

print(results)
# >>{'ensembl_hg38.chrom.sizes': CompatibilityStats(chrom_name_stats=ChromNameStats(xs=0.0, q_and_m=0.0, q_and_not_m=86.0, not_q_and_m=68.0, jaccard_index=0.0, jaccard_index_binary=0.0, passed_chrom_names=False), chrom_length_stats=ChromLengthStats(oobr=None, beyond_range=False, num_of_chrom_beyond=0, percentage_bed_chrom_beyond=0.0, percentage_genome_chrom_beyond=0.0), chrom_sequence_fit_stats=SequenceFitStats(sequence_fit=None), igd_stats=None, compatibility=RatingModel(assigned_points=10, tier_ranking=4)),
# >> 'ncbi_hg38.chrom.sizes': CompatibilityStats(chrom_name_stats=ChromNameStats(xs=0.0, q_and_m=0.0, q_and_not_m=86.0, not_q_and_m=705.0, jaccard_index=0.0, jaccard_index_binary=0.0, passed_chrom_names=False), chrom_length_stats=ChromLengthStats(oobr=None, beyond_range=False, num_of_chrom_beyond=0, percentage_bed_chrom_beyond=0.0, percentage_genome_chrom_beyond=0.0), chrom_sequence_fit_stats=SequenceFitStats(sequence_fit=None), igd_stats=None, compatibility=RatingModel(assigned_points=10, tier_ranking=4)),

```

### Example 2
Run validator with custom reference genome chrom sizes files.

```python

from bedboss.refgenome_validator.main import ReferenceValidator


ref_gen_list = [GenomeModel(
genome_alias="ensembl_hg38",
chrom_sizes_path="path/to/ensembl_hg38.chrom.sizes"
)
]
validator_obj = ReferenceValidator(
genome_models=ref_gen_list,
)

results = validator_obj.determine_compatibility("path/to/bedfile.bed")

print(results)
# >>{'ensembl_hg38': CompatibilityStats(chrom_name_stats=ChromNameStats(xs=0.0, q_and_m=0.0, q_and_not_m=86.0, not_q_and_m=68.0, jaccard_index=0.0, jaccard_index_binary=0.0, passed_chrom_names=False), chrom_length_stats=ChromLengthStats(oobr=None, beyond_range=False, num_of_chrom_beyond=0, percentage_bed_chrom_beyond=0.0, percentage_genome_chrom_beyond=0.0), chrom_sequence_fit_stats=SequenceFitStats(sequence_fit=None), igd_stats=None, compatibility=RatingModel(assigned_points=10, tier_ranking=4))}
```

### Example 3
Run genome predictor on a bed file with default reference genomes chrom sizes files.

```python
from bedboss.refgenome_validator.main import ReferenceValidator

validator_obj = ReferenceValidator()

results = validator_obj.predict("path/to/bedfile.bed")

print(results)

```
2 changes: 1 addition & 1 deletion docs/bedboss/usage.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Usage reference
# Command line interface reference

BEDboss is command-line tool-manager and a set of tools for working with BED files and BEDbase. Main components of BEDboss are: </br>
1) Pipeline for processing BED files: bedmaker, bedqc, and bedstats.</br>
Expand Down
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ nav:
- Command line interface: bedboss/usage.md
- How to guides:
- Create BEDbase database: bedboss/how-to-create-database.md
- Run BEDboss in Docker: bedboss/how-to-run-in-docker.md
- Create config file: bedbase/how-to-configure.md
- Install dependencies: bedboss/how-to-install-requirements.md
- Reference:
- How to cite: citations.md
- Usage: bedboss/usage.md
- Changelog: bedboss/changelog.md
- Geniml:
- Geniml: geniml/README.md
Expand Down

0 comments on commit 0bfeab1

Please sign in to comment.