Saravanan666/pypi-org huggingface dataset:
Package: phyles
BackgroundPhyles is a set of somewhat eclectic functions that makes the
implementation of utilities (little programs that can be controlled
by config files) easier. It started as a mass of boilerplate that I
would copy into almost every utility I wrote.  I finally decided to
consolidate this code into a package and add some schema-based
validation of config files and to document it fully.FeaturesPhyles provides support forYAML-based
config files as well as a means for validating the config files.
Phyles also provides several facilities for making utilities
more user friendly, including automatically generated banners,
automatically documented configuration templates, and graceful
recovery from configuration errors.Home Page & RepositoryThe phyles home page ishttp://phyles.bravais.net, and the source
code is maintained at github:https://github.com/jcstroud/phyles.ExampleAbout 90% of the convenience that phyles offers can
be summarized by a few lines of code. From the example
utility in the tutorial (http://pythonhosted.org/phyles):1|spec=phyles.package_spec(phyles.Undefined,"barbecue",|"schema","barbecue-time.yml")2|converters={'celsius to farenheit':|barbecue.celsius_to_farenheit}3|setup=phyles.set_up(__program__,__version__,|spec,converters)4|phyles.run_main(main,setup['config'],|catchall=barbecue.BarbecueError)These few lines find a schema specification from the package
contents (line 1), parses command line arguments (line 3),
validates a config file (lines 2 & 3), overrides configuration
settings therein (line 3), and runs the main function of the utility
in a try-except block that ensures graceful exit in the event that
an anticipated exception is raised (line 4).Schema are specified inYAML, terse, and hopefully intuitive.
Following is the example from the tutorial:!!omap-dish:--vegetable kabobs-smoked salmon-brisket-smoked salmon-Dish to cook-doneness:-rare:200medium:350well-done:500-medium-How much to cook the dish-temperature:-celsius to farenheit-105-Cooking temperature in °C-105-width:-int-70-width of report-70Phyles will automatically generate a documented sample
config files for users if they run the utility with
the--template(or-t) command line option. In the
tutorial, calling the example script (barbecue-time) with:barbecue_time -tproduces the following output, which is valid for the above
schema:%YAML1.2---# Dish to cook# One of: vegetable kabobs, smoked salmon, brisketdish:smoked salmon# How much to cook the dish# One of: well-done, medium, raredoneness:medium# Cooking temperature in °Ctemperature:105# width of reportwidth:70As one final example, another valid config file for this schema is:dish:smoked salmondoneness:mediumtemperature:107width:70
Package: phylm
PhylmFilm data aggregation with async support.MotivationWhen deciding which film to watch next, it can be helpful to have some key datapoints at
your fingertips, for example, the genre, the cast, the Metacritic score and, perhaps
most importantly, the runtime. This package provides a Phylm class to gather information
from various sources for a given film.InstallationpipinstallphylmUsage>>>fromphylmimportPhylm>>>p=Phylm("The Matrix")>>>awaitp.load_sources(["imdb","mtc"])>>>p.imdb.year1999>>>p.imdb.rating8.7>>>p.mtc.rating73phylmalso provides some tools around movie search results and more:>>>fromphylm.toolsimportsearch_movies,get_streaming_providers>>>search_movies("the matrix")[{'title':'The Matrix','kind':'movie','year':1999,'cover_photo':'https://some-url.com','imdb_id':'0133093',},{'title':'The Matrix Reloaded','kind':'movie','year':2003,'cover_photo':'https://some-url.com','imdb_id':'0234215',},{...>>>get_streaming_providers("0234215",regions=["gb"]){'gb':{'rent':[{'display_priority':8,'logo_path':'/pZgeSWpfvD59x6sY6stT5c6uc2h.jpg','provider_id':130,'provider_name':'Sky Store',}],'flatrate':[{'display_priority':8,'logo_path':'/ik9djlxNlex6sY6Kjsundc2h.jpg','provider_id':87,'provider_name':'Netflix',}]},{...}HelpSee thedocumentationfor more details.LicenceMIT
Package: phylmaker
Phylmaker is a modern Python library for interacting with the XML API
of FileMaker Servers.InstallationPhylmaker is available in PyPI; thePython Package Index, so:$ pip install phylmakerOr for the very latest development version, you can get it from BitBucket:$ pip install hg+https://bitbucket.org/Raumkraut/phylmaker#egg=phylmakerRequirements:Python >= 2.6Requests>= 1.0UsageQuickstart example:>>> import phylmaker
>>> srv = phylmaker.FMServer('fm.example.com', 'username', 'passphrase')
>>> srv.get_dbs()
[u'foo', u'bar', u'baz']
>>> srv.get_layouts('foo')
{u'spam': <phylmaker.server.FMLayout foo/spam (fm.example.com)>}
>>> layout = srv.get_layout(db='bar', layout='eggs')
>>> layout
<phylmaker.server.FMLayout bar/eggs (fm.example.com)>
>>> results = layout.find(canhas='*burger').execute()
>>> list(res['canhas'] for res in results)
[u'Hamburger', u'Cheeseburger', u'Tofuburger']For everything else,help()anddir()are your friends!LicensePhylmaker is licensed under the terms of theX11/MIT license:Copyright (c) 2016, Mel Collins <mel@raumkraut.net>Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Package: phylo2vec
Phylo2VecThis repository contains an implementation of Phylo2Vec. It is distributed under the GNU Lesser General Public License v3.0 (LGPL).Link to the preprint:https://arxiv.org/abs/2304.12693InstallationDependencies:python==3.10numba==0.56.4numpy==1.23.5biopython==1.80.0joblib==1.1.1User installation:We recommend to setup an isolated enviroment, using conda, mamba or virtualenv.Clone the repository and install usingpip:git clone https://github.com/Neclow/phylo2vec_dev.git
pip install -e .DevelopmentAdditional test dependencies:ete3==3.1.3pytest==7.4.2six==1.16.0Testing:After installation, you can launch the test suite from outside the source directory (you will need to have pytest >= 7.4.2 installed):pytest phylo2vecBasic usageConversionsThebasemodule contains elements to convert a Newick string (to_vector) to a Phylo2Vec vector and vice versa (to_newick)Example:importnumpyasnpfromphylo2vec.baseimportto_newick,to_vectorv=np.array([0,1,2,3,4])newick=to_newick(v)# '(0,(1,(2,(3,(4,5)6)7)8)9)10;'v_converted=to_vector(v)# array([0, 1, 2, 3, 4], dtype=int16)OptimizationTheoptmodule contains methods to perform phylogenetic inference using Phylo2Vec vectorsTODO: include GradME fromhttps://github.com/Neclow/GradMEExample:fromphylo2vec.optimportHillClimbingOptimizerhc=HillClimbingOptimizer(raxml_cmd="/path/to/raxml-ng_v1.2.0_linux_x86_64/raxml-ng",verbose=True)v_opt,taxa_dict,losses=hc.fit("/path/to/your_fasta_file.fa")Citation and other work@article{phylo2vec,
  title={Phylo2Vec: a vector representation for binary trees},
  author={Penn, Matthew J and Scheidwasser, Neil and Khurana, Mark P and Duch{\^e}ne, David A and Donnelly, Christl A and Bhatt, Samir},
  journal={arXiv preprint arXiv:2304.12693},
  year={2023}}Preprint repository (core functions are deprecated):https://github.com/Neclow/phylo2vec_preprintC++ version (deprecated):https://github.com/Neclow/phylo2vec_cppGradME:https://github.com/Neclow/GradME= phylo2vec + minimum evolution + gradient descent
Package: phylodm
🌲 PhyloDMPhyloDM is a high-performance library that converts a phylogenetic tree into a pairwise distance matrix.For a tree with 30,000 taxa, PhyloDM will use:~14GB of memory (94% less than DendroPy)~1 minute of CPU time (183x faster than DendroPy).PhyloDM is written in Rust and is exposed to Python via the Python PyO3 API. This means it
can be used in either Python or Rust, however, the documentation below is written for use in Python. For Rust documentation, seeCrates.io.⚙ InstallationRequires Python 3.7+PyPIPre-compiled binaries are packaged for most 64-bit Unix platforms. If you are installing on a different platform then you
will need to haveRustinstalled to compile the binaries.python-mpipinstallphylodmCondacondainstall-cbbiocondaphylodm🐍 Quick-startA pairwise distance matrix can be created from either a Newick file, or DendroPy tree.fromphylodmimportPhyloDM# PREPARATION: Create a test treewithopen('/tmp/newick.tree','w')asfh:fh.write('(A:4,(B:3,C:4):1);')# 1a. From a Newick filepdm=PhyloDM.load_from_newick_path('/tmp/newick.tree')# 1b. From a DendroPy treeimportdendropytree=dendropy.Tree.get_from_path('/tmp/newick.tree',schema='newick')pdm=PhyloDM.load_from_dendropy(tree)# 2. Calculate the PDMdm=pdm.dm(norm=False)labels=pdm.taxa()"""/------------[4]------------ A+|          /---------[3]--------- B\---[1]---+\------------[4]------------- Clabels = ('A', 'B', 'C')dm = [[0. 8. 9.][8. 0. 7.][9. 7. 0.]]"""Accessing dataThedmmethod generates a symmetrical NumPy matrix and returns a tuple of
keys in the matrix row/column order.# Calculate the PDMdm=pdm.dm(norm=False)labels=pdm.taxa()"""/------------[4]------------ A+|          /---------[3]--------- B\---[1]---+\------------[4]------------- Clabels = ('A', 'B', 'C')dm = [[0. 8. 9.][8. 0. 7.][9. 7. 0.]]"""# e.g. The following commands (equivalent) get the distance between A and Bdm[0,1]# 8dm[labels.index('A'),labels.index('B')]# 8NormalisationIf thenormargument ofdmis set toTrue, then the data will be normalised
by the sum of all edges in the tree.⏱ PerformanceTests were executed usingscripts/performance/Snakefileon an Intel(R) Xeon(R) CPU E5-2650 v3 @ 2.30GHz.For large numbers of taxa it is beneficial to use PhyloDM, however, if you have a small number
of taxa in the tree it is beneficial to use DendroPy for the great features it provides.
Package: phylogemetric
phylogemetricA python library for calculating delta score (Holland et al. 2002) and Q-Residual (Gray et al. 2010) for phylogenetic data.Installation:Installation is only a pip install away:pipinstallphylogemetricUsage: Command lineBasic usage:>phylogemetric

usage:phylogemetric[-h]methodfilenameCalculate delta score for filename example.nex:>phylogemetricdeltaexample.nex

taxon10.2453
taxon20.2404
taxon30.2954
...Calculate qresidual score for filename example.nex:>phylogemetricqresidualexample.nex

taxon10.0030
taxon20.0037
taxon30.0063
...Note: to save the results to a file use shell piping e.g.:>phylogemetricqresidualexample.nex>qresidual.txtSpeeding things up by using multiple processes.You can tell phylogemetric to use multiple cores with the-w/--workersargument:>phylogemetric-w4qresidualexample.nexUsage: LibraryCalculate scores:fromnexusimportNexusReaderfromphylogemetricimportDeltaScoreMetricfromphylogemetricimportQResidualMetric# load data from a nexus file:nex=NexusReader("filename.nex")qres=QResidualMetric(nex.data.matrix)# Or construct a data matrix directly:matrix={'A':['1','1','1','1','0','0','1','1','1','0','1','1','1','1','0','0','1','1','1','0'],'B':['1','1','1','1','0','0','0','1','1','1','1','1','1','1','1','0','0','1','1','1'],'C':['1','1','1','1','1','1','1','0','1','1','1','0','0','0','0','1','0','1','1','1'],'D':['1','0','0','0','0','1','0','1','1','1','1','0','0','0','0','1','0','1','1','1'],'E':['1','0','0','0','0','1','0','1','0','1','1','0','0','0','0','1','1','1','1','1'],}delta=DeltaScoreMetric(matrix)Class Methods:m=DeltaScoreMetric(matrix)# calculates the number of quartets in the data:m.nquartets()# returns the distance between two sequences:m.dist(['1','1','0'],['0','1','0'])# gets a dictionary of metric scores:m.score()m.score(workers=4)# with multiple processes.# pretty prints the metric scores:m.pprint()Requirements:python-nexus >= 1.1Performance Notes:Currentlyphylogemetricis implemented in python, and the Delta/Q-Residual algorithms are O(n). This means
that performance is not optimal, and it may take a while to calculate these metrics for datasets with more than
100 taxa or so. To help speed this up, use the multiple processes argument-w/--workersat the command line or by passingworkers=nto thescorefunction.I hope to improve performance in the near future, but in the meantime, if this is an issue for you then try
using the implementations available inSplitsTree.Citation:If you usephylogemetric, please cite:Greenhill, SJ. 2016. Phylogemetric: A Python library for calculating phylogenetic network metrics. Journal of Open Source Software.
http://dx.doi.org/10.21105/joss.00028Changelog:1.1.0:Added support for multiple processes.Removed python 2 support.Acknowledgements:Thanks to David Bryant for clarifying the Q-Residual code.Thanks toKristian Rotherfor code quality suggestions.
Package: phylogenetic-indices
Índices FilogenéticosVisão GeralÍndices Filogenéticos uma biblioteca Python que fornece funções para calcular vários índices de diversidade taxonômica (TD) a partir de histogramas de abundância de espécies. Estes índices são úteis para quantificar a diversidade e a composição de comunidades ecológicasFuncionalidades:Cálculo de riqueza de espécies.Cálculo do índice de distinção taxonômica (∆∗).Cálculo do índice de diversidade taxonômica (∆).Cálculo da entropia quadrática extensiva (F).Cálculo da entropia quadrática intensiva (J).Instalaçãopipinstallphylogenetic-indicesDocumentação
HTML documentação:https://readthedocs.org/projects/phylogenetic-indices
Package: phylokrr
Non-linear Phylogenetic regression using regularized kernelsInstallationpip install phylokrrQuick overviewData simulationThis simulation is based on a given covariance matriximportrandomimportnumpyasnp# seed for reproducibilityseed=12038np.random.seed(seed)random.seed(seed)# cov. matrix obtained from the phylogenetic treevcv=np.loadtxt("./data/test_cov2.csv",delimiter=',')# Trait simulation under Brownian motionn=vcv.shape[0]mean=np.zeros(n)X=np.random.multivariate_normal(cov=vcv,mean=mean).reshape(-1,1)# Non-linear response variable (sine curve)y=np.sin(X*2.1).ravel()+5# Add noise to the response variabley[::10]+=4*(0.5-np.random.rand(X.shape[0]//10))We then split data into training and testing sets, including their covariancesfromphylokrr.utilsimportsplit_data_vcv# split data into training and testing setsnum_test=round(0.5*n)(X_train,X_test,y_train,y_test,vcv_train,vcv_test)=split_data_vcv(X,y,vcv,num_test,seed=seed)# seed defined aboveSimple model fitting without Cross-Validation (CV)fromphylokrr.kernelsimportKRR# set modelmodel=KRR(kernel='rbf',fit_intercept=True)# arbitrarily proposed hyperparametersparams={'lambda':2,'gamma':2}# set hyperparamtersmodel.set_params(**params)# fit model with phylogenetic covariance matrixmodel.fit(X_train,y_train,vcv=vcv_train)y_pred1=model.predict(X_test)Let's compare it with the standard phylogenetic regression (i.e., PGLS)importmatplotlib.pyplotaspltfromphylokrr.utilsimportPGLS# fit standard phylogenetic regressionb_wls=PGLS(X_train,y_train,vcv_train)y_pred3=np.hstack((np.ones((X_test.shape[0],1)),X_test))@b_wlsplt.scatter(X_test,y_test,color='blue',alpha=0.5,label='Testing (unseen) data')plt.scatter(X_test,y_pred1,color='green',alpha=0.5,label='phyloKRR predictions w\o CV')plt.scatter(X_test,y_pred3,color='red',alpha=0.5,label='PGLS predictions')plt.xlabel('x')plt.ylabel('y')plt.legend()Hyperparameter tuning with CVfromphylokrr.utilsimportk_fold_cv_randomparams={'lambda':np.logspace(-5,5,200,base=2),'gamma':np.logspace(-5,5,200,base=2),}best_params=k_fold_cv_random(X_train,y_train,vcv_train,model,params,folds=2,sample=50)model.set_params(**best_params)model.fit(X_train,y_train,vcv=vcv_train)y_pred_cv=model.predict(X_test)plt.scatter(X_test,y_test,color='blue',alpha=0.5,label='Testing (unseen) data')plt.scatter(X_test,y_pred_cv,color='green',alpha=0.5,label='phyloKRR predictions \w CV')plt.scatter(X_test,y_pred3,color='red',alpha=0.5,label='PGLS predictions')# y_pred3 defined aboveplt.xlabel('x')plt.ylabel('y')plt.legend()ReferenceRosas-Puchuri, U., Santaquiteria, A., Khanmohammadi, S., Solis-Lemus, C., & Betancur-R, R. (2023).Non-linear phylogenetic regression using regularized kernels. bioRxiv, 2023-10.
Package: phylo-match
Phylo-MatchPhylo-Match is a package for correcting misspellings or disparate labelings in phylogenetic treesInstallationThis project was built with python v3.8 (python3). Later versions should be fine, but no guarantees for earlier. Not compatible with python 2.Check that you have python3 installed:python3--versionOutput should be something like:Python3.7.1If --version does not return a version, follow Python3installation instructions(or install Python3 your own way)Use the package managerpip3to install phylo-match.Install pip:python3-mensurepip--upgradeInstall Phylo-Match:pip3installphylo-matchUsagephylo-matchUse the gui to select a database file (.csv), and a taxa tree (.nexus) to match the database to. Click run when you are happy with your selection.Phylo-Match does all of its calculations and api requests upfront, so users may have to wait 10-15 minutes after run is clicked, depending on internet speed.This time can be minimized by unchecking 'Lookup Taxa Info' - a good idea if you're very familiar with the taxa, but the project will not provide information about matches beyond the name.Information about the DB's taxa will be on the left-hand side. All similar entries in the .nexus file will appear in the middle of the screen. Click on the name you'd like to change the entry to, manually enter a name on the bottom, or click on 'same species', or 'same genus' for additional options, if available.Once all selections have been made, a new .csv file will be created in the same directory as the original database .csv file.Examples:The program (correctly) thinks my best bet to match the database taxon Aotus azarae is Aotus azarai from the tree. But if I don't like that option I can click on 'same species' to see other taxa in the tree with the species name "azarae" or 'same genus' to see other members of the genus Aotus.Here's an example of the 'same species' option at work: The database has Vicunga pacos but the tree has Lama pacos. This is useful if the genus has been split up.Here's an example where I might want to use the "Same Genus" option. This can be useful if you don't have many taxa in that genus and it doesn't really matter which species in the genus you use: Here I have data for Cercocebus atys but that taxon isn't in the tree. I could use a different Cercocebus species as a substitute. The 'removed suggestions' in the bottom left tells me that C. agilis is already matched between the data and tree, but C. atys and C. torquatus are sister species, both equally closely related to C. agilis, so I can use C. torquatus instead.ContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.Please make sure to update tests as appropriate.LicenseGPL-3.0
Package: phylomatcher
PhyloMatcherPython modules to query the GFIB or NCBI Taxonomy databases for synonym names of target species.InstallationRequired packages:BiopythonpygbifpandastqdmEasiest installation using a conda environment and pip:conda create -n tm-env -c conda-forge python
conda activate tm-env
pip install PhyloMatcherModesGBIFCSV input file should be a single column of target species to look up (other columns will be ignored). Names can be either space or underscore ("_") separated, i.e. "Sphenodon_punctatus" is equivalent to "Sphenodon punctatus".E.g.Sphenodon_punctatus
Gonyosoma_prasinusUsage:$ PhyloMatcher gbif -h
usage: PhyloMatcher gbif [-h] -i INPUT_CSV -o OUTFILE [-t THREADS]

options:
  -h, --help            show this help message and exit
  -i INPUT_CSV, --csv INPUT_CSV
                        CSV where first column is a list of target species names to look up.
  -o OUTFILE, --outfile OUTFILE
                        Path to output.
  -t THREADS, --threads THREADSNCBIDue to the specificity of Entrez results and the relative sparseness of taxonomy data a CSV intended for NCBI matching can have multiple columns, assuming the first column is the target species and the remaining columns are prior-known synonyms. All names will be flattened and searched to increase the chances of matches in the database. A single-column CSV file will also work, identically to the GBIF format.Note: currently the multi-Entrez script assumes the final column in the CSV is for notes. If people decide this is worth fixing I will, but it seems like the GBIF approach is much better across the board.E.g.Sphenodon_punctatus,Hatteria_punctata
Gonyosoma_prasinus,Coluber_prasinus,Elaphe_prasina,Rhadinophis_prasinus,Rhadinophis_prasinaUsage:$ PhyloMatcher ncbi -h
usage: PhyloMatcher ncbi [-h] -i INPUT_CSV -o OUTFILE -e EMAIL

options:
  -h, --help            show this help message and exit
  -i INPUT_CSV, --csv INPUT_CSV
                        CSV where first column is a list of target species names to look up.
  -o OUTFILE, --outfile OUTFILE
                        Path to output.
  -e EMAIL, --email EMAILMatching trait files to PhyloMatcher outputOnce you have found synonyms from tree output you can match that to any phenotypic/trait data you have. Similar to the other inputs the first column must contain the species names you're targeting, and they should be formatted identically to how the PhyloMatcher output looks (case-sensitive and separated by underscores.)Usage:$ PhyloMatcher trait -h
usage: PhyloMatcher trait [-h] -t TRAITFILE -s SPECIESFILE -o OUTFILE

options:
  -h, --help            show this help message and exit
  -t TRAITFILE, --traitfile TRAITFILE
                        CSV of trait values, first column must be species names.
  -s SPECIESFILE, --speciesfile SPECIESFILE
                        CSV of species synonyms output by the gbif or ncbi modules.
  -o OUTFILE, --outfile OUTFILE
                        Path to output.