Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mayankkaashyap
    Member
    • Apr 2015
    • 18

    #1

    Dataset import in R studio doesn't pick up gene names

    Hi,
    I am a newbie in R language. Trying to make heatmap2 in R studio (latest version/Window). I tried to import csv, xls and trying all option but can't put gene names on heatmap. The data.matrix file doesn't recognise first column at all.
    I also tried:
    > x <- read.csv("~/Configuration/Desktop/Chapter1/TFs.csv", sep = ",")
    > row.names(TFs) <- TFs$Names
    > x <- read.csv("~/Configuration/Desktop/Chapter1/TFs.csv", sep = ",")
    > x
    Name JG11LC ICCV2LC JG11C ICCV2C
    1 Ca01823 2.7 1.2 1.3 -0.3
    2 Ca02518 -1.3 -2.4 -1.2 -2.3
    3 Ca02645 2.6 -0.7 -0.8 -0.1
    4 Ca03029 -0.5 0.0 0.0 0.0
    5 Ca03418 0.5 -0.1 0.9 -0.8
    6 Ca03510 3.0 2.7 -0.7 -0.5
    7 Ca03580 6.4 -1.0 0.4 0.7

    > TFs <- TFs[,2:6]
    Error: Invalid column indexes: 5, 6

    And the resulting heatmap is without gene names on the rows (attached).

    The code I am using is:
    library(gplots)
    library(edgeR)

    myclust<-function(c) { hclust(c,method='ward.D2') }
    x<-data.matrix(TFs)

    heatmap.2(x,distfun=dist,dendrogram="both",hclustfun=myclust,trace="none",density.info="none",cexRow=0.8,cexCol=0.8,las=2,col=redgreen(75),lhei=c(1.4,6),sepcolor="black", sepwidth0.1,margin=c(10,12),scale="row",Rowv =TRUE,Colv=TRUE, key=T)

    I never had this problem with old version of R studio. Please help!
  • dpryan
    Devon Ryan
    • Jul 2011
    • 3478

    #2
    Code:
    row.names(x) = as.character(x$Name)
    x = x[,-1]
    This has nothing to do with Rstudio, it's just an artefact of the "Name" column having a header.

    Comment

    • shunyip
      Member
      • Oct 2013
      • 20

      #3
      Another alternative is:
      Code:
      x <- read.csv("~/Configuration/Desktop/Chapter1/TFs.csv", row.names=1)

      Comment

      Latest Articles

      Collapse

      • SEQadmin2
        16S/ITS Profiling vs. Shotgun Metagenomics: What Changes in Your Workflow?
        by SEQadmin2




        NGS has revolutionized clinical microbiology by offering new ways to identify and surveil pathogens without prior knowledge of the target. One popular approach is 16S rRNA and ITS amplicon sequencing, which targets specific microbial markers. But studies are increasingly incorporating shotgun metagenomics, a technique that sequences all DNA from a sample without targeting specific microbial markers. This approach allows more detailed taxonomic classification, detection...
        Yesterday, 06:46 AM
      • SEQadmin2
        Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
        by SEQadmin2



        Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

        Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
        ...
        10-14-2026, 09:55 AM

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by SEQadmin2, 10-28-2026, 09:57 AM
      0 responses
      30 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 10-28-2026, 09:51 AM
      0 responses
      21 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 10-22-2026, 11:13 AM
      0 responses
      71 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 10-22-2026, 10:48 AM
      0 responses
      48 views
      0 reactions
      Last Post SEQadmin2  
      Working...