Skip to content

Commit

Permalink
feat: removed uniqueness of proteins and ligands
Browse files Browse the repository at this point in the history
  • Loading branch information
JaktensTid committed Jul 20, 2024
1 parent 4c2efef commit 20557b4
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions nolabs/domain/models/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,19 +337,6 @@ def create(cls, experiment: Experiment,
if not fasta_content and not pdb_content:
raise NoLabsException(ErrorCodes.protein_initialization_error)

proteins = cls.objects(name=name.value, experiment=experiment)
if proteins:
protein: Protein = proteins[0]

if fasta_content and not protein.fasta_content:
protein.set_fasta(fasta_content)

if pdb_content and not protein.pdb_content:
protein.set_pdb(pdb_content)

protein.set_name(name)
return protein

protein = Protein(
id=ProteinId(uuid.uuid4()).value,
experiment=experiment,
Expand Down Expand Up @@ -562,20 +549,6 @@ def create(cls, experiment: Experiment,
if sdf_content and isinstance(sdf_content, str):
sdf_content = sdf_content.encode()

ligands = cls.objects(name=name.value, experiment=experiment)
if ligands:
ligand: Ligand = ligands[0]

if smiles_content:
ligand.set_smiles(smiles_content)

if sdf_content:
ligand.set_sdf(sdf_content)

ligand.set_name(name)
ligand.link = link
return ligand

if 'id' not in kwargs:
id = LigandId(uuid.uuid4()).value
else:
Expand Down

0 comments on commit 20557b4

Please sign in to comment.