torognes / vsearch Goto Github PK
View Code? Open in Web Editor NEWVersatile open-source tool for microbiome analysis
License: Other
Versatile open-source tool for microbiome analysis
License: Other
Add a (Cython) API for the core functions of vsearch.
qlo, qhi, tlo, thi, raw should have meaningful values.
Compare sensitivity, precision, speed and memory usage
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?
Hello, very excited to see this project. If you are taking requests for usearch features, I would personally find the allpairs_global option useful. See http://www.drive5.com/usearch/manual/allpairs_global.html Thanks!
Make output to alnout, blast6out, userout, uc etc consistent for non-matching queries with output_no_hits and uc_allhits.
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.
The topscore_insert
function in search.cc should be modified to improve performance. This may be significant at least with long lists.
Look at this blog for inspiration.
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?
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
.
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.
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
Sortbysize does not work. Will be fixed in next version.
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?
Please consider making --help write to stdout so that it can be piped to a pager, grep, etc. Thanks!
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.
Ok on Mac
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?
in --blast6out, the third field (id) should be 0.0 (real) when there is no alignment, not 0 (integer). The behavior is correct in --userout.
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.
Sorting performed by cluster_fast and uchime_denovo should be stable to avoid input order dependencies. Sort by length and labels (and sequences?) as secondary keys.
USEARCH clustering commands:
The cluster_otus is a more complex clustering method that involves chimera detection.
Clustering options suggested:
Read input sizes when --sizein is specified and write size of clusters to centroids file if --sizeout is specified.
A manuscript describing VSEARCH should be submitted to a preprint journal.
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
.
With the last version (0.2.2), the evalue
and bits
fields return different values. With --blast6out
the fields are set to "*". With --userout
evalue = -1
and bits = 0
.
The documentation says it should be evalue = -1
and bits = 0
.
SIMD-vectorization of global alignment of one query vs one target sequence. Should use the striped approach of Farrar (2007) or the vertical vector approach of Rognes (2000).
Commands for chimera detection:
Suggested options for chimera checking
--usersort
--chimeras FILENAME
--abskew 2.0
--uchime FILENAME
--log FILENAME
--nonchimeras FILENAME
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
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.