This is a test version of Biostars. For the public version, visit https://www.biostars.org.
up-down regulated using log2FC

Hello,

I used Data Wrangling in R to write commands to find the number of FC>1 and FC<-1. But R recognizes the column "log2FC" as null.


library(tidyverse)
library(lubridate)
library(stringr)
targets <- read.csv("FilteredGenes1.csv")

glimpse(targets)

targets <- tibble('log2FC '=targets$log2FC)
glimpse(targets)

summary (targets)
targets<- tibble('log2FC'=targets$ log2FC)


Upregulated <- subset(targets, targets$log2FC>1)


 Filtered-target <- subset(targets, targets$log2FC>1)

Error: Must subset rows with a valid subscript vector.
i Logical subscripts must match the size of the indexed input.
x Input has size 13796 but subscript `r` has size 0.
Run `rlang::last_error()` to see where the error occurred.
In addition: Warning message:
Unknown or uninitialised column: `log2FC`.
rna-seq

1 answer

You should show the output of: glimpse(targets), or head(targets), or simply typing targets, so we can see the structure and data types of your table. Your tibble() assignment has some oddities. Why are there spaces after the column specifier ($)? Is the output of targets$log2FC>1 a boolean vector of TRUE or FALSE? Can you access any other columns of your tibble in a predictable way?

Problem solved. It was because of space after column. Thanks Seidel

P-value of less than 0.05. So I only selected the log2FC column

Log in to answer this question.