Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • splaisan
    senior molecular biologist
    • Jun 2009
    • 32

    compressing reference genome and indexing

    Hi all

    I report here a strange behavior I experience on both OSX10.6.8 and centos 5.7 with latest software installed (macport and yum respectively)

    If I download archived versions of the human reference genome from the Broad ftp (bundle 1.2)
    and run the command:
    Code:
    zgrep ">" human_b36_both.fasta.gz
    I get it all OK until the end and suddenly pages of binary garbage occur

    I thought this had to do with corruption of the archive and I did the following:
    expand the archive back to multifasta
    reformat the fasta content using bioperl (in and out as fasta)
    recompress with razip (samtools 1.18)
    repeat the zgrep command
    I get the garbage again!!

    Is this normal and due to some specificity of razip?

    ## below a series of commands and results
    Code:
    # sorry for the length
    $> razip -c human_b36_both.fa > human_b36_both.fa.gz
    $> zgrep ">" human_b36_both.fa.gz
    >1
    >2
    …
    >NT_113899
    >NT_113965
    >NT_113898
    >NC_007605
    ?f???,ixAp_?Òoё\G?C?Nm????R??[D?;?œ?)?pj5X??UL?`??mM?l%??ZºŐP?BI??W??d???HCoo??DS?ѷivfq(??X??U???w??? }?C"R???¿?.???????.\???,??7???bҳ*?k??F?b?l!??M??Ս??[???D?T?NfJ?8Ɉ?f?p??cGm
                                                 ?<?:vRv?Hd?ղ???C.??߉?ye???N?
                                                                             U?4CY???w??<??v!?@?o?w;??İ?xHD?b+????|????e9???D?
                          ??:??(fUY???m??jL??o?»B}??!;?X?c????` ?\Y4??)ß????<?/Þ?@@j!'?Y?B?2???"?$?	I???9_?5??=묦???H1?l??Q??|?{??6[????G?a;:&??gw?<e?u2???R,]?P?%?Vd')Y?_K?ae
                                                                          -Z ʂ@??g?YvF?By??q?'??m?Z&? (~5?ʈ???????3??8{?W?j?? 7_?L??-??r?kԊRb?׏?g?8?<?6??$???K??M?-
    ?$H?k?r??v%Jp˴lںxSJ
                       ?q????Khg?	db?>??b?q`E?RJ ?~lH?????%?m.???X?+??t?ߒ??%̽ @??ޫ?)`?it[?w??:?݃ݓY
                                                                                                 ?P3fg$j?????t?>??e?9?n?5?????y23?2WgT?f?*?=l??`ԊU?C??????P?TO
                                                          ??~?4dg?mq&z3??ZJ?qP-??j??r?*??????20?;vRe*?B??LD]
    #(… many many such pages of trailing binary garbage)
    
    # while the tail of the fasta file is clean
    $> tail human_b36_both.fa
    ATGGGGGGCCGCGCATTCCTGGAAAAAGTGGAGGGGGCGTGGCCTTCCCCCGCGGCCCCC
    CAGCCCCCCCGCACAGAGCGGCGCTACGGCGGGCGGGCGGCGGGGGGTCGGGGTCCGCGG
    GCTCCGGGGGCTGCGGGCGGTGGATGGCGGCGGACGTTCCGGGGATCGGGGGGGTCGGGG
    GGCGCCGCGCGGGCGCAGCCATGCGTGACCGTGATGAGGGGGCAGGGTCGCAGGGGGTGT
    GTCTGGTGGGGGCGGGAGCGGGGGGCGGCGCGGGAGCCTGCACGCCGTTGGAGGGTAGAA
    TGACAGGGGGCGGGGACAGAGAGGCGGTCGCGCCCCCGGCCGCGCCAGCCAAGCCCCCAA
    GGGGGGCGGGGAGCGGGCAATGGAGCGTGACGAAGGGCCCCAGGGCTGACCCCGGCAAAC
    GTGACCCGGGGCTCCGGGGTGACCCAGCCAAGCGTGACCAAGGGGCCCGTGGGTGACACA
    GGCAACCCTGACAAAGGCCCCCCAGGAAAGACCCCCGGGGGGCATCGGGGGGGGTGTTGG
    CGGGGGCATGGGGGGGTCGGATTTCGCCCTTATTGCCCTGTTT
    
    # indexing the archive works fine
    $>samtools faidx human_b36_both.fa.gz
    $>cat human_b36_both.fa.gz.fai
    1	247249719	3	60	61
    2	242951149	251370554	60	61
    ...
    NT_113898	1305230	3143346495	60	61
    NC_007605	171823	3144673490	60	61
    
    # extracting the last record also works and ends just like the tail above
    $>samtools faidx human_b36_both.fa.gz NC_007605
    >NC_007605
    AGAATTCGTCTTGCTCTATTCACCCTTACTTTTCTTCTTGCCCGTTCTCTTTCTTAGTAT
    GAATCCAGTATGCCTGCCTGTAATTGTTGCGCCCTACCTCTTTTGGCTGGCGGCTATTGC
    CGCCTCGTGTTTCACGGCCTCAGTTAGTACCGTTGTGACCGCCACCGGCTTGGCCCTCTC
    ACTTCTACTCTTGGCAGCAGTGGCCAGCTCATATGCCGCTGCACAAAGGAAACTGCTGAC
    …
    GGGGGGCGGGGAGCGGGCAATGGAGCGTGACGAAGGGCCCCAGGGCTGACCCCGGCAAAC
    GTGACCCGGGGCTCCGGGGTGACCCAGCCAAGCGTGACCAAGGGGCCCGTGGGTGACACA
    GGCAACCCTGACAAAGGCCCCCCAGGAAAGACCCCCGGGGGGCATCGGGGGGGGTGTTGG
    CGGGGGCATGGGGGGGTCGGATTTCGCCCTTATTGCCCTGTTT
    Last edited by splaisan; 01-29-2012, 05:50 AM.
    http://www.bits.vib.be/index.php
  • Richard Finney
    Senior Member
    • Feb 2009
    • 701

    #2
    It appears that razip uses gzip compression (or other kinds of compression) but is not gzip. The output contains chunks of (gzipped) compressed data but the entire file is not a gzipped file. razip output cannot be gUNzipped (but can be uncompressed using razip). zgrep tries to UNgzip the file, succeeds party, but then runs into the uncompressed part and fails.

    Comment

    • splaisan
      senior molecular biologist
      • Jun 2009
      • 32

      #3
      Thanks Richard

      I wrongly assumed this was a bonafide archive. Never mind, I will keep a second copy compressed with bgzip to reduce storage as compared to the plain 3GB fasta and use one or the other depending on the needs.

      Great help, thanks
      Stephane

      Originally posted by Richard Finney View Post
      It appears that razip uses gzip compression (or other kinds of compression) but is not gzip. The output contains chunks of (gzipped) compressed data but the entire file is not a gzipped file. razip output cannot be gUNzipped (but can be uncompressed using razip). zgrep tries to UNgzip the file, succeeds party, but then runs into the uncompressed part and fails.
      http://www.bits.vib.be/index.php

      Comment

      • lh3
        Senior Member
        • Feb 2008
        • 686

        #4
        It is part of the razip problem and part of gzip. If you run "gzip -dc | grep", you get normal output. But if you run "gzip -dcf | grep", which is what zgrep is actually calling, you get those rubbish.

        Comment

        • splaisan
          senior molecular biologist
          • Jun 2009
          • 32

          #5
          thanks Heng

          This helps a lot and I will alias it for regular use!
          You just saved me several gigabites of disk space.
          Cool
          Stephane

          Originally posted by lh3 View Post
          It is part of the razip problem and part of gzip. If you run:
          Code:
          gzip -dc | grep
          , you get normal output. But if you run "gzip -dcf | grep", which is what zgrep is actually calling, you get those rubbish.
          http://www.bits.vib.be/index.php

          Comment

          Latest Articles

          Collapse

          • SEQadmin2
            Proteomic Platforms: How to Choose the Right Analytical Strategy to Improve Detection and Clinical Applications
            by SEQadmin2


            Proteomics platforms are evolving rapidly, with advances in mass spectrometry and affinity-based approaches expanding what researchers can detect and at what scale. As the field moves toward deeper proteome coverage and clinical applications, scientists face an increasingly complex landscape of tools. This article will explore how researchers are navigating these choices to find the right platform for their work.

            The systematic characterization of the human proteome has
            ...
            07-20-2026, 11:48 AM
          • SEQadmin2
            Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
            by SEQadmin2



            Genomics studies in neuroscience face a special challenge due to the brain’s complexity and scarcity of samples. Mapping changes in cell type and state using conventional next-generation sequencing methods remains challenging. Advances in technologies like single-cell sequencing, spatial transcriptomics, and long-read sequencing have opened the door to deeper studies of the brain and diseases like Alzheimer’s, amyotrophic lateral sclerosis (ALS), and schizophrenia.
            ...
            07-09-2026, 11:10 AM
          • SEQadmin2
            Cancer Drug Resistance: The Lingering Barrier to Rising Survival
            by SEQadmin2



            Cancer survival rates have significantly increased in the last few decades in the United States, reaching a combined 70% 5-year survival rate by 2021. Behind this number, there are years of research to find new therapies, drug targets, and early detection methods. But there is one core challenge that keeps slowing down these advances, and it’s about drug resistance.

            There is no single reason why many patients don’t respond to treatment as expected. Cancer is...
            07-08-2026, 05:17 AM

          ad_right_rmr

          Collapse

          News

          Collapse

          Topics Statistics Last Post
          Started by SEQadmin2, 07-24-2026, 12:17 PM
          0 responses
          31 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 07-23-2026, 11:41 AM
          0 responses
          23 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 07-20-2026, 11:10 AM
          0 responses
          214 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 07-13-2026, 10:26 AM
          0 responses
          79 views
          0 reactions
          Last Post SEQadmin2  
          Working...