Error in run with a custom trait table

29 views
Skip to first unread message

小林 陽子.

unread,
Oct 1, 2025, 4:00:33 PMOct 1
to picrust-users
Dear Picrust2 developers,

I'm trying to run the PICRUSt2-SC using a custom trait table. I have created the custom trait table and done the PICRUSt2-SC. Some tables work fine, but some tables give an error and stop running.

The version of PICRUSt2 is v2.6.0.

---

I prepared the KO list file and ran using a for loop.
Run command is followed:
for KO in $(cat ko_list.txt)
do
  picrust2_pipeline.py -s dna-sequences.fasta -i feature-table.biom -o ${KO}/picrust2_out_pipeline_custom_traits  \
  -p 12 --custom_trait_tables_ref1 ${KO}/bacteria_${KO}.txt --custom_trait_tables_ref2 ${KO}/archaea_${KO}.txt --no_pathways
done

---

Fine result message:
Warning: There was only one file for the function: archaea_K28073
Maybe that's fine if you used custom traits or there were no sequences matching one of the domains.
Warning: There was only one file for the function: bacteria_K28073
Maybe that's fine if you used custom traits or there were no sequences matching one of the domains.
17 of 742 ASVs were above the max NSTI cut-off of 2.0 and were removed from the downstream analyses.
Warning: fewer than half of the sequence ids overlap between the input files.
 
17 of 742 ASVs were above the max NSTI cut-off of 2.0 and were removed from the downstream analyses.
 
Warning - 2 input sequences aligned poorly to reference sequences (--min_align option specified a minimum proportion of 0.8 aligning to reference sequences). These input sequences will not be placed and will be excluded from downstream steps.
 
This is the set of poorly aligned input sequences to be excluded: b8cc91ef66578d076ec15970520bf75d, 189eea600d467c1102d3a5572057db82
 
 
Warning - 3 input sequences aligned poorly to reference sequences (--min_align option specified a minimum proportion of 0.8 aligning to reference sequences). These input sequences will not be placed and will be excluded from downstream steps.
 
This is the set of poorly aligned input sequences to be excluded: b8cc91ef66578d076ec15970520bf75d, 4cdd7e73df4c30e2cdd005bcf7b31103, 189eea600d467c1102d3a5572057db82

---

Error result message:
Error running this command:
hsp.py --tree K28067/picrust2_out_pipeline_custom_traits/arc_reduced.tre --output K28067/picrust2_out_pipeline_custom_traits/arc_archaea_K28067_predicted.tsv.gz --observed_trait_table K28067/archaea_K28067.txt --hsp_method mp --edge_exponent 0.5 --seed 100 --processes 12
 
Standard error of the above failed command:
 
Error running this command:
Rscript /Users/kobayashiyouko/picrust2-2.6.0/picrust2/Rscripts/castor_hsp.R K28067/picrust2_out_pipeline_custom_traits/arc_reduced.tre /var/folders/sf/f44yk0zs0tzg9x_vpm16zf0c0000gn/T/tmp__u88tm2/subset_tab_0 mp 0.5 FALSE FALSE /var/folders/sf/f44yk0zs0tzg9x_vpm16zf0c0000gn/T/tmpn0e7h0le/predicted_counts.txt /var/folders/sf/f44yk0zs0tzg9x_vpm16zf0c0000gn/T/tmpn0e7h0le/predicted_ci.txt 100
 
Standard error of the above failed command:
matrix(0, nrow = Nclades, ncol = Nstates - common_state) でエラー:  
  'ncol' の値が不正です (大きすぎるか NA です)
呼び出し: lapply ... mp_study_probs -> hsp_max_parsimony -> cbind -> matrix
実行が停止されました  

(sorry in Japanese)

I'm attaching both files, giving the good(K28073) and the error(K28067) results as examples. I'm wondering why an error occurs even though the files look almost identical.

I apologize for taking up your valuable time, and would sincerely appreciate any help in resolving this issue. Please let me know if you would like more information.

Sincerely,
Yoko Kobayashi
bacteria_K28067.txt
bacteria_K28073.txt
archaea_K28067.txt
archaea_K28073.txt

Robyn Wright

unread,
Oct 2, 2025, 1:36:46 PMOct 2
to picrust-users
Hi Yoko,

It looks like the issue here is that none of the genomes in the archaeal trait table have any K28067 copies. I changed only the top genome to have 1 copy and then it ran fine (but prior to that I got the same error message as you). I'm not sure that I'd ever considered this being an issue before, but will try to add in a check for empty tables when I next update PICRUSt2. In your case, I'd probably suggest running each of the steps individually (as listed here) with just the bacterial tables - so you'd run steps 1-3 with both bacteria and archaea (or use your existing output for this), and then run step 4 with just bacteria, skip combining files in step 5, and run step 6 for just KOs. 

Best wishes,
Robyn
bacteria_combined.txt
archaea_combined.txt

Yoko Makabe-Kobayashi

unread,
Oct 2, 2025, 2:51:30 PMOct 2
to picrust-users
Dear Picrust2 developers,

I double-checked the error message, and it seems the cause was that all values in the archaea.txt file were 0. Adding a dummy value of 1 to the file resolved the issue. I’m sorry for taking up your valuable time.

Sincerely,
Yoko Kobayashi

2025年10月2日木曜日 5:00:33 UTC+9 Yoko Makabe-Kobayashi:

Yoko Makabe-Kobayashi

unread,
Oct 9, 2025, 2:40:36 PM (9 days ago) Oct 9
to picrust-users
Hi Robyn,

Thank you for your reply and for the very helpful advice! I also appreciate your decision to add a check for empty tables in the next update. I'll try running each of the steps individually.

Best regards,
Yoko

2025年10月3日金曜日 3:51:30 UTC+9 Yoko Makabe-Kobayashi:
Reply all
Reply to author
Forward
0 new messages