[BioC] request

Steve Lianoglou mailinglist.honeypot at gmail.com
Thu Jul 9 16:19:49 CEST 2009


Hi,

On Jul 9, 2009, at 12:22 AM, amrit karki wrote:

> DearTing-Yuan
> I found your answer about how can we calculate common genes from two  
> files but i have also similar problem but different interest. I also  
> have two .text files including Genebank accession numbers  
> respectively. I want to find the genes with the different GB  
> Acession numbers from between two .txt files rather than same GB  
> accession. Thank you so much for your help.

I'm not sure I get your question, but is this what you're after?

R> file1 <- paste("Gene", LETTERS[1:10])
R> file2 <- paste("Gene", LETTERS[5:15])
R> file1
  [1] "Gene A" "Gene B" "Gene C" "Gene D" "Gene E" "Gene F" "Gene G"  
"Gene H" "Gene I" "Gene J"

 > file2
  [1] "Gene E" "Gene F" "Gene G" "Gene H" "Gene I" "Gene J" "Gene K"  
"Gene L" "Gene M" "Gene N" "Gene O"

 > c(setdiff(file1, file2), setdiff(file2, file1))
[1] "Gene A" "Gene B" "Gene C" "Gene D" "Gene K" "Gene L" "Gene M"  
"Gene N" "Gene O"

You can then use the names of the genes in your "difference" set to  
find the line in the respective files that differ (I guess this is  
what you want?)

-steve

--
Steve Lianoglou
Graduate Student: Physiology, Biophysics and Systems Biology
Weill Medical College of Cornell University

Contact Info: http://cbio.mskcc.org/~lianos



More information about the Bioconductor mailing list