Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nickv
    Junior Member
    • Sep 2013
    • 2

    #1

    Completely renaming Fasta headers

    This may sound like a trivial question for most folks on this forum. Apologies, I a newbie.

    I have FASTA sequences from GenBank with unique sequence identifiers. For example, one looks something like this:

    >gi|74026815|gb|DQ107070.1| Feline immunodeficiency virus isolate Ac002pA3 pol protein (pol) gene, partial cds
    AGAGCAGATCCTAACAATCCCTGGAATACCCCTATATTTTGTATAAAGAAGAAATCAGGAAAATGGAGAATGTTAATAGATTTTAGAGAATTGAATGCAAAGACTGAGAAAGGAGCAGAAGTACAGTTAGGATTGCCTCA.....

    I would like to change the above header theoretically for all my sequences with names that are unique to where the sample was isolated. i.e.,

    >Yellowstone
    AGAGCAGATCCTAACAATCCCTGGAATACCCCTATATTTTGTATAAAGAAGAAATCAGGAAAATGGAGAATGTTAATAGATTTTAGAGAATTGAATGCAAAGACTGAGAAAGGAGCAGAAGTACAGTTAGGATTGCCTCA.....

    Is there a script out there that allows one to do this all simultaneously?

    Thank you kindly,
    Nick
  • rhinoceros
    Senior Member
    • Apr 2013
    • 372

    #2
    AFAIK, GenBank identifiers are not linked to geographical metadata, so unless you have the said data in e.g. a two column table (gi - location), no.
    Last edited by rhinoceros; 09-21-2013, 02:20 AM.
    savetherhino.org

    Comment

    • JamieHeather
      @jamimmunology
      • Nov 2012
      • 96

      #3
      Not sure if I understand, but if you already have separate fasta files that need renaming, something like this would do it:

      Code:
      sed 's/>.*/>Yellowstone/' INFILE.fa > OUTFILE.fa

      Comment

      • nickv
        Junior Member
        • Sep 2013
        • 2

        #4
        Thank you. To be more clear, I have 1 .fasta file with multiple sequence alignments. I want to rename all the headers with the names of certain geographical localities, depending on the isolates. Now that I am writing this, it doesn't seem possible.

        Kindly,
        Nick

        Comment

        • JamieHeather
          @jamimmunology
          • Nov 2012
          • 96

          #5
          Do you have the geographical data in some format?

          Comment

          • guptavipin142
            Member
            • Mar 2014
            • 12

            #6
            This seems a big trouble some time.
            I am also facing the same problem. I have 7.7 GB FQ file and want to rename their header completely.
            Pls suggest.

            Comment

            • JamieHeather
              @jamimmunology
              • Nov 2012
              • 96

              #7
              From what to what?

              Comment

              • guptavipin142
                Member
                • Mar 2014
                • 12

                #8
                i have illumina reads by name of
                >FCC1047ACXX:1:1101:1991:2224#GTTCGACA/1 1 1
                >FCC1047ACXX:1:1101:1991:2224#GTTCGACA/2 1 1
                I want to rename all these with "sequence 1"
                I am aligning these reads over to a genome using MUMMer but it is showing error
                Duplicate read....ignored.

                Pls suggest ....
                Thanks in advance....

                Comment

                • JamieHeather
                  @jamimmunology
                  • Nov 2012
                  • 96

                  #9
                  Are you sure you have a fastq file? IDs for a fastq should start with an '@' character. Yours appear to start with a '>', which is the format for fasta files.

                  I'm assuming you want to change each line to be numbered sequentially, not change them all to "sequence 1", as then they would all presumably count as duplicate reads?

                  These are all do-able using relatively simple commands (particularly sed and/or awk), but we just need to know exactly what it is you're trying to do to what before we can suggest some. Maybe if you give us a sample of what your data looks like now, and how you want it to look?

                  Comment

                  • guptavipin142
                    Member
                    • Mar 2014
                    • 12

                    #10
                    Yes Jamie you are right....
                    I have fasta sequences and they appear like this

                    >FCC1047ACXX:1:1101:1991:2224#GTTCGACA/1 1 1
                    AGAGCAGATCCTAACAATCCCTGGAATACCCCTATATTT
                    >FCC1047ACXX:1:1101:1991:2224#GTTCGACA/2 1 1
                    GAAATCAGGAAAATGGAGAATGTTAATAGATTTTAGAGAA

                    and i want to rename them like this

                    > sequence 1
                    AGAGCAGATCCTAACAATCCCTGGAATACCCCTATATTT

                    > sequence 2
                    GAAATCAGGAAAATGGAGAATGTTAATAGATTTTAGAGAA

                    Comment

                    • Brian Bushnell
                      Super Moderator
                      • Jan 2014
                      • 2709

                      #11
                      You can do that with BBTools.

                      bbrename.sh in=reads.fasta out=renamed.fasta prefix=sequence

                      But, note that your reads are paired and interleaved, so I suggest not remaining them "sequence_1" then "sequence_2", but rather "sequence_1 /1" and "sequence_1 /2" then "sequence_2 /1" and "sequence_2 /2", etc, which will keep the pairing information for downstream programs to use. To do that, you would just tell the tool that the reads are interleaved, like this:

                      bbrename.sh in=reads.fasta out=renamed.fasta prefix=sequence int=t

                      Comment

                      • guptavipin142
                        Member
                        • Mar 2014
                        • 12

                        #12
                        Hello Brian,

                        Can you also share the link for BBTools.

                        Thanks

                        Comment

                        • Brian Bushnell
                          Super Moderator
                          • Jan 2014
                          • 2709

                          #13
                          Certainly; it's here:

                          Download BBMap for free. BBMap short read aligner, and other bioinformatic tools. This package includes BBMap, a short read aligner, as well as various other bioinformatic tools. It is written in pure Java, can run on any platform, and has no dependencies other than Java being installed (compiled for Java 6 and higher).

                          Comment

                          Latest Articles

                          Collapse

                          • SEQadmin2
                            Beyond CRISPR/Cas9: Understand, Choose, and Use the Right Genome Editing Tool
                            by SEQadmin2



                            CRISPR/Cas9 sparked the gene editing revolution for both research and therapeutics.1 But this system still showed severe issues that limited its applications. The most prominent were the heavy reliance on PAM sequences, delivery limitations, double-stranded breaks that prompt unintended edits and cell death, and editing inefficiency (both in targeting and in knock-in reliability).

                            Despite this, “CRISPR helped turn genome editing from a specialized technique into
                            ...
                            07-31-2026, 11:01 AM
                          • SEQadmin2
                            Proteomic Platforms: How to Choose the Right Analytical Strategy to Improve Detection and Clinical Applications
                            by SEQadmin2


                            Proteomics platforms are evolving rapidly, with advances in mass spectrometry and affinity-based approaches expanding what researchers can detect and at what scale. As the field moves toward deeper proteome coverage and clinical applications, scientists face an increasingly complex landscape of tools. This article will explore how researchers are navigating these choices to find the right platform for their work.

                            The systematic characterization of the human proteome has
                            ...
                            07-20-2026, 11:48 AM

                          ad_right_rmr

                          Collapse

                          News

                          Collapse

                          Topics Statistics Last Post
                          Started by SEQadmin2, 08-11-2026, 10:35 AM
                          0 responses
                          11 views
                          0 reactions
                          Last Post SEQadmin2  
                          Started by SEQadmin2, 08-06-2026, 07:41 AM
                          0 responses
                          30 views
                          0 reactions
                          Last Post SEQadmin2  
                          Started by SEQadmin2, 08-03-2026, 10:13 AM
                          0 responses
                          48 views
                          0 reactions
                          Last Post SEQadmin2  
                          Started by SEQadmin2, 07-31-2026, 02:55 AM
                          0 responses
                          48 views
                          0 reactions
                          Last Post SEQadmin2  
                          Working...