Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SDPA_Pet
    Senior Member
    • Apr 2013
    • 222

    #1

    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.
  • vivek_
    PhD Student
    • Jul 2012
    • 164

    #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

    • SDPA_Pet
      Senior Member
      • Apr 2013
      • 222

      #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

      • vivek_
        PhD Student
        • Jul 2012
        • 164

        #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

        • 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
          ...
          Yesterday, 10:25 AM
        • SEQadmin2
          How Immunogenomics Decodes Immunity’s Genetic Blueprint
          by SEQadmin2




          The immune system’s power comes from its genetic diversity, allowing myriad threats to be neutralized through first recognizing foreign antigens. That diversity is also what makes the immune system so difficult to study. Recent advances in sequencing technology and computational biology, however, are giving researchers new tools to understand immune responses and immune-related diseases in greater detail.

          This convergence of genetics, immunology, and computation...
          09-01-2026, 05:41 AM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by SEQadmin2, 09-25-2026, 09:06 AM
        0 responses
        29 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 09-23-2026, 11:05 AM
        0 responses
        24 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 09-18-2026, 11:37 AM
        1 response
        46 views
        0 reactions
        Last Post pekgio
        by pekgio
         
        Started by SEQadmin2, 09-16-2026, 10:23 AM
        1 response
        55 views
        0 reactions
        Last Post pekgio
        by pekgio
         
        Working...