Application Mutation

The MUTATION application contains the actions to generate index mutation from Nextclade.

Key files of the « MUTATION » application

management.commands

run_index_mutation.py

class apps.mutation.management.commands.run_index_mutation.Command(stdout=None, stderr=None, no_color=False, force_color=False)
handle(*args, **kwargs)

SUMMARY LINE

Run task for non index file

HOW TO USE

docker-compose exec web python manage.py run_index_mutation

Add -f docker-compose.prod.yml in Prod

models.py

class apps.mutation.models.AlertVariant(*args, **kwargs)

Alert variant table

exception DoesNotExist
exception MultipleObjectsReturned
clean()

The clean function checks various fields and performs database checks based on the type of the field.

class apps.mutation.models.GenomicFeature(*args, **kwargs)

Genomic Feature table

exception DoesNotExist
exception MultipleObjectsReturned
class apps.mutation.models.IntermediateMutationGenomic(id, mutation, result)
exception DoesNotExist
exception MultipleObjectsReturned
class apps.mutation.models.IntermediateMutationProteomic(id, mutation, result)
exception DoesNotExist
exception MultipleObjectsReturned
class apps.mutation.models.MutationGenomic(*args, **kwargs)

Mutation nucleotide table

exception DoesNotExist
exception MultipleObjectsReturned
class apps.mutation.models.MutationProteomic(*args, **kwargs)

Mutation proteomic table

exception DoesNotExist
exception MultipleObjectsReturned
class apps.mutation.models.Protein(*args, **kwargs)

Protein table

exception DoesNotExist
exception MultipleObjectsReturned
class apps.mutation.models.ProteomicFeature(*args, **kwargs)

Proteomic Feature table

exception DoesNotExist
exception MultipleObjectsReturned
class apps.mutation.models.SeqName(*args, **kwargs)

Sequence name table

exception DoesNotExist
exception MultipleObjectsReturned

test.py

class apps.mutation.tests.mutationAlertTestCase(methodName='runTest')

Test for alert mutation app

setUp()

Hook method for setting up the test fixture before exercising it.

tearDown()

Hook method for deconstructing the test fixture after testing it.

test_explore_mutation_log_text()

Test get explore page

class apps.mutation.tests.mutationTaskTestCase(methodName='runTest')

Test for mutation task functions

setUp()

Hook method for setting up the test fixture before exercising it.

tearDown()

Hook method for deconstructing the test fixture after testing it.

test_index_mutation()

Test index mutation

test_index_mutation_auto()

Test index mutation auto

class apps.mutation.tests.mutationTestCase(methodName='runTest')

Test for mutation app

setUp()

Hook method for setting up the test fixture before exercising it.

test_str_Protein()

Test model : get str from Protein

test_str_SeqName()

Test model : get str from Seqnam

test_upload_gene_bad_extension()

Test admin upload gene bad extension

test_upload_gene_bad_file()

Test admin upload gene bad file

test_upload_gene_error()

Test admin upload gene error

test_upload_genomic()

Test admin upload genomic feature

test_upload_proteomic()

Test admin upload proteomic feature

test_upload_proteomic_bad_extension()

Test admin upload proteomi bad extension

test_upload_proteomic_bad_file()

Test admin upload proteomic bad file

test_upload_proteomic_error()

Test admin upload proteomic error

views.py

apps.mutation.views.alert_results(request, name=None)

The function alert_results retrieves alerts from the database and renders them in a template, with the option to filter by name.

Paramètres
  • request – The request parameter is an object that represents the HTTP request made by the client. It contains information such as the request method, headers, and body

  • name – The name parameter is an optional parameter that represents the name of an alert variant. If provided, the function will try to retrieve the alert variant with the given name from the database. If no alert variant with the given name is found, an error message will be displayed in the rendered template

Renvoie

The function alert_results returns a rendered HTML template. The specific template being rendered depends on the conditions in the code. If the name parameter is provided and a corresponding AlertVariant object is found, a template with the name “mutation/alert_results.html” is rendered with various variables passed to it. If the name parameter is not provided.

apps.mutation.views.alert_summary(request)

The function « alert_summary » renders a template called « mutation/alert_summary.html » and passes a dictionary containing the names of all fields in the « AlertVariant » model, excluding the primary key field.

Paramètres

request – The request parameter is an object that represents the HTTP request made by the client. It contains information such as the request method, headers, and body. It is typically passed to view functions in Django to handle the request and generate a response. In this case, it is being passed to the

Renvoie

a rendered HTML template called “mutation/alert_summary.html” with a context dictionary containing a list of column names from the AlertVariant model.