{ "info": { "author": "Silex", "author_email": "silex@silexsistemas.com.br", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: End Users/Desktop", "Intended Audience :: Science/Research", "License :: OSI Approved :: GNU General Public License (GPL)", "Programming Language :: Python" ], "description": "# Nedda 0.2\r\n## Automatic TNM cancer staging library\r\n\r\nWhat is new on version 0.2:\r\n\r\nWe have completely changed the way we receive the parameters for TNM and return the correct stage. On the prior version,\r\nwe had the naive implementation of different staging classes, that would be chosen by a factory method according to the\r\ngiven ICD. Inside each class, we had a set of regular expressions and if that would choose the correct stage.\r\n\r\nThis was a super simple way to do things and it was bad code. It was only a point of departure. It had the major incovenience\r\nof mixing data and code and, although simple to implement to a few cancer types, it would be impossible to mantain in\r\nthe long run.\r\n\r\nThanks to the help of Professors [Maria Laura Magalh\u00e3es Gomes] (http://lattes.cnpq.br/5671580360415081) and \r\n [Paulo Ant\u00f4nio Fonseca Machado] (http://www.mat.ufmg.br/~pafm/), from the [Mathematics Department of the Federal University\r\nof Minas Gerais] (http://www.mat.ufmg.br), we were able to do a much more intelligent implementation.\r\n\r\nThe problem of TNM staging consists fundamentally into mapping a set of values to different buckets. That could be solved\r\nusing a hash function, that the Python programming language has built in on its dictionary data structure.\r\n\r\nAfter this insight, we have changed the implemetation and created a csv file, consisting of the different TNM possibilities\r\nfor numerous cancer types and its corresponding stages.\r\n\r\nThis csv file is loaded into memory as a dictionary, and the TNM combination is the key that corresponds to a value. As\r\nfar as we know, dictionary lookups in Python are very fast and very simple to write: if a given key is found, the correspondig\r\nstage is returned. Otherwise, no stage is to be found.\r\n\r\nWe have also created a small django app that allows the user to input the ICD code, the T, the N, the M from select boxes\r\nand get the correct stage in return. The app allows to input dukes, psa and gleason values where fit. \r\n\r\n**What is cancer?**\r\n\r\nIn layman terms, the truth is that the word *cancer* actually refers to a huge number of different diseases. They have in common the fact that they are an abnormal reproduction of cells, and they have the capability to spread to other organs and parts of the body. The National Cancer Institute of the United States uses the interesting expression \"*a collection of related diseases*\" to describe cancer[1].\r\n \r\nCancer can appear on almost animal tissue. On the human body, there are different types of cancers for every organ and every kind of cell. To mention the most common types in the US, in 2015 figures[2]:\r\n\r\n|Cancer Type | New Cases | Deaths |\r\n|--------------------------------------------|-----------|---------|\r\n|Bladder |\t74,000 | 16,000 |\r\n|Breast (Female)\t | 231,840 | 40,290 |\r\n|Breast (Male) \t | 2,350 | 440 |\r\n|Colon and Rectal (Combined)\t | 132,700 | 49,700 |\r\n|Endometrial\t | 54,870 | 10,170 |\r\n|Kidney (Renal Cell and Renal Pelvis) Cancer |\t61,560 | 14,080 |\r\n|Leukemia (All Types)\t | 54,270 | 24,450 |\r\n|Lung (Including Bronchus)\t | 221,200 | 158,040 |\r\n|Melanoma\t | 73,870 | 9,940 |\r\n|Non-Hodgkin Lymphoma\t | 71,850 | 19,790 |\r\n|Pancreatic\t | 48,960 | 40,560 |\r\n|Prostate\t | 220,800 | 27,540 |\r\n|Thyroid\t | 62,450 | 1,950 |\r\n\r\n**What is cancer staging?**\r\n\r\nAccording to the introduction of the AJCC Cancer Staging Manual:\r\n\r\n> \"Cancer staging plays a pivotal role in the battle on cancer. It forms the basis for understanding the changes in population cancer incidence, extent of disease initial presentation, and the overall impact of improvements in cancer treatment. Staging forms the base for defining groups for inclusion in clinical trials. Most importantly, staging provides those with cancer and their physicians the critical benchmark for defining prognosis and the likelihood of overcoming the cancer and for determining the best treatment approach for their cases.\" [3]\r\n\r\nDifferent types of cancer have completely different treatment options and prognostics according to their staging. For instance, a very small and localized breast cancer determines a certain treatment path and has a very good (more than 95%) chance of total cure (or remission). Unfortunately, if the same type of cancer is not detected early, it can grow and spread to the lymphatic system (local and distant) and to other organs (metastatic disease). In this case, the treatment options are distinct, and the chance of cure much more remote.\r\n\r\n**How is cancer staged?**\r\n\r\nThere is a system called TNM to classify each kind cancer. It is maintained by the international medical community, through an organization called UICC. For each type of cancer there is a table that maps some values to a specific stage. Those values are known as T - the size of the tumor, N - the affected regional nodes, and M - the presence of metastatic disease. Some kinds of cancer can also consider other values on the computation. For instance, to compute the stage for prostate cancer, it is also necessary to use the values of PSA an Gleason. For Colon, a value known as Dukes.\r\n\r\nThe physician must know those values and manually look up on the specific table to correctly classify the cancer. Those tables are provided on medical manuals, and are updated periodicaly.\r\n\r\n**How can Nedda help you?**\r\n\r\nNedda is a Python library that computes, given an ICD code and the T, N and M values, the resulting staging. It is still a prototype. We intend to use Nedda in conjunction with a Oncology module we have been developing for GNU Health [4], an open source and free (as in freedom and as in free beer.GPL 3 rocks!) health administration system.\r\n\r\n**How to use Nedda**\r\n\r\nNedda still has a very simple interface. The idea is to pass to the library the ICD, T, N and M values and get a stager object, that validates the input and computes the correct stage for different types of cancer.\r\n\r\nThe GenericStager object can be used in two ways. First, it can be created with passing only the ICD to the constructor:\r\n```python\r\nfrom nedda.staging.staging import GenericStager\r\ngs = GenericStager('C50')\r\n```\r\n\r\nIn this case, the gs object will be used to supply the available Ts, Ns and Ms:\r\n```python\r\ngs.get_m_list()\r\n['M0', 'M1']\r\ngs.get_t_list()\r\n['Tis', 'T0', 'T1', 'T2', 'T3', 'T4']\r\ngs.get_m_list()\r\n['M0', 'M1']\r\n```\r\n\r\nThis is useful if you want to know only the available TNM options for that kind of cancer, and does not want to stage a specific case yet. This functionality is used by our web application to return the options to be selected on the user\r\ninterface after an user has chosen an ICD code.\r\n\r\nThe other way to use the GenericStager is to pass in all the values needed for an specific staging evaluation, and then call its stage field:\r\n\r\n```python\r\ngs = GenericStager('C50', 'T1', 'N1', 'M0')\r\n```\r\n\r\nIf you call then:\r\n```python\r\nstager.stage\r\n```\r\n\r\nYou will get the response:\r\n```python\r\n'IIA'\r\n```\r\n\r\nA simple web service\r\n\r\nWe have now also a Django app that can be used as a web service or as a stand alone app. In order to run it, the Django library should be installed (version 1.8 or higher). The app can be run from inside the web_services directory as a regular Django app:\r\n```bash\r\n$ nedda/web_service/python manage.py runserver\r\n```\r\n\r\nWe are still working on tests and trying to make the web interface a little less ugly.\r\n\r\nFor the time being, that is pretty much that. Nedda works for breast, cervix uteri, colon and rectum, lung, prostate, corpus uteri and stomach cancer. We have published the repository here in such an imature state hoping that the community would give some architectural and functional ideas and, of course, contributions on coding!\r\n\r\n**How does Nedda work?**\r\n\r\nNedda looks the ICD code and chooses from different lists which stager to return. Each cancer has a different table for TNM classification, so it is very difficult to be generic. Nedda, then, from different sets of regular expressions, matches the informed parameters to a determined stage. In the end, this is just a very fancy way to do a large number of nested 'ifs' and to code all those tables in a maintainable way.\r\n\r\nNedda also validates the Ts, Ns and Ms given to different lists according to the different cancer types. If an impossible combination is given, the TNM is considered invalid and a simple message is registered. We have also made lots of tests.\r\n\r\nAny ideas on how to do this complex set of nested ifs in a more elegant way is welcome! If you now arcane subjects such as graph theory, linear algebra, vector spaces, clustering and thinks that your knowledge can help us, please be my guest and \"tell me what you have learned, because the questions run so deep for such a simple man\" (Supertramp).\r\n \r\n**Who is Nedda?**\r\n\r\nNedda Novaes is an Oncologist in Belo Horizonte, MG, Brazil. She currently works on a huge hospital called Santa Casa de Miseric\u00f3rdia de Minas Gerais, and deals mainly with public health and poor patients. \r\nShe transcends the simple (yet extremely complex and dedication intensive) scientific and medical treatment of people. She really takes care of the social, psychological and human aspects of such a terrible disease, specially when associated to poverty and less than optimal social conditions. \r\nShe was the inspiration to create this project and to work on such an arid and hermetic subject.\r\nShe also happens to be my mother!\r\n\r\n\r\n[1] [What is Cancer](http://www.cancer.gov/about-cancer/what-is-cancer)\r\n[2] American Cancer Society: Cancer Facts and Figures 2015. Atlanta, Ga: American Cancer Society, 2015. \r\n[3] Cancer Staging Handbook. From the AJCC Cancer Staging Manual. p. vii\r\n[4] [GNU Health] (http://health.gnu.org/)\r\n\r\nCopyright 2015 [S\u00edlex Sistemas Ltda.] (http://www.silexsistemas.com.br)\r\nAttribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/silex/nedda", "keywords": "cancer,staging,tnm", "license": "UNKNOWN", "maintainer": "", "maintainer_email": "", "name": "nedda", "package_url": "https://pypi.org/project/nedda/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/nedda/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://bitbucket.org/silex/nedda" }, "release_url": "https://pypi.org/project/nedda/0.2/", "requires_dist": null, "requires_python": null, "summary": "A library for TNM cancer staging", "version": "0.2" }, "last_serial": 1759901, "releases": { "0.2": [ { "comment_text": "", "digests": { "md5": "ef4290f8faaf2196d188d19b6c813978", "sha256": "db15c1b57e30b61ed9d789ce3736fa19d6e9c6b482a7e4848dbecba7b1901877" }, "downloads": -1, "filename": "nedda-0.2.tar.gz", "has_sig": false, "md5_digest": "ef4290f8faaf2196d188d19b6c813978", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24823, "upload_time": "2015-10-09T11:52:44", "url": "https://files.pythonhosted.org/packages/2e/82/c8038b4970e6cbc286eacfad4cdd71d5c5a71f5e68537ee592ff5f143e35/nedda-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ef4290f8faaf2196d188d19b6c813978", "sha256": "db15c1b57e30b61ed9d789ce3736fa19d6e9c6b482a7e4848dbecba7b1901877" }, "downloads": -1, "filename": "nedda-0.2.tar.gz", "has_sig": false, "md5_digest": "ef4290f8faaf2196d188d19b6c813978", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24823, "upload_time": "2015-10-09T11:52:44", "url": "https://files.pythonhosted.org/packages/2e/82/c8038b4970e6cbc286eacfad4cdd71d5c5a71f5e68537ee592ff5f143e35/nedda-0.2.tar.gz" } ] }