Skip to content

Commit

Permalink
Feature: extra assembly annotations (sanntis) (#294)
Browse files Browse the repository at this point in the history
* fixes typo in ENASyncableModel logging

* [WIP] adding "Extra Assembly Annotations" model and importer

* adds SanntiS annotations as "extra" (non-pipeline) annotations

* adds assembly extra annotation to expected api surface

* adds api test for assembly-extra-annotations (and fix assemblies fixture)

* farewell python3.6 (`requests` has deprecated it)

* fixes py3.8.6 no longer available on GHA ubuntu-latest

* adds support for (optional) virify GFF in genome importer

* use in-mem cache of download description/format/subdir/group instances when uploading assembly extra annotation files

* cleanup old (now squashed) migrations

* [DEBUG] debugging failing test on GHA

* adds virify genome download label to test fixtures

* adds virify txt file to optional genome downloads
  • Loading branch information
SandyRogers authored Nov 24, 2022
1 parent ba60931 commit 3fc0b23
Show file tree
Hide file tree
Showing 58 changed files with 476 additions and 4,110 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.8.6]
python-version: [3.8, 3.9]
# TODO: Temporarily removed 3.7.1, waiting for https://github.com/celery/celery/issues/7783

steps:
Expand Down
16 changes: 16 additions & 0 deletions emgapi/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,19 @@ class PublicationAdmin(admin.ModelAdmin):
]


class AssemblyExtraAnnotationDownloads(admin.TabularInline):
model = emg_models.AssemblyExtraAnnotation
raw_id_fields = [
'assembly',
'parent_id',
'group_type',
'subdir',
'description',
'file_format'
]
extra = 0


@admin.register(emg_models.Assembly)
class AssemblyAdmin(admin.ModelAdmin):
change_list_template = "admin/change_list_filter_sidebar.html"
Expand All @@ -244,6 +257,9 @@ class AssemblyAdmin(admin.ModelAdmin):
'legacy_accession',
'experiment_type__experiment_type'
]
inlines = [
AssemblyExtraAnnotationDownloads
]


@admin.register(emg_models.AssemblyRun)
Expand Down
5 changes: 5 additions & 0 deletions emgapi/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class DownloadHyperlinkedIdentityField(serializers.HyperlinkedIdentityField):
def get_url(self, obj, view_name, request, format):
if obj.pk is None:
return None
kwargs = {}
# if study
if hasattr(obj, 'study') and hasattr(obj, 'pipeline'):
kwargs = {
Expand All @@ -44,6 +45,10 @@ def get_url(self, obj, view_name, request, format):
kwargs = {
'catalogue_id': obj.genome_catalogue.catalogue_id,
}
elif hasattr(obj, 'assembly'):
kwargs = {
'accession': obj.assembly.accession
}
kwargs['alias'] = obj.alias

return reverse(
Expand Down
322 changes: 0 additions & 322 deletions emgapi/migrations/0001_initial.py

This file was deleted.

278 changes: 0 additions & 278 deletions emgapi/migrations/0002_cleanup_and_rename.py

This file was deleted.

28 changes: 0 additions & 28 deletions emgapi/migrations/0003_annotations.py

This file was deleted.

Loading

0 comments on commit 3fc0b23

Please sign in to comment.