{"id":31663739,"url":"https://github.com/iavicenna/pyracmacs","last_synced_at":"2025-10-07T20:07:15.398Z","repository":{"id":43688632,"uuid":"462834972","full_name":"iAvicenna/PyRacmacs","owner":"iAvicenna","description":"A complete python interface to Racmacs via rpy2","archived":false,"fork":false,"pushed_at":"2025-08-06T16:19:03.000Z","size":3000,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-06T18:18:24.657Z","etag":null,"topics":["antigenic-cartography","computational-biology","immunology","racmacs","rpy2"],"latest_commit_sha":null,"homepage":"https://acorg.github.io/Racmacs/index.html","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iAvicenna.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-02-23T17:18:39.000Z","updated_at":"2025-08-06T16:19:06.000Z","dependencies_parsed_at":"2022-09-02T08:30:45.301Z","dependency_job_id":"513bc9c0-de05-4683-bb35-2e3a43ac56ef","html_url":"https://github.com/iAvicenna/PyRacmacs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/iAvicenna/PyRacmacs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iAvicenna%2FPyRacmacs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iAvicenna%2FPyRacmacs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iAvicenna%2FPyRacmacs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iAvicenna%2FPyRacmacs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iAvicenna","download_url":"https://codeload.github.com/iAvicenna/PyRacmacs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iAvicenna%2FPyRacmacs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278838434,"owners_count":26054720,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["antigenic-cartography","computational-biology","immunology","racmacs","rpy2"],"created_at":"2025-10-07T20:03:40.136Z","updated_at":"2025-10-07T20:07:15.392Z","avatar_url":"https://github.com/iAvicenna.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PyRacmacs\nA python interface to [Racmacs](https://acorg.github.io/Racmacs/index.html) using rpy2.\n\nAlmost all of the functionalities in Racmacs (and some more) are also available in PyRacmacs. Most properties and functions in Racmacs which would be in camelCase \nis in snake_case in PyRacmacs but otherwise available in a similar fashion. See examples folder for extensive tutorials on usage of PyRacmacs.\n\n## Installation notes:\nIf you want to get this running in a conda environment but have R packages installed in your base, the only way for the environment to see the R packages installed \nin the base seems to be installing rpy2 via pip and setting the environment variables correctly before doing so. See:\n\nhttps://stackoverflow.com/questions/68936589/how-to-select-r-installation-when-using-rpy2-on-conda\n\nA minimal working example is:\n\n1- Create an enviroment containing pip\n```\nconda create -n env-name pip \nconda activate env-name\n```\n\n2- Check that which R points to the base R and which pip points to env bin\n```\nwhich R\nusr/bin/R\nwhich pip\npath_to_env-name/bin/pip\n```\n\n3- export the necessary LDFLAG and install rpy2 via pip from your enviroment:\n```\nexport LDFLAGS=\"-Wl,-rpath,/usr/lib/R/lib\"\npip install rpy2 --force-reinstall --compile --no-binary rpy2\n```\n\nYou can check if the installation was correct by running python -m rpy2.situation.\nIf somewhere in the output it says\n\n```\nLooking for R's HOME:\n    Environment variable R_HOME: None\n    Calling `R RHOME`: /usr/lib/R\n```\n\nyou are good to go. \n\nNote that installing other R related packages such as r-base prior to this will result in R RHOME likely pointing to enviroment's bin directory\nand I am not sure how to create such an environment, apart from trying to install r-base afterwards rpy2.\n\nIf you want to create an environment with more packages changing the first step to \n\n```\nconda create -n env-name r-base other-packages\n```\n\nseems to work fine too.\n\n\n## Warning and error notes:\nSome of the warning and error messages returned will directly be from R. An example is when there are disconnected points in a map, you will get the following when you run PyRacmacs optimize on such a map:\n\n```\nRRuntimeError: Error: Map contains disconnected points (points that are not connected through any path of detectable titers so cannot be coordinated relative to each other). To optimize anyway, rerun with 'options = list(ignore_disconnected = TRUE)'.\n```\n\nIn such a case you should check for the corresponding way of supplying options in PyRacmacs. In PyRacmacs supplying options is done via dictionaries (as named lists don't exist in python) and the corresponding fix would be\nsupplying to the PyRacmacs optimize function\n\n```\noptions={\"ignore_disconnected\":True}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiavicenna%2Fpyracmacs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiavicenna%2Fpyracmacs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiavicenna%2Fpyracmacs/lists"}