GSNAP(1)
π gsnap β Genomic Short-read Nucleotide Alignment Program π
okay bestie, welcome to gsnap(1) from the User Commands section π β this is the Genomic Short-read Nucleotide Alignment Program and she is booked and busy. grab a snack, this page is long, and this is only part 1 π«Ά
β¨ NAME β¨
gsnap β Genomic Short-read Nucleotide Alignment Program. that's it, that's the name, no notes π
πΈ SYNOPSIS πΈ
gsnap [OPTIONS...] <FASTA file>, or cat <FASTA file> | gmap [OPTIONS...]
like, either you hand her a FASTA file directly, or you pipe it in. both valid, both iconic β¨ (yes the piped version says gmap, that's literally what the manpage says, don't come for me)
π OPTIONS π
𧬠Input options (must include -d) π§¬
okay so for the input options you must include -d. no -d, no alignment, periodt.
-D,--dir=directoryβ the Genome directory. the default (as specified by--with-gmapdbto the configure program) is/var/cache/gmap.-d,--db=STRINGβ the Genome database.--two-passβ Two-pass mode π¦. the sequences get processed first to identify splice sites and introns, and then they're aligned using this splicing information. two passes, twice the drama.--use-localdb=INTβ whether to use the local suffix arrays, which help with finding extensions to the ends of alignments in the presence of splicing or indels.0=no,1=yes if available (default). so the default is yes if available, lowkey polite of her.
π Transcriptome-guided options (optional) π
these are optional, so no pressure, but if you want them she's ready
-C,--transcriptdir=directoryβ Transcriptome directory. the default is the value for--dirabove.-c,--transcriptdb=STRINGβ Transcriptome database.--transcriptome-mode=STRINGβ Options:assist,only,annotate(default). lemme break it down:assistmeans try transcriptome alignment first, but then use genomic alignment if nothing is found.onlymeans try transcriptome alignment only.annotatemeans try only genomic alignment, and use the transcriptome only for annotation β this is the fastest option β‘. in the other two options, annotation is also performed.
π₯ Computation options π₯
-k,--kmer=INTβ kmer size to use in genome database (allowed values:16or less). if you don't specify it, the program will find the highest available kmer size in the genome database. she'll figure it out herself, main character energy.--sampling=INTβ Sampling to use in genome database. if not specified, the program will find the smallest available sampling value in the genome database within the selected k-mer size.--align-fraction=FLOATβ process only the given fraction of reads, selected at random. if--align-fractionand--partare both given,--align-fractiontakes precedence π.-q,--part=INT/INTβ process only the i-th out of every n sequences, e.g.0/100or99/100(useful for distributing jobs to a computer farm π).--input-buffer-size=INTβ size of input buffer (program reads this many sequences at a time for efficiency) (default10000).--barcode-length=INTβ amount of barcode to remove from start of every read before alignment (default0).--endtrim-length=INTβ amount of trim to remove from the end of every read before alignment (default0).--orientation=STRINGβ orientation of paired-end reads. allowed values:FR(fwd-rev, or typical Illumina; default),RF(rev-fwd, for circularized inserts), orFF(fwd-fwd, same strand), or10X(single-cell where read 1 has barcode information; read 2 is rev).--10x-whitelist=FILEβ whitelist of 10X Genomics GEM bead barcodes, needed to perform correction of cellular barcodes. this file can be obtained atcellranger-x.y.z/lib/python/cellranger/barcodes(for Cell Ranger version >= 4), orcellranger-x.y.z/lib/cellranger-cs/x.y.z/lib/python/cellranger/barcodes(<= 3).--10x-well-position=INTβ position of well information in the accession, when separated by colons. if set to0, then no well information will be printed in the CB field (default:4).--fastq-id-start=INTβ starting position of identifier in FASTQ header, space-delimited (>=1).--fastq-id-end=INTβ ending position of identifier in FASTQ header, space-delimited (>=1).
π Examples π
@HWUSI-EAS100R:6:73:941:1973#0/1β start=1, end=1(default) => identifier isHWUSI-EAS100R:6:73:941:1973#0@SRR001666.1 071112_SLXA-EAS1_s_7:5:1:817:345 length=36β start=1, end=1=> identifier isSRR001666.1; start=2, end=2=> identifier is071112_SLXA-EAS1_s_7:5:1:817:345; start=1, end=2=> identifier isSRR001666.1 071112_SLXA-EAS1_s_7:5:1:817:345
back to the options, we're not done bestie:
--force-single-endβ when multiple FASTQ files are provided on the command line, GSNAP assumes they are matching paired-end files. this flag treats each file as single-end. no assumptions, just vibes π--filter-chastity=STRINGβ skips reads marked by the Illumina chastity program. expecting a string after the accession having a'Y'after the first colon, like this:
@accession 1:Y:0:CTTGTA
where the 'Y' signifies filtering by chastity. Values: off (default), either, both. for 'either', a 'Y' on either end of a paired-end read will be filtered. for 'both', a 'Y' is required on both ends of a paired-end read (or on the only end of a single-end read).
--allow-pe-name-mismatchβ allows accession names of reads to mismatch in paired-end files. let them be different, it's fine π--interleavedβ input is in interleaved format (one read per line, tab-delimited--gunzipβ uncompress gzipped input files.--bunzip2β uncompress bzip2-compressed input files.
π₯ Computation options π₯ (yes, again β she said it twice, it's a whole thing)
-B,--batch=INTβ Batch mode (default =5). here's the whole breakdown, no cap:
Mode Hash offsets Hash positions Genome Local hash offsets Local hash positions Localdb
0 allocate mmap mmap allocate mmap mmap
1 allocate mmap & preload mmap allocate mmap & preload mmap
2 allocate mmap & preload mmap & preload allocate mmap & preload mmap
3 allocate allocate mmap & preload allocate allocate mmap
4 allocate allocate allocate allocate allocate mmap
5 allocate allocate allocate allocate allocate allocate
(default) is 5. and a little note from her to you π«Ά: for a single sequence, all data structures use mmap. a batch level of 5 means the same as 4, and is kept only for backward compatibility.
--use-shared-memory=INTβ if1, then allocated memory is shared among all processes on this node. if0(default), then each process has private allocated memory.--preload-shared-memoryβ load files indicated by--batchmode into shared memory for use by other GMAP/GSNAP processes on this node, and then exit. ignore any input files. she's just prepping, not aligning, ok?--unload-shared-memoryβ unload files indicated by--batchmode into shared memory, or allow them to be unloaded when existing GMAP/GSNAP processes on this node are finished with them. ignore any input files.-m,--max-mismatches=FLOATβ maximum number of mismatches allowed (if not specified, then GSNAP tries to find the best possible match in the genome). if specified between0.0and1.0, then treated as a fraction of each read length. otherwise, treated as an integral number of mismatches (including indel and splicing penalties). Default is0.3.--query-unk-mismatch=INTβ whether to count unknown (N) characters in the query as a mismatch (0=no (default),1=yes).--genome-unk-mismatch=INTβ whether to count unknown (N) characters in the genome as a mismatch (0=no,1=yes). if--use-maskis specified, default is no, otherwise yes.--maxsearch=INTβ maximum number of alignments to find (default1000). should be larger than--npaths, which is the number to report. keeping this number large will allow for random selection among multiple alignments. reducing this number can speed up the program β‘.--indel-endlength=INTβ minimum length at end required for indel alignments (default4).--max-insertions=INTβ maximum number of insertions allowed (default6).--max-deletions=INTβ maximum number of deletions allowed (default9).-M,--suboptimal-levels=INTβ report suboptimal hits beyond best hit (default0). all hits with best score plus suboptimal-levels are reported. (Note: Not currently implemented β yeah bestie, it's not even live yet, don't @ me π)-a,--adapter-strip=STRINGβ method for removing adapters from reads. currently allowed values:off,paired. Default is"off". to turn on, specify"paired", which removes adapters from paired-end reads if they appear to be present.-e,--use-mask=STRINGβ use genome containing masks (e.g. for non-exons) for scoring preference.-V,--snpsdir=STRINGβ directory for SNPs index files (created usingsnpindex) (default is location of genome index files specified using-Dand-d).-v,--use-snps=STRINGβ use database containing known SNPs (in<STRING>.iit, built previously usingsnpindex) for tolerance to SNPs.--cmetdir=STRINGβ directory for methylcytosine index files (created usingcmetindex) (default is location of genome index files specified using-D,-V, and-d).--atoidir=STRINGβ directory for A-to-I RNA editing index files (created usingatoiindex) (default is location of genome index files specified using-D,-V, and-d).--mode=STRINGβ alignment mode:standard(default),cmet-stranded,cmet-nonstranded,atoi-stranded,atoi-nonstranded,ttoc-stranded, orttoc-nonstranded. non-standard modes require you to have previously run thecmetindexoratoiindexprograms (which also cover the ttoc modes) on the genome. so like, prep work first, bestie, no shortcuts π-t,--nthreads=INTβ number of worker threads. more threads, more power, iykyk.
𧬠Splicing options for DNA-Seq π§¬
--find-dna-chimeras=INTβ look for distant splicing involving poor splice sites (0=no,1=yes). if not specified, then default is to be on unless only known splicing is desired (--use-splicingis specified and--novelsplicingis off).
πΈ Splicing options for RNA-Seq πΈ
-N,--novelsplicing=INTβ look for novel splicing (0=no (default),1=yes).--splicingdir=STRINGβ directory for splicing involving known sites or known introns, as specified by the-sor--use-splicingflag (default is directory computed from-Dand-dflags). Note: can just give full pathname to the-sflag instead. your call, both work β¨-s,--use-splicing=STRINGβ look for splicing involving known sites or known introns (in<STRING>.iit), at short or long distances. see README instructions for the distinction between known sites and known introns π
okay that's part 1 bestie, more is coming so don't go anywhere π
--splices-noevalβ don't evaluate splices for probability or intron length, bestie β just depend on the sequence alignment. it's giving "trust the alignment" energy. π--splices-dump=FILEβ write splice junction info to FILE, same format as for STAR plus MaxEnt probabilities for the two intron positions. note that in this dump file, the annotation column is reserved strictly for known introns, not novel introns that passed some criterion from a first pass. β¨--splices-exclude-knownβ in the file for--splices-dump, exclude all known introns. no cap. π«-w,--localsplicedist=INTβ definition of local novel splicing event (default200000). the way that's a big number... π§¬--merge-distant-samechrβ report distant splices on the same chromosome as a single splice, if possible. will produce a single SAM line instead of two SAM lines, which is also done for translocations, inversions, and scramble events. slay. π
β¨ Options for paired-end reads β¨
--pairmax-dna=INTβ max total genomic length for DNA-Seq paired reads, or other reads without splicing (default2000). used if-Nor-sis not specified. this value is also used for circular chromosomes when splicing in linear chromosomes is allowed. π--pairmax-rna=INTβ max total genomic length for RNA-Seq paired reads, or other reads that could have a splice (default200000). used if-Nor-sis specified. should probably match the value for-w,--localsplicedist. fr fr. π--resolve-inner=INTβ whether to resolve soft-clipping on the insides of paired-end reads (default1). π€--pairexpect=INTβ expected paired-end length, used for resolving soft-clipping on the insides of paired-end reads, and for pairing DNA-seq reads (default200). π--pairdev=INTβ allowable deviation from expected paired-end length, used for resolving soft-clipping on the insides of paired-end reads (default100). π--pass1-min-support=INTβ threshold read support for learning an intron during pass 1 of--two-passmode (default20). π₯
β¨ Options for quality scores β¨
--quality-protocol=STRINGβ protocol for input quality scores. allowed values:illumina(ASCII 64-126) (equivalent to-J 64 -j -31),sanger(ASCII 33-126) (equivalent to-J 33 -j 0). π
default is sanger (no quality print shift).
SAM output files should have quality scores in sanger protocol.
or you can customize this behavior with these flags:
-J,--quality-zero-score=INTβ FASTQ quality scores are zero at this ASCII value (default is33for sanger protocol; for Illumina, select64). π’-j,--quality-print-shift=INTβ shift FASTQ quality scores by this amount in output (default is0for sanger protocol; to change Illumina input to Sanger output, select-31). π
β¨ Output options β¨
-n,--npaths=INTβ maximum number of paths to print (default100). π€οΈ-Q,--quiet-if-excessiveβ if more than maximum number of paths are found, then nothing is printed. π€«-O,--orderedβ print output in same order as input (relevant only if there is more than one worker thread). π--show-refdiffβ for GSNAP output in SNP-tolerant alignment, shows all differences relative to the reference genome as lower case (otherwise, it shows all differences relative to both the reference and alternate genome). π--clip-overlapβ for paired-end reads whose alignments overlap, clip the overlapping region. βοΈ--merge-overlapβ for paired-end reads whose alignments overlap, merge the two ends into a single end (beta implementation). π§ͺ--print-snpsβ print detailed information about SNPs in reads (works only if-valso selected) (not fully implemented yet). π§¬--failsonlyβ print only failed alignments, those with no results. π--nofailsβ exclude printing of failed alignments. π«--only-concordantβ print only concordant alignments (concordant_uniq,concordant_mult,concordant_circular). π€--omit-concordant-uniqβ do not print anyconcordant_uniqalignments. π--omit-concordant-multβ do not print anyconcordant_multalignments. π--omit-softclippedβ do not allow any alignments with soft clips. π«--only-tr-consistentβ print only alignments with consistent transcripts (XX field present, identical if paired-end). π-A,--format=STRINGβ another format type, other than default. currently implemented:sam,m8(BLAST tabular format). π--split-output=STRINGβ basename for multiple-file output, separately fornomapping,halfmapping_uniq,halfmapping_mult,unpaired_uniq,unpaired_mult,paired_uniq,paired_mult,concordant_uniq, andconcordant_multresults. π-o,--output-file=STRINGβ file name for a single stream of output results. π--failed-input=STRINGβ print completely failed alignments as input FASTA or FASTQ format, to the given file, appending.1or.2, for paired-end data. if the--split-outputflag is also given, this file is generated in addition to the output in the.nomappingfile. πΎ--append-outputβ when--split-outputor--failed-inputis given, this flag will append output to the existing files. otherwise, the default is to create new files. β--order-among-best=STRINGβ among alignments tied with the best score, order those alignments in this order. allowed values:genomic,random(default). π²--output-buffer-size=INTβ buffer size, in queries, for output thread (default1000). when the number of results to be printed exceeds this size, worker threads wait until the backlog is cleared. π¦
β¨ Options for SAM output β¨
--no-sam-headersβ do not print headers beginning with@. π«--add-paired-nomappersβ add nomapper lines as needed to make all paired-end results alternate between first end and second end. π--paired-flag-means-concordant=INTβ whether the paired bit in the SAM flags means concordant only (1) or paired plus concordant (0, default). π€--sam-headers-batch=INTβ print headers only for this batch, as specified by-q. π¦--sam-hardclip-use-Sβ useSinstead ofHfor hardclips. π--sam-use-0M=INTβ if1(default), then insert0Min CIGAR between adjacent indels and introns. if0, do not allow0M. Picard disallows0M, but other tools may require it. β οΈ--sam-extended-cigarβ use extended CIGAR format (usingXand=symbols instead ofM, to indicate matches and mismatches, respectively). π€--sam-multiple-primariesβ allows multiple alignments to be marked as primary if they have equally good mapping scores. π--sam-sparse-secondariesβ for secondary alignments (in multiple mappings), uses*for SEQ and QUAL fields, to give smaller file sizes. However, the output will give warnings in Picard to give warnings and may not work with downstream tools. β οΈ
β οΈ heads up: this will give warnings in Picard and may not work with downstream tools. proceed with caution, bestie.
--force-xs-dirβ for RNA-Seq alignments, disallowsXS:A:?when the sense direction is unclear, and replaces this value arbitrarily withXS:A:+. May be useful for some programs, such as Cufflinks, that cannot handleXS:A:?. However, if you use this flag, the reported value ofXS:A:+in these cases will not be meaningful. β οΈ
β οΈ note: if you use this flag, the reported XS:A:+ value in these cases will not be meaningful. no cap.
--md-report-snpsβ in MD string, when known SNPs are given by the-vflag, prints difference nucleotides when they differ from reference but match a known alternate allele. π§¬--no-soft-clipsβ does not allow soft clips at ends. mismatches will be counted over the entire query. π«--extend-soft-clipsβ extends alignments through soft clipped regions. CIGAR string and coordinates will be revised, but mismatches and the MD string will reflect the clipped CIGAR. π--action-if-cigar-errorβ action to take if there is a disagreement between CIGAR length and sequence length. allowed values:ignore,warning(default),noprint,abort. note that thenoprintoption does not print the CIGAR string at all if there is an error, so it may break a SAM parser. π¨
β οΈ the noprint option does not print the CIGAR string at all if there is an error, so it may break a SAM parser. you've been warned.
--read-group-id=STRINGβ value to put into read-group id (RG-ID) field. π·οΈ--read-group-name=STRINGβ value to put into read-group name (RG-SM) field. π·οΈ--read-group-library=STRINGβ value to put into read-group library (RG-LB) field. π·οΈ--read-group-platform=STRINGβ value to put into read-group library (RG-PL) field. π·οΈ
β¨ Help options β¨
--checkβ check compiler assumptions. β--versionβ show version. π--helpβ show this help message. β
Other tools of GMAP suite are located in /usr/lib/gmap. π
π that's the whole GSNAP(1) manual, bestie! this page comes from gsnap 2025-07-31+ds-1, dated October 2025. stay slay and may your alignments always be concordant! π
β¨
π¦ where this page comes from
- ubuntu resolute: gmap 2025-07-31+ds-1 Β· Apache-2.0
- ubuntu stonking: gmap 2025-07-31+ds-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms