{"action":"created","issue":{"url":"https://api.github.com/repos/arendsee/phylostratr/issues/4","repository_url":"https://api.github.com/repos/arendsee/phylostratr","labels_url":"https://api.github.com/repos/arendsee/phylostratr/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/arendsee/phylostratr/issues/4/comments","events_url":"https://api.github.com/repos/arendsee/phylostratr/issues/4/events","html_url":"https://github.com/arendsee/phylostratr/issues/4","id":320418347,"number":4,"title":"Possible bug? number of genes per strata is way higher than the total number of genes","user":{"login":"aseetharam","id":4835524,"avatar_url":"https://avatars0.githubusercontent.com/u/4835524?v=4","gravatar_id":"","url":"https://api.github.com/users/aseetharam","html_url":"https://github.com/aseetharam","followers_url":"https://api.github.com/users/aseetharam/followers","following_url":"https://api.github.com/users/aseetharam/following{/other_user}","gists_url":"https://api.github.com/users/aseetharam/gists{/gist_id}","starred_url":"https://api.github.com/users/aseetharam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aseetharam/subscriptions","organizations_url":"https://api.github.com/users/aseetharam/orgs","repos_url":"https://api.github.com/users/aseetharam/repos","events_url":"https://api.github.com/users/aseetharam/events{/privacy}","received_events_url":"https://api.github.com/users/aseetharam/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2018-05-04T20:25:20Z","updated_at":"2018-05-07T23:44:07Z","closed_at":null,"author_association":"NONE","body":"I re-ran the `phylostratr` recently on `Apis florea` and got really weired results. The number of genes reported per strata were way higher than the previous run and the sum doesn't equate to the total number of genes. I think it is due to some bug introduced recently because the previous run had much resonable numbers. The only difference between the previous run and this run is that I've added 16 extra spp for the latest run. \r\n\r\nHere is more information:\r\n\r\n### R script for previous run\r\n\r\n```\r\nlibrary(devtools)\r\nsource(\"https://bioconductor.org/biocLite.R\")\r\nlibrary(phylostratr)\r\nlibrary(magrittr)\r\nlibrary(plotly)\r\nfocal_taxid <- '7463'\r\nstrata <-\r\n  uniprot_strata(focal_taxid, from=2) %>%\r\n  add_taxa('7463') %>%\r\n  strata_apply(f=diverse_subtree, n=5, weights=uniprot_weight_by_ref()) %>%\r\n  use_recommended_prokaryotes %>%\r\n  uniprot_fill_strata\r\nresults <- strata_blast(strata, blast_args=list(nthreads=8)) %>%\r\n  strata_besthits %>%\r\n  merge_besthits\r\nphylostrata <- stratify(results)\r\nwrite.csv(phylostrata, \"phylostrata_table.csv\")\r\ntabled <- table(stratify(results)$mrca_name)\r\nwrite.csv(tabled, \"phylostrata_stats.csv\")\r\n```\r\n### R script for the present run:\r\n\r\n```\r\n#!/usr/bin/Rscript\r\nlibrary(devtools)\r\nsource(\"https://bioconductor.org/biocLite.R\")\r\nlibrary(phylostratr)\r\nlibrary(magrittr)\r\nlibrary(plotly)\r\nfocal_taxid <- '7463'\r\nstrata <-\r\n  uniprot_strata(focal_taxid, from=2) %>%\r\n  add_taxa('7463') %>%\r\n  strata_apply(f=diverse_subtree, n=5, weights=uniprot_weight_by_ref()) %>%\r\n  add_taxa(c('30195','88501','78185','78189','44477','132113','143995','156304','166423','175324','175328','178035','481568','516756','597456')) %>%\r\n  use_recommended_prokaryotes %>%\r\n  uniprot_fill_strata\r\nresults <- strata_blast(strata, blast_args=list(nthreads=8)) %>%\r\n  strata_besthits %>%\r\n  merge_besthits\r\nphylostrata <- stratify(results)\r\nwrite.csv(phylostrata, \"phylostrata_table.csv\")\r\ntabled <- table(stratify(results)$mrca_name)\r\nwrite.csv(tabled, \"phylostrata_stats.csv\")\r\nplot_heatmaps(results, \"heatmaps3.pdf\")\r\n```\r\n\r\n### Previous results:\r\n```\r\n\"\",\"Var1\",\"Freq\"\r\n\"1\",\"cellular organisms\",6853\r\n\"2\",\"Eukaryota\",5120\r\n\"3\",\"Opisthokonta\",415\r\n\"4\",\"Metazoa\",1940\r\n\"5\",\"Eumetazoa\",333\r\n\"6\",\"Bilateria\",456\r\n\"7\",\"Protostomia\",277\r\n\"8\",\"Ecdysozoa\",62\r\n\"9\",\"Panarthropoda\",48\r\n\"10\",\"Arthropoda\",216\r\n\"11\",\"Mandibulata\",72\r\n\"12\",\"Pancrustacea\",131\r\n\"13\",\"Hexapoda\",112\r\n\"14\",\"Neoptera\",639\r\n\"15\",\"Holometabola\",62\r\n\"16\",\"Apocrita\",305\r\n\"17\",\"Aculeata\",188\r\n\"18\",\"Apoidea\",75\r\n\"19\",\"Apidae\",70\r\n\"20\",\"Apis\",97\r\n\"21\",\"Apis florea\",205\r\n```\r\n\r\n### Present results:\r\n\r\n```\r\n\"\",\"Var1\",\"Freq\"\r\n\"1\",\"cellular organisms\",284161\r\n\"2\",\"Eukaryota\",103882\r\n\"3\",\"Opisthokonta\",44785\r\n\"4\",\"Metazoa\",63526\r\n\"5\",\"Eumetazoa\",63633\r\n\"6\",\"Bilateria\",130111\r\n\"7\",\"Protostomia\",153915\r\n\"8\",\"Ecdysozoa\",173269\r\n\"9\",\"Panarthropoda\",37748\r\n\"10\",\"Arthropoda\",95879\r\n\"11\",\"Mandibulata\",14997\r\n\"12\",\"Pancrustacea\",57473\r\n\"13\",\"Hexapoda\",48852\r\n\"14\",\"Neoptera\",106423\r\n\"15\",\"Holometabola\",116966\r\n\"16\",\"Apocrita\",33352\r\n\"17\",\"Aculeata\",72995\r\n\"18\",\"Apoidea\",38565\r\n\"19\",\"Apidae\",158736\r\n\"20\",\"Apinae\",8673\r\n\"21\",\"Apis\",15274\r\n\"22\",\"Apis florea\",15810\r\n```\r\n\r\nClearly, this isn't right. Could you please take a look at it?\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/arendsee/phylostratr/issues/comments/387239866","html_url":"https://github.com/arendsee/phylostratr/issues/4#issuecomment-387239866","issue_url":"https://api.github.com/repos/arendsee/phylostratr/issues/4","id":387239866,"user":{"login":"arendsee","id":3998543,"avatar_url":"https://avatars3.githubusercontent.com/u/3998543?v=4","gravatar_id":"","url":"https://api.github.com/users/arendsee","html_url":"https://github.com/arendsee","followers_url":"https://api.github.com/users/arendsee/followers","following_url":"https://api.github.com/users/arendsee/following{/other_user}","gists_url":"https://api.github.com/users/arendsee/gists{/gist_id}","starred_url":"https://api.github.com/users/arendsee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arendsee/subscriptions","organizations_url":"https://api.github.com/users/arendsee/orgs","repos_url":"https://api.github.com/users/arendsee/repos","events_url":"https://api.github.com/users/arendsee/events{/privacy}","received_events_url":"https://api.github.com/users/arendsee/received_events","type":"User","site_admin":false},"created_at":"2018-05-07T23:44:07Z","updated_at":"2018-05-07T23:44:07Z","author_association":"OWNER","body":"@aseetharam Sorry, disregard the last two messages, I didn't fix a bug, I added a new one.\r\n"}}
{"actor":{"display_login":"arendsee"}}