Skip to content

Commit

Permalink
Merge pull request #365 from EBI-Metagenomics/add-new-analysis-files
Browse files Browse the repository at this point in the history
Add new analysis files
  • Loading branch information
SandyRogers authored Aug 15, 2024
2 parents 43ec147 + 90b78b4 commit f5925b7
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 2 deletions.
48 changes: 48 additions & 0 deletions emgapi/migrations/0018_genome_annotations_v2_4_downloads.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Generated by Django 3.2.12 on 2024-08-15 00:00

from django.db import migrations


def create_v2_4_genome_download_description(apps, schema_editor):
DownloadDescriptionLabel = apps.get_model("emgapi", "DownloadDescriptionLabel")

DownloadDescriptionLabel.objects.create(
description="CAZy and putative polysaccharide utilization loci annotations produced by dbCAN",
description_label="Genome dbCAN Annotation"
)
DownloadDescriptionLabel.objects.create(
description="Anti-phage defence system annotations produced by Defense Finder",
description_label="Genome Defense Finder Annotation"
)
DownloadDescriptionLabel.objects.create(
description="BGC annotations produced by GECCO",
description_label="Genome GECCO Annotation"
)
DownloadDescriptionLabel.objects.create(
description="Completeness of identified KEGG pathways",
description_label="KEGG Pathway Completeness"
)


def remove_v2_4_genome_download_description(apps, schema_editor):
DownloadDescriptionLabel = apps.get_model("emgapi", "DownloadDescriptionLabel")
DownloadDescriptionLabel.objects.filter(description_label__in=[
"Genome dbCAN Annotation",
"Genome Defense Finder Annotation",
"Genome GECCO Annotation",
"KEGG Pathway Completeness",
]).delete()


class Migration(migrations.Migration):

dependencies = [
('emgapi', '0017_auto_20240129_1401'),
]

operations = [
migrations.RunPython(
code=create_v2_4_genome_download_description,
reverse_code=remove_v2_4_genome_download_description,
),
]
9 changes: 9 additions & 0 deletions emgapianns/management/commands/import_genomes.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,15 @@ def upload_genome_files(self, genome, directory, has_pangenome):
genome.accession + '_crisprcasfinder.tsv', 'Genome analysis', 'genome', False)
self.upload_genome_file(genome, directory, 'Genome Mobilome Annotation', 'gff',
genome.accession + '_mobilome.gff', 'Genome analysis', 'genome', False)
# pipeline v2.4.0 files (if not empty):
self.upload_genome_file(genome, directory, 'Genome dbCAN Annotation', 'gff',
genome.accession + '_dbcan.gff', 'Genome analysis', 'genome', False)
self.upload_genome_file(genome, directory, 'Genome Defense Finder Annotation', 'gff',
genome.accession + '_defense_finder.gff', 'Genome analysis', 'genome', False)
self.upload_genome_file(genome, directory, 'Genome GECCO Annotation', 'gff',
genome.accession + '_gecco.gff', 'Genome analysis', 'genome', False)
self.upload_genome_file(genome, directory, 'KEGG Pathway Completeness', 'tsv',
genome.accession + '_kegg_pathways.tsv', 'Genome analysis', 'genome', False)

if has_pangenome:
self.upload_genome_file(genome, directory, 'Pangenome core genes list', 'tab',
Expand Down
2 changes: 1 addition & 1 deletion emgcli/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__: str = "2.4.48"
__version__: str = "2.4.49"
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ max-line-length = 119
"""

[tool.bumpversion]
current_version = "2.4.48"
current_version = "2.4.49"

[[tool.bumpversion.files]]
filename = "emgcli/__init__.py"
4 changes: 4 additions & 0 deletions tests/webuploader/test_genomes.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ def _setup(self):
("Additional data for CRISPRCasFinder records reported in the CRISPRCasFinder GFF", "Genome CRISPRCasFinder Additional Records"),
("Annotated viral sequence and mobile elements", "Genome Mobilome Annotation"),
("List of genes in the pan-genome with their annotation and MGYG accessions.", "Gene Presence / Absence list"),
("CAZy and putative polysaccharide utilization loci annotations produced by dbCAN", "Genome dbCAN Annotation"),
("Anti-phage defence system annotations produced by Defense Finder", "Genome Defense Finder Annotation"),
("BGC annotations produced by GECCO", "Genome GECCO Annotation"),
("Completeness of identified KEGG pathways", "KEGG Pathway Completeness"),
)
for d in downloads:
emg_models.DownloadDescriptionLabel.objects.get_or_create(
Expand Down

0 comments on commit f5925b7

Please sign in to comment.