{"action":"created","issue":{"url":"https://api.github.com/repos/joey711/phyloseq/issues/462","labels_url":"https://api.github.com/repos/joey711/phyloseq/issues/462/labels{/name}","comments_url":"https://api.github.com/repos/joey711/phyloseq/issues/462/comments","events_url":"https://api.github.com/repos/joey711/phyloseq/issues/462/events","html_url":"https://github.com/joey711/phyloseq/issues/462","id":69162207,"number":462,"title":"Getting Top N (10 or 15) abundant OTU for each taxa rank","user":{"login":"saidheeraj1","id":11686303,"avatar_url":"https://avatars.githubusercontent.com/u/11686303?v=3","gravatar_id":"","url":"https://api.github.com/users/saidheeraj1","html_url":"https://github.com/saidheeraj1","followers_url":"https://api.github.com/users/saidheeraj1/followers","following_url":"https://api.github.com/users/saidheeraj1/following{/other_user}","gists_url":"https://api.github.com/users/saidheeraj1/gists{/gist_id}","starred_url":"https://api.github.com/users/saidheeraj1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saidheeraj1/subscriptions","organizations_url":"https://api.github.com/users/saidheeraj1/orgs","repos_url":"https://api.github.com/users/saidheeraj1/repos","events_url":"https://api.github.com/users/saidheeraj1/events{/privacy}","received_events_url":"https://api.github.com/users/saidheeraj1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-04-17T15:34:57Z","updated_at":"2015-04-21T17:40:10Z","closed_at":null,"body":"Hello everyone,\r\n\r\nI am trying to get the top10 abundant OTU for taxa rank Genus. However I am unable to do that. Here is my code,\r\n\r\n> b1 = prune_taxa(taxa_sums(bacteria1) > 0, bacteria1)\r\n// bacteria is phyloseq object that contains otu_table, tax_table, tree and sample data)\r\n>mergedb1=merge_samples(b1, \"Mouse.Type\")\r\n// Mouse.Type is the variable which identifies the mouse\r\n>SD = merge_samples(sample_data(b1), \"Mouse.Type\")\r\n>identical(SD, sample_data(mergedb1))\r\n[1] TRUE\r\n>OTU10 = names(sort(taxa_sums(b1), TRUE)[1:10])\r\n>b10=prune_taxa(OTU10, b1)\r\n>mb10 = prune_taxa(OTU10, mergedb1)\r\n>rowSums(otu_table(b10))\r\n// I get the below result, but unable to understand it. I know that first row is abundance values, but what does the values in second row indicate?\r\n\r\n66734 101877 320116 360657 105514 360611 110629 105458 360612 360613 \r\n   639    639    561   1176    531   1176    953    531   1176   1176 \r\n\r\nplot_bar(b10, \"Mouse.Type\", fill = \"Mouse.Type\", facet_grid=~taxonomy7)\r\n//taxonomy7 is the genus\r\n\r\n![image]  (https://cloud.githubusercontent.com/assets/11686303/7205115/888d044c-e4ec-11e4-96cb-a0fefd961c3e.png)\r\n\r\nIn the above image I only see 6 genus instead of 10? \r\nWhat does the separating lines indicate in the bar? For example genus \"Streptococcus\", all bars contain lines.\r\n\r\nPlease help me out with this, let me know if there is any mistake in my code and any other better approach to do this.\r\n\r\nThanks in advance"},"comment":{"url":"https://api.github.com/repos/joey711/phyloseq/issues/comments/94882790","html_url":"https://github.com/joey711/phyloseq/issues/462#issuecomment-94882790","issue_url":"https://api.github.com/repos/joey711/phyloseq/issues/462","id":94882790,"user":{"login":"saidheeraj1","id":11686303,"avatar_url":"https://avatars.githubusercontent.com/u/11686303?v=3","gravatar_id":"","url":"https://api.github.com/users/saidheeraj1","html_url":"https://github.com/saidheeraj1","followers_url":"https://api.github.com/users/saidheeraj1/followers","following_url":"https://api.github.com/users/saidheeraj1/following{/other_user}","gists_url":"https://api.github.com/users/saidheeraj1/gists{/gist_id}","starred_url":"https://api.github.com/users/saidheeraj1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saidheeraj1/subscriptions","organizations_url":"https://api.github.com/users/saidheeraj1/orgs","repos_url":"https://api.github.com/users/saidheeraj1/repos","events_url":"https://api.github.com/users/saidheeraj1/events{/privacy}","received_events_url":"https://api.github.com/users/saidheeraj1/received_events","type":"User","site_admin":false},"created_at":"2015-04-21T17:40:10Z","updated_at":"2015-04-21T17:40:10Z","body":"I tried using merge_samples, but i got the below error\r\n> m1<-merge_samples(b10new, \"Grp\")\r\nError in validObject(.Object) : invalid class “phyloseq” object: \r\n Component sample names do not match.\r\n Try sample_names()\r\n\r\nSo i didn't merge samples, instead used variable \"Grp\" in facet_grid while plotting bar.\r\nSame error is also reported in issue #459 "}}