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.40.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

cutseq-0.0.40-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cutseq-0.0.40.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.19

File hashes

Hashes for cutseq-0.0.40.tar.gz
Algorithm Hash digest
SHA256 ece1dea0a9793243dc9847fc7da27aca5b31b6ae17f3e7e851789ab153e355c2
MD5 aa069c63d2987e12889f02806db84b31
BLAKE2b-256 381a287787721d8416cedd2644c7c514cb8c175cf2d4b3a388c320be26abfad3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cutseq-0.0.40-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.19

File hashes

Hashes for cutseq-0.0.40-py3-none-any.whl
Algorithm Hash digest
SHA256 f93a9ecaa9c7cdebaa91cb2831d7ae2bc007af735e2ed0bfc09292fdf8e5d57b
MD5 4cfd9cd626b032d9b9d52d80b726a0e5
BLAKE2b-256 9362cbada5aea9a0ea4b1b93ae483341c6a392186c02aaa2ed5953726c41c34e

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