{"id":21662791,"url":"https://github.com/higlass/higlass-sequence","last_synced_at":"2025-04-11T23:42:08.914Z","repository":{"id":39137463,"uuid":"262097378","full_name":"higlass/higlass-sequence","owner":"higlass","description":"Nucleotide sequence track for HiGlass","archived":false,"fork":false,"pushed_at":"2025-01-10T18:38:53.000Z","size":795,"stargazers_count":6,"open_issues_count":4,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T19:38:05.830Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/higlass.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-07T16:07:03.000Z","updated_at":"2025-01-10T18:38:49.000Z","dependencies_parsed_at":"2023-02-12T05:30:52.961Z","dependency_job_id":null,"html_url":"https://github.com/higlass/higlass-sequence","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/higlass%2Fhiglass-sequence","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/higlass%2Fhiglass-sequence/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/higlass%2Fhiglass-sequence/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/higlass%2Fhiglass-sequence/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/higlass","download_url":"https://codeload.github.com/higlass/higlass-sequence/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248497902,"owners_count":21113982,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-25T10:18:06.215Z","updated_at":"2025-04-11T23:42:08.892Z","avatar_url":"https://github.com/higlass.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nucleotide sequence tracks for HiGlass\n\nDisplay nucleotide sequences in HiGlass!\n\n![Sequence track](https://aveit.s3.amazonaws.com/higlass/static/higlass-sequence-screenshot.png)\n\n\n**Note**: This is the source code for the sequence track only! You might want to check out the following repositories as well:\n\n- HiGlass viewer: https://github.com/higlass/higlass\n- HiGlass server: https://github.com/higlass/higlass-server\n- HiGlass docker: https://github.com/higlass/higlass-docker\n\n\n## Installation\n \n```\nnpm install higlass-sequence\n```\n\n## Usage\n\nThe live script can be found at:\n\n- https://unpkg.com/higlass-sequence/dist/higlass-sequence.js\n\n### Client\n\n1. Make sure you load this track prior to `hglib.js`. For example:\n\n```\n\u003cscript src=\"/higlass-sequence.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"hglib.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  ...\n\u003c/script\u003e\n```\n\n2. higlass-sequence can load sequence data in two ways:\n  - Convert a FASTA file into the multivec format. Use this format if you need aggregation on lower zoom levels. See the `colorAggregationMode` option below. The script `scripts/fasta_to_hdf5.py` will convert your FASTA file into the hdf5 format which then can be converted to the multivec format (see the [HiGlass docs](https://docs.higlass.io/data_preparation.html#multivec-files) for more information). After ingesting the multivec file into a HiGlass server, you can configure the track in your view config in the usual way, using a `server` and `tilesetUid`:\n  ```\n  {\n    \"server\": \"http://localhost:8001/api/v1\",\n    \"tilesetUid\": \"ScrlBGMbR_WJ0fzKXxKFzA\",\n    \"uid\": \"seq_multivec_example\",\n    \"type\": \"horizontal-sequence\",\n    \"options\": {\n      ...\n    },\n    \"width\": 568,\n    \"height\": 25\n  },\n ```\n  - The sequence track can also load the data directly into the client using indexed FASTA files. No running HiGlass server is required in this case. The only additional data required (besides the FASTA file) is a `fai` index file and a chrom sizes file. The track then can be configured in the following way:\n   ```\n  {\n    \"uid\": \"seq_fasta_example\",\n    \"type\": \"horizontal-sequence\",\n    \"data\": {\n      \"type\": \"fasta\",\n      \"fastaUrl\": \"https://aveit.s3.amazonaws.com/higlass/data/sequence/hg38.fa\",\n      \"faiUrl\": \"https://aveit.s3.amazonaws.com/higlass/data/sequence/hg38.fa.fai\",\n      \"chromSizesUrl\": \"https://aveit.s3.amazonaws.com/higlass/data/sequence/hg38.mod.chrom.sizes\"\n    },\n    \"options\": {\n      ...\n    },\n    \"width\": 568,\n    \"height\": 25\n  },\n ```\n \n\u003eUsing indexed FASTA files is easier and faster than multivec files. If no aggregation is needed, this is the preferred way to load data in higlass-sequence.\n\nFor an example, see [`src/index.html`](src/index.html).\n\n3. The following options are available:\n```\n{\n   \"colorAggregationMode\": \"none\", // ['none', 'max', 'weighted']. Ignored when using indexed FASTA files. Determines how pixels are colored on lower zoom levels. 'max' colors the pixels according to the nucleotide with the highest occurence. 'weighted' uses a weighted interpolation of colors.\n   \"extendedPreloading\": false, // More tiles than necessary are loaded. Leads to a smoother horizontal scrolling especially for multivec files.\n   \"labelPosition\": \"topLeft\",\n   \"labelColor\": \"black\",\n   \"labelTextOpacity\": 0.4,\n   \"notificationText\": \"Zoom in to see nucleotides...\", // Notification text if colorAggregationMode == \"none\" and user zooms out too far.\n   \"trackBorderWidth\": 0,\n   \"trackBorderColor\": \"white\",\n   \"backgroundColor\": \"white\",\n   \"barBorder\": true,\n   \"barBorderColor\": \"white\",\n   \"fontSize\": 16, // size of the letters\n   \"fontFamily\": \"Arial\",\n   \"fontColor\": \"white\",\n   \"colorScale\": [\n     \"#007FFF\", // color of A\n     \"#e8e500\", // color of T\n     \"#008000\", // color of G\n     \"#FF0038\", // color of C\n     \"#800080\", // color of N\n     \"#DCDCDC\", // color of everything else\n   ],\n }\n```\n\n### ECMAScript Modules (ESM)\n\nWe also build out ES modules for usage by applications who may need to import or use `higlass-sequence` as a component.\n\nWhenever there is a statement such as the following, assuming `higlass-sequence` is in your node_modules folder:\n```javascript\nimport { SequenceTrack } from 'higlass-sequence';\n```\n\nThen SequenceTrack would automatically be imported from the `./es` directory (set via package.json's `\"module\"` value). \n\n## Support\n\nFor questions, please either open an issue or ask on the HiGlass Slack channel at http://bit.ly/higlass-slack\n\n## Development\n\n### Testing\n\nTo run the test suite:\n\n```\nnpm run test-watch\n```\n\n\n### Installation\n\n```bash\n$ git clone https://github.com/higlass/higlass-sequence.git\n$ cd higlass-sequence\n$ npm install\n```\nIf you have a local copy of higlass, you can then run this command in the higlass-sequence directory:\n\n```bash\nnpm link higlass\n```\n\n### Commands\n\n - **Developmental server**: `npm start`\n - **Production build**: `npm run build`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhiglass%2Fhiglass-sequence","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhiglass%2Fhiglass-sequence","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhiglass%2Fhiglass-sequence/lists"}