Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • Recover only longest version of sequence from multiple sequence fasta file - help

    Greetings,
    I have a large list of fasta sequences (not paired end) from which I want to isolate the longest version of each "sequence" (obviously the longest one has a different sequence). For example:

    input.fa:
    >Seq_1
    AAACCCGGGTTT

    Seq_2
    CCCGGG

    output_keep.fa:
    >Seq_1
    AAACCCGGGTTT

    output_ditch.fa:
    >Seq_2
    CCCGGG

    I tried a number of approaches using a mock dataset containing mismatches, exact copies, and known truncations from either end of the long form - "test_dups.fa":

    (1) dedupe.sh in SAMtools
    dedupe.sh test_dups.fa test_dups_dedupe.fa outd=test_dups_removed.fa

    this didn't work: its output didn't make sense, and an exact duplicate pair was removed completely (didn't leave behind one of them, which is bad news).

    (2) with the ac=f option
    dedupe.sh test_dups.fa test_dups_dedupe.fa outd=test_dups_removed.fa ac=f

    that only removed the exact copy pair, again not leaving one copy in file.

    (3) clustering by overlap
    dedupe.sh test_dups.fa test_dups_dedupe.fa outd=test_dups_removed.fa ac=f mo=50 c pc csf=stats.txt outbest=test_best.fa mcs=1

    didn't work (retained were not longest examples).

    Then I moved on to VSEARCH, to sort by size, then form clusters and output the "seed":

    (4) vsearch clustering
    --cluster_fast dups.fa --centroids test_unique_1.0.fa --id 1.0
    oddly, this kept a truncation of the longest sequence, but was close...

    (5) using the iddef = 0, to ignore end gaps
    vsearch --cluster_fast dups.fa --centroids test_unique_1.0.fa --id 1.0 --iddef 0

    this did not ignore the end gaps penalties as expected.

    (6) Align two seqs and see what the perceived idenity is
    vsearch --allpairs_global dups_9_10.fa --acceptall --alnout test_aln.fa --iddef 0

    the resulting alignment shows 100% identity, as expected with the iddef 0 option.

    Why are those sequences not in the same cluster then?

    Searching for help on "remove duplicates" is a disaster here, so I hope I can get some help. One consideration is to merge the sequences with 100% identity for the "overlap", but those tools merge from one end of the read, as is used to combine paired end reads. The other consideration is spending a day writing a script. I reasoned I can not be the first person to do this.

  • #2
    What I will do is to write my own script to
    1) blastn the sequences against itself (hopefully your sequences are long enough to justify using blast)
    2) filter the results to remove blastn results of the same sequences and min e-value
    3) Do single linkage clustering based on the blastn results
    4) Choose the longest sequence for each cluster

    There should be an easier way by using k-mer?!

    Comment


    • #3
      have you tried CD-hit?

      Comment

      Latest Articles

      Collapse

      • noor121
        Reply to Latest Developments in Precision Medicine
        by noor121
        Qadri offers efficient online services designed for students and staff of University Targu Mures Medical Campus Hamburg. We streamline your academic and administrative processes for a hassle-free experience.

        VIsit us:
        https://qadri-international.com/univ...s-hamburg-umch...
        Today, 09:33 PM
      • seqadmin
        Non-Coding RNA Research and Technologies
        by seqadmin




        Non-coding RNAs (ncRNAs) do not code for proteins but play important roles in numerous cellular processes including gene silencing, developmental pathways, and more. There are numerous types including microRNA (miRNA), long ncRNA (lncRNA), circular RNA (circRNA), and more. In this article, we discuss innovative ncRNA research and explore recent technological advancements that improve the study of ncRNAs.

        Nobel Prize for MicroRNA Discovery
        This week,...
        Yesterday, 08:07 AM
      • seqadmin
        Recent Developments in Metagenomics
        by seqadmin





        Metagenomics has improved the way researchers study microorganisms across diverse environments. Historically, studying microorganisms relied on culturing them in the lab, a method that limits the investigation of many species since most are unculturable1. Metagenomics overcomes these issues by allowing the study of microorganisms regardless of their ability to be cultured or the environments they inhabit. Over time, the field has evolved, especially with the advent...
        09-23-2024, 06:35 AM

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by seqadmin, 10-02-2024, 04:51 AM
      0 responses
      96 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 10-01-2024, 07:10 AM
      0 responses
      107 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 09-30-2024, 08:33 AM
      1 response
      109 views
      0 likes
      Last Post EmiTom
      by EmiTom
       
      Started by seqadmin, 09-26-2024, 12:57 PM
      0 responses
      20 views
      0 likes
      Last Post seqadmin  
      Working...
      X