Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • Renaming of Fasta headers according to their container name

    Hi there,
    i am a somewhat beginner in bioinformatics, so please apologize if i am asking any silly questions.

    I do have several dozens of files containing millions of processed illumina reads. The sequences have already been converted to fasta format.
    Now i want to bin all my files into a single file, in order to have a uniform OTU nomenclature (i want to feed my otu picker with a single file).
    I will use a normal cat command for merging all my files.
    However, i cant think of commands, that
    a) add an additional character (the number of sample) to any fasta header in the file
    b) later on, after OTU picking, sort all sequences containing that same identifier into a new file.

    I cant use the barcode information in the header, because several barcodes have been used multiple times.

    Any idea? Thank you very much!

  • #2
    I would check the FastX toolskit, which has a renamer-tool in it: http://hannonlab.cshl.edu/fastx_tool...mmandline.html.

    Edit: http://www.biostars.org/p/68477/ has more options for renaming headers.

    Comment


    • #3
      If all of your samples are in separate files, then you can use a simple sed command to add sample info to the fasta header for each sequence in a file as follows:

      Code:
       sed 's/^>/>SampleA/g' INFILE.fasta>OUTFILE.fasta
      That will add SampleA to the header for all sequences in the file, and you can just repeat that command for as many files/samples as you have.

      For your second task, you can use a grep command as follows:

      Code:
       grep -a1 '^>SampleA' INFILE.fasta>OUTFILE.fasta
      That will find all lines in your concatenated file that begin with >SampleA, and then print that line and the following line (the sequence) into a new file. Again, you would have to execute the grep command for each different sample to produce a fasta file for each.

      All of that is quite a lot of work, even if you shell script it, so you might want to take advantage of some of the scripts that are a part of the QIIME package, most importantly add_qiime_labels.py which takes a folder of fasta files and a sample mapping file and adds sample IDs to the fasta headers and concatenates the output into one file.

      Comment

      Latest Articles

      Collapse

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

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by seqadmin, 04-11-2024, 12:08 PM
      0 responses
      30 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-10-2024, 10:19 PM
      0 responses
      32 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-10-2024, 09:21 AM
      0 responses
      28 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-04-2024, 09:00 AM
      0 responses
      53 views
      0 likes
      Last Post seqadmin  
      Working...
      X