Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • Download BOLD sequences with R and remove duplicates

    Hello,

    I am using the package bold in R to download COI sequences from BOLD and specifying the taxon of interest and the marker like this:

    bold_seq(taxon='Chironomidae', marker='COI-5P', response=TRUE) as well as
    bold_seq(taxon = 'Chironomidae', marker = "COX1", response = TRUE)

    for which I get a fasta file. When I tried to format a database in BLAST (makeblastdb) using this file I got an error that duplicate IDs were present. I looked inside the fasta and found that the duplicates
    were sequences of the same organism one from COI-5P and another from CAD, for example:

    >CHRSV056-08|Cricotopus glacialis|CAD
    CTGGCGTCAAAAGTATAAGCTCGCTGAGTGGATGAAGAAGCACAACGTCGTTGGAATCAGTGGAATTGACACC...
    >CHRSV056-08|Cricotopus glacialis|COI-5P|KC130785
    AACATTATATTTTATTTTCGGGGCTTGATCAGGGATAGTAGGAACTTCCTTAAGAATCTTAATTCGAGCTGAA...

    and there's plenty of them. I can't removed them all one by one. There's like 160k sequences in this file.
    Any idea how I can remove duplicate ID+seq from the fasta file or any way to fix the R comand to avoid getting sequences from other genes?
    thanks

  • #2
    You could replace the spaces in the names with an underscore and see if that gets you past the "duplicate" name problem.

    Code:
    $ sed 's/ /\_/g' your_file > new_file
    The example you posted has "duplicate" names since makeblastdb stops at the first space it encounters in the name. The sequences themselves are not duplicates.
    Last edited by GenoMax; 06-24-2015, 01:23 PM.

    Comment


    • #3
      Hello,

      if I understand correctly, if I replaced the spaces with an _ using sed, wouldnt this happen on all the IDs and basically end up with duplicate IDs again only with underscores?
      Yes, the sequences are not the same (different genes) so a "duplicate sequence" removal wouldnt work because they are not really duplicates.
      Maybe a command that can look up the IDs and remove the ones with CAD? Is there something like that? But it should take the sequence out too..

      Comment


      • #4
        So you are saying that for each entry there is a CAD and a COI-5P. If you just want to take out all entries with "CAD" then something simple like

        Code:
        $ cat your_file | grep -A 1 "COI-5P" > new_file
        should work, as long as your file has sequences that don't wrap around on multiple lines.

        BTW: With the two line example you posted "makeblastdb" did not generate an error for me.

        Comment

        Latest Articles

        Collapse

        • seqadmin
          Essential Discoveries and Tools in Epitranscriptomics
          by seqadmin




          The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist...
          04-22-2024, 07:01 AM
        • seqadmin
          Current Approaches to Protein Sequencing
          by seqadmin


          Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
          04-04-2024, 04:25 PM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by seqadmin, 04-25-2024, 11:49 AM
        0 responses
        19 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-24-2024, 08:47 AM
        0 responses
        19 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-11-2024, 12:08 PM
        0 responses
        62 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-10-2024, 10:19 PM
        0 responses
        60 views
        0 likes
        Last Post seqadmin  
        Working...
        X