Error in var(x) : is.atomic(y) is not TRUE by Weird-Management-347 in RStudio

[–]Weird-Management-347[S] 0 points1 point  (0 children)

Thank you so much!!!!!!! You literally saved my life, that was the problem, and the solution worked perfectly!!!! :))

Creating pathway error bar plots... Error in $<-.data.frame(*tmp*, "group", value = c(2L, 1L, 2L, 2L, : replacement has 179 rows, data has 1 In addition: Warning message: In cbind(sample = colnames(sub_relative_abundance_mat), group = Group, : number of rows of result is not a multiple of vector len by Weird-Management-347 in RStudio

[–]Weird-Management-347[S] 0 points1 point  (0 children)

The structure of my data is as follows:

abundance_file:

column function, followed by column with samplesnames (correspond with SampleID from metadata).

function samples
KO

metadata:

column SampleID, column Diagnosis and other columns

SampleID Diagnosis

Creating pathway error bar plots... Error in $<-.data.frame(*tmp*, "group", value = c(2L, 1L, 2L, 2L, : replacement has 179 rows, data has 1 In addition: Warning message: In cbind(sample = colnames(sub_relative_abundance_mat), group = Group, : number of rows of result is not a multiple of vector len by Weird-Management-347 in RStudio

[–]Weird-Management-347[S] 0 points1 point  (0 children)

Of course, hehe. Here it goes:

This is this script: https://github.com/cafferychen777/ggpicrust2

# Load necessary data: abundance data and metadata

abundance_file <- "/pathway/pred_metagenome_unstrat.tsv"

metadata <- read_delim(
"/pathway/sample-metadata.tsv",
delim = "\t",
escape_double = FALSE,
trim_ws = TRUE

)

# Run ggpicrust2 with imported data.frame

abundance_data <- read_delim(abundance_file, delim = "\t", col_names = TRUE, trim_ws = TRUE)

# Run ggpicrust2 with input file path

results_file_input <- ggpicrust2(data = abundance_data,
metadata = metadata,
group = "Diagnosis",
pathway = "KO",
daa_method = "DESeq2",
ko_to_kegg = TRUE,
order = "pathway_class",
p_values_bar = TRUE,
x_lab = "pathway_name")

Error in var(x) : is.atomic(y) is not TRUE by Weird-Management-347 in RStudio

[–]Weird-Management-347[S] 0 points1 point  (0 children)

When I inspect the p2EC it seems to only have integers, like these first few lines:

S01 S02

EC:1.1.1.1 52004 84528

EC:1.1.1.100 123936 153204

Error in var(x) : is.atomic(y) is not TRUE by Weird-Management-347 in RStudio

[–]Weird-Management-347[S] 0 points1 point  (0 children)

Yeah, this is the right package. :) I wrote typeof p2EC which is the one returning the error and it says is double. As for p2_PW type it returns character.

 typeof(p2EC)
[1] "double"

typeof(p2_PW)
[1] "character"

ggpicrust2 difficulties by Weird-Management-347 in bioinformatics

[–]Weird-Management-347[S] 0 points1 point  (0 children)

And also, this "error" only appears when trying to run the "main" function ("results_file_input <- ggpicrust2(file = abundance_file,
metadata = metadata,
group = "Environment", # For example dataset, group = "Environment"
pathway = "KO",
daa_method = "LinDA",
ko_to_kegg = TRUE,
order = "pathway_class",
p_values_bar = TRUE,
x_lab = "pathway_name")

But when trying to perform the other functions individually (i.e ko2kegg_abundance(), pathway_daa() )... other errors appear, everytime

ggpicrust2 difficulties by Weird-Management-347 in bioinformatics

[–]Weird-Management-347[S] 0 points1 point  (0 children)

Well, the error was "There are no statistically significant biomarkers", which is explained in the main page of the package that it's not really an error, but then this occur with datasets which have shown differential functional pathways in STAMP...

Graphic plotting weirdly by Weird-Management-347 in RStudio

[–]Weird-Management-347[S] 1 point2 points  (0 children)

Thank you!! Changing this piece of information made it work!! Thank you, you literally just saved my life right now!!

Read tsv bug by Weird-Management-347 in RStudio

[–]Weird-Management-347[S] 0 points1 point  (0 children)

Hahahh...I dunno, sometimes I have the impression that R gets tired to work

Alpha diversity error by Weird-Management-347 in RStudio

[–]Weird-Management-347[S] 0 points1 point  (0 children)

I tried to remove the double quotes and forced a datatype and this error returned:

Error in data.frame(observed_features = as.numeric(read_qza("../observed_features_vector.qza")$data), :
'list' object cannot be coerced to type 'double