Skip to main content

Automatically cut adapter / barcode / UMI from NGS data

Project description

✂️ CutSeq

Pypi Releases Downloads

CutSeq is a tool that provides an efficient wrapper for the cutadapt tool, which is powerful in handling various types of NGS libraries. Due to the complexities involved in NGS library preparation methods, mutiple operations are necessary to process sequencing reads correctly.

Take SMARTer® Stranded Total RNA-Seq Kit v3 as an example, at least 9 operations are required.

For Read 1:

  1. Remove the Illumina p7 adapter from the end of the sequence.
  2. Remove 14 nt (8+3+3) at the rightmost position of the sequence, representing UMI and linker sequence from the beginning of read 2. This is required when the library insert size is shorter than the sequencing length.
  3. Remove poly-T sequences at the beginning of the sequence (read 1 is oriented in reverse to the RNA, hence a polyA tail appears as a leading polyT sequence).
  4. Remove low-quality bases from right to left.

For Read 2:

  1. Remove the reverse complement Illumina p5 adapter from the end of the sequence.
  2. Extract the 8 nt UMI sequence from the beginning of the sequence and append it to the read name for downstream analysis.
  3. Mask a 6 nt linker sequence at the leftmost position immediately after clipping the UMI sequence.
  4. Remove poly-A sequences at the end of the read.
  5. Remove low-quality bases from right to left.

These operations must be performed in the correct order. The limitations of the cutadapt tool make it challenging to configure these operations in a single command, often leading to errors unnoticed in some publications.


To solve this by using cutadapt, we can run multiple cutadpat insitent sequentially or pipe multiple commands together. But this waste lots of IO and computational resource. I am thinking there a more eligent API to make things easy. Then comes this toy project. -- What you need is only one parameter which spcific what the library would looks like.

CutSeq overcomes these limitations by enabling multiple operations in a automatical manner to ensure accuracy and efficiency.

How to install?

pip install cutseq

How to use?

Execute adapter trimming by providing a single parameter and your input files:

cutseq -A TAKARAV3 test_R1.fq.gz test_R2.fq.gz

Alternatively, you can specify a custom adapter sequence:

cutseq -a "ACACGACGCTCTTCCGATCTXXX<XXXXXXNNNNNNNNAGATCGGAAGAGCACACGTC"

The customized scheme can be explained by diagram above.

  • The outmost parts on both ends are the Illumina adapters.
  • The first inner parts are inline barcode sequence or customized PCR primers in the library construction step. These are also fixed DNA sequence, and will be represented by by sequence within ( and ).
  • The second inner parts are the UMI sequence, which is a random sequence and will be represented by N.
  • The innermost parts are sequnce to be masked, which will be represented by X. This can be random tail in the library construction step, caused by template switching or other reasons.
  • The center parts are the actual library sequence, which will be represented by > , < or -. > means that sequence is forward, < means that sequence is reverse, - means that sequence orientation is unknown.

More details can be found in the document

TODO

[ ] support more library scheme

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cutseq-0.0.30.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

cutseq-0.0.30-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file cutseq-0.0.30.tar.gz.

File metadata

  • Download URL: cutseq-0.0.30.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.14 Darwin/23.4.0

File hashes

Hashes for cutseq-0.0.30.tar.gz
Algorithm Hash digest
SHA256 034caafba95496d5ddc6f2a4e8d8a078c7ad5d28c7ebef1519a4bf8ca0379443
MD5 31d03f48c443e87ef993dfeb6e748ea4
BLAKE2b-256 d2663cac6c8dc48d32eff8426462137e97527d39cfabcde20bcab4d90b9254e8

See more details on using hashes here.

File details

Details for the file cutseq-0.0.30-py3-none-any.whl.

File metadata

  • Download URL: cutseq-0.0.30-py3-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.14 Darwin/23.4.0

File hashes

Hashes for cutseq-0.0.30-py3-none-any.whl
Algorithm Hash digest
SHA256 0166139efb808a93d22e713ffe109cff7b1dff21b658ba9e7d64fcf7434e8b48
MD5 4c78bf34d9beefe414ad3b967cce06bb
BLAKE2b-256 e2b5bb2d73831f0c717fef9027ebc2a0ce27f32864744e4163106a253da5f7d9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page