matthiasblanke / App-SpaM

Alignment-free Phylogenetic Placement using filtered SPAced word Matches
GNU General Public License v3.0
10 stars 1 forks source link

Internal node error #4

Closed Ufungi closed 1 year ago

Ufungi commented 1 year ago

Dear Matthias Blanke,

Hello, I've been using App-Spam to phylogenetically place fungal ITS sequences (ITS1, ITS2, and full ITS are mixed in this query) against the reference alignment and tree generated from customized UNITE fungal ITS database. The reference alignment was generated using Magus and UPP2, and the reference tree was built from the reference alignment using VeryFastTree. App-spam ran successfully, but resulting jplace file occurred an error when it was transferred to other programs like gappa and iTOL.

Here is my App-Spam command on Linux:

appspam \ -t /data/snyoo/DB/magus/upp2_output/output_alignment.tree \ -s /data/snyoo/DB/magus/upp2_output/output_alignment.fasta \ -q /home/snyoo/QIIME2/00_Fungi/merged_all/04_final/ktu-sequence.fasta \ -o unite_ktu_appspam.jplace


Alignment-free phylogenetic placement algorithm based on spaced word matches

-> Reading sequences. -> Comparing reads and genomes.

    -> Read partition 0: Calculating distances.
    -> Read partition 0: Placing reads in tree.

-> Placement finished. Output files are in the folder: ./

Here is my gappa command on Linux:

jplace=/home/snyoo/pp_result/unite_rescript_witch_upp2_vft/unite_ktu_appspam.jplace gappa examine info --jplace-path $jplace

Started 2023-04-07 09:28:23

Found 1 jplace file Jplace document contains meta-data at key 'dont cares' that is not stored as a string, and hence ignored. Jplace document contains meta-data at key 'filtering threshold' that is not stored as a string, and hence ignored. Jplace document contains meta-data at key 'minHashLowerLimit' that is not stored as a string, and hence ignored. Jplace document contains meta-data at key 'number of patterns' that is not stored as a string, and hence ignored. Jplace document contains meta-data at key 'sampling' that is not stored as a string, and hence ignored. Jplace document contains meta-data at key 'unassembled' that is not stored as a string, and hence ignored. Jplace document contains meta-data at key 'weight' that is not stored as a string, and hence ignored. terminate called after throwing an instance of 'std::runtime_error' what(): Jplace document contains a pquery where field 'edge_num' has value '56760', which does not correspond to any edge_num in the given Newick tree of the document. Aborted (core dumped)

Error on iTOL When I uploaded the jplace file to iTOL, following error occurs image

I think the errors occurred because of the string "internal" in the jplace file, but I don't know how to solve it.

Here is my resulting jplace file: unite_ktu_appspam.txt

Since I am not skilled in coding, I may lack the information needed for the question. Please ask me if needed.

Thank you in advance for your assistance. I look forward to hearing from you soon.

Best regards,

Shinnam Yoo

matthiasblanke commented 1 year ago

Hi, sorry for the late reply. Uploading your supplied file to iTol gives me an "Invalid branch length: App-SpaM"-error, but they also state at the top: "You can also use .jplace files generated by RaxML or pplacer, or .qza tree files generated by QIIME 2.", indicating that they might be aware of problems for JPlace files from other programs. Having said that, I always used iTol before with JPlace files generated by App-Spam without many problems.

However, I've seen the error you are getting before: It arises when queries are placed at the root (which is the case in your example: internal node 56760 is the name of (and corresponds to) the root); in those cases iTol expects round brackets that enclose the whole tree. As far as I know this contradicts how the root is commonly annotated in the Newick-format (namely, outside the most outer brackets) and led to compatibility clashes with other programs. Thus, App-SpaM omits these brackets at the moment – but I may take another look into this in the future. For your single example you could simply try placing the two brackets by hand. I will see if I can figure out what the "Invalid branch length"-error is about. Is it possible to upload the original tree to iTol without any errors? Best wishes, Matthias

Ufungi commented 1 year ago

Placing round brackets at the edge solved the problem.

Downstream analyses proceeded without any problems.

Thank you!

Best regards, Shinnam Yoo