{"id":26573259,"url":"https://github.com/linsalrob/primer-trimming","last_synced_at":"2026-04-02T02:18:52.310Z","repository":{"id":88681610,"uuid":"280457997","full_name":"linsalrob/primer-trimming","owner":"linsalrob","description":"Fast C code for identifying and removing primers and adapters","archived":false,"fork":false,"pushed_at":"2023-05-20T10:43:22.000Z","size":96,"stargazers_count":11,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-03-29T13:46:44.705Z","etag":null,"topics":["bioinformatics","dna-sequences","dna-sequencing"],"latest_commit_sha":null,"homepage":"","language":"C","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/linsalrob.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-07-17T15:18:51.000Z","updated_at":"2025-08-19T08:46:08.000Z","dependencies_parsed_at":"2025-05-29T15:48:32.640Z","dependency_job_id":null,"html_url":"https://github.com/linsalrob/primer-trimming","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/linsalrob/primer-trimming","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linsalrob%2Fprimer-trimming","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linsalrob%2Fprimer-trimming/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linsalrob%2Fprimer-trimming/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linsalrob%2Fprimer-trimming/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linsalrob","download_url":"https://codeload.github.com/linsalrob/primer-trimming/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linsalrob%2Fprimer-trimming/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31294527,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T01:43:37.129Z","status":"online","status_checked_at":"2026-04-02T02:00:08.535Z","response_time":89,"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","dna-sequences","dna-sequencing"],"created_at":"2025-03-23T00:39:57.443Z","updated_at":"2026-04-02T02:18:52.302Z","avatar_url":"https://github.com/linsalrob.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Edwards Lab](https://img.shields.io/badge/Bioinformatics-EdwardsLab-03A9F4)](https://edwards.sdsu.edu/research)\n[![DOI](https://www.zenodo.org/badge/280457997.svg)](https://www.zenodo.org/badge/latestdoi/280457997)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n![GitHub language count](https://img.shields.io/github/languages/count/linsalrob/primer-trimming)\n[![Downloads](https://img.shields.io/github/downloads/linsalrob/primer-trimming/total?style=flat-square)](https://github.com/linsalrob/primer-trimming/releases)\n\n\n\n# PRINSEQ Primer Trimming\n\nThis is a standalone prinseq package for the identification and removal of primer and adapter sequences from your fastq files. It is written in ANSI C and designed to be fast, memory efficient, and portable. We have also aimed to make it accessible!\n\n## What is it?\nMost DNA sequencing approaches use _artificial sequences_ such as adapters, primers, linkers, or MID tags, small sequences that are added to the beginning or ends of the DNA samples before they are sequenced. Here, we call them _artificial sequences_ so we don't have to keep writing adapters, primers, linkers, or MID tags!\n\nThis code is designed to identify and remove those sequences before you perform any downstream processing on the sequences.\n\n## How does it work?\n\nThere are two steps, and one of those is optional!\n1. Identify the _artifical sequences_ in your fastq file. If you know what those are (e.g. you have a file from your sequence provider, you can supply that in step 2). If you don't know what they are, we can quickly identify them for you.\n2. Remove those sequences from your fastq file. We trim the primer sequences off of the left (and/or right ends).\n\n## TL;DR\n\n**Step 1**: Use `primer-predictions` to predict the primer sequences:\n\n```bash\n./primer-predictions -f sequences.fastq \u003e primers.fasta\n```\n\nand if you want to check for 3' adapters:\n\n```bash\n./primer-predictions -k 10 -m 10 -f -t  sequences.fastq.gz \u003e adapters.fasta\n```\n\n**Step 2**: Use `primer-trimming` to remove those primers:\n\n```bash\n./primer-trimming -l primers.fasta -r adapters.fasta sequences.fastq.gz \u003e trimmed.fastq\n```\n## I prefer Python\n\nWe have you covered. Just follow the [python installation](#python-installation) instructions, and you can access the C code straight from Python. You have all the advantages of speed, all the ease of writing code in Python.\n\n### Predicting primers\n\nStarting with a fastq (or fasta) file of sequences, use `primer-predictions` to identify _artificial sequences_ at the 5' end of your reads. There are a couple of input paramters you can play with:\n\n - `-k` to adjust the base _k_-mer size that we start with. The default (8) is a good starting point as it will allow of for the occasional sequencing error in your primers and still catch them. Its probably better not to go above 12 or 15 on a large sequence file.\n - `-p` will print out the primers and their abundances in the sequences. This is a great sanity check to make sure what we are suggesting is real (especially with 3' sequences, see below).\n  - `-f` will print the primer sequences in fasta format that can be used in `primer-trimming` see below.\n  - `-m` the percentage of the sequences that a _k_-mer should be present in to be included in the search. This can be a number between 1 and 100. The default is 1% of the sequences.\n  - `-t` look for adapters on the 3' end of the sequences (see below).\n  \n There are some other options that are largely for debuging the code, and you are free to explore them, but you will likely not need to use or change them.\n \n#### 5' and 3' Searching\n\nWe can search either the 5' end of the sequences (e.g. for MID tags, linkers, primers, etc) or the 3' end of the sequences (e.g. for a reverse primer). If you are searching the 3' end of the sequences we strongly recommend printing the counts of the primers in the actual sequences (using the `-p` option) to the code, and then deciding whether those sequences need trimming off with `primer-trimming`. In our experience we mostly don't find a 3' sequence worthy of trimming, but we may still report it here. We also recommend increasing the value of `-m` as this will remove errant sequences that are not really primers.\n\n\n### Trimming primers \n\nWe can trim either 5' primers (using the `-l` or `--left_primers` option) or 3' primers (using the `-r` or `--right_primers` option). We also trim poly-A tails off of sequences by default.\n\nThe `-l` and `-r` options need a fasta format file, and so you can use the output from `primer-prediction` above directly in the trimming step here.\n\n## Installation\n\nThere are two ways to install this code. You can either install the standalone applications using `GNU Make` or install the Python packages using `setup.py`. Or you can install both!\n\n### Python Installation\n\nWe will release a PyPi version soon, we are just finalizing some bug tests and reconsidering the whole name thing!\n\nClone the repository, and use pythons setup.py to build and install. Note in this example, we use the `--user` flag to just install in our local python environment.\n\n```bash\ngit clone https://github.com/linsalrob/primer-trimming.git\ncd primer-trimming\npython3 setup.py install --user\n```\n\n\n### C executable installation\n\nYou can install the executables from source, you just need GCC. Clone this git repo and use make:\n\n```bash\ngit clone https://github.com/linsalrob/primer-trimming.git\ncd primer-trimming\nmake all\nsudo make install\n```\n\nThis will install `primer-trimming` and  `primer-predictions` in `/usr/local/bin` (by default).\n\n\nBoth PyPi and Conda installations are coming soon (bug Rob about it!)\n\n# Contributors\n\nMost of the code was written by Kate McNair, with some help from Adrian Cantu and Rob Edwards.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinsalrob%2Fprimer-trimming","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinsalrob%2Fprimer-trimming","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinsalrob%2Fprimer-trimming/lists"}