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

Hello Guy, I have deseq2 table with differentially expressed genes. I would like to extract the log2FC as well as raw counts for 5 genes That are flanking my gene of interest to use them for heatmap .. can anyone help?

rna-seq deseq2

Sure.

  1. Get the coordinates of your gene of interest from GTF.
  2. use bedtools to find what are the nearest genes using closest feature
  3. Take the gene IDs from step.2 and grep for log2FC from DESeq2 results

or

  1. Go to UCSC genome browser and enter your gene of interest
  2. Zoom out to find what are the flanking genes and note down
  3. Take the gene IDs from step.2 and grep for log2FC from DESeq2 results

thanks much venu ... but there is no shortcut to do this task?

If you know the names of those genes then fish them out of the results object (which can be written to a file).

Thanks Genomax .. I was just thinking of direct way to fetch the names of those genes then extract the expression values .. I will do it manually ... thanks once more

Both of them takes <5 min to complete the task. I can't think of any other shortcut.

1 answer

dds <- DESeq(dds)
res <- results(dds)

res is the data frame where you can find log2FC in second column res[,2] and rownames are genes.

dds <- DESeqDataSetFromMatrix(countData = cts,
                          colData = coldata,
                          design = ~ condition)

The counts are stored in countData.

thanks arta for the contribution ... but this not what I want actually

Log in to answer this question.