Skip to main content

BAM to scIDX

bam-to-scidx

Convert BAM file to scIDX file like a genome-wide pileup.

File input (BAM)​

This script processes BAM-type files so make sure your input is properly formatted and uses the appropriate .bam extension if you are working from the GUI.

caution

Make sure your BAM input files are sorted and indexed.

Read Encoding Options​

This tool has multiple read options to output.

  • Read 1: output Read 1 (5' end)
  • Read 2: output Read 2 (5' end)
  • Combined: output both reads (5' end)
  • Midpoint: output the midpoint between reads
note

The Midpoint option requires proper mate-pair reading.

Tag Shift​

For each position determined by the read encoding, the position is shifted up or downstream by the user-specified number of base pairs with respect to the read strand (read 1 if midpoint selected).

Filter Options​

  • Require Proper Paired-End refers to the proper pairing of reads Read 1 and Reads 2.
  • Filter Min Insert Size (bp) refers to the minimum insert size to filter
  • Filter Max Insert Size (bp) refers to the maximum insert size to filter

Output format (scIdx)​

The genome-wide tag pileup of each BAM entry is written to the scIdx format. The output filename is derived from the BAM filename with the read encoding information. For example, given an input BAM filename, mybam.bam, the following output files will be produced for each read encoding option:

  • Read 1 example: mybam_READ1.tab
  • Read 2 example: mybam_READ2.tab
  • Combined example: mybam_COMBINED.tab
  • Midpoint example: mybam_MIDPOINT.tab

Output GZip​

Toggling this allows the user to write output to a compressed file format using a general compression (gzip) which has the added advantage of speeding up the execution time by shrinking the I/O load (esp for large output). The .gz extension will be appended as appropriate.

Command Line Interface​

Usage:

java -jar ScriptManager.jar bam-format-converter bam-to-scidx [-1 | -2 | -a | -m]
[-hpsV] [-n=<MIN_INSERT>] [-o=<output>] [-x=<MAX_INSERT>] <bamFile>

Positional Input​

This tool takes a single BAM file for input. As with other tools, this tool requires the BAM file be indexed.

Output Options​

OptionDescription
-o, --output=<output>specify output directory (name will be same as original with .tab ext)
-s, --stdoutstream output file to STDOUT (cannot be used with -o flag)
-z, --gzipgzip output (default=false)

Filter Options​

These filter options are shared across all the BAM Format Converter tools.

OptionDescription
-p, --mate-pairrequire proper mate pair (default not required)
-n, --min-insert=<MIN_INSERT>filter by min insert size in bp
-x, --max-insert=<MAX_INSERT>filter by max insert size in bp

Read Options​

OptionDescription
-1, --read1output read 1 (default)
-2, --read2output read 2
-a, --all-readsoutput combined
-m, --midpointoutput midpoint (require PE)
--shiftset a shift in bp (default=0bp)