Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • tir_al
    Member
    • Sep 2010
    • 22

    FastQ/BAM compression

    Does anybody know of a more recent comparison of algorithms for fastq/bam compression, than this thread?
    Discussion of next-gen sequencing related bioinformatics: resources, algorithms, open source efforts, etc


    Best
  • GenoMax
    Senior Member
    • Feb 2008
    • 7142

    #2
    CRAM is reference based compression so may or may not be of interest for you. http://www.ebi.ac.uk/ena/about/cram_toolkit/

    Comment

    • tir_al
      Member
      • Sep 2010
      • 22

      #3
      Tnx for the prompt answer!

      I just tried cram today. The compression ratio is extremely impressive, but it's a too slow for my needs.

      Comment

      • winsettz
        Member
        • Sep 2012
        • 91

        #4
        tir_al,

        What is the compression ratio? Curious to see before I take a dive with my own data.

        Comment

        • tir_al
          Member
          • Sep 2010
          • 22

          #5
          I tried it on 75bp, cca 80 mil. reads, pair end bam file. And it crammed 3.6 GB file into a 257MB archive.

          Comment

          • winsettz
            Member
            • Sep 2012
            • 91

            #6
            Originally posted by tir_al View Post
            I tried it on 75bp, cca 80 mil. reads, pair end bam file. And it crammed 3.6 GB file into a 257MB archive.
            Sounds like a promising way to store genomic data in the long run if indexed to hg19?

            Comment

            • tir_al
              Member
              • Sep 2010
              • 22

              #7
              Yeah. Preferably for storing old projects.

              Comment

              • GenoMax
                Senior Member
                • Feb 2008
                • 7142

                #8
                Originally posted by tir_al View Post
                Yeah. Preferably for storing old projects.
                Are you sure the effort is going to be worthwhile rather than using plain old tar/gzip combination?

                If you are looking at thousands of samples a year then perhaps it may be.

                Comment

                • tir_al
                  Member
                  • Sep 2010
                  • 22

                  #9
                  I currently have no options, and no place for new disk space

                  Comment

                  • bruce01
                    Senior Member
                    • Mar 2011
                    • 160

                    #10
                    Hi all, I can't figure out how to specify loseless compression using cramTools (ie retain all quality score info), can someone help me out? In NGCs paper they state a few flags which seem to be discontinued in 1.0. Presumably I specify using --lossy-quality-score-spec but I can't figure out how to set it to 'any/all'. I appreciate any help/ideas on this. Also if I am missing the point and the compression inherently removes quality scores I apologise in advance, I am n00 to the area=P
                    Last edited by bruce01; 01-11-2013, 02:55 AM.

                    Comment

                    • priesgo
                      Member
                      • Aug 2012
                      • 22

                      #11
                      Hi,

                      I'm in the same situation as Bruce. I want to compress keeping the base call qualities but can't figure out how...

                      Just did a naïf try:
                      Code:
                      --lossy-quality-score-spec all
                      and got:
                      Code:
                      Exception in thread "main" java.lang.RuntimeException: Uknown read or base category: a
                              at net.sf.cram.lossy.QualityScorePreservation.parseSinglePolicy(QualityScorePreservation.java:138)
                      So apparently you can specify a read name to keep the quality, not of use in my case as I want to keep all of them; and base category. But, what is the base category? I also tried a numeric value in case it referred referred to an index in the read, but with similar result.


                      Thanks!
                      Pablo.

                      Comment

                      • bruce01
                        Senior Member
                        • Mar 2011
                        • 160

                        #12
                        Hi Pablo,

                        found it on the archives of cram mailing list, the call includes: -L m999 (-L flag is your --lossy-quality-score-spec above). All reads are retained, but you lose column 12+ ('info'). This isn't an issue for me, and the compressed cram file for a 1GB bam is 600MB which is pretty good!

                        Comment

                        • priesgo
                          Member
                          • Aug 2012
                          • 22

                          #13
                          Thanks Bruce,

                          It's running!
                          For the columns 12+ I guess with the option --capture-tags you can keep tags as the read group which is usually important.


                          Regards,
                          Pablo.

                          Comment

                          • jkbonfield
                            Senior Member
                            • Jul 2008
                            • 146

                            #14
                            I just noticed this thread, rather late.

                            There is CRAM from EBI, which has long term support and handles random access. It's the most direct competitor to BAM I would guess.

                            Alternatives are Goby (similar ratios, but even slower from my experience), Quip (faster encoding, great compression ratio, but no(?) random access) and SamComp1/2 (faster encoding, great compression ratio, no random access, and doesn't really implement the full SAM spec - more of a fastq compressor). Finally on that topic there are tools like quip again, fqzcomp and fastqz for compression of FASTQ data. [All 3 of these were SequenceSqueeze competition entries.]

                            Comment

                            • narain
                              Banned
                              • Aug 2011
                              • 73

                              #15
                              But as I saw in one of the presentations, it seems CRAM does a lossy conversion from BAM, and introduces false positive and false negatives ? Is CRAM mature now to do a lossless compression from FASTQ and BAM files with random access such as BAM files give ?

                              Comment

                              Latest Articles

                              Collapse

                              • GATTACAT
                                Reply to Nine Things a Sample Prep Scientist Thinks About Before Sequencing
                                by GATTACAT
                                Love this - good data definitely starts from good input, and poor input can only give relatively poor data. I particularly like the mention of Nanodrop/absorbance based methods for quantification. It's such a toss up if you'll get an accurate reading or what amounts to a randomly generated number, and a lot of library/sequencing related issues can be traced back to poor quant.
                                07-01-2026, 11:43 AM
                              • SEQadmin2
                                Nine Things a Sample Prep Scientist Thinks About Before Sequencing
                                by SEQadmin2


                                I’m not a sequencing expert. I’m a purification scientist who uses NGS to evaluate workflows my group develops. With this perspective, we think about the sample first and the NGS workflow second. The sequencer is an exceptionally honest reporter, but it can only report on what you give it, so whether you get clean, interpretable data from an NGS workflow is largely determined before you begin.

                                Here are nine questions we think about, in roughly the order they matter, before...
                                06-18-2026, 07:11 AM

                              ad_right_rmr

                              Collapse

                              News

                              Collapse

                              Topics Statistics Last Post
                              Started by SEQadmin2, 07-02-2026, 11:08 AM
                              0 responses
                              23 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, 06-30-2026, 05:37 AM
                              0 responses
                              23 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, 06-26-2026, 11:10 AM
                              0 responses
                              23 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, 06-17-2026, 06:09 AM
                              0 responses
                              55 views
                              0 reactions
                              Last Post SEQadmin2  
                              Working...