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

Uploaded Source

Built Distribution

cutseq-0.0.32-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for cutseq-0.0.32.tar.gz
Algorithm Hash digest
SHA256 c527b30eb68f6594c0ca8ce0d284db3ae29f6bc97e66ef9bcce5084b7dc531f3
MD5 a949f1d848361bd77f65548320d8c7e9
BLAKE2b-256 6c1bb42f9afe19ab4154f1f6078d732e9c4b282d775c654639ec4a4fda6718b7

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for cutseq-0.0.32-py3-none-any.whl
Algorithm Hash digest
SHA256 65480598f4c9a18eee0357e81d58d1d8ddc546d8672870a6eaf11b63d9bbc659
MD5 f85755acb6587df452bffc7c9902f9d9
BLAKE2b-256 d20c434a3b661aac8b73443c982cbee0ee5b8de4622eca4c26516c3da70f7db1

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