From 16014e1252e622214cde55cc0fcab9aca8f29201 Mon Sep 17 00:00:00 2001 From: Sagar Date: Mon, 16 Dec 2024 15:47:20 +0100 Subject: [PATCH 1/2] feat: new component to display entry details for the molecule in a particular compound --- app/Livewire/EntryDetailsDisplay.php | 28 + .../livewire/entry-details-display.blade.php | 102 ++ .../views/livewire/molecule-details.blade.php | 1601 +++++++++-------- 3 files changed, 932 insertions(+), 799 deletions(-) create mode 100644 app/Livewire/EntryDetailsDisplay.php create mode 100644 resources/views/livewire/entry-details-display.blade.php diff --git a/app/Livewire/EntryDetailsDisplay.php b/app/Livewire/EntryDetailsDisplay.php new file mode 100644 index 0000000..6e3b97a --- /dev/null +++ b/app/Livewire/EntryDetailsDisplay.php @@ -0,0 +1,28 @@ +entry_details = $this->mol->entries()->where('collection_id', $this->collection->id)->where('reference_id', $this->reference)->get(); + } + + public function render() + { + return view('livewire.entry-details-display', [ + 'entry_details' => $this->entry_details, + ]); + } +} diff --git a/resources/views/livewire/entry-details-display.blade.php b/resources/views/livewire/entry-details-display.blade.php new file mode 100644 index 0000000..639f73c --- /dev/null +++ b/resources/views/livewire/entry-details-display.blade.php @@ -0,0 +1,102 @@ +
+ + + + + + + +
+
+ + +
+ +
+
+ +
+

Entry Details

+ +
+ + +
+ @foreach ($entry_details as $entry) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + {{$entry->canonical_smiles ?? '-'}} +
Name{{$entry->name ?? '-'}}
DOI{{$entry->doi ?? '-'}}
Organism{{$entry->organism ?? '-'}}
Organism Part{{$entry->organism_part ?? '-'}}
Geo Location{{$entry->geo_location ?? '-'}}
Location{{$entry->location ?? '-'}}
Molecular Formula{{$entry->molecular_formula ?? '-'}}
Created at{{$entry->created_at ?? '-'}}
+ @endforeach +
+ + +
+ +
+
+
+
+
\ No newline at end of file diff --git a/resources/views/livewire/molecule-details.blade.php b/resources/views/livewire/molecule-details.blade.php index 90987ff..1d4bdcd 100644 --- a/resources/views/livewire/molecule-details.blade.php +++ b/resources/views/livewire/molecule-details.blade.php @@ -4,37 +4,37 @@
@if ($molecule->status == 'REVOKED') -
-
-
- -
-
-

STATUS: {{ $molecule->status }} -

-

This compound has been removed from the - COCONUT - database due to the lack - of conclusive evidence supporting its classification as a natural product.

-
-
    -
  • {{ $molecule->comment[0]['comment'] }}
    - Last update: {{ $molecule->comment[0]['timestamp'] }} - -
  • -
-
- Request - changes to this page +
+
+
+ +
+
+

STATUS: {{ $molecule->status }} +

+

This compound has been removed from the + COCONUT + database due to the lack + of conclusive evidence supporting its classification as a natural product.

+
+
    +
  • {{ $molecule->comment[0]['comment'] }}
    + Last update: {{ $molecule->comment[0]['timestamp'] }} + +
  • +
+ Request + changes to this page
+
@endif
@@ -55,51 +55,51 @@ class="mb-2 text-2xl break-all font-bold leading-7 break-words text-gray-900 sm:
@if ($molecule->properties) -
-
-
-
NPLikeness -
- - NP Likeness Score: The likelihood of the compound - to be a - natural - product, ranges from -5 (less likely) to 5 (very likely). -
-
-
-
-
- @foreach (range(0, ceil(npScore($molecule->properties->np_likeness))) as $i) -
- @endforeach -
- {{ $molecule->properties->np_likeness }} -
+
+
+
+
NPLikeness +
+ + NP Likeness Score: The likelihood of the compound + to be a + natural + product, ranges from -5 (less likely) to 5 (very likely).
+
+
+
+
+ @foreach (range(0, ceil(npScore($molecule->properties->np_likeness))) as $i) +
+ @endforeach +
+ {{ $molecule->properties->np_likeness }} +
-
-
-
Annotation Level
-
- @for ($i = 0; $i < $molecule->annotation_level; $i++) - - @endfor - @for ($i = $molecule->annotation_level; $i < 5; $i++) - ☆ - @endfor -
+
+
+
+
Annotation Level
+
+ @for ($i = 0; $i < $molecule->annotation_level; $i++) + + @endfor + @for ($i = $molecule->annotation_level; $i < 5; $i++) + ☆ + @endfor +
@if ($molecule->organisms && count($molecule->organisms) > 0) -
-
-
-

- Organisms ({{ count($molecule->organisms) }}) -

-
-
-
- -
- -
- - @if (count($molecule->organisms) > 10) -
- - -
+
+
+
+

+ Organisms ({{ count($molecule->organisms) }}) +

+
+
+
+ +
+ +
+ + @if (count($molecule->organisms) > 10) +
+ +
+ @endif
-
+
+
@endif @if ($molecule->geo_locations && count($molecule->geo_locations) > 0) -
-
-
-

- Geolocations

-
-
-
-
    - @foreach ($molecule->geo_locations as $geo_location) - @if ($geo_location != '') -
  • - - {{ $geo_location->name }} - -
  • - @endif - @endforeach -
-
+
+
+
+

+ Geolocations

+
+
+
+
    + @foreach ($molecule->geo_locations as $geo_location) + @if ($geo_location != '') +
  • + + {{ $geo_location->name }} + +
  • + @endif + @endforeach +
-
+
+
@endif
@@ -341,62 +341,62 @@ class="text-sm font-medium text-gray-500 sm:flex sm:justify-between">
@if ($molecule->properties) -
-
-
- Murcko - Framework -
-
-
- {{ $molecule->properties->murcko_framework ? $molecule->properties->murcko_framework : '-' }} - +
+
+
+ Murcko + Framework
+
+ {{ $molecule->properties->murcko_framework ? $molecule->properties->murcko_framework : '-' }} + +
+
@endif @if ($molecule->synonyms && count($molecule->synonyms) > 0) -
-
- Synonyms -
+
+
+ Synonyms +
-
-
-
    - @foreach ($molecule->synonyms as $index => $synonym) - @if ($synonym != '') -
  • - - {{ $synonym }} - -
  • - @endif - @endforeach -
- @if ($molecule->synonym_count > 10) -
- - -
+
+
+
    + @foreach ($molecule->synonyms as $index => $synonym) + @if ($synonym != '') +
  • + + {{ $synonym }} + +
  • @endif + @endforeach +
+ @if ($molecule->synonym_count > 10) +
+ +
+ @endif
+
@endif
@@ -407,111 +407,111 @@ class="text-base font-semibold leading-7 text-secondary-dark text-sm"> @if ($molecule->properties) -
-
+
+ @endif @if ($molecule->properties) -
-
+
+ @endif @@ -528,339 +528,342 @@ class="ml-3 text-base">Class: Citations @if (count($molecule->citations) > 0) -
-
- @foreach ($molecule->citations as $index => $citation) - @if ($citation->title != '') -
- -
- -

- - {{ $citation->title }} - -

-

- - {{ $citation->authors }} - -

-

- - DOI: {{ $citation->doi }} - - - - -

-

- - Lens.org - - - - - - - - -
- The Lens serves all the patents and scholarly work in the world as a free, open and secure digital public good, with user privacy a paramount focus. -
-
-

+
+
+ @foreach ($molecule->citations as $index => $citation) + @if ($citation->title != '') +
+ +
+ +

+ + {{ $citation->title }} + +

+

+ + {{ $citation->authors }} + +

+

+ + DOI: {{ $citation->doi }} + + + + +

+

+ + Lens.org + + + + + + + + +
+ The Lens serves all the patents and scholarly work in the world as a free, open and secure digital public good, with user privacy a paramount focus.
-

- @endif - @endforeach - -
- @if (count($molecule->citations) > 6) -
- - + +
+
@endif + @endforeach + +
+ @if (count($molecule->citations) > 6) +
+ +
+ @endif +
@else -

No citations

+

No citations

@endif

Collections

@if (count($molecule->collections) > 0) -
- @foreach ($molecule->collections as $index => $collection) -
-
-
-
+
+
+ + + {{ $collection->title }} + + + + +

+ {{ $collection->description }} +

+

+ {{ $collection->doi }} +

+

+ @foreach ($this->getReferenceUrls($collection->pivot) as $key => $item) + @foreach ($item as $reference => $url) + @if (!empty($url)) + + {{ $reference }} + - - - - - - - - - - - - - - - - - - - - - - - - - - + viewBox="0 0 24 24" + stroke-width="1.5" + stroke="currentColor" + class="size-4 inline"> + + - - {{ $collection->title }} - - - - -

- {{ $collection->description }} -

-

- {{ $collection->doi }} -

-

- @foreach ($this->getReferenceUrls($collection->pivot) as $key => $item) - @foreach ($item as $reference => $url) - @if (!empty($url)) - - {{ $reference }} - - - - - - - - - @else - {{ $reference }} - - - - @endif - @endforeach - @endforeach + + + + + @else + {{ $reference }} + + + + @endif + + + + @endforeach + @endforeach -

-
-
-
- @endforeach - @if (count($molecule->collections) > 6) -
- - +
- @endif +
+
+ @endforeach + @if (count($molecule->collections) > 6) +
+ +
+ @endif +
@else -

No collections

+

No collections

@endif
@@ -870,222 +873,222 @@ class="text-base font-semibold leading-7 text-secondary-dark text-sm"> @if ($molecule->related && count($molecule->related) > 0) -
-
-
-
-

- Tautomers

-
-
-
- @foreach ($molecule->related as $tautomer) - - @endforeach -
+
+
+
+
+

+ Tautomers

+
+
+
+ @foreach ($molecule->related as $tautomer) + + @endforeach
-
+
+
@endif @if ($molecule->is_parent && $molecule->has_variants) -
-
-
-
-

- Stereochemical - Variants -

-
-
-
- @foreach ($molecule->variants as $variant) - - @endforeach -
+
+
+
+
+

+ Stereochemical + Variants +

+
+
+
+ @foreach ($molecule->variants as $variant) + + @endforeach
-
+
+
@endif @if ($molecule->parent_id != null) -
-
-
-
-

Parent - (Without - stereo definitions) -

-
-
-
-
- -
+
+
+
+
+

Parent + (Without + stereo definitions) +

+
+
+
+
+
-
+
+
@endif @if ($molecule->properties) -
-
-
-
-

- Molecular - Properties -

-
-
-
-
    -
  • Mol. Formula : - {{ $molecule->properties->molecular_formula }} -
  • -
  • - Mol. Weight - - - - -
    - Exact Isotopic Mass is calculated using RDKit - - https://www.rdkit.org/docs/source/rdkit.Chem.Descriptors.html -
    -
    {{ $molecule->properties->exact_molecular_weight }}
    -
  • -
  • Total - atom number : - {{ $molecule->properties->total_atom_count }} -
  • -
  • Heavy - atom number : - {{ $molecule->properties->heavy_atom_count }} -
  • -
  • Aromatic Ring - Count : - {{ $molecule->properties->aromatic_rings_count }} -
  • -
  • Rotatable Bond - count : - {{ $molecule->properties->rotatable_bond_count }} -
  • -
  • Minimal number of - rings - : - {{ $molecule->properties->number_of_minimal_rings }} -
  • -
  • Formal Charge : - {{ $molecule->properties->total_atom_count }} -
  • -
  • Contains Sugar : - {{ $molecule->properties->contains_sugar ? 'True' : 'False' }} -
  • -
  • Contains Ring - Sugars : - {{ $molecule->properties->contains_ring_sugars ? 'True' : 'False' }} -
  • -
  • Contains Linear - Sugars - : - {{ $molecule->properties->contains_linear_sugars ? 'True' : 'False' }} -
  • -
-
-
+
+
+
+
+

+ Molecular + Properties +

-
-
- -
-
-
-
-

- Molecular - Descriptors -

-
-
-
    +
    +
    +
      +
    • Mol. Formula : + {{ $molecule->properties->molecular_formula }} +
    • NP-likeness scores : - {{ $molecule->properties->np_likeness }}
    • + class="ml-3 text-base text-gray-500"> + Mol. Weight + + + + +
      + Exact Isotopic Mass is calculated using RDKit - + https://www.rdkit.org/docs/source/rdkit.Chem.Descriptors.html +
      +
      {{ $molecule->properties->exact_molecular_weight }} +
    • Alogp - : - {{ $molecule->properties->alogp }}
    • + class="ml-3 text-base text-gray-500">Total + atom number : + {{ $molecule->properties->total_atom_count }} +
    • TopoPSA : - {{ $molecule->properties->topological_polar_surface_area }} + class="ml-3 text-base text-gray-500">Heavy + atom number : + {{ $molecule->properties->heavy_atom_count }}
    • Fsp3 - : - {{ $molecule->properties->fractioncsp3 }}
    • + class="ml-3 text-base text-gray-500">Aromatic Ring + Count : + {{ $molecule->properties->aromatic_rings_count }} +
    • Hydrogen - Bond Acceptor Count + class="ml-3 text-base text-gray-500">Rotatable Bond + count : + {{ $molecule->properties->rotatable_bond_count }} +
    • +
    • Minimal number of + rings : - {{ $molecule->properties->hydrogen_bond_acceptors }} + {{ $molecule->properties->number_of_minimal_rings }}
    • Hydrogen - Bond Donor Count : - {{ $molecule->properties->hydrogen_bond_donors }} + class="ml-3 text-base text-gray-500">Formal Charge : + {{ $molecule->properties->total_atom_count }}
    • Lipinski - Hydrogen Bond - Acceptor Count : - {{ $molecule->properties->hydrogen_bond_acceptors_lipinski }} + class="ml-3 text-base text-gray-500">Contains Sugar : + {{ $molecule->properties->contains_sugar ? 'True' : 'False' }}
    • Lipinski - Hydrogen Bond Donor - Count : - {{ $molecule->properties->hydrogen_bond_donors_lipinski }} + class="ml-3 text-base text-gray-500">Contains Ring + Sugars : + {{ $molecule->properties->contains_ring_sugars ? 'True' : 'False' }}
    • Lipinski - RO5 Violations : - {{ $molecule->properties->lipinski_rule_of_five_violations }} + class="ml-3 text-base text-gray-500">Contains Linear + Sugars + : + {{ $molecule->properties->contains_linear_sugars ? 'True' : 'False' }}
-
+
+
+ +
+
+
+
+

+ Molecular + Descriptors +

+
+
+
    +
  • NP-likeness scores : + {{ $molecule->properties->np_likeness }}
  • +
  • Alogp + : + {{ $molecule->properties->alogp }}
  • +
  • TopoPSA : + {{ $molecule->properties->topological_polar_surface_area }} +
  • +
  • Fsp3 + : + {{ $molecule->properties->fractioncsp3 }}
  • +
  • Hydrogen + Bond Acceptor Count + : + {{ $molecule->properties->hydrogen_bond_acceptors }} +
  • +
  • Hydrogen + Bond Donor Count : + {{ $molecule->properties->hydrogen_bond_donors }} +
  • +
  • Lipinski + Hydrogen Bond + Acceptor Count : + {{ $molecule->properties->hydrogen_bond_acceptors_lipinski }} +
  • +
  • Lipinski + Hydrogen Bond Donor + Count : + {{ $molecule->properties->hydrogen_bond_donors_lipinski }} +
  • +
  • Lipinski + RO5 Violations : + {{ $molecule->properties->lipinski_rule_of_five_violations }} +
  • +
+
+
+
+
@endif
@@ -1120,4 +1123,4 @@ class="text-base font-semibold text-text-dark hover:text-slate-600"
-
+
\ No newline at end of file From e0b88335fc3f7b674f5d63abc272b1da2fe92915 Mon Sep 17 00:00:00 2001 From: Sagar Date: Mon, 16 Dec 2024 16:29:21 +0100 Subject: [PATCH 2/2] fix: enabled button groups, moved modal view functionality to reference id, z index issue fixes, and icons text colour fix --- .../livewire/entry-details-display.blade.php | 14 ++-- .../views/livewire/molecule-details.blade.php | 66 +++++++++---------- 2 files changed, 39 insertions(+), 41 deletions(-) diff --git a/resources/views/livewire/entry-details-display.blade.php b/resources/views/livewire/entry-details-display.blade.php index 639f73c..42f5c68 100644 --- a/resources/views/livewire/entry-details-display.blade.php +++ b/resources/views/livewire/entry-details-display.blade.php @@ -1,9 +1,11 @@
- - - - - + +
-
+

Entry Details

diff --git a/resources/views/livewire/molecule-details.blade.php b/resources/views/livewire/molecule-details.blade.php index 1d4bdcd..faaa863 100644 --- a/resources/views/livewire/molecule-details.blade.php +++ b/resources/views/livewire/molecule-details.blade.php @@ -708,9 +708,9 @@ class="mb-2 mt-4 text-lg font-medium text-gray-900">
+ class="group rounded-xl border border-slate-200">
+ class="overflow-hidden rounded-xl p-6">

@foreach ($this->getReferenceUrls($collection->pivot) as $key => $item) @foreach ($item as $reference => $url) - @if (!empty($url)) - - {{ $reference }} - - - - - - - - - @else - {{ $reference }} - - - - @endif - + + + @if (!empty($url)) + + + + + + + @endif + @if (!empty($reference)) +
+ + + +
+ @endif
@endforeach @endforeach - -

+