Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

  • #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


    • #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


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

        Best Regards
        Zillur

        Comment

        Latest Articles

        Collapse

        • seqadmin
          Advanced Methods for the Detection of Infectious Disease
          by seqadmin




          The recent pandemic caused worldwide health, economic, and social disruptions with its reverberations still felt today. A key takeaway from this event is the need for accurate and accessible tools for detecting and tracking infectious diseases. Timely identification is essential for early intervention, managing outbreaks, and preventing their spread. This article reviews several valuable tools employed in the detection and surveillance of infectious diseases.
          ...
          11-27-2023, 01:15 PM
        • seqadmin
          Strategies for Investigating the Microbiome
          by seqadmin




          Microbiome research has led to the discovery of important connections to human and environmental health. Sequencing has become a core investigational tool in microbiome research, a subject that we covered during a recent webinar. Our expert speakers shared a number of advancements including improved experimental workflows, research involving transmission dynamics, and invaluable analysis resources. This article recaps their informative presentations, offering insights...
          11-09-2023, 07:02 AM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by seqadmin, Today, 08:23 AM
        0 responses
        7 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 12-01-2023, 09:55 AM
        0 responses
        21 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 11-30-2023, 10:48 AM
        0 responses
        20 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 11-29-2023, 08:26 AM
        0 responses
        15 views
        0 likes
        Last Post seqadmin  
        Working...
        X