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
        Strategies for Sequencing Challenging Samples
        by seqadmin


        Despite advancements in sequencing platforms and related sample preparation technologies, certain sample types continue to present significant challenges that can compromise sequencing results. Pedro Echave, Senior Manager of the Global Business Segment at Revvity, explained that the success of a sequencing experiment ultimately depends on the amount and integrity of the nucleic acid template (RNA or DNA) obtained from a sample. “The better the quality of the nucleic acid isolated...
        03-22-2024, 06:39 AM
      • seqadmin
        Techniques and Challenges in Conservation Genomics
        by seqadmin



        The field of conservation genomics centers on applying genomics technologies in support of conservation efforts and the preservation of biodiversity. This article features interviews with two researchers who showcase their innovative work and highlight the current state and future of conservation genomics.

        Avian Conservation
        Matthew DeSaix, a recent doctoral graduate from Kristen Ruegg’s lab at The University of Colorado, shared that most of his research...
        03-08-2024, 10:41 AM

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by seqadmin, Yesterday, 06:37 PM
      0 responses
      8 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, Yesterday, 06:07 PM
      0 responses
      8 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 03-22-2024, 10:03 AM
      0 responses
      49 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 03-21-2024, 07:32 AM
      0 responses
      66 views
      0 likes
      Last Post seqadmin  
      Working...
      X