Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zillur
    Senior Member
    • Sep 2014
    • 106

    #1

    Convert intiger into ascii character in a .qual file

    Hi there,
    I have a quality file like this:
    Code:
    >M00365:7:000000000-A48JK:1:1101:14885:1320
    32 32 32 32 32 37 37 31 33 33 33 33 38 38 38 38 34 36 32 37 36 37 36 36 36 36 38 35 37 38 38 39 38 38 36 30 32 32 37 39 37 36 36 34 36 38 38 34 36 36 37 37 37 39 36 36 38 36 30 38
    >M00365:7:000000000-A48JK:1:1101:16088:1320
    33 33 32 32 33 37 37 37 37 37 37 37 38 38 38 17 36 36 37 37 38 38 38 38 38 38 38 39 33 34 38 38 36 36 36 36 36 38 39 39 39 37 37 38 37 38 38 39 37 38 34 36 30 36 36 36 38 38 35
    truncated for convenience. I want to convert them into:
    Code:
    >M00365:7:000000000-A48JK:1:1101:14885:1320
    HIKALUIKJHKHKHUIKJHHIJHGFUIYDFHKKIJGHJKIIIII...............and so on.....
    >M00365:7:000000000-A48JK:1:1101:16088:1320
    IKJHGFRFIKJGDHKBFRTJJKH........and so on.......
    Any suggestion? I also want them sort according to header.

    Thanks in advance for your comments.

    Best Regards
    Zillur
  • lindenb
    Senior Member
    • Apr 2010
    • 143

    #2
    use awk:

    Code:
       awk '/^>/ {print;next;} {for(i=0;i<NF;++i) printf("%c",33+int($i));printf("\n");}'
    I don't know your endoding. I just put +33. However, your example is strange, if a quality starts with

    Code:
    32 32 32 32 32  ....
    then the translated qualities should be the same isn't it ?

    Comment

    • zillur
      Senior Member
      • Sep 2014
      • 106

      #3
      Thank you very much. That exactly what I wanted.
      Code:
      >M00365:7:000000000-A48JK:1:1101:14885:1320
      AAAAAAFF@BBBBGGGGCEAFEFEEEEGDFGGHGGE?AAFHFEECEGGCEEFFFHEEGE?
      FFGEGGHG/>EEEHHHHHGHHHHHHFHGGGGHEGHHHHHHGHFDHGHHHHHHFFFHH2FD
      FFFHFHBDDG?DCHHFFGHHGGGCGFHHGHH
      >M00365:7:000000000-A48JK:1:1101:16088:1320
      BBBAABFFFFFFFGGG2EEFFGGGGGGGHBCGGEEEEEGHHHFFGFGGHFGCE?EEEGGD
      EEFFFGFEE>>FGHHHHHHHFGHHHHHHGEGGGHHHHHGCGGGHHHGHHHGHHHHHFHCH
      GGGGHGEAEDCEGH0<<D<GAGHGHCGGHGF
      Thanks again.

      Best Regards
      Zillur

      Comment

      • zillur
        Senior Member
        • Sep 2014
        • 106

        #4
        Thanks again. How can sort the file according to header?

        Best Regards
        Zillur

        Comment

        Latest Articles

        Collapse

        • SEQadmin2
          Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
          by SEQadmin2



          Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

          Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
          ...
          10-14-2026, 09:55 AM
        • SEQadmin2
          New Genomics Technologies Take Aim at Long-Standing Limits
          by SEQadmin2


          Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

          We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
          ...
          09-28-2026, 10:25 AM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by SEQadmin2, 10-22-2026, 11:13 AM
        0 responses
        28 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 10-22-2026, 10:48 AM
        0 responses
        20 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 10-15-2026, 10:52 AM
        0 responses
        38 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 10-14-2026, 05:39 AM
        0 responses
        44 views
        0 reactions
        Last Post SEQadmin2  
        Working...