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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: cutseq-0.0.38.tar.gz
  • Upload date:
  • Size: 11.8 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.38.tar.gz
Algorithm Hash digest
SHA256 726709d1247e8073e8a23ba47a963b927901dc9936fcf096185bf4223ab740e9
MD5 2cae493978bb45480775231011903812
BLAKE2b-256 3c2d73c445426030afe40b589324d39c7185e3697b19ab72e178b263a19ceb40

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cutseq-0.0.38-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.38-py3-none-any.whl
Algorithm Hash digest
SHA256 e19cc2a8fcfe6ab6fb765066670d6f117abcb93fc27ea839230bc9ce874c5dbd
MD5 0db41200aa992c3e2d0b487d21eaab95
BLAKE2b-256 36cd05f14c9640d0b472e4eee9e38f757b2349af41d41d6e9f8dee24b563a801

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