Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cdlam
    Junior Member
    • Oct 2012
    • 7

    #1

    Concatenating Sequences Within a single Fasta File

    Hi all,
    I need to concatenate a bunch of sequences in a FASTA file. I have a file of extracted introns and would like to essentially splice them all together for use in a program. Is there any way to do either of these using perl (preferably) or python (if necessary):

    1. Join all the introns of a single gene, preserving the FASTA heading for that gene.

    > Gene 1 Intron 1
    GTACGCC....CTGATAGAG
    >Gene 1 Intron 2
    GTCCAGGAC.....CTGAGTAAG

    Becomes
    > Gene 1 Intron 1
    GTACGCC....CTGATAGAGGTCCAGGAC.....CTGAGTAAG

    or
    2. Join a number of introns together (not accounting for what genes they came from) under a non-specific FASTA formatted heading?

    Basically I want to splice together a bunch of intron sequences like they were exons so that I can run them through a program that doesn't like how short they are. The first way would be the most biologically relevant and useful for my purposes, but if it can't be done I can live with it haha. Any help would be greatly appreciated. Thanks a lot!
  • westerman
    Rick Westerman
    • Jun 2008
    • 1104

    #2
    I don't think that there is a program out there that will do what you want. In part this is because FastA headers are not standardized. Basically all you need for FastA is the '>'. So it would be hard to create a general purpose program that would combine FastA sequences together based on some regular yet arbitrary criteria. That said it would be trivial (for a programmer, at least) to create a one-shot specific program that would do the combining.

    Now that I think of it, such an program would be a good one to give to a beginning programmer. Straight-forward yet not so trivial as to be boring.
    Last edited by westerman; 12-04-2012, 07:54 AM. Reason: Added words, "one-shot specific"

    Comment

    • JackieBadger
      Senior Member
      • Mar 2009
      • 385

      #3
      A little fiddly but you can use the text manipulation tool in Galaxy.

      Convert your fastas to tabula formats....and use the cut column and paste files side by side to get your sequences in the same file.... you can then merge columns and convert back to fast

      Comment

      • westerman
        Rick Westerman
        • Jun 2008
        • 1104

        #4
        Jackie: I'll agree that conversion to tabular is a good first step -- and this can be done via the command line as well using the FastX tools -- but I don't see how a merger could be done automatically. Let's say after the conversion I have

        Gene 1 Intron 1 <tab> GTACGCC....CTGATAGAG
        Gene 1 Intron 2 <tab> GTCCAGGAC.....CTGAGTAAG
        Gene 2 Intron 1 <tab> sequence
        Gene 3 Intron 1 <tab> sequence
        Gene 3 Intron 2 <tab> sequence
        Gene 3 Intron 3 <tab> sequence
        etc.

        How to pull all of the Gene1, Gene2, Gene3, etc. sequences together without some programming? I'm not familiar enough with Galaxy to follow your "cut column and paste files" suggestion but if it is anything like the normal Unix 'cut' and 'paste' commands then I just don't see how to do the cut'n'paste automatically.

        Perhaps if the tabular file becomes:

        Gene<tab>1<tab>Intron<tab>1<tab>Sequence
        Gene<tab>1<tab>Intron<tab>2<tab>Sequence
        etc.

        Then maybe cut'n'paste would work.

        Comment

        Latest Articles

        Collapse

        • SEQadmin2
          Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
          by SEQadmin2



          Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

          Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
          ...
          10-14-2026, 09:55 AM
        • SEQadmin2
          New Genomics Technologies Take Aim at Long-Standing Limits
          by SEQadmin2


          Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

          We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
          ...
          09-28-2026, 10:25 AM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by SEQadmin2, 10-22-2026, 11:13 AM
        0 responses
        26 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 10-22-2026, 10:48 AM
        0 responses
        20 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 10-15-2026, 10:52 AM
        0 responses
        36 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 10-14-2026, 05:39 AM
        0 responses
        43 views
        0 reactions
        Last Post SEQadmin2  
        Working...