This is a test version of Biostars. For the public version, visit https://www.biostars.org.
select of genes

hello everyone

I'm working on an RNA-SEQ analysis and I want to select the genes that have a fold change between 1.25 and 0.75 from a data.frame, this it locates the genes in the rows and the statistics in the columns, so the data I want get are from the same column.

How can I do this?

thank you

rna-seq

It would be useful to show us how your dataframe looks like. But this looks like a standard R dataframe slicing question, so googling will give you some ideas.

dear, my data.frame looks like this, I have searched how to do the selection of the genes that have a range of Fold Chage, but when I observe the data.frame filtered they are not what I want.

I used this command

genes_select = my_dataframe%>%
select (Foldchage> 0.75 | Foldchage> 1.25)
head (genes_select)


id.         ctrl1 ctrl2 trt1 trt2  Foldchage  log2FC      pvalue               padj
gene1.    3     5     20   30     1.5             0.6           0.05                   0.3
gene2.    2     4     40   50.     2.               1.2          0.05x10^-7       0.04x10^-6
gene3     10   15    3    2.       0.4            -1.301      0.006                3.2x10^-3
gene Nº  n      n1   n2  n3.     0.092        -3.449.     1.23x10^-10     4.5x10^-9

1 answer

Since you said

a fold change between 1.25 and 0.75

I think your command should be

select (Foldchage> 0.75 | Foldchage < 1.25)

Does that help?

I added code markup to your post for increased readability. You can do this by selecting the text and clicking the 101010 button. When you compose or edit a post that button is in your toolbar, see image below:

101010 Button

Thanks for the tips, I use the filter function and the range you suggested and I got what I needed. thanks again.

filter (Foldchage> 0.75 | Foldchage < 1.25)

Log in to answer this question.