Important error in Lulu script
Lulu is the post-clustering curation algorithm: it removes false OTUs based on % identity and co-occurance rate to more abundant OTUs. Steps in the Lulu script:
1/ Create a matchlist of OTUs: blast the OTUs in the OTU table against each other at a specific % identity level. You obtain a matchlist table giving you the % identity of each OTU against all other OTUs in the OTU table, from the % identity you have set in blast. In the script below, the perc_identity parameter should be increased to 95% as we use coding genes (COI,18S), whereas the developers used ITS. #First produce a blastdatabase with the OTUs makeblastdb -in OTU_sequences.fasta -parse_seqids -dbtype nucl
Then blast the OTUs against the database
blastn -db OTU_sequences.fasta -outfmt '6 qseqid sseqid pident' -out match_list.txt -qcov_hsp_perc 80 -perc_identity 84 -query OTU_sequences.fasta
Here is does not matter to increase the perc_identity parameter above 95%, we only want to blast OTUs against each other from 95% identity onwards. The important filtration step occurs in the next step!!
2/ Run Lulu to produce the curated OTU table:
curated_result <- lulu(otutab, matchlist)
....Which is equivalent of running LULU with default settings for the options minimum_ratio_type, minimum_ratio, minimum_relative_cooccurence
curated_result <- lulu(otutab, matchlist, minimum_ratio_type = "min", minimum_ratio = 1, minimum_match = 84, minimum_relative_cooccurence = 0.95)
Here the minimum_match % should be increased to at least 97% for 18S (but 98,99% should also be tried!) and 96% (but 97,98% should also be tried!) for COI. Caroline did NOT do that in her Lulu.R script, she instead changed the perc_identity parameter in the blastn command to produce the matchlist!
other parameters: minimum_ratio_type = "min", minimum_ratio = 1 ==> the parent OTU has to be more abundant in ALL samples minimum_relative_cooccurence = 0.95 ==> For an OTU to be a parent OTU, the OTU has to be present in 95% of samples, meaning that 1 in 20 samples are allowed to have no parent presence.