Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/NFDI4Chem/nmrxiv into prod-…
Browse files Browse the repository at this point in the history
…helm-deploy
  • Loading branch information
NishaSharma14 committed Nov 16, 2023
2 parents 4d514b1 + d4b3ae0 commit f57e3aa
Show file tree
Hide file tree
Showing 35 changed files with 2,331 additions and 190 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## [1.0.1-rc.10](https://github.com/NFDI4Chem/nmrxiv/compare/v1.0.0-rc.10...v1.0.1-rc.10) (2023-11-16)


### Bug Fixes

* added molecular search ([8dfcc4a](https://github.com/NFDI4Chem/nmrxiv/commit/8dfcc4a0a2b218ee68e7d39d8916ac44e93af508))
* enable listing of files with missing flag at root and title udpates ([05adf74](https://github.com/NFDI4Chem/nmrxiv/commit/05adf74dbf0161c38475821f7c5528597d717a4a))
* molecules filtering and other bug fixes ([bb3d701](https://github.com/NFDI4Chem/nmrxiv/commit/bb3d7012123df556c63188443b9741e7a8ea2ab9))
* updated molecular card link and studies filtering ([cf6763e](https://github.com/NFDI4Chem/nmrxiv/commit/cf6763e6f595285682cc870f5dd5c44bf6d0a3ef))

## [1.0.1-rc.9](https://github.com/NFDI4Chem/nmrxiv/compare/v1.0.0-rc.9...v1.0.1-rc.9) (2023-11-15)


Expand Down
10 changes: 5 additions & 5 deletions app/Console/Commands/SanitizeMolecules.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ class SanitizeMolecules extends Command
*/
public function handle()
{
$molecules = Molecule::whereNull('CANONICAL_SMILES')->get();
$molecules = Molecule::whereNull('canonical_smiles')->get();

foreach ($molecules as $molecule) {
echo $molecule->id;
echo "\r\n";
$molecule->MOL = '
'.$molecule->MOL;
$standardisedMOL = $this->standardizeMolecule($molecule->MOL);
$molecule->CANONICAL_SMILES = $standardisedMOL['canonical_smiles'];
$molecule->STANDARD_INCHI = $standardisedMOL['inchi'];
$molecule->INCHI_KEY = $standardisedMOL['inchikey'];
$standardisedMOL = $this->standardizeMolecule($molecule->sdf);
$molecule->canonical_smiles = $standardisedMOL['canonical_smiles'];
$molecule->standard_inchi = $standardisedMOL['inchi'];
$molecule->inchi_key = $standardisedMOL['inchikey'];
$molecule->save();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ public function getMolecules($sample)
{
$molecules = [];
foreach ($sample->molecules as &$molecule) {
$inchiKey = $molecule->INCHI_KEY;
$inchiKey = $molecule->inchi_key;
$pubchemLink = 'https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/inchikey/'.$inchiKey.'/property/IUPACName/JSON';
$json = json_decode(Http::get($pubchemLink)->body(), true);
// $cid = $json['PropertyTable']['Properties'][0]['CID'];
Expand All @@ -240,14 +240,14 @@ public function getMolecules($sample)
// $moleculeSchema['@id'] = $inchiKey;
// $moleculeSchema['dct:conformsTo'] = $this->conformsTo(['https://bioschemas.org/profiles/MolecularEntity/0.5-RELEASE']);
// $moleculeSchema['identifier'] = $inchiKey;
// $moleculeSchema->name($molecule->CAS_NUMBER);
// $moleculeSchema->name($molecule->cas);
// $moleculeSchema->url('https://pubchem.ncbi.nlm.nih.gov/compound/'.$cid);
// $moleculeSchema->inChI('InChI='.$molecule->STANDARD_INCHI);
// $moleculeSchema->inChI('InChI='.$molecule->standard_inchi);
// $moleculeSchema->inChIKey($inchiKey);
// $moleculeSchema->iupacName($iupacName);
// $moleculeSchema->molecularFormula($molecule->FORMULA);
// $moleculeSchema->molecularWeight($molecule->MOLECULAR_WEIGHT);
// $moleculeSchema->smiles([$molecule->SMILES, $molecule->SMILES_CHIRAL, $molecule->CANONICAL_SMILES]);
// $moleculeSchema->molecularFormula($molecule->molecular_formula);
// $moleculeSchema->molecularWeight($molecule->molecular_weight);
// $moleculeSchema->smiles([$molecule->SMILES, $molecule->absolute_smiles, $molecule->canonical_smiles]);
// $moleculeSchema->hasRepresentation($molecule->MOL);
// $moleculeSchema->description('Percentage composition: '.$molecule->pivot->percentage_composition.'%');
// array_push($molecules, $moleculeSchema);
Expand Down
Loading

0 comments on commit f57e3aa

Please sign in to comment.