Skip to content

Commit

Permalink
fixed dm
Browse files Browse the repository at this point in the history
  • Loading branch information
haeussma committed Jun 11, 2024
1 parent b29f919 commit 3f48fd3
Show file tree
Hide file tree
Showing 19 changed files with 150 additions and 130 deletions.
66 changes: 62 additions & 4 deletions graph-network/graph-network/populate.ipynb

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions pyeed/core/abstractannotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ class AbstractAnnotation(
json_schema_extra=dict(),
)

_repo: Optional[str] = PrivateAttr(default="https://github.com/PyEED/pyeed")
_commit: Optional[str] = PrivateAttr(
default="6cb7b2b9f86383fe9659fc93e0802306fd288462"
)

_raw_xml_data: Dict = PrivateAttr(default_factory=dict)

@model_validator(mode="after")
Expand Down
5 changes: 0 additions & 5 deletions pyeed/core/alignmentresult.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,6 @@ class AlignmentResult(
json_schema_extra=dict(),
)

_repo: Optional[str] = PrivateAttr(default="https://github.com/PyEED/pyeed")
_commit: Optional[str] = PrivateAttr(
default="6cb7b2b9f86383fe9659fc93e0802306fd288462"
)

_raw_xml_data: Dict = PrivateAttr(default_factory=dict)

@model_validator(mode="after")
Expand Down
5 changes: 0 additions & 5 deletions pyeed/core/blastdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,6 @@ class BlastData(
json_schema_extra=dict(),
)

_repo: Optional[str] = PrivateAttr(default="https://github.com/PyEED/pyeed")
_commit: Optional[str] = PrivateAttr(
default="6cb7b2b9f86383fe9659fc93e0802306fd288462"
)

_raw_xml_data: Dict = PrivateAttr(default_factory=dict)

@model_validator(mode="after")
Expand Down
10 changes: 3 additions & 7 deletions pyeed/core/clustalomegaresult.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
from typing import Dict, Optional
from uuid import uuid4

import sdRDM
from lxml.etree import _Element
from pydantic import PrivateAttr, model_validator
from pydantic_xml import attr, element
from sdRDM.base.listplus import ListPlus
from sdRDM.tools.utils import elem2dict

from .alignmentresult import AlignmentResult


class ClustalOmegaResult(
sdRDM.DataModel,
AlignmentResult,
search_mode="unordered",
):
""""""
Expand All @@ -29,11 +30,6 @@ class ClustalOmegaResult(
json_schema_extra=dict(),
)

_repo: Optional[str] = PrivateAttr(default="https://github.com/PyEED/pyeed")
_commit: Optional[str] = PrivateAttr(
default="6cb7b2b9f86383fe9659fc93e0802306fd288462"
)

_raw_xml_data: Dict = PrivateAttr(default_factory=dict)

@model_validator(mode="after")
Expand Down
16 changes: 4 additions & 12 deletions pyeed/core/dnarecord.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
from typing import Dict, Optional, Set
from typing import Dict, Optional
from uuid import uuid4

import sdRDM
from lxml.etree import _Element
from pydantic import PrivateAttr, model_validator
from pydantic_xml import attr, element
from sdRDM.base.listplus import ListPlus
from sdRDM.tools.utils import elem2dict

from .sequencerecord import SequenceRecord


class DNARecord(
sdRDM.DataModel,
SequenceRecord,
search_mode="unordered",
):
"""A nucleic acid sequence and associated metadata 🧬"""
Expand All @@ -29,15 +30,6 @@ class DNARecord(
json_schema_extra=dict(),
)

_repo: Optional[str] = PrivateAttr(default="https://github.com/PyEED/pyeed")
_commit: Optional[str] = PrivateAttr(
default="6cb7b2b9f86383fe9659fc93e0802306fd288462"
)

_object_terms: Set[str] = PrivateAttr(
default={"http://semanticscience.org/resource/SIO_010008"}
)

_raw_xml_data: Dict = PrivateAttr(default_factory=dict)

@model_validator(mode="after")
Expand Down
5 changes: 0 additions & 5 deletions pyeed/core/numberedsequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ class NumberedSequence(
),
)

_repo: Optional[str] = PrivateAttr(default="https://github.com/PyEED/pyeed")
_commit: Optional[str] = PrivateAttr(
default="6cb7b2b9f86383fe9659fc93e0802306fd288462"
)

_raw_xml_data: Dict = PrivateAttr(default_factory=dict)

@model_validator(mode="after")
Expand Down
5 changes: 0 additions & 5 deletions pyeed/core/organism.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,6 @@ class Organism(
),
)

_repo: Optional[str] = PrivateAttr(default="https://github.com/PyEED/pyeed")
_commit: Optional[str] = PrivateAttr(
default="6cb7b2b9f86383fe9659fc93e0802306fd288462"
)

_raw_xml_data: Dict = PrivateAttr(default_factory=dict)

@model_validator(mode="after")
Expand Down
10 changes: 3 additions & 7 deletions pyeed/core/pairwisealignmentresult.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
from typing import Dict, Optional
from uuid import uuid4

import sdRDM
from lxml.etree import _Element
from pydantic import PrivateAttr, model_validator
from pydantic_xml import attr, element
from sdRDM.base.listplus import ListPlus
from sdRDM.tools.utils import elem2dict

from .alignmentresult import AlignmentResult


class PairwiseAlignmentResult(
sdRDM.DataModel,
AlignmentResult,
search_mode="unordered",
):
""""""
Expand Down Expand Up @@ -57,11 +58,6 @@ class PairwiseAlignmentResult(
json_schema_extra=dict(),
)

_repo: Optional[str] = PrivateAttr(default="https://github.com/PyEED/pyeed")
_commit: Optional[str] = PrivateAttr(
default="6cb7b2b9f86383fe9659fc93e0802306fd288462"
)

_raw_xml_data: Dict = PrivateAttr(default_factory=dict)

@model_validator(mode="after")
Expand Down
24 changes: 12 additions & 12 deletions pyeed/core/proteinrecord.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import asyncio
import warnings
from concurrent.futures import ThreadPoolExecutor
from typing import Dict, List, Optional, Set
from typing import Dict, List, Optional
from uuid import uuid4

import nest_asyncio
import sdRDM
from Bio.Blast import NCBIXML
from IPython.display import clear_output
from lxml.etree import _Element
Expand All @@ -21,10 +20,11 @@

from .dnarecord import DNARecord
from .region import Region
from .sequencerecord import SequenceRecord


class ProteinRecord(
sdRDM.DataModel,
SequenceRecord,
search_mode="unordered",
):
"""A protein sequence and associated metadata."""
Expand Down Expand Up @@ -73,15 +73,6 @@ class ProteinRecord(
),
)

_repo: Optional[str] = PrivateAttr(default="https://github.com/PyEED/pyeed")
_commit: Optional[str] = PrivateAttr(
default="6cb7b2b9f86383fe9659fc93e0802306fd288462"
)

_object_terms: Set[str] = PrivateAttr(
default={"http://semanticscience.org/resource/SIO_010043"}
)

_raw_xml_data: Dict = PrivateAttr(default_factory=dict)

@model_validator(mode="after")
Expand All @@ -100,6 +91,9 @@ def add_to_coding_sequence(
self,
start: Optional[int] = None,
end: Optional[int] = None,
url: Optional[str] = None,
accession_id: Optional[str] = None,
name: Optional[str] = None,
id: Optional[str] = None,
**kwargs,
) -> Region:
Expand All @@ -110,11 +104,17 @@ def add_to_coding_sequence(
id (str): Unique identifier of the 'Region' object. Defaults to 'None'.
start (): Start position of the site.. Defaults to None
end (): End position of the site.. Defaults to None
url (): URI of the annotation.. Defaults to None
accession_id (): Accession ID of the annotation.. Defaults to None
name (): A name of a sequence feature, e.g. the name of a feature. Defaults to None
"""

params = {
"start": start,
"end": end,
"url": url,
"accession_id": accession_id,
"name": name,
}

if id is not None:
Expand Down
16 changes: 4 additions & 12 deletions pyeed/core/region.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
from typing import Dict, Optional, Set
from typing import Dict, Optional
from uuid import uuid4

import sdRDM
from lxml.etree import _Element
from pydantic import PrivateAttr, model_validator
from pydantic_xml import attr, element
from sdRDM.base.listplus import ListPlus
from sdRDM.tools.utils import elem2dict

from .abstractannotation import AbstractAnnotation


class Region(
sdRDM.DataModel,
AbstractAnnotation,
search_mode="unordered",
):
"""Regional annotation of a feature within a sequence. The direction of the region is defined by the start and end positions."""
Expand Down Expand Up @@ -40,15 +41,6 @@ class Region(
),
)

_repo: Optional[str] = PrivateAttr(default="https://github.com/PyEED/pyeed")
_commit: Optional[str] = PrivateAttr(
default="6cb7b2b9f86383fe9659fc93e0802306fd288462"
)

_object_terms: Set[str] = PrivateAttr(
default={"http://semanticscience.org/resource/SIO_000370"}
)

_raw_xml_data: Dict = PrivateAttr(default_factory=dict)

@model_validator(mode="after")
Expand Down
14 changes: 9 additions & 5 deletions pyeed/core/regionset.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ class RegionSet(
),
)

_repo: Optional[str] = PrivateAttr(default="https://github.com/PyEED/pyeed")
_commit: Optional[str] = PrivateAttr(
default="6cb7b2b9f86383fe9659fc93e0802306fd288462"
)

_object_terms: Set[str] = PrivateAttr(
default={"http://semanticscience.org/resource/SIO_000370"}
)
Expand All @@ -60,6 +55,9 @@ def add_to_regions(
self,
start: Optional[int] = None,
end: Optional[int] = None,
url: Optional[str] = None,
accession_id: Optional[str] = None,
name: Optional[str] = None,
id: Optional[str] = None,
**kwargs,
) -> Region:
Expand All @@ -70,11 +68,17 @@ def add_to_regions(
id (str): Unique identifier of the 'Region' object. Defaults to 'None'.
start (): Start position of the site.. Defaults to None
end (): End position of the site.. Defaults to None
url (): URI of the annotation.. Defaults to None
accession_id (): Accession ID of the annotation.. Defaults to None
name (): A name of a sequence feature, e.g. the name of a feature. Defaults to None
"""

params = {
"start": start,
"end": end,
"url": url,
"accession_id": accession_id,
"name": name,
}

if id is not None:
Expand Down
5 changes: 0 additions & 5 deletions pyeed/core/sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ class Sequence(
json_schema_extra=dict(),
)

_repo: Optional[str] = PrivateAttr(default="https://github.com/PyEED/pyeed")
_commit: Optional[str] = PrivateAttr(
default="6cb7b2b9f86383fe9659fc93e0802306fd288462"
)

_raw_xml_data: Dict = PrivateAttr(default_factory=dict)

@model_validator(mode="after")
Expand Down
23 changes: 18 additions & 5 deletions pyeed/core/sequencerecord.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,6 @@ class SequenceRecord(
),
)

_repo: Optional[str] = PrivateAttr(default="https://github.com/PyEED/pyeed")
_commit: Optional[str] = PrivateAttr(
default="6cb7b2b9f86383fe9659fc93e0802306fd288462"
)

_raw_xml_data: Dict = PrivateAttr(default_factory=dict)

@model_validator(mode="after")
Expand All @@ -123,6 +118,9 @@ def _parse_raw_xml_data(self):
def add_to_sites(
self,
positions: List[int] = ListPlus(),
url: Optional[str] = None,
accession_id: Optional[str] = None,
name: Optional[str] = None,
id: Optional[str] = None,
**kwargs,
) -> Site:
Expand All @@ -132,10 +130,16 @@ def add_to_sites(
Args:
id (str): Unique identifier of the 'Site' object. Defaults to 'None'.
positions (): Position of the site(s) within the sequence.. Defaults to ListPlus()
url (): URI of the annotation.. Defaults to None
accession_id (): Accession ID of the annotation.. Defaults to None
name (): A name of a sequence feature, e.g. the name of a feature. Defaults to None
"""

params = {
"positions": positions,
"url": url,
"accession_id": accession_id,
"name": name,
}

if id is not None:
Expand All @@ -151,6 +155,9 @@ def add_to_regions(
self,
start: Optional[int] = None,
end: Optional[int] = None,
url: Optional[str] = None,
accession_id: Optional[str] = None,
name: Optional[str] = None,
id: Optional[str] = None,
**kwargs,
) -> Region:
Expand All @@ -161,11 +168,17 @@ def add_to_regions(
id (str): Unique identifier of the 'Region' object. Defaults to 'None'.
start (): Start position of the site.. Defaults to None
end (): End position of the site.. Defaults to None
url (): URI of the annotation.. Defaults to None
accession_id (): Accession ID of the annotation.. Defaults to None
name (): A name of a sequence feature, e.g. the name of a feature. Defaults to None
"""

params = {
"start": start,
"end": end,
"url": url,
"accession_id": accession_id,
"name": name,
}

if id is not None:
Expand Down
Loading

0 comments on commit 3f48fd3

Please sign in to comment.