Unconfigured Ad

Collapse
X
 
  • Filter
  • 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
                          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.
                          ...
                          Yesterday, 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:04 AM
                        0 responses
                        10 views
                        0 reactions
                        Last Post SEQadmin2  
                        Started by SEQadmin2, 07-08-2026, 10:08 AM
                        0 responses
                        7 views
                        0 reactions
                        Last Post SEQadmin2  
                        Started by SEQadmin2, 07-07-2026, 11:05 AM
                        0 responses
                        12 views
                        0 reactions
                        Last Post SEQadmin2  
                        Started by SEQadmin2, 07-02-2026, 11:08 AM
                        0 responses
                        31 views
                        0 reactions
                        Last Post SEQadmin2  
                        Working...