From b6213c990c936a801aedf3a45f6c9dbc498c4fa4 Mon Sep 17 00:00:00 2001 From: Mike Thang Date: Fri, 13 Oct 2023 14:42:48 +1000 Subject: [PATCH] replace contained with located in the python script --- machado/loaders/analysis.py | 2 +- machado/loaders/assay.py | 2 +- machado/loaders/biomaterial.py | 2 +- machado/loaders/feature.py | 2 +- machado/loaders/project.py | 2 +- machado/loaders/sequence.py | 2 +- machado/loaders/similarity.py | 2 +- machado/management/commands/remove_analysis.py | 2 +- .../management/commands/remove_relationship.py | 4 ++-- machado/tests/test_loaders_analysis.py | 2 +- machado/tests/test_loaders_assay.py | 2 +- machado/tests/test_loaders_biomaterial.py | 2 +- machado/tests/test_loaders_coexpression.py | 4 ++-- machado/tests/test_loaders_feature.py | 18 +++++++++--------- .../tests/test_loaders_featureattributes.py | 2 +- machado/tests/test_loaders_orthology.py | 2 +- machado/tests/test_loaders_project.py | 2 +- machado/tests/test_loaders_sequence.py | 2 +- machado/tests/test_loaders_similarity.py | 2 +- 19 files changed, 29 insertions(+), 29 deletions(-) diff --git a/machado/loaders/analysis.py b/machado/loaders/analysis.py index a77c859c..c80f6f81 100644 --- a/machado/loaders/analysis.py +++ b/machado/loaders/analysis.py @@ -27,7 +27,7 @@ class AnalysisLoader(object): def __init__(self) -> None: """Execute the init function.""" self.cvterm_contained_in = Cvterm.objects.get( - name="contained in", cv__name="relationship" + name="located in", cv__name="relationship" ) def store_analysis( diff --git a/machado/loaders/assay.py b/machado/loaders/assay.py index 9195f50f..b30f15e9 100644 --- a/machado/loaders/assay.py +++ b/machado/loaders/assay.py @@ -47,7 +47,7 @@ def __init__(self) -> None: name="Null", ) self.cvterm_contained_in = Cvterm.objects.get( - name="contained in", cv__name="relationship" + name="located in", cv__name="relationship" ) def store_assay( diff --git a/machado/loaders/biomaterial.py b/machado/loaders/biomaterial.py index 68934f42..6f10ab65 100644 --- a/machado/loaders/biomaterial.py +++ b/machado/loaders/biomaterial.py @@ -24,7 +24,7 @@ class BiomaterialLoader(object): def __init__(self) -> None: """Execute the init function.""" self.cvterm_contained_in = Cvterm.objects.get( - name="contained in", cv__name="relationship" + name="located in", cv__name="relationship" ) def store_biomaterial( diff --git a/machado/loaders/feature.py b/machado/loaders/feature.py index 747a2852..9f5eed7c 100644 --- a/machado/loaders/feature.py +++ b/machado/loaders/feature.py @@ -64,7 +64,7 @@ def __init__(self, source: str, filename: str, doi: str = None) -> None: ) self.cvterm_contained_in = Cvterm.objects.get( - name="contained in", cv__name="relationship" + name="located in", cv__name="relationship" ) self.aa_cvterm = Cvterm.objects.get(name="polypeptide", cv__name="sequence") self.so_term_protein_match = Cvterm.objects.get( diff --git a/machado/loaders/project.py b/machado/loaders/project.py index 184666fe..ae605c45 100644 --- a/machado/loaders/project.py +++ b/machado/loaders/project.py @@ -20,7 +20,7 @@ class ProjectLoader(object): def __init__(self) -> None: """Execute the init function.""" self.cvterm_contained_in = Cvterm.objects.get( - name="contained in", cv__name="relationship" + name="located in", cv__name="relationship" ) def store_project(self, name: str, filename: str) -> Project: diff --git a/machado/loaders/sequence.py b/machado/loaders/sequence.py index b44af662..0425eb76 100644 --- a/machado/loaders/sequence.py +++ b/machado/loaders/sequence.py @@ -40,7 +40,7 @@ def __init__( # Retrieve sequence ontology object self.cvterm_contained_in = Cvterm.objects.get( - name="contained in", cv__name="relationship" + name="located in", cv__name="relationship" ) # Retrieve DOI's Dbxref diff --git a/machado/loaders/similarity.py b/machado/loaders/similarity.py index 85a0e748..135dc298 100644 --- a/machado/loaders/similarity.py +++ b/machado/loaders/similarity.py @@ -61,7 +61,7 @@ def __init__( name="in similarity relationship with", cv__name="relationship" ) self.cvterm_contained_in = Cvterm.objects.get( - name="contained in", cv__name="relationship" + name="located in", cv__name="relationship" ) self.analysis_loader = AnalysisLoader() self.analysis = self.analysis_loader.store_analysis( diff --git a/machado/management/commands/remove_analysis.py b/machado/management/commands/remove_analysis.py index 9816684c..6d650d65 100644 --- a/machado/management/commands/remove_analysis.py +++ b/machado/management/commands/remove_analysis.py @@ -40,7 +40,7 @@ def handle(self, name: str, verbosity: int = 1, **options): ) cvterm_contained_in = Cvterm.objects.get( - name="contained in", cv__name="relationship" + name="located in", cv__name="relationship" ) analysisprop_list = Analysisprop.objects.filter( value=name, type_id=cvterm_contained_in.cvterm_id diff --git a/machado/management/commands/remove_relationship.py b/machado/management/commands/remove_relationship.py index 10bd24ef..3b6941b5 100644 --- a/machado/management/commands/remove_relationship.py +++ b/machado/management/commands/remove_relationship.py @@ -29,9 +29,9 @@ def add_arguments(self, parser): def handle(self, file: str, verbosity: int = 0, **options): """Execute the main function.""" - # get cvterm for contained in + # get cvterm for located in try: - cvterm = Cvterm.objects.get(name="contained in", cv__name="relationship") + cvterm = Cvterm.objects.get(name="located in", cv__name="relationship") except IntegrityError as e: raise ImportingError(e) filename = os.path.basename(file) diff --git a/machado/tests/test_loaders_analysis.py b/machado/tests/test_loaders_analysis.py index 63e0481e..cf3d78ff 100644 --- a/machado/tests/test_loaders_analysis.py +++ b/machado/tests/test_loaders_analysis.py @@ -55,7 +55,7 @@ def test_store_analysis(self): is_relationshiptype=0, ) Cvterm.objects.create( - name="contained in", + name="located in", cv=test_cv2, dbxref=test_dbxref2, is_obsolete=0, diff --git a/machado/tests/test_loaders_assay.py b/machado/tests/test_loaders_assay.py index 81a6c6d2..abc17d4b 100644 --- a/machado/tests/test_loaders_assay.py +++ b/machado/tests/test_loaders_assay.py @@ -25,7 +25,7 @@ def test_store_assay(self): test_dbxref = Dbxref.objects.create(accession="00002", db=test_db) test_cv = Cv.objects.create(name="relationship") Cvterm.objects.create( - name="contained in", + name="located in", cv=test_cv, dbxref=test_dbxref, is_obsolete=0, diff --git a/machado/tests/test_loaders_biomaterial.py b/machado/tests/test_loaders_biomaterial.py index aa556f68..ca859ded 100644 --- a/machado/tests/test_loaders_biomaterial.py +++ b/machado/tests/test_loaders_biomaterial.py @@ -24,7 +24,7 @@ def test_store_biomaterial(self): test_dbxref = Dbxref.objects.create(accession="00002", db=test_db) test_cv = Cv.objects.create(name="relationship") Cvterm.objects.create( - name="contained in", + name="located in", cv=test_cv, dbxref=test_dbxref, is_obsolete=0, diff --git a/machado/tests/test_loaders_coexpression.py b/machado/tests/test_loaders_coexpression.py index 9b21d04c..bf3a5ea1 100644 --- a/machado/tests/test_loaders_coexpression.py +++ b/machado/tests/test_loaders_coexpression.py @@ -62,7 +62,7 @@ def test_load_coexpression_pairs(self): # is_obsolete=0, is_relationshiptype=0) # register features. cvterm_contained_in = Cvterm.objects.create( - name="contained in", + name="located in", cv=test_cv2, dbxref=test_dbxref2, is_obsolete=0, @@ -232,7 +232,7 @@ def test_load_coexpression_clusters(self): # is_obsolete=0, is_relationshiptype=0) # register features. Cvterm.objects.create( - name="contained in", + name="located in", cv=test_cv2, dbxref=test_dbxref2, is_obsolete=0, diff --git a/machado/tests/test_loaders_feature.py b/machado/tests/test_loaders_feature.py index 23a5774d..521938b6 100644 --- a/machado/tests/test_loaders_feature.py +++ b/machado/tests/test_loaders_feature.py @@ -89,12 +89,12 @@ def test_store_tabix_GFF_feature(self): is_obsolete=0, is_relationshiptype=0, ) - # create RO term: contained in + # create RO term: located in test_db = Db.objects.create(name="RO") test_dbxref = Dbxref.objects.create(accession="00002", db=test_db) test_cv = Cv.objects.create(name="relationship") Cvterm.objects.create( - name="contained in", + name="located in", cv=test_cv, dbxref=test_dbxref, is_obsolete=0, @@ -282,12 +282,12 @@ def test_store_tabix_VCF_feature(self): is_relationshiptype=0, ) - # create RO term: contained in + # create RO term: located in test_db = Db.objects.create(name="RO") test_dbxref = Dbxref.objects.create(accession="00002", db=test_db) test_cv = Cv.objects.create(name="relationship") Cvterm.objects.create( - name="contained in", + name="located in", cv=test_cv, dbxref=test_dbxref, is_obsolete=0, @@ -399,12 +399,12 @@ class TabixFeature(object): def test_store_bio_searchio_hit(self): """Tests - store bio searchio hit.""" - # create RO term: contained in + # create RO term: located in test_db = Db.objects.create(name="RO") test_dbxref = Dbxref.objects.create(accession="00002", db=test_db) test_cv = Cv.objects.create(name="relationship") Cvterm.objects.create( - name="contained in", + name="located in", cv=test_cv, dbxref=test_dbxref, is_obsolete=0, @@ -493,7 +493,7 @@ def test_store_feature_annotation(self): test_dbxref = Dbxref.objects.create(accession="00002", db=test_db) test_cv = Cv.objects.create(name="relationship") Cvterm.objects.create( - name="contained in", + name="located in", cv=test_cv, dbxref=test_dbxref, is_obsolete=0, @@ -606,7 +606,7 @@ def test_store_feature_publication(self): test_dbxref = Dbxref.objects.create(accession="00002", db=test_db) test_cv = Cv.objects.create(name="relationship") Cvterm.objects.create( - name="contained in", + name="located in", cv=test_cv, dbxref=test_dbxref, is_obsolete=0, @@ -697,7 +697,7 @@ def test_store_feature_dbxref(self): test_dbxref = Dbxref.objects.create(accession="00002", db=test_db) test_cv = Cv.objects.create(name="relationship") Cvterm.objects.create( - name="contained in", + name="located in", cv=test_cv, dbxref=test_dbxref, is_obsolete=0, diff --git a/machado/tests/test_loaders_featureattributes.py b/machado/tests/test_loaders_featureattributes.py index 9c69dc3e..1a547f38 100644 --- a/machado/tests/test_loaders_featureattributes.py +++ b/machado/tests/test_loaders_featureattributes.py @@ -94,7 +94,7 @@ def test_process_attributes(self): test_dbxref = Dbxref.objects.create(accession="00002", db=test_db) test_cv = Cv.objects.create(name="relationship") Cvterm.objects.create( - name="contained in", + name="located in", cv=test_cv, dbxref=test_dbxref, is_obsolete=0, diff --git a/machado/tests/test_loaders_orthology.py b/machado/tests/test_loaders_orthology.py index 11edc749..9d0821c9 100644 --- a/machado/tests/test_loaders_orthology.py +++ b/machado/tests/test_loaders_orthology.py @@ -35,7 +35,7 @@ def test_orthology(self): ro_dbxref = Dbxref.objects.create(accession="658", db=ro_db) # creating test SO term Cvterm.objects.create( - name="contained in", + name="located in", cv=ro_cv, dbxref=ro_dbxref, is_obsolete=0, diff --git a/machado/tests/test_loaders_project.py b/machado/tests/test_loaders_project.py index d12bea52..3bcaaa07 100644 --- a/machado/tests/test_loaders_project.py +++ b/machado/tests/test_loaders_project.py @@ -24,7 +24,7 @@ def test_store_project(self): test_dbxref = Dbxref.objects.create(accession="00002", db=test_db) test_cv = Cv.objects.create(name="relationship") Cvterm.objects.create( - name="contained in", + name="located in", cv=test_cv, dbxref=test_dbxref, is_obsolete=0, diff --git a/machado/tests/test_loaders_sequence.py b/machado/tests/test_loaders_sequence.py index 95ba91e1..c8373c36 100644 --- a/machado/tests/test_loaders_sequence.py +++ b/machado/tests/test_loaders_sequence.py @@ -40,7 +40,7 @@ def setUp(self): test_dbxref = Dbxref.objects.create(accession="00002", db=test_db) test_cv = Cv.objects.create(name="relationship") Cvterm.objects.create( - name="contained in", + name="located in", cv=test_cv, dbxref=test_dbxref, is_obsolete=0, diff --git a/machado/tests/test_loaders_similarity.py b/machado/tests/test_loaders_similarity.py index f82946df..e0069f17 100644 --- a/machado/tests/test_loaders_similarity.py +++ b/machado/tests/test_loaders_similarity.py @@ -79,7 +79,7 @@ def test_store_bio_searchio_blast_record(self): ) test_dbxref4 = Dbxref.objects.create(accession="12345678", db=test_db2) Cvterm.objects.create( - name="contained in", + name="located in", cv=test_cv2, dbxref=test_dbxref4, is_obsolete=0,