{ "info": { "author": "Guanliang Meng", "author_email": "mengguanliang@foxmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Science/Research", "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3", "Topic :: Scientific/Engineering :: Bio-Informatics" ], "description": "# mglcmdtools\n\n## 1 Introduction\n\n`mglcmdtools` is a collection of common cmd tools intended to be used in Python3 scripts. By Guanliang MENG, see https://github.com/linzhi2013/mglcmdtools.\n\n\n## 2 Installation\n\n pip install mglcmdtools\n\n\n## 3 Usage\n\n from mglcmdtools import rm_and_mkdir, runcmd, longStrings_not_match_shortStrings, read_fastaLike, read_fastaLike2, csv2dict, csv2tupe, split_fasta_to_equal_size\n\n\n rm_and_mkdir('Newdirectory')\n\n rm_and_mkdir('Newdirectory', force=True)\n\n\n cmd = 'ls -lhtr /'\n runcmd(cmd)\n\n runcmd(cmd, verbose=True)\n\n\n Long_strings = ['AABB', 'CCDD', 'EEFF']\n Short_strings = ['AA', 'EE']\n longStrings_not_match_shortStrings(Long_strings, Short_strings)\n # ['CCDD']\n\n\n`seq.fa` file has following content:\n\n >scaffold512 Locus_1222_0 8.3 LINEAR length=1717 score=20.785\n COX2 2 649 45 643 + 4\n COX3 897 1691 18 784 + 4\n >C7676 18.0 length=1633 score=19.113\n DNA afd\n COX1 34 1580 12 1530 - 4\n >C7536 14.0 length=1185 score=13.529\n CYTB 178 1185 25 1008 + 4\n >scaffold619 Locus_1559_0 5.0 LINEAR length=803 score=3.515\n ND4 27 764 515 1185 + 2\n >scaffold367 Locus_808_0 4.6 LINEAR length=652 score=2.296\n ATP6 1 306 324 620 - 4\n AAA adfjkaj\n\n\nThen read each record:\n\n for rec in read_fastaLike('seq.fa'):\n print('seqid line:', rec[0])\n print('sequence line 1:', rec[1])\n\n\nfunction `csv2dict(file=None, header=None, nrows=None, index_col=0, rm_self=True, **kwargs)`:\n\n targeted file: a csv file containing a matrix.\n\n by default, assuming the csv file does not have header row, and the first column (index 0) is the row names.\n\n you must specify how many rows to be read.\n\n 1. read data from a csv file into a pandas Dataframe;\n 2. change the up triangular and low triangular to dictionary 'triu_dict' and 'tril_dict', respectively.\n\n Parameter:\n rm_self: remove the pair of self-to-self, default True.\n\n\n Return:\n (triu_dict, tril_dict)\n\n\nfunction `csv2tupe(file=None, header=None, nrows=None, index_col=0, rm_self=True, **kwargs)`:\n\n targeted file: a csv file containing a matrix.\n\n by default, assuming the csv file does not have header row, and the first column (index 0) is the row names.\n\n you must specify how many rows to be read.\n\n 1. read data from a csv file into a pandas Dataframe;\n 2. change the up triangular and low triangular to LIST of tupes 'triu' and 'tril', respectively.\n\n Parameter:\n rm_self: remove the pair of self-to-self, default True.\n\n\n Return:\n (triu, tril)\n\n\nfunction `split_fasta_to_equal_size(fastafile=None, tot_file_num=10, outdir='./')`:\n\n Split a fasta file to `tot_file_num` subfiles, and all subfiles have\n appropximately equal size.\n\n Return:\n A list of the subfiles' abspath\n\n\nfunction `extend_ambiguous_dna(seq=None, get_a_random_seq=False, get_first_seq=False)`:\n\n return a `map` iterator of all possible sequences given an ambiguous\n DNA input.\n\n if `get_a_random_seq=True`, return a randomly chosen sequence. Beware, if the seq is too long, and there are too many ambiguous sites,this can take\n a lot of memory. It is at your own risk to use `get_a_random_seq=True`. I\n would suggest you use `get_first_seq=True` instead.\n\n if `get_first_seq=True`, return only the first sequence of the `map`\n iterator. the result should always be the same for one input DNA.\n\n if `get_a_random_seq=True` and `get_first_seq=True` at the same time,\n only `get_first_seq=True` will work.\n\n cannot deal with 'U' in RNA sequences.\n\n the lower case or upper case of each base will be the same with input DNA.\n\n modified from:\n https://stackoverflow.com/questions/27551921/how-to-extend-ambiguous-dna-sequence\n\n\nfunction `extend_ambiguous_dna_randomly(seq=None)`:\n\n return one sequence by randomly extending the input ambiguous DNA.\n\n the lower case or upper case of each base will be the same with input DNA.\n\n cannot deal with 'U' in RNA sequences.\n\n\n\n## 4 Author\nGuanliang MENG\n\n## 5 Citation\nCurrently I have no plan to publish `mglcmdtools`.", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/linzhi2013/mglcmdtools", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "mglcmdtools", "package_url": "https://pypi.org/project/mglcmdtools/", "platform": "", "project_url": "https://pypi.org/project/mglcmdtools/", "project_urls": { "Homepage": "https://github.com/linzhi2013/mglcmdtools" }, "release_url": "https://pypi.org/project/mglcmdtools/0.0.8/", "requires_dist": null, "requires_python": ">=3", "summary": "common cmd tools to be used in Python3 scripts. By Guanliang MENG, see https://github.com/linzhi2013/mglcmdtools.", "version": "0.0.8" }, "last_serial": 4554531, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "5b734dd2626957a00172bc92b00e5d2b", "sha256": "bc22c3a25e9a03bdef5cd6ede22130cc2ab1fafa06b6247036f4fe70c5b74a12" }, "downloads": -1, "filename": "mglcmdtools-0.0.1.tar.gz", "has_sig": false, "md5_digest": "5b734dd2626957a00172bc92b00e5d2b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 15086, "upload_time": "2018-08-28T04:04:45", "url": "https://files.pythonhosted.org/packages/0f/f6/dbfd8ce8b9704766dc004c397d7951e2f982bf667437a1c0e806aa73173b/mglcmdtools-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "ed28bd8ef53eedfebce36a9ba14385f2", "sha256": "b4d3be36d8a39337f018533f615bf573e9b38bc1a758780c05d4dc7b799443e6" }, "downloads": -1, "filename": "mglcmdtools-0.0.2.tar.gz", "has_sig": false, "md5_digest": "ed28bd8ef53eedfebce36a9ba14385f2", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 15383, "upload_time": "2018-09-05T03:44:09", "url": "https://files.pythonhosted.org/packages/da/90/2b5ef2a936db141aff9a0ee3bd856d3ac74d480b56f9d6aaa06e07fa5216/mglcmdtools-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "7d6fd311d4ea40b48df35fe3e1944f64", "sha256": "60cfa46b765a250c5634b9a49848e32d899c364f6089341212166f65493c64a1" }, "downloads": -1, "filename": "mglcmdtools-0.0.3.tar.gz", "has_sig": false, "md5_digest": "7d6fd311d4ea40b48df35fe3e1944f64", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 16747, "upload_time": "2018-09-12T14:37:51", "url": "https://files.pythonhosted.org/packages/63/ca/4c9c64a45fbbb9e1cdf53b9b515f05ea41243ab7879017d0d79b3c876045/mglcmdtools-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "2c9c65acf1b97a179b1629769a5616be", "sha256": "d8b08e796791a2ff073cd1ed332c3635f4fd7e49ee3102eda503d509ad2d1cef" }, "downloads": -1, "filename": "mglcmdtools-0.0.4.tar.gz", "has_sig": false, "md5_digest": "2c9c65acf1b97a179b1629769a5616be", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 17552, "upload_time": "2018-11-08T10:07:01", "url": "https://files.pythonhosted.org/packages/98/05/e572b2dffbe8b5cf4968d8f3b8f59afb0fb0acbcf72e964fb2b2e8d7f286/mglcmdtools-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "a8f98935bca1e7f93b0d8df25f03d07c", "sha256": "b199ed216fb88da3ddce72fb3c4db92d76a53d13e6c81fb6c5ee474698632346" }, "downloads": -1, "filename": "mglcmdtools-0.0.5.tar.gz", "has_sig": false, "md5_digest": "a8f98935bca1e7f93b0d8df25f03d07c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 18555, "upload_time": "2018-12-03T02:29:24", "url": "https://files.pythonhosted.org/packages/08/6f/feaf514d97eb9f5afefdd84243815be38d91f7bfd4fa9d2dbea76d03f3fc/mglcmdtools-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "2caa1badce06145992986bed63d1f483", "sha256": "24337577772d3109483de2d0cca1ece9bd856763fd3bdc00f7f81e5e74cf501d" }, "downloads": -1, "filename": "mglcmdtools-0.0.6.tar.gz", "has_sig": false, "md5_digest": "2caa1badce06145992986bed63d1f483", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 19060, "upload_time": "2018-12-03T03:19:25", "url": "https://files.pythonhosted.org/packages/07/a3/921cf10f4c8267be0f82097e12c2860b83c0fc3b42910f87371a6a39d3f8/mglcmdtools-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "c38a9cf5c0bafd0f3dd048e1dfc13b98", "sha256": "fc6d440b7c66571797df125a9e70805c3077091710e7f71d903244396e435607" }, "downloads": -1, "filename": "mglcmdtools-0.0.7.tar.gz", "has_sig": false, "md5_digest": "c38a9cf5c0bafd0f3dd048e1dfc13b98", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 19199, "upload_time": "2018-12-03T03:41:04", "url": "https://files.pythonhosted.org/packages/67/7b/06f7eba173a40014e9ddda7961fb5c99a72abe4425c8f08a8f80638de431/mglcmdtools-0.0.7.tar.gz" } ], "0.0.8": [ { "comment_text": "", "digests": { "md5": "24f3418bae5ac6d9f63f781a14723a8d", "sha256": "8f5b2c503c8c16c3c53c982f7af8d0f85f006f2cf0b3e751c516e706fc7d2cef" }, "downloads": -1, "filename": "mglcmdtools-0.0.8.tar.gz", "has_sig": false, "md5_digest": "24f3418bae5ac6d9f63f781a14723a8d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 19797, "upload_time": "2018-12-03T06:40:48", "url": "https://files.pythonhosted.org/packages/b4/5d/1a8f88d76041daf8f2ae18e33dbc65e375c6306531ac6a688f1f750a84d5/mglcmdtools-0.0.8.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "24f3418bae5ac6d9f63f781a14723a8d", "sha256": "8f5b2c503c8c16c3c53c982f7af8d0f85f006f2cf0b3e751c516e706fc7d2cef" }, "downloads": -1, "filename": "mglcmdtools-0.0.8.tar.gz", "has_sig": false, "md5_digest": "24f3418bae5ac6d9f63f781a14723a8d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 19797, "upload_time": "2018-12-03T06:40:48", "url": "https://files.pythonhosted.org/packages/b4/5d/1a8f88d76041daf8f2ae18e33dbc65e375c6306531ac6a688f1f750a84d5/mglcmdtools-0.0.8.tar.gz" } ] }