bioconductor

heatmap.2 (gplots package) - how to remove annoying lines in some cells?

感情迁移 提交于 2019-12-08 08:10:44
问题 I'm trying to generate a simple heatmap that has each row and column separated by a black line. However, for some reason this only happens for the first and last color. The middle color in my colorpanel() command has an addition horizontal and vertical line that I would like to get rid off when plotted using heatmap.2() . Any suggestions as to why I see these lines? library(gplots) my.matrix <- cbind(func.1 = c(1,2,2,1,1,3,1,2,3,1,1,2,2,3,1), func.2 = c(2,2,1,1,3,3,1,1,2,2,1,3,3,2,1)) mycol <

merge two data.frame with condition in R

[亡魂溺海] 提交于 2019-12-08 06:51:17
问题 I would like to compare two data sets df1 and df2 in such a way that, the unique characters in df2$ID should be added as a new column in df1 and assign df2$Xp value for each gene, if the coordinates of df1 overlaps with the coordinates of df2: df1 <- read.table(text=" Gene chr Start End Gm12724 4 1000 1105 Zfhx2 4 1254 1369 Usp17lc 7 5004 5412 Lingo1 7 5698 5789 Sart3 7 5987 6041 Olfr978 4 1452 1564 ", header=T) df2 <- read.table(text=" ID chr Start End Xp S8411 4 989 1258 0.312 S8411 4 1300

Is it possible to install bioconductor package 'rain' in R Jupyter notebook?

左心房为你撑大大i 提交于 2019-12-08 00:51:58
问题 I want to install the bioconductor rain package for R in Jupyter notebook. I am not able to install this package in Jupyter notebook following instructions given on the website linked above - in an R Jupiter notebook: source("https://bioconductor.org/biocLite.R") biocLite("rain") I get the following error: Warning message: In install.packages(pkgs = doing, lib = lib, ...): installation of package ‘gmp’ had non-zero exit statusWarning message: In install.packages(pkgs = doing, lib = lib, ...):

Downgrade R version and R package Bioconductor [duplicate]

浪尽此生 提交于 2019-12-07 06:50:25
问题 This question already has answers here : How to install 2 different R versions on Debian? (4 answers) Closed 6 years ago . Hello everyone I am currently running R 3.0.2 on a debian server with Bioconductor v2.13. My question is simple although searching through the internet hasn't provided me with a clear answer: How can I downgrade from R 3.0.2. to R 2-15? Considering i keep R 3.0.2 how can i downgrade Bioconductor to v2.12? Thank you in advance, 回答1: Generally, Bioconductor is designed to

merge two data.frame with condition in R

折月煮酒 提交于 2019-12-06 15:48:53
I would like to compare two data sets df1 and df2 in such a way that, the unique characters in df2$ID should be added as a new column in df1 and assign df2$Xp value for each gene, if the coordinates of df1 overlaps with the coordinates of df2: df1 <- read.table(text=" Gene chr Start End Gm12724 4 1000 1105 Zfhx2 4 1254 1369 Usp17lc 7 5004 5412 Lingo1 7 5698 5789 Sart3 7 5987 6041 Olfr978 4 1452 1564 ", header=T) df2 <- read.table(text=" ID chr Start End Xp S8411 4 989 1258 0.312 S8411 4 1300 1800 0.144 S8411 7 5641 6874 0.136 S8413 4 1307 1360 -1.999 ",header=T) expected output df3 <- read

Is it possible to install bioconductor package 'rain' in R Jupyter notebook?

与世无争的帅哥 提交于 2019-12-06 10:41:30
I want to install the bioconductor rain package for R in Jupyter notebook. I am not able to install this package in Jupyter notebook following instructions given on the website linked above - in an R Jupiter notebook: source("https://bioconductor.org/biocLite.R") biocLite("rain") I get the following error: Warning message: In install.packages(pkgs = doing, lib = lib, ...): installation of package ‘gmp’ had non-zero exit statusWarning message: In install.packages(pkgs = doing, lib = lib, ...): installation of package ‘rain’ had non-zero exit status I was able to install a different bioconductor

Modify r object with rpy2

拜拜、爱过 提交于 2019-12-06 06:27:13
I'm trying to use rpy2 to use the DESeq2 R/Bioconductor package in python. I actually solved my problem while writing my question (using do_slots allows access to the r objects attributes), but I think the example might be useful for others, so here is how I do in R and how this translates in python: In R I can create a "DESeqDataSet" from two data frames as follows: counts_data <- read.table("long/path/to/file", header=TRUE, row.names="gene") head(counts_data) ## WT_RT_1 WT_RT_2 prg1_RT_1 prg1_RT_2 ## aap-1 406 311 41 95 ## aat-1 5 8 2 0 ## aat-2 1 1 0 0 ## aat-3 13 12 0 1 ## aat-4 6 6 2 3 ##

How to “eval” results returned by “paste0”?

半腔热情 提交于 2019-12-05 07:20:48
问题 It seem that I can never get the returned values of 'paste0' been evaluated , as well as any characters that have been quoted. Do I have to use 'substr' or 'gsub' to remove these quotation marks ? eval(paste0('1','+','1')) [1] "1+1" eval(expression(paste0('1','+','1'))) [1] "1+1" eval(expression("1+1")) [1] "1+1" eval("1+1") [1] "1+1" eval(expression(1+1)) [1] 2 eval(1+1) [1] 2 回答1: An expression consisting of a string is just the string, evaluating the string just returns the string (if you

Extracting values from IRanges objects in R/Bioconductor

怎甘沉沦 提交于 2019-12-04 18:40:56
I've imported a UCSC alignability track into R using import.bw() (from the rtracklayer package) but am having trouble accessing the values I need. For example: I want to provide a chromosome and a base and return the value at that position. My object is called al100: > al100 RangedData with 21591667 rows and 1 value column across 25 spaces space ranges | score <factor> <IRanges> | <numeric> 1 chr1 [10001, 10014] | 0.002777778 2 chr1 [10015, 10015] | 0.333333343 3 chr1 [10016, 10026] | 0.500000000 4 chr1 [10027, 10031] | 1.000000000 I want a function where I specify a chrosome and position and

how use matchpattern() to find certain aminoacid in a file with many sequence(.fasta) in R

可紊 提交于 2019-12-03 21:40:32
I have a file (mydata.txt) that contains many exon sequences with fasta format. I want to find start ('atg') and stop ('taa','tga','tag') codons for each DNA sequence (considering the frame). I tried using matchPattern ( a function from the Biostrings R package) to find theses amino acids: As an example mydata.txt could be: >a atgaatgctaaccccaccgagtaa >b atgctaaccactgtcatcaatgcctaa >c atggcatgatgccgagaggccagaataggctaa >d atggtgatagctaacgtatgctag >e atgccatgcgaggagccggctgccattgactag file=read.fasta(file="mydata.txt") matchPattern( "atg" , file) Note: read.fasta is a function in seqinr package