logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

samtools-reference - extracts an embedded reference from a CRAM file

Author

       Written by James Bonfield from the Sanger Institute.

Description

       Creates  the reference from aligned data using either the MD:Z auxiliary tags or an embedded reference in
       a CRAM file.  The output is a FASTA file.

       For the embedded reference mode (-e) this operation is fast, but  only  works  on  CRAMs  produced  using
       --output-fmt-optionembed_ref=1.  Note this may not be the complete reference used.  Each CRAM slice will
       hold the entire reference that spans the slice coordinates, but gaps in coverage can lead to gaps between
       slices.   However  this  reference  should  be  suitable for passing into a CRAM decode (samtoolsview-Tref.fa).

       For SAM/BAM files or CRAMs without  reference,  using  the  MD:Z  tag  may  also  produce  an  incomplete
       reference.   Unlike  embedded reference, this reference may not be sufficient for decoding a CRAM file as
       the CRAM slice headers store the MD5sum of the portion of reference than spans that slice, but the  slice
       may  not have 100% coverage leading to Ns in the computed reference.  However it should still be possible
       to decode such CRAMs  by  ignoring  the  md5  mismatches  using  e.g.  samtoolsview--input-fmt-optionignore_md5=1.

Name

       samtools-reference - extracts an embedded reference from a CRAM file

Options

-e      Enable CRAM embedded reference mode.

       -q      Enables  quiet  mode  and  will  produce no output.  By default a line per reference is reporting
               describing the percentage with non-N bases.

       -rregion
               Specifies a single region to produce the reference from.  If specified, an  index  file  must  be
               present.

       -oFILE Write the FASTA records to FILE.  By default this is sent to stdout.

       -@INT  The number of BAM/CRAM decompression threads to use in addition to the main thread [0].

               Note  this does not multi-thread the main reference generation steps, so scaling may be capped by
               2 or 3 threads, depending on the data.  It will also not affect the -e option for  CRAM  embedded
               reference, although this is already the fastest method.

See Also

samtools(1)

       Samtools website: <http://www.htslib.org/>

samtools-1.21                                   12 September 2024                          samtools-reference(1)

Synopsis

       samtools reference [-q] [-rregion] [-oout.fa] in.cram

See Also