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
        Investigating the Gut Microbiome Through Diet and Spatial Biology
        by seqadmin




        The human gut contains trillions of microorganisms that impact digestion, immune functions, and overall health1. Despite major breakthroughs, we’re only beginning to understand the full extent of the microbiome’s influence on health and disease. Advances in next-generation sequencing and spatial biology have opened new windows into this complex environment, yet many questions remain. This article highlights two recent studies exploring how diet influences microbial...
        02-24-2025, 06:31 AM
      • seqadmin
        Quality Control Essentials for Next-Generation Sequencing Workflows
        by seqadmin




        Like all molecular biology applications, next-generation sequencing (NGS) workflows require diligent quality control (QC) measures to ensure accurate and reproducible results. Proper QC begins at nucleic acid extraction and continues all the way through to data analysis. This article outlines the key QC steps in an NGS workflow, along with the commonly used tools and techniques.

        Nucleic Acid Quality Control
        Preparing for NGS starts with isolating the...
        02-10-2025, 01:58 PM

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by seqadmin, 03-03-2025, 01:15 PM
      0 responses
      151 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 02-28-2025, 12:58 PM
      0 responses
      229 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 02-24-2025, 02:48 PM
      0 responses
      599 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 02-21-2025, 02:46 PM
      0 responses
      262 views
      0 likes
      Last Post seqadmin  
      Working...
      X