Unconfigured Ad

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

    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
          Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
          by SEQadmin2



          Genomics studies in neuroscience face a special challenge due to the brain’s complexity and scarcity of samples. Mapping changes in cell type and state using conventional next-generation sequencing methods remains challenging. Advances in technologies like single-cell sequencing, spatial transcriptomics, and long-read sequencing have opened the door to deeper studies of the brain and diseases like Alzheimer’s, amyotrophic lateral sclerosis (ALS), and schizophrenia.
          ...
          07-09-2026, 11:10 AM
        • SEQadmin2
          Cancer Drug Resistance: The Lingering Barrier to Rising Survival
          by SEQadmin2



          Cancer survival rates have significantly increased in the last few decades in the United States, reaching a combined 70% 5-year survival rate by 2021. Behind this number, there are years of research to find new therapies, drug targets, and early detection methods. But there is one core challenge that keeps slowing down these advances, and it’s about drug resistance.

          There is no single reason why many patients don’t respond to treatment as expected. Cancer is...
          07-08-2026, 05:17 AM
        • GATTACAT
          Reply to Nine Things a Sample Prep Scientist Thinks About Before Sequencing
          by GATTACAT
          Love this - good data definitely starts from good input, and poor input can only give relatively poor data. I particularly like the mention of Nanodrop/absorbance based methods for quantification. It's such a toss up if you'll get an accurate reading or what amounts to a randomly generated number, and a lot of library/sequencing related issues can be traced back to poor quant.
          07-01-2026, 11:43 AM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by SEQadmin2, Yesterday, 10:26 AM
        0 responses
        15 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 07-09-2026, 10:04 AM
        0 responses
        28 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 07-08-2026, 10:08 AM
        0 responses
        16 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 07-07-2026, 11:05 AM
        0 responses
        33 views
        0 reactions
        Last Post SEQadmin2  
        Working...