shenwei356 / taxonkit

A Practical and Efficient NCBI Taxonomy Toolkit, also supports creating NCBI-style taxdump files for custom taxonomies like GTDB/ICTV
https://bioinf.shenwei.me/taxonkit
MIT License
361 stars 29 forks source link

taxonkit reformat erro :panic: runtime error: invalid memory address or nil pointer dereference #14

Closed wfgui closed 5 years ago

wfgui commented 5 years ago

hello, I've been having some problems lately when using the latest version:

$ taxonkit list --ids 2,4751,13776,10239 --indent "" -j 8 > bac_fun_arc_vir_taxids.txt
$ taxonkit lineage bac_fun_arc_vir_taxids.txt -o bac_fun_arc_vir_taxids_lineage.txt -j 8
$ time taxonkit reformat -F -f "k__{k}|p__{p}|c__{c}|o__{o}|f__{f}|g__{g}|s__{s}" bac_fun_arc_vir_taxids_lineage.txt -o bac_fun_arc_vir_taxids_lineage_reformat.txt
ids_lineage.txt -o bac_fun_arc_vir_taxids_lineage_reformat.txt

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x6f1e49]

goroutine 284259 [running]:
github.com/shenwei356/taxonkit/taxonkit/cmd.glob..func7.1(0xc472103340, 0xae, 0x8, 0x8, 0x9, 0xc4720c4b00, 0x8)
    /home/shenwei/shenwei/script/Go/project/src/github.com/shenwei356/taxonkit/taxonkit/cmd/reformat.go:157 +0x579
github.com/shenwei356/breader.(*BufferedReader).run.func2.1(0xc471116850, 0xc458bea7e0, 0xc4585087c0, 0xc458c98840, 0xc448f384e0, 0xc471116860, 0x108a0, 0xc471f252c0, 0xa, 0xa)
    /home/shenwei/shenwei/script/Go/project/src/github.com/shenwei356/breader/BufferedReader.go:168 +0xef
created by github.com/shenwei356/breader.(*BufferedReader).run.func2
    /home/shenwei/shenwei/script/Go/project/src/github.com/shenwei356/breader/BufferedReader.go:160 +0x245

[Uploading bac_fun_arc_vir_taxids.txt…]()

Thanks!

shenwei356 commented 5 years ago

Everything is fine with https://github.com/shenwei356/taxonkit/releases/tag/v0.2.5-dev3

$ time taxonkit reformat -F -f "k__{k}|p__{p}|c__{c}|o__{o}|f__{f}|g__{g}|s__{s}" bac_fun_arc_vir_taxids_lineage.txt -o bac_fun_arc_vir_taxids_lineage_reformat.txt
[WARN] unofficial taxon name detected: cassava brown streak virus-[malawi:karonga 17. Possible reasons: 1) lineages were produced with different taxonomy data files, please re-run taxonkit lineage; 2) some taxon names contain semicolon (";"), please re-run taxonkit lineage and taxonkit reformat with different flag value of -d, e.g., -d /

real    0m21.910s
user    0m40.430s
sys     0m1.486s

$ head -n 3  bac_fun_arc_vir_taxids_lineage_reformat.txt | cut -f 3
k__Bacteria|p__unclassified Bacteria phylum|c__unclassified Bacteria class|o__unclassified Bacteria order|f__unclassified Bacteria family|g__unclassified Bacteria genus|s__unclassified Bacteria species
k__Bacteria|p__Proteobacteria|c__unclassified Proteobacteria class|o__unclassified Proteobacteria order|f__unclassified Proteobacteria family|g__unclassified Proteobacteria genus|s__unclassified Proteobacteria species
k__Bacteria|p__Proteobacteria|c__Gammaproteobacteria|o__unclassified Gammaproteobacteria order|f__unclassified Gammaproteobacteria family|g__unclassified Gammaproteobacteria genus|s__unclassified Gammaproteobacteria species
shenwei356 commented 5 years ago

Note that, option -F, --fill-miss-rank is experimental.

wfgui commented 5 years ago

谢谢申威!

shenwei356 commented 5 years ago

It's 沈伟.