Seqanswers Leaderboard Ad

Collapse

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
          Essential Discoveries and Tools in Epitranscriptomics
          by seqadmin




          The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist...
          04-22-2024, 07:01 AM
        • seqadmin
          Current Approaches to Protein Sequencing
          by seqadmin


          Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
          04-04-2024, 04:25 PM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by seqadmin, Today, 08:47 AM
        0 responses
        11 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-11-2024, 12:08 PM
        0 responses
        60 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-10-2024, 10:19 PM
        0 responses
        59 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-10-2024, 09:21 AM
        0 responses
        54 views
        0 likes
        Last Post seqadmin  
        Working...
        X