Skip to content

akikuno/calcs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

licence PyPI version install with bioconda

Description

calcs is a command-line tool specifically designed to append a minimap2's cs tag to a SAM file.

Caution

calcs is deprecated.

If your SAM file has MD tags, we recommend using cstag-cli or paftools.js sam2paf.
Even if your SAM/BAM files do not have MD tags, we recommend using samtools calmd to add MD tags, and cstag-cli to add cs tags since calcs requires computational time.
See the Comparison with other tools section for details.

Installation

You can install calcs using pip:

pip install calcs

Alternatively, you can get calcs from bioconda:

conda install -c bioconda calcs

Usage

calcs [options] <in.sam> -r/--reference <in.fasta>

Options

-l/--long: output a cs tag in the long form
-t/--threads [INT]: number of threads to use (default: 1)

Examples

# cs tag (short form)
calcs examples/example.sam --reference examples/ref.fa > example_cs.sam

# cs tag (long form)
calcs examples/example.sam --reference examples/ref.fa --long > example_cslong.sam

# PAF format with cs tag (short form)
calcs examples/example.sam --reference examples/ref.fa --paf > example_cs.paf

# PAF format with cs tag (long form)
calcs examples/example.sam --reference examples/ref.fa --paf --long > example_cslong.paf

# Multiprocessing
calcs examples/example.sam --reference examples/ref.fa --threads 4 > example_cs.sam

If the input file is a BAM/CRAN format, you can use samtools view.

samtools view examples/example.bam |
  calcs -l -r examples/ref.fa |
  samtools sort > example_cslong.bam

Comparison with other tools

Here is the brief comparison between calcs, cstag-cli, and sam2paf.

calcs cstag-cli sam2paf
Input SAM and FASTA SAM or BAM with a MD tag SAM with a MD tag
Output format SAM or PAF SAM or BAM PAF
Speed Slow🐢 Fast🐇 Fast🐇

Instead of calcs, we recommend using either cstag-cli or sam2paf.
If a SAM file lacks MD tags, you can first add these tags using samtools calmd and then apply cstag-cli.

About

Append CS tag to SAM file

Resources

Stars

Watchers

Forks

Packages

No packages published