|
| 1 | +# TypeScript Sequence Viewer |
| 2 | + |
| 3 | +Represent biological data with the sequence viewer library! Used in [MobiDB](http://mobidb.bio.unipd.it/), |
| 4 | +[DisProt](http://www.disprot.org/) and [RepeatsDB](http://repeatsdb.bio.unipd.it/). |
| 5 | + |
| 6 | +This is a code repository for the BioComputingUP Sequence Viewer project. |
| 7 | +Full documentation is available at: [sequence-viewer-typescript](https://biocomputingup.github.io/sequence-viewer-documentation/). |
| 8 | + |
| 9 | +This version is based on [Typescript](https://www.typescriptlang.org/) and compatible with [Angular 2+](https://angular.io/) framework. |
| 10 | +A Javascript version of the package is also available (see the documentation at [sequence-viewer-typescript](https://biocomputingup.github.io/sequence-viewer-documentation/) for more info). |
| 11 | + |
| 12 | +[comment]: <> (demo image) |
| 13 | +[comment]: <> () |
| 14 | + |
| 15 | +## Getting started |
| 16 | + |
| 17 | +### Javascript installation |
| 18 | +1. Download the sequence viewer stylesheet |
| 19 | +You can find the <i>sqv.css</i> file in the src/assets folder on this Github repo. |
| 20 | + |
| 21 | +2. Download the library code |
| 22 | + You can find the <i>sqv-bundle.js</i> file in the dist folder on this Github repo. |
| 23 | + |
| 24 | +3. In your index.html: |
| 25 | +``` html |
| 26 | +<head> |
| 27 | + <link rel="stylesheet" type="text/css" href="sqv.css"> |
| 28 | +</head> |
| 29 | +<body> |
| 30 | + |
| 31 | + |
| 32 | +<div id="sqv"></div> |
| 33 | + |
| 34 | +<script src="sqv-bundle.js"></script> |
| 35 | +<script> |
| 36 | +
|
| 37 | + const seqs = [ |
| 38 | + {sequence: 'MVLSPADKVGAH--RMFLSFPTTKTYF--LS', id: 1, label: 'sp|P69905|HBA_HUMAN'} |
| 39 | + ]; |
| 40 | + // Create an instance of the sequence viewer in javascript |
| 41 | + const sequenceviewer = new SequenceViewer('sqv'); |
| 42 | + sequenceviewer.draw(sequence); |
| 43 | + |
| 44 | +</script> |
| 45 | + |
| 46 | +</body> |
| 47 | +``` |
| 48 | +### Angular installation |
| 49 | + |
| 50 | +1 Install the library using npm |
| 51 | +``` |
| 52 | +npm install sequence-viewer-typescript |
| 53 | +``` |
| 54 | + |
| 55 | +2 Import the sequence viewer in javascript or your angular component |
| 56 | +```typescript |
| 57 | +import {SequenceViewer} from 'sequence-viewer-typescript/dist'; |
| 58 | +``` |
| 59 | + |
| 60 | +3 Load the feature viewer stylesheet in your angular.json "styles". |
| 61 | +```json |
| 62 | +styles: [ |
| 63 | + "./node_modules/sequence-viewer-typescript/dist/assets/sqv.css" |
| 64 | +] |
| 65 | +``` |
| 66 | + |
| 67 | +4 Place the sequence viewer in your html |
| 68 | +```html |
| 69 | + <div id="sqv"></div> |
| 70 | +``` |
| 71 | + |
| 72 | +5 Create an instance of the sequence viewer in your component, add inputs and execute |
| 73 | +```typescript |
| 74 | + const seqs = [ |
| 75 | + {sequence: 'MVLSPADKTNVGAH--RMFLSFPTTKTYF--LSHGG', id: 1, label: 'sp|P69905|HBA_HUMAN'} |
| 76 | + ]; |
| 77 | + const sequenceviewer = new SequenceViewer('sqv'); |
| 78 | + sequenceviewer.draw(sequence); |
| 79 | +``` |
| 80 | + |
| 81 | + |
| 82 | +## Compiler |
| 83 | + |
| 84 | +This package ECMAScript target version is: es2015. |
| 85 | + |
| 86 | +## Dependencies |
| 87 | + |
| 88 | +* [Typescript](https://www.typescriptlang.org/) |
| 89 | + |
| 90 | + |
| 91 | +## Development |
| 92 | + |
| 93 | +`git clone https://github.com/BioComputingUP/sequence-viewer-typescript.git` |
| 94 | + |
| 95 | +`npm install` (will install the development dependencies) |
| 96 | + |
| 97 | +...make your changes and modifications... |
| 98 | + |
| 99 | +`npm run build` (will create the bundle js files) |
| 100 | + |
| 101 | +`npm run postbuild` (will move assets files in dist/) |
| 102 | + |
| 103 | +`npm run wp` (will create the sqv-bundle.js file in dist/) |
| 104 | + |
| 105 | +`npm run post wp` (will edit the bundle file to make it work) |
| 106 | + |
| 107 | +This commands can be found in package.json |
| 108 | + |
| 109 | +## Support |
| 110 | + |
| 111 | +If you have any problem or suggestion please open an issue. |
| 112 | + |
| 113 | +## License |
| 114 | + |
| 115 | +This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public |
| 116 | +License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later |
| 117 | +version. |
0 commit comments