Skip to content

Commit

Permalink
fixed merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
puja-trivedi committed Nov 6, 2024
2 parents edc1df3 + 5294835 commit 92706e9
Show file tree
Hide file tree
Showing 52 changed files with 21,343 additions and 1,162 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/add_dunder_methods.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: add dunder methods to genome_annotation model

on:
push:
paths:
- 'bkbit/models/genome_annotation.py'

permissions:
contents: write

jobs:
run-script:
runs-on: ubuntu-latest
steps:
- name: Checkout this repository
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Run add_dunderMethods_genomeAnnotation
run: python bkbit/model_editors/add_dunderMethods_genomeAnnotation.py

- name: Commit changes
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
git add bkbit/models/genome_annotation.py
git commit -m 'Update genome_annotation.py with dunder methods'
git push
34 changes: 34 additions & 0 deletions .github/workflows/generate_docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish bkbit Documentation

on:
push:
branches:
- main
- create_docs_20241003

jobs:
publish_bkbit_docs:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
pip install -e .
pip install sphinx sphinx_rtd_theme
pip install m2r
- name: Sphinx build
run: |
sphinx-apidoc -o docs bkbit --separate
sphinx-build docs docs/_build/html
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build/html
force_orphan: true
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
__pycache__
_build
6 changes: 6 additions & 0 deletions bkbit/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
from bkbit.data_translators.library_generation_translator import specimen2jsonld
from bkbit.data_translators.file_manifest_translator import filemanifest2jsonld
from bkbit.data_translators.specimen_metadata_translator import list_library_aliquot
from bkbit.data_translators.genome_annotation_translator import gff2jsonld
from bkbit.utils.get_ncbi_taxonomy import download_ncbi_taxonomy
from bkbit.model_editors.linkml_trimmer import linkml_trimmer

@click.group()
def cli():
Expand All @@ -16,6 +19,9 @@ def cli():
cli.add_command(specimen2jsonld)
cli.add_command(filemanifest2jsonld)
cli.add_command(list_library_aliquot)
cli.add_command(gff2jsonld)
cli.add_command(download_ncbi_taxonomy)
cli.add_command(linkml_trimmer)

if __name__ == '__main__':
cli()
107 changes: 107 additions & 0 deletions bkbit/data_translators/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,111 @@ ls .
DO-XIQQ6047.jsonld
DO-WFFF3774.jsonld
DO-RMRL6873.jsonld
# genome_annotation_translator.py

## Overview
genome_annotation_translator uses annotated genome data in GFF3 format to generate respective data objects representing genes, genome assemblies, and organisms. All data object are defined in the [Genome Annotation Schema](https://brain-bican.github.io/models/index_genome_annotation/).<br>
Each jsonld file will contain:
- GeneAnnotation objects
- 1 GenomeAnnotation object
- 1 GenomeAssembly object
- 1 OrganismTaxon object
- 1 Checksum object



## Command Line
### gen-geneannotation
```python
gen-geneannotation [OPTIONS] GFF3_URL
```

#### Options
<span style="color: red;">-a, --assembly_accession</span> <br>
&emsp;ID assigned to the genomic assembly used in the GFF3 file. <br>
&emsp;<b>*Note*</b>: Must be provided when using ENSEMBL GFF3 files

<span style="color: red;">-s, --assembly_strain</span> <br>
&emsp;Specific strain of the organism associated with the GFF3 file.

<span style="color: red;">-l, --log_level</span> <br>
&emsp;Logging level. <br>
&emsp;DEFAULT:<br>
&emsp;&emsp;'WARNING'<br>
&emsp;OPTIONS:<br>
&emsp;&emsp;DEBUG | INFO | WARNING | ERROR | CRITICIAL

<span style="color: red;">-f, --log_to_file</span> <br>
&emsp;Log to a file instead of the console. <br>
&emsp;DEFAULT:<br>
&emsp;&emsp;False <br>

## Examples
#### Example 1: NCBI GFF3 File

```python
pip install bkbit

gen-geneannotation 'https://ftp.ncbi.nlm.nih.gov/genomes/all/annotation_releases/9823/106/GCF_000003025.6_Sscrofa11.1/GCF_000003025.6_Sscrofa11.1_genomic.gff.gz' > output.jsonld
```

#### Example 2: ENSEMBL GFF3 File

```python
pip install bkbit

# genome_annotation_translator.py

## Overview
genome_annotation_translator uses annotated genome data in GFF3 format to generate respective data objects representing genes, genome assemblies, and organisms. All data object are defined in the [Genome Annotation Schema](https://brain-bican.github.io/models/index_genome_annotation/).<br>
Each jsonld file will contain:
- GeneAnnotation objects
- 1 GenomeAnnotation object
- 1 GenomeAssembly object
- 1 OrganismTaxon object
- 1 Checksum object



## Command Line
### gen-geneannotation
```python
gen-geneannotation [OPTIONS] GFF3_URL
```

#### Options
<span style="color: red;">-a, --assembly_accession</span> <br>
&emsp;ID assigned to the genomic assembly used in the GFF3 file. <br>
&emsp;<b>*Note*</b>: Must be provided when using ENSEMBL GFF3 files

<span style="color: red;">-s, --assembly_strain</span> <br>
&emsp;Specific strain of the organism associated with the GFF3 file.

<span style="color: red;">-l, --log_level</span> <br>
&emsp;Logging level. <br>
&emsp;DEFAULT:<br>
&emsp;&emsp;'WARNING'<br>
&emsp;OPTIONS:<br>
&emsp;&emsp;DEBUG | INFO | WARNING | ERROR | CRITICIAL

<span style="color: red;">-f, --log_to_file</span> <br>
&emsp;Log to a file instead of the console. <br>
&emsp;DEFAULT:<br>
&emsp;&emsp;False <br>

## Examples
#### Example 1: NCBI GFF3 File

```python
pip install bkbit

gen-geneannotation 'https://ftp.ncbi.nlm.nih.gov/genomes/all/annotation_releases/9823/106/GCF_000003025.6_Sscrofa11.1/GCF_000003025.6_Sscrofa11.1_genomic.gff.gz' > output.jsonld
```

#### Example 2: ENSEMBL GFF3 File

```python
pip install bkbit

gen-geneannotation -a 'GCF_003339765.1' 'https://ftp.ensembl.org/pub/release-104/gff3/macaca_mulatta/Macaca_mulatta.Mmul_10.104.gff3.gz' > output.jsonld
```
Loading

0 comments on commit 92706e9

Please sign in to comment.