-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The condition has length > 1 and only the first element will be used (load_taxa_table) #34
Comments
Hi Jarrod, Often this issue comes up if there isn't a "#" symbol in front of the first line of the taxa table. This quirk is a legacy of the way that Qiime OTU tables were formatted when the mctoolsr package was first written. Hope this helps! |
Hi Hannah @hhollandmoritz Thanks for the fast reply :) Both of my files have a # at the beginning of the first line. I attached them just in case. Best |
Hi Jarrod (@jarrodscott), Thanks for attaching those files, they were very useful! I was able to load in the samples successfully on my own computer without an issue so it seems like it might be something that is specific to either your code or your installation and set up. Hopefully it is your code as that will be a much easier problem to solve. This is the exact code I used to load your samples: library(mctoolsr)
tax_table_fp = "~/Downloads/tmp_otu_tax.txt"
map_fp = "~/Downloads/tmp_md.txt"
input = load_taxa_table(tax_table_fp, map_fp) Let me know if you still have issues after using that code and we can try to troubleshoot what might be going on with your setup. Cheers, (As a post-script - there have been a bunch of installation-related issues recently with mctoolsr, so I wouldn't be at all surprised if it's not a code issue at all and there is something wrong with your installation). |
Hi Hannah, Thank you, thank you! It is great that the files worked for you---valuable information. I tried your code and got the same message. I also tried running the code in R Console (I was using RStudio before) and got a slightly more informative message:
So it seems like this is maybe not a problem as much as a warning. I also tried reinstalling the dev version and got this message:
So my install is up to date. Maybe I will try a complete reinstall... |
I think it's worth trying a full reinstall eventually. But if you're pressed for time, for now you can check the From what I could tell, the length warning comes from an if-then statement that's been fed an invalid argument. There are a lot of if-then statements in the I'll keep looking around for leads in that area, but if your input object is looking okay, then you should be able to continue, although, obviously solving the problem would be a more ideal solution. |
Great, thanks! My data looks fine when I load it.
|
I finally figured out what the problem is on my end. For unclassified taxonomic ranks, I was using the next highest rank call with the rank as a prefix. For example, if I had an OTU that was not classified below
Where I substitute
|
Good to know! Thanks for reporting back!
…--
Hannah Holland-Moritz
Doctoral Candidate, Fierer Lab
EBIO Department
University of Colorado Boulder
she/her pronouns
hhollandmoritz@gmail.com
https://hhollandmoritz.github.io
I may email you outside your working hours. Please don't feel pressure to
respond until your working hours.
<https://secure-web.cisco.com/1nTIVc1yBgvWcr9ZPOBTASp9_B57lnQ2aj5sai1lo304Yz6TAYV1KgaIjy8mdd6ecxxkAuyveefGtuo9q-x_tPBIQou65oUF1ejWVINiDhLx1aoll_9TM-3YMx6GtsWx931K0aQIW1RC6R_C-kG7snK823Jq9eiPb_UJMfiq2WSEql7gVYJNpN1upiP5-BM5X7eR0rXGhQm_s0F9dbvfiNpTzXlIaFX3s2MqXFP7TXHpdPziIhb4_M4GWqaqWzSfmqV7CqeEEr5ure6eRjV6oVFqKBRHTIZV_5CotcOyf0zbbnoyPuJ3KAOyJ_gdGqLWoH1BtS5Ezvhvp13K32T-sfpYcBee6pJcdFI7RtfL3223-lSBJswahOQtYVgKxyhyRAN8rUw3FckK6se-HGVppDOI0jBaWAj92AQgUJgsGIO9fgK8vOJk0BMY8_65FW55B2rnNMrPH41SUusHSZvOPzw/https%3A%2F%2Fgotguts.org>
On Fri, Dec 11, 2020 at 6:33 AM Jarrod ***@***.***> wrote:
I finally figured out what the problem is on my end. For unclassified
taxonomic ranks, I was using the next highest rank call with the rank as a
prefix. For example, if I had an OTU that was not classified below Class
I had the lineage like so:
Bacteria;Proteobacteria;Gammaproteobacteria;c_Gammaproteobacteria;c_Gammaproteobacteria;c_Gammaproteobacteria
Where I substitute c_Gammaproteobacteria for all unclassified ranks. If
instead I remove those and have this instead:
Bacteria;Proteobacteria;Gammaproteobacteria;;; it works fine. Still no
explanation why it work on your setup @hhollandmoritz
<https://github.com/hhollandmoritz> but at least I figured out why I was
getting that warning. Thanks for your help, I will close for now.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#34 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB4MVPCXBV6DXIRRM5UQQ3TSUINRLANCNFSM4UVNXLSQ>
.
|
Hi,
I am running the function
load_taxa_table
using tab delimited taxa and metadata tables and I get the following:the condition has length > 1 and only the first element will be used
My tables are formatted (to the best of my knowledge) just like the example files provided with the
mctoolsr
package. When I run the command using these files, like soinput <- load_taxa_table("fruits_veggies_taxa_table_wTax.txt", "fruits_veggies_metadata.txt")
I do not get this error, so something is wrong with my input files. I cannot for the life of me figure out what the problem is.Any ideas? Thanks
The text was updated successfully, but these errors were encountered: