Package: kitsune
KITSUNE: K-mer-length Iterative Selection for UNbiased EcophylogenomicsKITSUNE is a toolkit for evaluation of the length of k-mer in a given genome dataset for alignment-free phylogenimic analysis.K-mer based approach is simple and fast yet has been widely used in many applications including biological sequence comparison. However, selection of an appropriate k-mer length to obtain a good information content for comparison is normally overlooked. The optimum k-mer length is a prerequsite to obtain biological meaningful genomic distance for assesment of phylogenetic relationships. Therefore, we have developed KITSUNE to aid k-mer length selection process in a systematic way, based on a three-steps aproach described inViral Phylogenomics Using an Alignment-Free Method: A Three-Step Approach to Determine Optimal Length of k-mer.KITSUNE will calculte the three matrices across considered k-mer range:Cumulative Relative Entropy (CRE)Average number of Common Features (ACF)Observed Common Features (OCF)Moreover, KITSUNE also provides various genomic distance calculations from the k-mer frequency vectors that can be used for species identification or phylogenomic tree construction.Note:
If you use KITSUNE in your research, please cite:KITSUNE: A Tool for Identifying Empirically Optimal K-mer Length for Alignment-free Phylogenomic AnalysisInstallationKitsune is developed under python version 3 environment. We recommend users use python >= v3.5.Requirement packages: scipy >= 0.18.1, numpy >= 1.1.0, tqdm >= 4.32Kitsune also requiresJellyfishfor k-mer counting as external software dependency. Thus, you need to install it before running the tool:https://github.com/gmarcais/JellyfishInstall with pippipinstallkitsuneInstall from source# Clone the GitHub repositorygitclonehttps://github.com/natapol/kitsune# Move to the kitsune foldercdkitsune/# Installpythonsetup.pyinstallUsageOverview of kitsunecommand for listing help$kitsune--help

usage:kitsune<command>[<args>]Availablecommands:acfComputeaveragenumberofcommonfeaturesbetweensignaturescreComputecumulativerelativeentropydmatrixComputedistancematrixkoptComputerecommendedchoice(optimal)ofkmerwithinagivenkmerintervalforasetofgenomesusingthecre,acfandofcofcComputeobservedfeaturefrequencies

Use--helpinconjunctionwithoneofthecommandsaboveforalistofavailableoptions(e.g.kitsuneacf--help)Calculate CRE, ACF, and OFC value for specific kmerKitsune provides three commands to calculate an appropiate k-mer using CRE, ACF, and OCF:Calculate CRE$kitsunecre-h

usage:kitsune(cre)[-h]--filenameFILENAME[--fast][--canonical]-keKEND[-kfKFROM][-tTHREAD][-oOUTPUT]Calculatek-merfromcumulativerelativeentropyofallgenomes

optionalarguments:-h,--helpshowthishelpmessageandexit--filenameFILENAMEAgenomefileinfastaformat(default:None)--fastJellyfishone-passcalculation(faster)(default:False)--canonicalJellyfishcountonlycanonicalmer(default:False)-keKEND,--kendKENDLastk-mer(default:None)-kfKFROM,--kfromKFROMCalculatefromk-mer(default:4)-tTHREAD,--threadTHREAD-oOUTPUT,--outputOUTPUTOutputfilename(default:None)Calculate ACF$kitsuneacf-h

usage:kitsune(acf)[-h]--filenamesFILENAMES[FILENAMES...][--fast][--canonical]-kKMERS[KMERS...][-tTHREAD][-oOUTPUT]Calculateanaveragenumberofcommonfeaturespairwisebetweenonegenome
againstothers

optionalarguments:-h,--helpshowthishelpmessageandexit--filenamesFILENAMES[FILENAMES...]Genomefilesinfastaformat(default:None)--fastJellyfishone-passcalculation(faster)(default:False)--canonicalJellyfishcountonlycanonicalmer(default:False)-kKMERS[KMERS...],--kmersKMERS[KMERS...]Havetostatebefore(default:None)-tTHREAD,--threadTHREAD-oOUTPUT,--outputOUTPUTOutputfilename(default:None)Calculate OFC$kitsuneofc-h

usage:kitsune(ofc)[-h]--filenamesFILENAMES[FILENAMES...][--fast][--canonical]-kKMERS[KMERS...][-tTHREAD][-oOUTPUT]Calculateanobservefeaturefrequency

optionalarguments:-h,--helpshowthishelpmessageandexit--filenamesFILENAMES[FILENAMES...]Genomefilesinfastaformat(default:None)--fastJellyfishone-passcalculation(faster)(default:False)--canonicalJellyfishcountonlycanonicalmer(default:False)-kKMERS[KMERS...],--kmersKMERS[KMERS...]-tTHREAD,--threadTHREAD-oOUTPUT,--outputOUTPUTOutputfilename(default:None)General Examplekitsunecre--filenamegenome1.fna-kf5-ke10kitsuneacf--filenamesgenome1.fnagenome2.fna-k5kitsuneofc--filenamesgenome_fasta/*-k5Calculate genomic distance at specific k-mer from kmer frequency vectors of two of genomesKitsune provides a commands to calculate genomic distance using different distance estimation method. Users can assess the impact of a selected k-mer length on the genomic distnace of choice below.distance optionnamebraycurtisBray-Curtis distancecanberraCanberra distancechebyshevChebyshev distancecityblockCity Block (Manhattan) distancecorrelationCorrelation distancecosineCosine distanceeuclideanEuclidean distancejensenshannonJensen-Shannon distancesqeuclideanSquared Euclidean distancediceDice dissimilarityhammingHamming distancejaccardJaccard-Needham dissimilaritykulsinskiKulsinski dissimilarityrogerstanimotoRogers-Tanimoto dissimilarityrussellraoRussell-Rao dissimilaritysokalmichenerSokal-Michener dissimilaritysokalsneathSokal-Sneath dissimilarityyuleYule dissimilaritymashMASH distancejsmashMASH Jensen-Shannon distancejaccarddistpJaccard-Needham dissimilarity Probabilityeuclidean_of_frequencyEuclidean distance of FrequencyKitsune provides a choice of distance transformation proposed byFan et.al.Calculate a distance matrix$kitsunedmatrix-h

usage:kitsune(dmatrix)[-h][--filenames[FILENAMES[FILENAMES...]]][--fast][--canonical]-kKMER[-iINPUT][-oOUTPUT][-tTHREAD][--transformed][-d{braycurtis,canberra,jsmash,chebyshev,cityblock,correlation,cosine,dice,euclidean,hamming,jaccard,kulsinsk,matching,rogerstanimoto,russellrao,sokalmichener,sokalsneath,sqeuclidean,yule,mash,jaccarddistp}][-fFORMAT]Calculateadistancematrix

optionalarguments:-h,--helpshowthishelpmessageandexit--filenames[FILENAMES[FILENAMES...]]Genomefilesinfastaformat(default:None)--fastJellyfishone-passcalculation(faster)(default:False)--canonicalJellyfishcountonlycanonicalmer(default:False)-kKMER,--kmerKMER-iINPUT,--inputINPUTListofgenomefilesintxt(default:None)-oOUTPUT,--outputOUTPUTOutputfilename(default:None)-tTHREAD,--threadTHREAD--transformed-d{braycurtis,canberra,jsmash,chebyshev,cityblock,correlation,cosine,dice,euclidean,hamming,jaccard,kulsinsk,matching,rogerstanimoto,russellrao,sokalmichener,sokalsneath,sqeuclidean,yule,mash,jaccarddistp},--distance{braycurtis,canberra,jsmash,chebyshev,cityblock,correlation,cosine,dice,euclidean,hamming,jaccard,kulsinsk,matching,rogerstanimoto,russellrao,sokalmichener,sokalsneath,sqeuclidean,yule,mash,jaccarddistp}-fFORMAT,--formatFORMATExample of choosing distance option:kitsunedmatrix--filenamesgenome1.fnagenome2.fna-k11-djaccard--canonical--fast-ooutput.txt
kitsunedmatrix--filenamesgenome1.fnagenome2.fna-k11-dhensenshannon--canonical--fast-ooutput.txtFind optimum k-mer from a given set of genomesKitsune provides a wrap-up comand to find optimum k-mer length for a given set of genome within a given kmer interval.$kitsunekopt-h

usage:kitsune(kopt)[-h][--acf-cutoffACF_CUTOFF][--canonical][--closely-related][--cre-cutoffCRE_CUTOFF][--fast]--filenamesFILENAMES[--hashsizeHASHSIZE][--in-memory][--k-minK_MIN]--k-maxK_MAX[--lowerLOWER][--nprocNPROC][--outputOUTPUT][--threadsTHREADS]OptimalkmersizeselectionforasetofgenomesusingAveragenumberof
CommonFeatures(ACF),CumulativeRelativeEntropy(CRE),andObservedCommon
Features(OCF).Example:kitsunekopt--filenamesgenomeList.txt--k-min4--k-max12--canonical--fast

optionalarguments:-h,--helpshowthishelpmessageandexit--acf-cutoffACF_CUTOFFCutofftouseinselectingkmerswhoseACFsare>=(cutoff*max(ACF))(default:0.1)--canonicalJellyfishcountonlycanonicalkmers(default:False)--closely-relatedUseincaseofcloselyrelatedgenomes(default:False)--cre-cutoffCRE_CUTOFFCutofftouseinselectingkmerswhoseCREsare<=(cutoff*max(CRE))(default:0.1)--fastJellyfishone-passcalculation(faster)(default:False)--filenamesFILENAMESPathtothefilewiththelistofgenomefilespaths.Thereshouldbeatlist2inputgenomes(default:None)--hashsizeHASHSIZEJellyfishinitialhashsize(default:100M)--in-memoryKeepJellyfishcountsinmemory(default:False)--k-minK_MINMinimumkmersize(default:4)--k-maxK_MAXMaximumkmersize(default:None)--lowerLOWERDonotletJellyfishoutputkmerswithcount<--lower(default:1)--nprocNPROCMaximumnumberofCPUstomakeitparallel(default:1)--outputOUTPUTPathtotheoutputfile(default:None)--threadsTHREADSMaximumnumberofthreadsforJellyfish(default:1)Example datasetFirst download the example files.Downloadkitsunekopt--filenamesgenome_list--k-min6--k-max21--canonical--fast--threads4--nproc2--outputout.txt:warning:Please be aware that this command will use big computational resources when large number of genomes and/or large genome size are used as the input.