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

Uploaded Source

Built Distribution

cutseq-0.0.54-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for cutseq-0.0.54.tar.gz
Algorithm Hash digest
SHA256 3059de3ff145e5980cd896fbb80642841ec3c80df731929ad67cfe84a2ed3707
MD5 a07df96c007946ea45604459011d03f1
BLAKE2b-256 f9323c698f273add483385ddcc5ce1e9a5d0151b68de5c77d123459f4b8fcede

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for cutseq-0.0.54-py3-none-any.whl
Algorithm Hash digest
SHA256 3e7278cdd454bda796f18a6b482bd7c5b934751fad145a8d75ae5ae0329cdb97
MD5 948f54fe7289f349800b0b897c22747e
BLAKE2b-256 16f9bf9461a1c38378661d0ea58b8f5e493208a921a80bfa7b8297f1fb7536d6

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