Skip to content

Commit

Permalink
replace contained with located in the python script
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Thang committed Oct 13, 2023
1 parent 855b427 commit b6213c9
Show file tree
Hide file tree
Showing 19 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion machado/loaders/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion machado/loaders/assay.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion machado/loaders/biomaterial.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion machado/loaders/feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion machado/loaders/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion machado/loaders/sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion machado/loaders/similarity.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion machado/management/commands/remove_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions machado/management/commands/remove_relationship.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion machado/tests/test_loaders_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion machado/tests/test_loaders_assay.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion machado/tests/test_loaders_biomaterial.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions machado/tests/test_loaders_coexpression.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
18 changes: 9 additions & 9 deletions machado/tests/test_loaders_feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion machado/tests/test_loaders_featureattributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion machado/tests/test_loaders_orthology.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion machado/tests/test_loaders_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion machado/tests/test_loaders_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion machado/tests/test_loaders_similarity.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit b6213c9

Please sign in to comment.