Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dpryan
    Devon Ryan
    • Jul 2011
    • 3478

    #16
    Edit: I should have refreshed before posting, Maubp's suggestion is probably easier!

    You might be able to just use grep (grep -v -f ids.file ...), though you might have to collapse the read name and sequence onto one line (with awk) first, then pipe that into grep and pipe the output back to awk to split things back again.
    Last edited by dpryan; 07-25-2013, 01:34 AM. Reason: Too slow

    Comment

    • flacchy
      Member
      • Apr 2013
      • 33

      #17
      thank you ...
      but could you please be a little more specific ... I am very new to this field and I am still learning... also I have to consider if using the splitted files or if I can use my big file (which contain ~20 mil reads)...

      Thanks in advance for every advice and suggestion

      Comment

      • flacchy
        Member
        • Apr 2013
        • 33

        #18
        so grep is not working..or at least not in this case... so I'll try to explain better...

        1. I have a fasta file splitted (each file contain 3 mil reads) with line like this:
        >D3P26HQ1:180:c0yj8acxx:4:2208:3279:56003 1:N:0:TGTCAA
        CCTCACCAGCCGCACGAACACGCCCCCGCTGAGCAAGCATCCCGTGGCGTCAGCGGATGAGCGACGCGGAGACAGCACCTGACCCATGTTGATGTAGTGT
        >D3P26HQ1:180:c0yj8acxx:4:1108:21179:84973 1:N:0:AGACCA
        CACGTCTGAACTCCAGTCACACAGTGATCTCGTATGCCGTCTTCTGCTTGAAAAAAAAAAGAAAGAAAGAAGAAACAGTGGGAGAGTGGGGGGGACGGAG
        >D3P26HQ1:180:c0yj8acxx:4:2103:16692:4396 1:N:0:TGTCAA
        GATCGGAAGAGCACACGTCTGAACTCCAGTCACAGTCAAATCTCGTATGCCGTCTTCTGCTTGAAAAAAAAACAACACCAAAAAGGTGAAGAGATCGATA
        >D3P26HQ1:180:c0yj8acxx:4:2307:9878:25361 1:N:0:GGCTAA
        ACAGCAATAACTGTGCCGCCATCGTCAGAATATTGGCGGGCGATTTTCATGATTTGAATTTTGTGACGAATATCTAAGCTTGAGATTGGCTAGATCTGAA

        2. a txt file with ID's of reads I want to remove
        D3P26HQ1:180:c0yj8acxx:4:2316:9843:31035
        D3P26HQ1:180:c0yj8acxx:4:2316:9844:63006
        D3P26HQ1:180:c0yj8acxx:4:2316:9885:5144
        D3P26HQ1:180:c0yj8acxx:4:2316:9888:45894
        D3P26HQ1:180:c0yj8acxx:4:2316:9914:29032

        What I want to do is remove all the reads that have the ID's presents into the txt file.

        Can anyone help me sort this out???

        thanks!!!!!

        Comment

        • dpryan
          Devon Ryan
          • Jul 2011
          • 3478

          #19
          It'll be easier for you to use the python script that maubp linked to.

          Comment

          • rhinoceros
            Senior Member
            • Apr 2013
            • 372

            #20
            I usually use filter_fasta.py from QIIME for this purpose..
            savetherhino.org

            Comment

            • flacchy
              Member
              • Apr 2013
              • 33

              #21
              Thanks rhinoceros... that sounds nice.. but instead of keeping the sequence in the list can I just discard them?? or create two files one with the kept reads and one with the discarded???

              filter_fasta.py -f inseqs.fasta -o list_filtered_seqs.fasta -s seqs_to_keep.txt

              Comment

              • rhinoceros
                Senior Member
                • Apr 2013
                • 372

                #22
                Originally posted by flacchy View Post
                Thanks rhinoceros... that sounds nice.. but instead of keeping the sequence in the list can I just discard them?? or create two files one with the kept reads and one with the discarded???

                filter_fasta.py -f inseqs.fasta -o list_filtered_seqs.fasta -s seqs_to_keep.txt
                filter_fasta.py -f inseqs.fasta -o list_filtered_seqs.fasta -s seqs_to_keep.txt
                filter_fasta.py -f inseqs.fasta -o list_filtered_seqs.fasta -s seqs_to_remove.txt -n


                Note, it's not a standalone solution but has dependencies so you need to have qiime installed (which is highly recommended because there's a ton of other useful stuff too)..
                Last edited by rhinoceros; 07-25-2013, 06:06 AM.
                savetherhino.org

                Comment

                • flacchy
                  Member
                  • Apr 2013
                  • 33

                  #23
                  Thanks so so much... I'll try ... just one more thing... I know I am a bit of a pain but I've seriously started 3 months ago and there are tons of things I need to learn...

                  could I only use this: filter_fasta.py -f inseqs.fasta -o list_filtered_seqs.fasta -s seqs_to_remove.txt -n???
                  and have my clean file with only the reads that are not presents in the ID list???

                  Comment

                  • rhinoceros
                    Senior Member
                    • Apr 2013
                    • 372

                    #24
                    Originally posted by flacchy View Post
                    Thanks so so much... I'll try ... just one more thing... I know I am a bit of a pain but I've seriously started 3 months ago and there are tons of things I need to learn...

                    could I only use this: filter_fasta.py -f inseqs.fasta -o list_filtered_seqs.fasta -s seqs_to_remove.txt -n???
                    and have my clean file with only the reads that are not presents in the ID list???
                    Yes, but like I said, the script is not standalone but relies on other qiime stuff so you need to have that installed. If you happen to be on Mac OS X, I highly recommend Macqiime, which is very painless to install..
                    savetherhino.org

                    Comment

                    • flacchy
                      Member
                      • Apr 2013
                      • 33

                      #25
                      we do have quiime installed into the biolinux platform

                      Comment

                      • flacchy
                        Member
                        • Apr 2013
                        • 33

                        #26
                        Oh my THANK YOU so so much rhinocheros it did work!!!!!! ^_^

                        Comment

                        Latest Articles

                        Collapse

                        • 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...
                          Today, 05:41 AM
                        • 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

                        ad_right_rmr

                        Collapse

                        News

                        Collapse

                        Topics Statistics Last Post
                        Started by SEQadmin2, 08-24-2026, 10:32 AM
                        0 responses
                        42 views
                        0 reactions
                        Last Post SEQadmin2  
                        Started by SEQadmin2, 08-20-2026, 11:17 AM
                        0 responses
                        48 views
                        0 reactions
                        Last Post SEQadmin2  
                        Started by SEQadmin2, 08-18-2026, 10:05 AM
                        0 responses
                        55 views
                        0 reactions
                        Last Post SEQadmin2  
                        Started by SEQadmin2, 08-13-2026, 12:22 PM
                        0 responses
                        50 views
                        0 reactions
                        Last Post SEQadmin2  
                        Working...