danknights / sourcetracker

70 stars 26 forks source link

Returning error with sourcetracker() #5

Open Riselya opened 7 years ago

Riselya commented 7 years ago

Hi,

I'm using SourceTracker in R for the first time and can't work out an error I'm getting when using the sourcetracker() function on my own data (works for example data though):

Error in if (sum(as.integer(train) != as.numeric(train)) > 0) { : missing value where TRUE/FALSE needed

I've checked the data is all integer format as suggested by the function, including using ceiling() etc, but same error pops up. I do have low number of soil samples compared to microbiome samples (5 sink samples and 89 source samples), but from what I've read this shouldn't be a problem. I didn't upload the data in quiime format but uploaded it in the final format required by the example script, so I don't think this would be a problem either (i.e metadata as a dataframe and OTU table as a matrix; with row.names = sample name for both). Have tried a number of different formatting solutions but always with the same error. As far as I can see my data matches the format of the example data exactly, including the desc, envs and train.ix objects created, and not sure if I'm missing something silly/obvious (disclaimer - this could be the case, but I've spent a day working out what it could be). I haven't copied all the code here in case there is an obvious solution to the error, but I've uploaded the OTU table, metadata file and the R script below. Happy to provide more detail as needed.

Background: I have a number of avian gut microbiome samples from a species of shorebird, as well as some soil samples from the area where they were foraging when they were captured. I want to estimate the proportion of bacterial taxa shared between the avian and soil assemblages, but the number of soil samples is low (only n = 4, compared to ~90 bird samples; I pooled 4 soil samples into each DNA sample as I was not interested in spatial variation), and I also have one negative extraction control (made up of three pooled negative control samples). I analysed sequences in mothur so formatted the resulting count table and metadata to match the example data within R. I've already analysed the data with Phyloseq, but wanted just to estimate the number of shared bacterial taxa as quantified support for if the birds are sourcing their gut microbiome from the feeding environment.

Any help appreciated,

Cheers Alice

r_script.txt #rscript count_table.txt #otu table metadata1.txt #metadata

brilliant2643 commented 2 months ago

Hi,

I'm using SourceTracker in R for the first time and can't work out an error I'm getting when using the sourcetracker() function on my own data (works for example data though):

Error in if (sum(as.integer(train) != as.numeric(train)) > 0) { : missing value where TRUE/FALSE needed

I've checked the data is all integer format as suggested by the function, including using ceiling() etc, but same error pops up. I do have low number of soil samples compared to microbiome samples (5 sink samples and 89 source samples), but from what I've read this shouldn't be a problem. I didn't upload the data in quiime format but uploaded it in the final format required by the example script, so I don't think this would be a problem either (i.e metadata as a dataframe and OTU table as a matrix; with row.names = sample name for both). Have tried a number of different formatting solutions but always with the same error. As far as I can see my data matches the format of the example data exactly, including the desc, envs and train.ix objects created, and not sure if I'm missing something silly/obvious (disclaimer - this could be the case, but I've spent a day working out what it could be). I haven't copied all the code here in case there is an obvious solution to the error, but I've uploaded the OTU table, metadata file and the R script below. Happy to provide more detail as needed.

Background: I have a number of avian gut microbiome samples from a species of shorebird, as well as some soil samples from the area where they were foraging when they were captured. I want to estimate the proportion of bacterial taxa shared between the avian and soil assemblages, but the number of soil samples is low (only n = 4, compared to ~90 bird samples; I pooled 4 soil samples into each DNA sample as I was not interested in spatial variation), and I also have one negative extraction control (made up of three pooled negative control samples). I analysed sequences in mothur so formatted the resulting count table and metadata to match the example data within R. I've already analysed the data with Phyloseq, but wanted just to estimate the number of shared bacterial taxa as quantified support for if the birds are sourcing their gut microbiome from the feeding environment.

Any help appreciated,

Cheers Alice

r_script.txt #rscript count_table.txt #otu table metadata1.txt #metadata

Hi! I came across the same problem, I wonder how did you solve this problem? Thanks!

Sushi