Git Product home page Git Product logo

vsearch's People

Contributors

angrybee avatar colinbrislawn avatar davidealbanese avatar emollier avatar frederic-mahe avatar mys721tx avatar nielsonj avatar peterjc avatar pschloss avatar torognes avatar wasade avatar wwood avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vsearch's Issues

API

Add a (Cython) API for the core functions of vsearch.

maxuniquesize option for dereplication

There is a minuniquesize option:

--minuniquesize positive integer
discard sequences with an abundance value smaller than integer.

Maybe the opposite option (maxuniquesize) would be useful?

Documentation

A man page and other documentation should be created. As for now, the online USEARCH documentation is useful, but VSEARCH should not be dependent on it.

Should T and U be considered as identical during dereplication?

When aligning sequences during searching and clustering, T and U are considered identical, regardless of
their case. During dereplication, T and U are treated as different. Should we harmonize that behavior? T and U treated as identical in every situation?

When searching a database against itself, sequence labels are not truncated correctly

On a database of sequences with labels structured as such: >sequenceID taxonomy, it seems that the query receives the full fasta header while the target is truncated correctly when using --self. That leads to incorrect results where a query is aligned with itself. The option --selfid yields the correct result (no alignment of a query against itself).

${VSEARCH} \
    --vsearch_global "${SUBJECTS}" \
    --db "${SUBJECTS}" \
    --self \
    --id 0.5 \
    --blast6out results.blast6

head -n 3 results.blast6

chout1 Eukaryota|Alveolata|Dinophyta|Dinophyceae|Suessiales|Suessiaceae|Gymnodinium|simplex|simplex_X   chout1  100.0   162 0   0   1   162 1   162 *   *
chout2 Eukaryota|Alveolata|Dinophyta|Dinophyceae|Suessiales|Suessiaceae|Polarella|glacialis|glacialis_X chout2  100.0   234 0   0   1   234 1   234 *   *
chout20 Eukaryota|Alveolata|Dinophyta|Dinophyceae|Peridiniales|Peridiniales_X|Heterocapsa|sp|sp_X   chout20 100.0   229 0   0   1   229 1   229 *   *


${VSEARCH} \
    --vsearch_global "${SUBJECTS}" \
    --db "${SUBJECTS}" \
    --selfid \
    --id 0.5 \
    --blast6out results.blast6

head -n 3 results.blast6

chout1 Eukaryota|Alveolata|Dinophyta|Dinophyceae|Suessiales|Suessiaceae|Gymnodinium|simplex|simplex_X   chvA18  50.7    148 70  1   1   162 1   148 *   *
chout2 Eukaryota|Alveolata|Dinophyta|Dinophyceae|Suessiales|Suessiaceae|Polarella|glacialis|glacialis_X chout21 63.9    241 58  8   1   234 1   235 *   *
chout20 Eukaryota|Alveolata|Dinophyta|Dinophyceae|Peridiniales|Peridiniales_X|Heterocapsa|sp|sp_X   chout21 89.8    235 17  1   1   229 1   235 *   *

The problem is the same when using -userout filename --userfields query+id+target. The problem disappears when using --notrunclabels.

Minor bug in Makefile

After a make, if I want to clean the directory, the make clean command does not remove the object files:

$ make
g++ -O3 -msse4.1 -mtune=core2 -Icityhash -Wall    -c -o vsearch.o vsearch.cc
g++ -O3 -msse4.1 -mtune=core2 -Icityhash -Wall    -c -o query.o query.cc
g++ -O3 -msse4.1 -mtune=core2 -Icityhash -Wall    -c -o db.o db.cc
g++ -O3 -msse4.1 -mtune=core2 -Icityhash -Wall    -c -o dbindex.o dbindex.cc
g++ -O3 -msse4.1 -mtune=core2 -Icityhash -Wall    -c -o vsearch_global.o vsearch_global.cc
g++ -O3 -msse4.1 -mtune=core2 -Icityhash -Wall    -c -o align.o align.cc
g++ -O3 -msse4.1 -mtune=core2 -Icityhash -Wall    -c -o showalign.o showalign.cc
g++ -O3 -msse4.1 -mtune=core2 -Icityhash -Wall    -c -o util.o util.cc
g++ -O3 -msse4.1 -mtune=core2 -Icityhash -Wall    -c -o unique.o unique.cc
g++ -O3 -msse4.1 -mtune=core2 -Icityhash -Wall    -c -o userfields.o userfields.cc
g++ -O3 -msse4.1 -mtune=core2 -Icityhash -Wall    -c -o results.o results.cc
g++ -O3 -msse4.1 -mtune=core2 -Icityhash -Wall    -c -o sortbysize.o sortbysize.cc
g++ -O3 -msse4.1 -mtune=core2 -Icityhash -Wall    -c -o derep.o derep.cc
g++ -O3 -msse4.1 -mtune=core2 -Icityhash -Wall    -c -o maps.o maps.cc
g++ -O3 -msse4.1 -mtune=core2 -Icityhash -Wall    -c -o arch.o arch.cc
g++ -O3 -msse4.1 -mtune=core2 -Icityhash -Wall    -c -o sortbylength.o sortbylength.cc
g++ -O3 -msse4.1 -mtune=core2 -Icityhash -Wall    -c -o shuffle.o shuffle.cc
g++ -O3 -msse4.1 -mtune=core2 -Icityhash -Wall    -c -o align_simd.o align_simd.cc
align_simd.cc: In function ‘void search16(s16info_s*, unsigned int, unsigned int*, CELL*, short unsigned int*, short unsigned int*, short unsigned int*, short unsigned int*, char**)’:
align_simd.cc:730:11: warning: variable ‘QR_query_left’ set but not used [-Wunused-but-set-variable]
   __m128i QR_query_left, R_query_left;
           ^
g++ -O3 -msse4.1 -mtune=core2 -Icityhash -Wall    -c -o mask.o mask.cc
g++ -O3 -msse4.1 -mtune=core2 -Icityhash -Wall    -c -o minheap.o minheap.cc
minheap.cc: In function ‘void minheap_test()’:
minheap.cc:210:26: warning: narrowing conversion of ‘random()’ from ‘long int’ to ‘unsigned int’ inside { } is ill-formed in C++11 [-Wnarrowing]
       elem_t x = {random(),0,1};
                          ^
g++ -O3 -msse4.1 -mtune=core2 -Icityhash -Wall    -c -o bitmap.o bitmap.cc
g++ -O3 -msse4.1 -mtune=core2 -Icityhash -Wall    -c -o cluster.o cluster.cc
g++ -O3 -msse4.1 -mtune=core2 -Icityhash -Wall    -c -o searchcore.o searchcore.cc
g++  -o vsearch vsearch.o query.o db.o dbindex.o vsearch_global.o align.o showalign.o util.o unique.o userfields.o results.o sortbysize.o derep.o maps.o arch.o sortbylength.o shuffle.o align_simd.o mask.o minheap.o bitmap.o cluster.o searchcore.o cityhash/city.o -lpthread
$ make clean
rm -f *~ *.{o,S,gcda,gcno,gcov} vsearch gmon.out cityhash/*.{o,S,gcda,gcno,gcov}
$ ls *.o
align.o       arch.o    cluster.o  db.o     maps.o  minheap.o  results.o     showalign.o  sortbylength.o  unique.o      util.o            vsearch.o
align_simd.o  bitmap.o  dbindex.o  derep.o  mask.o  query.o    searchcore.o  shuffle.o    sortbysize.o    userfields.o  vsearch_global.o

I tried different modifications of the Makefile, but nothing worked. If I launch the rm command manually, the objects files are deleted as expected. I am using GNU Make 4.0.

That's weird.

Prioritized features/options

Here are some often used options that should be implemented (from Frédéric):

Chimera checking

--usersort
--chimeras FILENAME
--abskew 2.0
--uchime FILENAME
--log FILENAME
--nonchimeras FILENAME

Clustering

--cluster FILENAME
--usersort
--id 0.97
--slots 16769023
--sizeout
--uc FILENAME
--w 64
--seedsout FILENAME
--maxrejects 500
--sizein
--log FILENAME

Reference Chimera checking.

Hi,
I'm testing out vsearch where I was using USEARCH. I have used vsearch uchime_denovo with these files and it worked great. I am running into a few problems with the uchime_ref command. My uchime command looked like this:

usearch -uchime_ref derep.fasta  -db custom_nt_database.fasta -chimeras chimeras.fasta -nonchimeras non_chimeras.fasta -uchimeout derep.uchime -log uchime_ref.log --abskew 2 

Which would run fine. I removed the log command as it is not supported in vsearch and ran:

vsearch --uchime_ref derep.fasta  --db custom_nt_database.fasta --chimeras chimeras.fasta --nonchimeras non_chimeras.fasta --uchimeout derep.uchime --abskew 2 

However with vsearch I get an error that I don't understand when I run that command.

Reading file custom_nt_database.fasta 100%  
684514 nt in 1036 seqs, min 204, max 5800, avg 661
WARNING: 47 sequences longer than 50000 nucleotides discarded.
Indexing sequences 100%  
Counting unique k-mers 100%  
Creating index of unique k-mers 100%  
Detecting chimeras 0%*** glibc detected *** /home/labop/vsearch/vsearch-1.0.5-linux-x86_64: realloc(): invalid next size: 0x00007fc300025400 ***
*** glibc detected *** /home/labop/vsearch/vsearch-1.0.5-linux-x86_64: double free or corruption (out): 0x00007fc31002bae0 ***

And it just hangs there.

I've used the vsearch derep_fulllength to get derep.fasta.

head of my derep.fasta gives:

>Lib_pool22_M00366:44:000000000-A92F0:1:1117:6872:7515_1:N:0:4;size=4033;
AATTCGCCCTTGAGGGGGCGACGGTGCTGGACGCACAGAAGGGTGCCTATTATACACCAATAACAGCACTAGATTTCGAA
GGTCTATATCCATCAATTATGATGGCACATAATTTATGTTATTCATCAATGGTTATGGATTCTAAATACGAAAATATACC
TGGTATAACATACGAAACGTTTGGGTTTTATAAGTTTGCACAAGATGTTCCAAGTCTTTTACCAAGTATTCTTCTAGAAC
TAAAACAGTTTCGTAAACAAGCTAAAAAGGATATGGCACAATCATCCGGTGCACTAAA
>Lib_pool21_M00366:44:000000000-A92F0:1:1115:18924:7329_1:N:0:3;size=2837;
AATTCGCCCTTGAGGGGGCGACGGTGCTGGACGCACAAAAGGGGGCATATTATACACCGATTACAGCCCTAGATTTTGAA
GCACTATATCCATCAATCATGATGGCACACAATCTATGTTACTCTACACTCGTTATGGATGAGTATCGGTACGGTAATGT
TCCTGGTATAAACTATGAATCATTCAAAATTGGCGACAAAATATATAAATTTGCGCAAGGTGTACCCAGTCTTTTACCCG
labop@mesa:/Data/Julia/Thesis/Thesis-Overall/Miseq_Initial_Run_Processing/scripts$ head ../results/Divided_by_primers/All_libs_combined_OTUs_picked/Total_AVS_R1_annotated_trimmed_paired_derep.fasta 
>Lib_pool22_M00366:44:000000000-A92F0:1:1117:6872:7515_1:N:0:4;size=4033;
AATTCGCCCTTGAGGGGGCGACGGTGCTGGACGCACAGAAGGGTGCCTATTATACACCAATAACAGCACTAGATTTCGAA
GGTCTATATCCATCAATTATGATGGCACATAATTTATGTTATTCATCAATGGTTATGGATTCTAAATACGAAAATATACC
TGGTATAACATACGAAACGTTTGGGTTTTATAAGTTTGCACAAGATGTTCCAAGTCTTTTACCAAGTATTCTTCTAGAAC
TAAAACAGTTTCGTAAACAAGCTAAAAAGGATATGGCACAATCATCCGGTGCACTAAA
>Lib_pool21_M00366:44:000000000-A92F0:1:1115:18924:7329_1:N:0:3;size=2837;
AATTCGCCCTTGAGGGGGCGACGGTGCTGGACGCACAAAAGGGGGCATATTATACACCGATTACAGCCCTAGATTTTGAA
GCACTATATCCATCAATCATGATGGCACACAATCTATGTTACTCTACACTCGTTATGGATGAGTATCGGTACGGTAATGT
TCCTGGTATAAACTATGAATCATTCAAAATTGGCGACAAAATATATAAATTTGCGCAAGGTGTACCCAGTCTTTTACCCG
CAATTCTTCTTGAACTCAAACAATTTCGTAAAAAAGCTAAAAAGGATATGGCCGCTGCGAC

So I wondered if --uchime_ref is having a problem with the line wrapping generated from derep?

So I removed the wrapping from the derep.fasta so that it looked like this head:

>Lib_pool22_M00366:44:000000000-A92F0:1:1117:6872:7515_1:N:0:4;size=4033;
AATTCGCCCTTGAGGGGGCGACGGTGCTGGACGCACAGAAGGGTGCCTATTATACACCAATAACAGCACTAGATTTCGAAGGTCTATATCCATCAATTATGATGGCACATAATTTATGTTATTCATCAATGGTTATGGATTCTAAATACGAAAATATACCTGGTATAACATACGAAACGTTTGGGTTTTATAAGTTTGCACAAGATGTTCCAAGTCTTTTACCAAGTATTCTTCTAGAACTAAAACAGTTTCGTAAACAAGCTAAAAAGGATATGGCACAATCATCCGGTGCACTAAA
>Lib_pool21_M00366:44:000000000-A92F0:1:1115:18924:7329_1:N:0:3;size=2837;
AATTCGCCCTTGAGGGGGCGACGGTGCTGGACGCACAAAAGGGGGCATATTATACACCGATTACAGCCCTAGATTTTGAAGCACTATATCCATCAATCATGATGGCACACAATCTATGTTACTCTACACTCGTTATGGATGAGTATCGGTACGGTAATGTTCCTGGTATAAACTATGAATCATTCAAAATTGGCGACAAAATATATAAATTTGCGCAAGGTGTACCCAGTCTTTTACCCGCAATTCTTCTTGAACTCAAACAATTTCGTAAAAAAGCTAAAAAGGATATGGCCGCTGCGAC
>Lib_pool57_M00366:44:000000000-A92F0:1:1101:6581:8826_1:N:0:39;size=2079;
AATTCGCCCTTGAGGGGGCGACGGTGCTGGATGCACAAAAGGGGGCATATTATACACCGATTACAGCCCTAGATTTTGAAGCACTATATCCATCAATCATGATGGCACACAATCTATGTTACTCTACACTCGTTATGGATGAGTATCGGTACGGTAATGTTCCTGGTATAAACTATGAATCATTCAAAATTGGCGACAAAATATATAAATTTGCGCAAGGTGTACCCAGTCTTTTACCCGCAATTCTTCTTGAACTCAAACAATTTCGTAAAAAAGCTAAAAAGGATATGGCCGCTGCGAC
>Lib_pool2_Julia.2_2886829_M01170:9:000000000-A6JT1:1:1108:16338:8526_1:N:0:0;size=1828;
GAGGGGGCGACGGTGTTGGACGCCATGCGTAAACAGTTATGGGTCAGCCAAGCTGCACCTAACCCCAAGCTGCGTATGTCCAACATTGGAAAGCCTTGTAGCAGGGCGCTCTGGTACGACATCAATGGTGACGAGCAAGCGGAGAGCTTTACGCCACAGACCAAGCTCAAGTTCATCGTAGGTGACATTGTTGAAGCAATGTTGATCTACTTGGCCAAGGAAGCTGGACATTCTGTGACTGAGATGCAATC
>Lib_pool1_Julia.1_8087229_M01170:9:000000000-A6JT1:1:2107:10781:13498_1:N:0:0;size=1809;

But when I run the vsearch uchime command with it I get a new error:

Reading file custom_nt_database.fasta 100%  
684514 nt in 1036 seqs, min 204, max 5800, avg 661
WARNING: 47 sequences longer than 50000 nucleotides discarded.
Indexing sequences 100%  
Counting unique k-mers 100%  
Creating index of unique k-mers 100%  
Detecting chimeras 0%

Fatal error: Illegal header line in query fasta file

Any ideas of things to try?

Write --help to stdout

Please consider making --help write to stdout so that it can be piped to a pager, grep, etc. Thanks!

Support for long (>15 nt) and gapped seeds

Requires changes to code that identified unique seeds in a sequence. Also the current direct index of kmers to a list of the database sequences where the kmer is present must be changed to a hash table.

Add support for amino acid sequences

The README says that this "may be added in the future." Any updates on those plans? Would adding AA support be a large undertaking or something as simple as adding a new alphabet and scoring matrix?

Speed-up searching when using the --top_hits_only option

During a search, the target sequences are sorted by decreasing k-mer composition similarity with the query sequence. The target sequences that are the most likely to get a high similarity score with the query are the first to be treated (i.e. pairwise aligned).

In a taxonomic assignment context (with --maxaccepts 0 --maxrejects 0 --id 0.5), and when using the option --top_hits_only, vsearch ends up comparing all the targets to the query, which is inefficient. The search process could stop once the query-target similarities start to drop. In practice, the algorithm could count the number of blocks (a block contains 16 targets if I am correct) where observed similarities are all lower than the best obtained so far. After two blocks of decreasing similarity values, the search can safely stop and start working on the next query.

Clustering

USEARCH clustering commands:

  • cluster_fast
  • cluster_smallmem
  • cluster_otus

The cluster_otus is a more complex clustering method that involves chimera detection.

Clustering options suggested:

  • --cluster FILENAME
  • --usersort
  • --id 0.97
  • --slots 16769023
  • --sizeout
  • --uc FILENAME
  • --w 64
  • --seedsout FILENAME
  • --maxrejects 500
  • --sizein
  • --log FILENAME

Manuscript

A manuscript describing VSEARCH should be submitted to a preprint journal.

Bug in masking

With the latest vsearch version (0.2.0), when masking the vderep.fsa file, the output is empty when using --qmask none or --qmask soft. The output is ok when using --qmask dust:

${VSEARCH} --maskfasta vderep.fsa --output vderep.fsa_masked -qmask soft
wc -l < vderep.fsa_masked

The computation takes a few seconds with dust, but is immediate with none and soft.

Chimera detection

Commands for chimera detection:

  • uchime_ref
  • uparse_ref

Suggested options for chimera checking

--usersort
--chimeras FILENAME
--abskew 2.0
--uchime FILENAME
--log FILENAME
--nonchimeras FILENAME

add usearch's fastq_mergepairs function and options

I had been using a function in usearch to detect overlap of paired-end reads. This used the following options which would be nice to have available in vsearch.

usearch_v.7.0.1090_i86linux32 -fastq_mergepairs read1.fq 
                              -reverse read2.fq
                              -fastq_maxdiffs 6
                              -fastq_truncqual 2 
                              -fastq_minlen 36 
                              -fastq_minmergelen 50 
                              -fastqout merge.fq 
                              -fastq_allowmergestagger

Illegal instruction fault on some cpus

vsearch 1.0.1 crashes with an illegal instruction fault on some cpus, notably AMD cpus. The problem is identified (it is due to lack of ssse3 and/or sse41 features) and a fix (that only requires sse2) is in the works.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.