Skip to content

Commit

Permalink
Merge branch 'master' into #1640-add-cdx-support
Browse files Browse the repository at this point in the history
  • Loading branch information
ZaimBeshich1 committed Jun 14, 2022
2 parents 07a454a + 6ebb073 commit 1176988
Show file tree
Hide file tree
Showing 33 changed files with 438 additions and 112 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ assignees: AndreiMazol
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error


**Expected behavior**
A clear and concise description of what you expected to happen.
Expand Down
42 changes: 9 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ Ketcher is an open-source web-based chemical structure editor incorporating high
- 🛠️ Settings support (Rendering, Displaying, Debugging)
- :camera: Use of SVG to achieve best quality in-browser chemical structure rendering


### Editor builtin tools:

- Atom Tool, Bond Tool, and Template Tool to draw and edit structures
Expand All @@ -27,34 +26,17 @@ Ketcher is an open-source web-based chemical structure editor incorporating high
- MW and Structure Parameters Calculate Tool
- Select, modify, and erase connected and unconnected atoms and bonds using Selection Tool, or using Shift key
- Advanced Structure Clean up Tool (+ stereochemistry checking and structure layout)
- Simple Structure Clean up Tool (checks bonds length, angles and spatial arrangement of atoms)
- Simple Structure Clean up Tool (checks bonds length, angles and spatial arrangement of atoms)
- Easy to use R-Group and S-Group tools (Generic, Multiple group, SRU polymer, peratom, Data S-Group)
- Reaction Tool (reaction generating, manual and automatic atom-to-atom mapping)
- Flip/Rotate Tool


## Installation and usage

At this moment Ketcher library is delivered as a [react component library](https://www.npmjs.com/package/ketcher-react) and [zip archive](https://lifescience.opensource.epam.com/download/ketcher.html)

```
npm install ketcher-standalone
```

```tsx
import { StandaloneStructServiceProvider } from 'ketcher-standalone'

const structServiceProvider = new StandaloneStructServiceProvider()

const MyComponent = () => {
return (
<Editor
staticResourcesUrl={process.env.PUBLIC_URL}
structServiceProvider={structServiceProvider}
/>
)
```
At this moment Ketcher can be embedded into your application in two ways:

- as a [react component library](https://www.npmjs.com/package/ketcher-react)
- as ready-to-run application (to find desired version please look at Assets block of [releases](https://github.com/epam/ketcher/releases)). The application can be injected as IFrame or a separate page.

## FAQ

Expand All @@ -67,16 +49,13 @@ Look at the following [link](packages/ketcher-react/README.md) for details.
You can find the instruction for service installation
[here](http://lifescience.opensource.epam.com/indigo/service/index.html).

## Packages

| Project | Status | Description |
|---------|--------|-------------|
| [ketcher-core](https://github.com/epam/ketcher/tree/master/packages/ketcher-core) | [![npm version](https://badge.fury.io/js/ketcher-core.svg)](https://www.npmjs.com/package/ketcher-core) | Core functionality: domain, shared services, functions and interface declarations |
| [ketcher-standalone](https://github.com/epam/ketcher/tree/master/packages/ketcher-standalone) | [![npm version](https://badge.fury.io/js/ketcher-standalone.svg)](https://www.npmjs.com/package/ketcher-standalone) | Contains only the functionality necessary to start Ketcher in standalone mode |
| [ketcher-react](https://github.com/epam/ketcher/tree/master/packages/ketcher-react) | [![npm version](https://badge.fury.io/js/ketcher-react.svg)](https://www.npmjs.com/package/ketcher-react) | Package contains only the functionality necessary to define components. |
| Project | Status | Description |
| --------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| [ketcher-core](https://github.com/epam/ketcher/tree/master/packages/ketcher-core) | [![npm version](https://badge.fury.io/js/ketcher-core.svg)](https://www.npmjs.com/package/ketcher-core) | Core functionality: domain, shared services, functions and interface declarations |
| [ketcher-standalone](https://github.com/epam/ketcher/tree/master/packages/ketcher-standalone) | [![npm version](https://badge.fury.io/js/ketcher-standalone.svg)](https://www.npmjs.com/package/ketcher-standalone) | Contains only the functionality necessary to start Ketcher in standalone mode |
| [ketcher-react](https://github.com/epam/ketcher/tree/master/packages/ketcher-react) | [![npm version](https://badge.fury.io/js/ketcher-react.svg)](https://www.npmjs.com/package/ketcher-react) | Package contains only the functionality necessary to define components. |

## 3D Viewer

Expand All @@ -85,17 +64,14 @@ Ketcher uses Miew-React for viewing and editing data in 3D.
You can find the latest version of Miew-React [here](https://github.com/epam/miew/tree/master/packages/miew-react).
The last checked version - [1.0.0](https://www.npmjs.com/package/miew-react).

## Contribution

See [Contributing Guide](./DEVNOTES.md).

## License

[Apache 2.0](LICENSE)

Please read [LICENSE](LICENSE) and [NOTICE](NOTICE) for details.

Copyright (c) 2021 [EPAM Systems, Inc.](https://www.epam.com/)
38 changes: 38 additions & 0 deletions documentation/wiki/pages/RNA_Hydrogen_bonds_creation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# [Create RNA Structure] As Ketcher User I want to create hydrogen bonds linking RNA monomers on the canvas

| As | I want | so that |
| ----------------------------- | ------------------------------------------ | ------------------------------------------------------------ |
| A Ketcher peptide editor user | to add hydrogen bonds between RNA monomers | I can reflect hydrogen bonds existing in real life between RNA polymer chains |



#### 1. Context

Glossary: [Peptide Glossary](https://github.com/epam/ketcher/wiki/Polymer-Glossary)

HB is a specific chemical type of bond which can be created between polar functional groups between monomers. Hydrogen bonds do not use of monomer's R attachment points. Hydrogen bonds can be created between RNA nucleobase type monomers. Only between complimentary ones

#### 3. Assumptions

| ID | Assumption |
| ---- | ------------------------------------------------------------ |
| 1 | Ketcher Polymer Editor users are interested only in creating hydrogen bonds between complimentary natural type RNA nucleobase type monomers |
| 2 | Single monomer can have only 1 hydrogen bond created |
| 3 | The same bond creation tool is used for hydrogen bond creation |
| 4 | Complimentary rule is applicable only for natural type RNA nucleobase type monomers |
| 5 | We do not allow users to create hydrogen bonds with unnatural RNA monomers, however users can create a hydrogen bond between natural analogs and |



#### 8. Acceptance criteria



| # | User Group | GIVEN | WHEN | THEN |
| ---- | --------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| 1 | Ketcher Polymer editor User | There are at least 2 complimentary RNA nucleobase type monomers on the canvas without Hydrogen bonds connected to them<br /> AND<br />They all their R attachment points are occupied | dragging from the one RNA nucleobase type monomer to another complimentary one | Ketcher visualize the line representing chemical bond from the first monomer to the cursor while dragging<br />AND<br />when dropping Ketcher visualize the Hydrogen bond type line between involved monomers<br />AND<br />Ketches aligns the monomers on the canvas in accordance with Business rules<br />AND<br />Ketcher creates a Hydrogen bond<br /><br />Count of polymers is not changed<br />Polymer ID's in not changed |
| 2 | | There are at least 2 non-complimentary RNA nucleobase type monomers on the canvas without Hydrogen bonds connected to them<br />AND<br />They all their R attachment points are occupied | dragging from the one RNA nucleobase type monomer to another non-complimentary one | Ketcher visualize the line representing chemical bond from the first monomer to the cursor while dragging<br />AND<br />when dropping Ketcher stop the line visualization<br />AND<br />Ketches shows notification message that hydrogen bond can be crated only between complimentary natural type monomers<br /> |
| 3 | | There are at least 2 RNA nucleobase type monomers on the canvas <br />AND<br />They all their R attachment points are occupied<br />AND<br />at least one of them have a hydrogen bond connected | dragging from the one RNA nucleobase type monomer to another one | Ketcher visualize the line representing chemical bond from the first monomer to the cursor while dragging<br />AND<br />when dropping Ketcher stop the line visualization<br />AND<br />Ketches shows notification message that only one hydrogen bond can be connected to the monomer<br /> |



12 changes: 6 additions & 6 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
"version": "1.0.0",
"private": true,
"scripts": {
"start:standalone": "cross-env MODE=standalone react-app-rewired start",
"start:remote": "cross-env MODE=remote react-app-rewired start",
"start:standalone": "cross-env MODE=standalone ENABLE_POLYMER_EDITOR=true react-app-rewired start",
"start:remote": "cross-env MODE=remote ENABLE_POLYMER_EDITOR=true react-app-rewired start",
"clean:build": "shx rm -rf build",
"delete:dist": "shx rm -rf dist/$MODE",
"init:dist": "shx mkdir -p dist/$MODE",
"copy:build": "shx cp -r build/. dist/$MODE",
"prebuild": "run-s delete:dist init:dist",
"postbuild": "run-s copy:build clean:build",
"build:remote": "cross-env MODE=remote run-s prebuild build:react postbuild",
"build:standalone": "cross-env MODE=standalone run-s prebuild build:react postbuild",
"build:remote": "cross-env MODE=remote ENABLE_POLYMER_EDITOR=true run-s prebuild build:react postbuild",
"build:standalone": "cross-env MODE=standalone ENABLE_POLYMER_EDITOR=true run-s prebuild build:react postbuild",
"build:react": "react-app-rewired build",
"build:react:analyze": "react-app-rewired build --analyze",
"build": "run-s build:standalone build:remote",
"build:standalone:analyze": "cross-env MODE=standalone run-s prebuild build:react:analyze postbuild",
"build:remote:analyze": "cross-env MODE=remote run-s prebuild build:react:analyze postbuild",
"build:standalone:analyze": "cross-env MODE=standalone ENABLE_POLYMER_EDITOR=true run-s prebuild build:react:analyze postbuild",
"build:remote:analyze": "cross-env MODE=remote ENABLE_POLYMER_EDITOR=true run-s prebuild build:react:analyze postbuild",
"test": "run-s test:prettier test:stylelint test:eslint test:unit",
"test:eslint": "eslint . --ext .ts,.js,.jsx,.tsx",
"test:unit": "react-app-rewired test --passWithNoTests",
Expand Down
2 changes: 1 addition & 1 deletion packages/ketcher-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ketcher-core",
"version": "1.3.0",
"version": "1.4.0",
"description": "Web-based molecule sketcher",
"license": "Apache-2.0",
"homepage": "http://lifescience.opensource.epam.com/ketcher",
Expand Down
4 changes: 4 additions & 0 deletions packages/ketcher-core/src/application/ketcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ export class Ketcher {
throw Error('not implemented yet')
}

recognize(image: Blob, version?: string): Promise<Struct> {
return this.#indigo.recognize(image, { version: version })
}

async generateImage(
data: string,
options: GenerateImageOptions = { outputFormat: 'png' }
Expand Down
1 change: 1 addition & 0 deletions packages/ketcher-polymer-editor-react/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"private": true,
"name": "ketcher-polymer-editor-react",
"version": "1.0.0",
"description": "Web-based molecule sketcher",
Expand Down
2 changes: 1 addition & 1 deletion packages/ketcher-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ketcher-react",
"version": "2.4.2",
"version": "2.5.0",
"description": "Web-based molecule sketcher",
"license": "Apache-2.0",
"homepage": "http://lifescience.opensource.epam.com/ketcher",
Expand Down
4 changes: 4 additions & 0 deletions packages/ketcher-react/src/icons/files/compressed-hand.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/ketcher-react/src/icons/files/hand.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions packages/ketcher-react/src/icons/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ import EraseIcon from './files/erase.svg'
import ExtendedTableIcon from './files/extended-table.svg'
import FileThumbnailIcon from './files/file-thumbnail.svg'
import GenericGroupsIcon from './files/generic-groups.svg'
import HandIcon from './files/hand.svg'
import CompressedHandIcon from './files/compressed-hand.svg'
import HelpIcon from './files/help.svg'
import HistoryIcon from './files/history.svg'
import ImageFrameIcon from './files/image-frame.svg'
Expand Down Expand Up @@ -292,6 +294,8 @@ const icons = {
'fullscreen-enter': FullscreenEnterIcon,
'fullscreen-exit': FullscreenExitIcon,
'generic-groups': GenericGroupsIcon,
hand: HandIcon,
compressedhand: CompressedHandIcon,
help: HelpIcon,
history: HistoryIcon,
'image-frame': ImageFrameIcon,
Expand Down
7 changes: 5 additions & 2 deletions packages/ketcher-react/src/script/editor/Editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ class Editor implements KetcherEditor {
dearomatizeStruct: PipelineSubscription
enhancedStereoEdit: PipelineSubscription
confirm: PipelineSubscription
cursor: Subscription
}

lastEvent: any
Expand Down Expand Up @@ -162,7 +163,8 @@ class Editor implements KetcherEditor {
dearomatizeStruct: new PipelineSubscription(),
// TODO: correct
enhancedStereoEdit: new PipelineSubscription(),
confirm: new PipelineSubscription()
confirm: new PipelineSubscription(),
cursor: new PipelineSubscription()
}

domEventSetup(this, clientArea)
Expand Down Expand Up @@ -518,7 +520,8 @@ function domEventSetup(editor: Editor, clientArea) {
'mousedown',
'mousemove',
'mouseup',
'mouseleave'
'mouseleave',
'mouseover'
].forEach((eventName) => {
editor.event[eventName] = new DOMSubscription()
const subs = editor.event[eventName]
Expand Down
Loading

0 comments on commit 1176988

Please sign in to comment.