Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • How can I do this kind of filtering

    Hi I have a fasta file, sequence like this. Basically, it is an annotated files the sequences name include fuction name, and organism.

    I want to do this kind of filtering.

    1> extract the sequence name ("mgm4510423.3|contig02227|RefSeq|73954f841ecd7c512c5428ed1b1a747e accession=[NP_559375.1],function=[carbamate kinase],organism=[Pyrobaculum aerophilum str. IM2]")to a text file. I would be better to separate by comma. That is, make three columns. ID, function and organism.

    2> After I create the upper text file. I can choose the organism that I want to keep. Filter the fasta files, so I will get all the sequences that I need for particular organisms.

    Any software or Unix command like grep /awk can do this.

    Code:
    >mgm4510423.3|contig02227|RefSeq|73954f841ecd7c512c5428ed1b1a747e accession=[NP_559375.1],function=[carbamate kinase],organism=[Pyrobaculum aerophilum str. IM2]
    AAGAAACGTCGACGTAGCCGCCAGAGTCGTGGCAGGGgTAATGCAGGGAGGCCACCAGGTGGTGGTGACGCACGGCAACGGGCCCCAGGTGGGCTACCTGGCGgAGTTGCaGAgaGACAACGGCACATTTCGGCTGGACGCCCTAAACGCCATGACGCaGGGgATGCTCGGCTACTTCCTTGTCTCTGCGCTTGATAAATACTTAGGCAGGGGGAGGGCCGCGGCTTTGGTGACCAGAGTCGAGGTGGACTGCGACGACCCGGCTTTTaaagaCCCGACcAAGTTCATAGGTCCCCTATACGGCAAGGAaCaGgCTGAGGCCCTCGCACAGAGGTACGGGTGGCAGTTTAGGCAAGACCCAAGAGGAGGCTGGCgtCGCGTCGTCGCGTCGCCTACGCCGCTCAGAAtcGTGGAGATAGAGGCCGTAAAGaGGTTGCTGgACGCGgGTTTCGTCGTTGTGGCGgCGGGCGGCGGCGGTaTACCGCTCTGCGGAGACAGAgaCGTAGAGGGGGTTATAGACAAGGACTTGGCCTCTTCTCTCCTCGCTGTGGAGCTCGGCGCGGACTTCTTCATGATGCTGACCGACATAGACGCCGTCTACCTAAACTACGGGAaGCCGAACCAGAGGAGGCTAGACAGCGTAGGGGCTGACGAGCTGGAGAGGTATTTCGCCGAtGGCcACTTCCCGCCGGGCTCCATGGGGCCGAAGGTGCAGGCCGCGATAAACTTCGTGAAacAAAcGGggaGAaGGGCGGCCATCGGGGCGCTGGAGGAGGGCTAtGACGtGTTCAGGGGAATAAAGGGGACCCAGGTgACGCCTTAGAGCTCGTTTATTGGCTTTTCGTATTCCTCCCTcTtCtGGAGGTCTCGgATCTTgACTACGCCGCGCTCCAGCTCTTTCTTGCCGATTATGATTAGGtACCGCGTGCCTATCTTCAAGATGTATTCAAAGGCCTcTTTtAGGCTTTTCTCGCCCAGCTCCACAGCCACGCTGAAGCCTGCGCTCCTCAGCTTCTtcGCAACTGCCACGGCCTGCGGGTACGCCTCgTCGTCGAAGATGTAGATGTAGTAGTCCAGCGGCTTCTCCACGTTGTGGAGCCCcACGgCCTCcATAAACcTCTCAACGCCGATGGCGAaCCCCAGCGCCGgCGtCtttACGCCGCTGTAGAGCT
    Last edited by Brian Bushnell; 02-23-2017, 08:45 AM.

  • #2
    grep "^>" your_fasta > headers.txt
    Gives you the headers

    If your entire sequence is in one line, you can use

    grep -A 1 "Pyrobaculum aerophilum str. IM2" > paerophilum.fasta
    to select all sequences belonging to that organism.

    Comment


    • #3
      for the 2nd question. Is it possible to filter it by column? Let's say I have column list all the name of organism that I want to extract.

      Comment


      • #4
        You can try this

        for organism in `cat your_organisms.txt`;do grep -A 1 -w $organism your_fasta.fa > $organism.fa;done

        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