{"id":34975587,"url":"https://github.com/openvax/pepnet","last_synced_at":"2025-12-27T00:06:13.578Z","repository":{"id":57451817,"uuid":"84465844","full_name":"openvax/pepnet","owner":"openvax","description":"Neural networks for amino acid sequences","archived":false,"fork":false,"pushed_at":"2018-02-26T19:54:19.000Z","size":392,"stargazers_count":21,"open_issues_count":1,"forks_count":8,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-09-23T12:41:38.679Z","etag":null,"topics":["biological-data-analysis","machine-learning","neural-networks","protein-sequences"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openvax.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2017-03-09T16:43:43.000Z","updated_at":"2025-08-25T11:41:37.000Z","dependencies_parsed_at":"2022-09-15T21:53:23.616Z","dependency_job_id":null,"html_url":"https://github.com/openvax/pepnet","commit_stats":null,"previous_names":["hammerlab/pepnet"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/openvax/pepnet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openvax%2Fpepnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openvax%2Fpepnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openvax%2Fpepnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openvax%2Fpepnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openvax","download_url":"https://codeload.github.com/openvax/pepnet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openvax%2Fpepnet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28065691,"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","status":"online","status_checked_at":"2025-12-26T02:00:06.189Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["biological-data-analysis","machine-learning","neural-networks","protein-sequences"],"created_at":"2025-12-27T00:06:12.933Z","updated_at":"2025-12-27T00:06:13.564Z","avatar_url":"https://github.com/openvax.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://travis-ci.org/openvax/pepnet\"\u003e\n    \u003cimg src=\"https://travis-ci.org/openvax/pepnet.svg?branch=master\" alt=\"Build Status\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://coveralls.io/github/openvax/pepnet?branch=master\"\u003e\n    \u003cimg src=\"https://coveralls.io/repos/openvax/pepnet/badge.svg?branch=master\u0026service=github\" alt=\"Coverage Status\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://pypi.python.org/pypi/pepnet/\"\u003e\n    \u003cimg src=\"https://img.shields.io/pypi/v/pepnet.svg?maxAge=1000\" alt=\"PyPI\" /\u003e\n\u003c/a\u003e\n\n# pepnet\nNeural networks for amino acid sequences\n\n## Predictor API\n\nSequence and model construction can both be handled for you by pepnet's\n`Predictor`:\n\n```python\nfrom pepnet import Predictor, SequenceInput, NumericInput, Output\npredictor = Predictor(\n    inputs=[\n        SequenceInput(length=4, name=\"x1\", variable_length=True),\n        NumericInput(dim=30, name=\"x2\")],\n    outputs=[Output(name=\"y\", dim=1, activation=\"sigmoid\")],\n    dense_layer_sizes=[30],\n    dense_activation=\"relu\")\nsequences = [\"ACAD\", \"ACAA\", \"ACA\"]\nvectors = np.random.normal(10, 100, (3, 30))\ny = numpy.array([0, 1, 0])\npredictor.fit({\"x1\": sequences, \"x2\": vectors}, y)\ny_pred = predictor.predict({\"x1\": sequences, \"x2\": vectors})[\"y\"]\n```\n\n## Convolutional sequence filtering\n\nThis model takes an amino acid sequence (of up to length 50) and applies to it two layers of 9mer convolution with 3x maxpooling and 2x downsampling in between. The second layer's activations are then pooled across all sequence positions (using both mean and max pooling) and passed to a single dense output node called \"y\".\n\n```python\npeptide =\npredictor = Predictor(\n    inputs=[SequenceInput(\n        length=50, name=\"peptide\", encoding=\"index\", variable_length=True,\n        conv_filter_sizes=[9],\n        conv_output_dim=8,\n        n_conv_layers=2,\n        global_pooling=True)\n    ],\n    outputs=[Output(name=\"y\", dim=1, activation=\"sigmoid\")])\n```\n\n\n## Manual index encoding of peptides\n\nRepresent every amino acid with a number between 1-21 (0 is reserved for padding)\n\n```python\nfrom pepnet.encoder import Encoder\nencoder = Encoder()\nX_index = encoder.encode_index_array([\"SYF\", \"GLYCI\"], max_peptide_length=9)\n```\n\n## Manual one-hot encoding of peptides\n\nRepresent every amino acid with a binary vector where only one entry is 1 and\nthe rest are 0.\n\n```python\nfrom pepnet.encoder import Encoder\nencoder = Encoder()\nX_binary = encoder.encode_onehot([\"SYF\", \"GLYCI\"], max_peptide_length=9)\n```\n\n## FOFE encoding of peptides\n\nImplementation of FOFE encoding from [A Fixed-Size Encoding Method for Variable-Length Sequences with its Application to Neural Network Language Models](https://arxiv.org/abs/1505.01504)\n\n```python\nfrom pepnet.encoder import Encoder\nencoder = Encoder()\nX_binary = encoder.encode_FOFE([\"SYF\", \"GLYCI\"], bidirectional=True)\n```\n## Example network\n\nSchematic of a convolutional model: ![](conv_large.png)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenvax%2Fpepnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenvax%2Fpepnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenvax%2Fpepnet/lists"}