{"id":32174660,"url":"https://github.com/not-a-feature/minifasta","last_synced_at":"2025-10-21T19:04:36.556Z","repository":{"id":39029057,"uuid":"440126588","full_name":"not-a-feature/miniFASTA","owner":"not-a-feature","description":"An small FASTA toolbox for small to medium size projects without dependencies.","archived":false,"fork":false,"pushed_at":"2024-03-12T16:50:23.000Z","size":152,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-21T19:04:29.302Z","etag":null,"topics":["bioinformatics","fasta","python","reader-writer","toolbox"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/not-a-feature.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,"governance":null}},"created_at":"2021-12-20T10:19:35.000Z","updated_at":"2024-04-27T11:50:03.000Z","dependencies_parsed_at":"2023-09-26T03:37:12.633Z","dependency_job_id":null,"html_url":"https://github.com/not-a-feature/miniFASTA","commit_stats":{"total_commits":82,"total_committers":2,"mean_commits":41.0,"dds":0.04878048780487809,"last_synced_commit":"24403cee3ae3d15a5503eecf18299c5351f9c0c8"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/not-a-feature/miniFASTA","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/not-a-feature%2FminiFASTA","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/not-a-feature%2FminiFASTA/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/not-a-feature%2FminiFASTA/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/not-a-feature%2FminiFASTA/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/not-a-feature","download_url":"https://codeload.github.com/not-a-feature/miniFASTA/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/not-a-feature%2FminiFASTA/sbom","scorecard":{"id":694758,"data":{"date":"2025-08-11","repo":{"name":"github.com/not-a-feature/miniFASTA","commit":"ac81244660418deb2d2a422ff094aa876efb25a7"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.9,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/10 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/black.yml:1","Warn: no topLevel permission defined: .github/workflows/python-publish.yml:1","Warn: no topLevel permission defined: .github/workflows/tests.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":1,"reason":"dependency not pinned by hash detected -- score normalized to 1","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/black.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/not-a-feature/miniFASTA/black.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/black.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/not-a-feature/miniFASTA/black.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/not-a-feature/miniFASTA/python-publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/not-a-feature/miniFASTA/python-publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/not-a-feature/miniFASTA/tests.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/not-a-feature/miniFASTA/tests.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:28","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:29","Warn: pipCommand not pinned by hash: .github/workflows/tests.yml:23","Warn: pipCommand not pinned by hash: .github/workflows/tests.yml:24","Info:   0 out of   5 GitHub-owned GitHubAction dependencies pinned","Info:   1 out of   2 third-party GitHubAction dependencies pinned","Info:   0 out of   4 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-22T03:21:44.586Z","repository_id":39029057,"created_at":"2025-08-22T03:21:44.586Z","updated_at":"2025-08-22T03:21:44.586Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280317354,"owners_count":26310019,"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-10-21T02:00:06.614Z","response_time":58,"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":["bioinformatics","fasta","python","reader-writer","toolbox"],"created_at":"2025-10-21T19:04:27.017Z","updated_at":"2025-10-21T19:04:36.551Z","avatar_url":"https://github.com/not-a-feature.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"https://github.com/not-a-feature/miniFASTA/raw/main/miniFASTA.png\" width=300px alt=\"fastq logo\"\u003e\u003c/img\u003e\n\nA simple FASTA read and write toolbox for small to medium size projects.\n\nThis module is now part of the bfx suite. See https://py-bfx.readthedocs.io for more information.\n\n[![DOI](https://zenodo.org/badge/440126588.svg)](https://zenodo.org/badge/latestdoi/440126588)\n![Test Badge](https://github.com/not-a-feature/miniFASTA/actions/workflows/tests.yml/badge.svg)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\u003cbr\u003e\n![Download Badge](https://img.shields.io/pypi/dm/miniFASTA.svg)\n![Python Version Badge](https://img.shields.io/pypi/pyversions/miniFASTA)\n[![install with conda](https://img.shields.io/badge/install%20with-conda-brightgreen.svg?style=flat)](https://anaconda.org/conda-forge/minifasta)\n\n\n\nFASTA files are text-based files for storing nucleotide or amino acid sequences.\nReading such files is not particularly difficult, yet most off the shelf packages are overloaded with strange dependencies.\n\nminiFASTA offers an alternative to this and brings many useful functions without relying on third party packages.\n\n## Installation\nUsing pip  / pip3:\n```bash\npip install miniFasta\n```\nOr by source with pip:\n```bash\ngit clone git@github.com:not-a-feature/miniFASTA.git\ncd miniFASTA\npip install .\n```\nOr by conda:\n```bash\nconda install -c conda-forge minifasta\n```\n\n## How to use\nminiFASTA offers easy to use functions for fasta handling.\nThe five main parts are:\n- read()\n- write()\n- fasta_object()\n    - toAmino()\n    - roRevComp()\n    - valid()\n    - len() / str() / eq() / iter()\n- translate_seq()\n- reverse_comp()\n\n## Reading FASTA files\n`read()` is a fasta reader which is able to handle compressed and non-compressed files.\nFollowing compressions are supported: zip, tar, tar.gz, gz. If multiple files are stored inside an archive, all files are read.\nThis function returns a Iterator of fasta_objects. If only the sequences should be returnes set the positional argument `seq=True`.\nThe entries are usually casted to upper case letters. Set `read(\"path.fasta\", upper=False)` to disable casting.\n\n```python\n# Read fasta_objects\nfos = mf.read(\"dolphin.fasta\") # Iterator of fasta_objects.\nfos = list(fos) # Casts the iterator to list of fasta_objects\n\n# Read only the sequence\nfasta_strings = mf.read(\"dolphin.fasta\", seq=True) # Iterator of string.\nfasta_strings = [fo.body for fo in mf.read(\"dolphin.fasta\")] # Alternative\n\n# Options and compressed files\nfos = mf.read(\"mouse.fasta\", upper=False) # The entries won't be casted to upper case.\nfos = mf.read(\"reads.tar.gz\") # Is able to handle compressed files.\n```\n\n## Writing FASTA files\n`write()` is a basic fasta writer.\nIt takes a single or a list of fasta_objects and writes it to the given path.\n\nThe file is usually overwritten. Set `write(fo, \"path.fasta\", mode=\"a\")` to append file.\n\n```python\nfos = mf.read(\"dolphin.fasta\") # Iterator of fasta entries\nfos = list(fos) # Materialize\nmf.write(fos, \"new.fasta\")\n```\n\n### fasta_object()\nThe core component of miniFASTA is the ```fasta_object()```. This object represents an FASTA entry and consists of a head and body.\n\n```python\nimport miniFasta as mf\nfo = mf.fasta_object(\"\u003eAtlantic dolphin\", \"CGGCCTTCTATCTTCTTC\", stype=\"DNA\")\nfo.getHead() or fo.head\n# \u003eAtlantic dolphin\n\nfo.getSeq() or fo.body\n# CGGCCTTCTATCTTCTTC\n\n### Following functions are defined on a fasta_object():\n\nstr(fo) # will return:\n# \u003eAtlantic dolphin\n# CGGCCTTCTATCTTCTTC\n\n# Body length\nlen(fo) # will return 18, the length of the body\n\n# Equality\nfo == fo # True\n\nfo_b = mf.fasta_object(\"\u003eSame Body\", \"CGGCCTTCTATCTTCTTC\")\nfo == fo_b # True\n\nfo_c = mf.fasta_object(\"\u003eDifferent Body\", \"ZZZZAGCTAG\")\nfo == fo_c # False\n\nfor s in fo:\n    # Iterates through the sequence of fo.\n```\n\n**fasta_object(...).valid()**\n\nChecks if the body contains invalid characters.\n_stype_ of fasta_object needs to be set in order to check for illegal characters in its body.\n\nstype is one of:\n- ANY : [default] Allows all characters.\n- NA  : Allows all Nucleic Acid Codes (DNA \u0026 RNA).\n- DNA : Allows all IUPAC DNA Codes.\n- RNA : Allows all IUPAC RNA Codes.\n- PROT: Allows all IUPAC Aminoacid Codes.\n\nOptional: allowedChars can be set to overwrite default settings.\n\n```python\n# The default object allows all characters.\n# True\nfasta_object(\"\u003evalid\", \"Ä'_**?.asdLLA\").valid()\n\n# Only if stype is specified, valid can check for illegal characters.\n# True\nfasta_object(\"\u003evalid\", \"ACGTUAGTGU\", stype=\"NA\").valid()\n\n# False, as W is not allowed for DNA/RNA\nfasta_object(\"\u003einvalid\", \"ACWYUOTGU\", stype=\"NA\").valid()\n\n# True\nfasta_object(\"\u003evalid\", \"AGGATTA\", stype=\"ANY\").valid(allowedChars = \"AGTC\")\n\n# True, as stype is ignored if allowedChars is set.\nfasta_object(\"\u003evalid\", \"WYU\", stype=\"DNA\").valid(allowedChars = \"WYU\")\n```\n\n**fasta_object(...).toAmino(translation_dict)**\n\nTranslates the body to an amino-acid sequence. See `tranlate_seq()` for more details.\n```python\nfo.toAmino()\nfo.body # Will return RPSIFF\nd = {\"CCG\": \"Z\", \"CTT\": \"A\" ...}\nfo.toAmino(d)\nfo.getBody # Will return ZA...\n```\n**fasta_object(...).toRevComp(complement_dict)**\n\nConverts the body to its reverse comlement. See `reverse_comp()` for more details.\n```python\nfo.toRevComp()\nfo.getBody # Will return GAAGAAGATAGAAGGCCG\n```\n\n## Sequence translation\n`translate_seq()` translates a sequence starting at position 0.\nUnless translation_dict is provided, the standart bacterial code is used. If the codon was not found, it will be replaced by an `~`. Tailing bases that do not fit into a codon will be ignored.\n\n```python\nmf.translate_seq(\"CGGCCTTCTATCTTCTTC\") # Will return RPSIFF\n\nd = {\"CGG\": \"Z\", \"CTT\": \"A\"}\nmf.translate_seq(\"CGGCTT\", d) # Will return ZA.\n```\n\n## Reverse Complement\n`reverse_comp()` converts a sequence to its reverse comlement.\nUnless complement_dict is provided, the standart complement is used. If no complement was found, the nucleotide remains unchanged.\n```python\nmf.reverse_comp(\"CGGCCTTCTATCTTCTTC\") # Will return GAAGAAGATAGAAGGCCG\n\nd = {\"C\": \"Z\", \"T\": \"Y\"}\nmf.reverse_comp(\"TC\", d) # Will return ZY\n```\n\n## License\nCopyright (C) 2024 by Jules Kreuer - @not_a_feature\n\nThis piece of software is published unter the GNU General Public License v3.0\nTLDR:\n\n| Permissions      | Conditions                   | Limitations |\n| ---------------- | ---------------------------- | ----------- |\n| ✓ Commercial use | Disclose source              | ✕ Liability |\n| ✓ Distribution   | License and copyright notice | ✕ Warranty  |\n| ✓ Modification   | Same license                 |             |\n| ✓ Patent use     | State changes                |             |\n| ✓ Private use    |                              |             |\n\nGo to [LICENSE.md](https://github.com/not-a-feature/miniFASTA/blob/main/LICENSE) to see the full version.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnot-a-feature%2Fminifasta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnot-a-feature%2Fminifasta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnot-a-feature%2Fminifasta/lists"}