Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • Rename fastq seq ID with unique identifier

    Hi everyone,
    I have a problem, my solid data do not have unique identifier and I'm afraid it could be a problem at some point in the analysis.

    I would like to rename every fastq sequence with an unique identifier

    @Indx_1 - @Indx-10000000 etc

    now they are labelled: @1_5_1645_F3

    I'm a newbie in bioinformatics and wanted to try with awk but wasn't sure how to deal with the @ beeing also inside the qualities (in ASCII). And the fastx tool just renumber but do not give the possibility to add an identifier...

    Any ideas?

    Thank

    Have a nice evening

  • #2
    While this can certainly be done with standard awk, bioawk, makes it a bit easier:

    Code:
    awk -c fastx '{printf("@Indx-%d\n%s\n+\n%s\n",cnt++,$seq,$qual)}' old.fastq > new.fastq
    ...on reflection, this isn't too hard using standard awk...

    Code:
    awk '{if( (NR-1)%4 ) print; else printf("@Indx-%d\n",cnt++)}' old.fastq > new.fastq
    ...this depends on the first entry starts on the first line, and following entries occur every four lines after that.

    Comment


    • #3
      Try something like this ...
      cat file.fq | awk '{if ((p%4)==0) print "@whatev_"p;else print $0;p++}'

      If you're repairing paired data, you will lose the pairs. sadly.

      (edit: alex beat me to it)

      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 on Modified Bases...
        Today, 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, 04-11-2024, 12:08 PM
      0 responses
      37 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-10-2024, 10:19 PM
      0 responses
      41 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-10-2024, 09:21 AM
      0 responses
      35 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-04-2024, 09:00 AM
      0 responses
      54 views
      0 likes
      Last Post seqadmin  
      Working...
      X