Menu
  • HOME
  • TAGS

Understanding an RLE coverage value

r,range,bioconductor

Probably it's better to ask about Bioconductor packages on the Bioconductor support site. The interpretation is that there is a run of 25 nucleotides with 0 coverage, then a run of 24 nucleotides with 1 coverage (i.e., a single read) then another run of 249 nucleotides with no coverage, then...

Not able to executing all text files from one folder by a Rscript

r,bioconductor

Give the full path of the folder under path as below: scanFiles<-dir(path='/path/to/folder/',pattern = ".*.txt$") ...

Subset SAM/BAM file in R

r,subset,bioinformatics,bioconductor

It's probably more convenient to input the data with GenomicAlignments::readGAlignments, including the qname by specifying param=ScanBamParam(what="qname") as an argument. You could then subset with %in%. Here's a more complete example, using one of the ExperimentData packages library(GenomicAlignments) library(RNAseqData.HNRNPC.bam.chr14) fname <- RNAseqData.HNRNPC.bam.chr14_BAMFILES[1] want <- c("ERR127306.11930623", "ERR127306.24720935", "ERR127306.23706011", "ERR127306.22418829", "ERR127306.13372247", "ERR127306.20686334",...

R: when to use setGeneric or export a s4 method in the namespace

r,oop,s4,bioconductor

In an R session with only the base packages and methods loaded you can see that the generic for "[" is defined, and the generic for "as.list" is not > getGeneric("[") standardGeneric for "[" defined from package "base" function (x, i, j, ..., drop = TRUE) standardGeneric("[", .Primitive("[")) <bytecode: 0x28f7990>...

write a function that check whether a package has been install in R system

r,function,bioconductor

Use tryCatch. Here is an example: # purpose: write a function to: # - attempt package load # - if not then attempt package install & load checkInstallPackage = function(packName) { tryCatch(library(packName), error = function(errCondOuter) { message(paste0("No such package: ", packName, "\n Attempting to install.")) tryCatch({ install.packages(packName) library(packName, character.only =...

merge two data.frame with condition in R

r,bioinformatics,bioconductor

May be this helps library(data.table) setkey(setDT(df1),chr, Start, End) setkey(setDT(df2), chr, Start, End) res <- foverlaps(df1, df2, type='any')[ ( Start > i.Start| End> i.End)|is.na(Start)][, c('Start', 'End') := list(i.Start, i.End)][,7:8 := NULL] dcast(res, ...~ID, value.var='Xp', fill=0)[, -7, with=FALSE] # chr Start End Gene S8411 S8413 #1: 4 1000 1105 Gm12724 0.312 0.000...

How to exclude packages for updating in R?

r,bioconductor

You can prepare an "updatable" list of packages, then call biocLite blacklist <- c("pkga", "pkgb") installed <- rownames(installed.packages()) updatable <- installed[!installed %in% blacklist] biocLite(updatable) ...

Concatenating positions into genomic segments

r,concatenation,bioinformatics,bioconductor,genome

I couldn't think of any pretty solution using basic dataframe manipulation, so here's a bad-looking one that works: First, add stringsAsFactors to df creation: df <- read.table(text=df, header=T, stringsAsFactors = FALSE) start <- df$Position[1] end <- integer() output <- NULL count <- 1 for (i in 1:(nrow(df)-1)) { if(df$Bel[i] <...

LiftOver in R (error)

r,apply,data-conversion,bioconductor,genome

This is just a warning, not an error. A simple web search found: https://www.biostars.org/p/122005/...

RGraphiz installation keeps on failing ubuntu 12.04

r,bioconductor

After correspondence with the package maintainer, I found out that the most recent commit was not pushed to github yet. This issue is now resolved and installing from github works flawlessly: install_github("kasperdanielhansen/Rgraphviz") The problem was caused by some agressive compiler settings used on Ubuntu 12.04. It was solved in commit...

How to create GRange object for a large dataset

r,bioconductor

Use makeGRangesFromDataFrame() with keep.extra.columns=TRUE. Alternatively create the GRanges as above, then add mcols() dropping uninteresting columns. mcols(gr) = reference[,-(1:3)] Feel free to ask questions about Bioconductor packages on the Bioconductor support forum....

How can I convert Ensembl ID to gene symbol in R?

r,data.frame,bioinformatics,bioconductor

This is because the values you have in your gene column are not gene ids, they are peptide id (they start with ENSP). To get the info you need, try replacing ensembl_gene_id by ensembl_peptide_id: G_list <- getBM(filters= "ensembl_peptide_id", attributes= c("ensembl_peptide_id", "entrezgene", "description"),values=genes,mart= mart) Also, what you are really looking for...

Creating a loop to use read.eset in bioconductor

r,loops,input,bioconductor

Ah - just spotted the error - you must remove quotes from around the "ffdat" on the final line, and same for the "expr"

R, biocLite, error installing DESeq2

r,bioinformatics,bioconductor

From the log, it seems that the problem originated from XML package. XML package fails to compile if libxml2 library is not available. To install it on Linux: sudo apt-get install libxml2 sudo apt-get install libxml2-dev Then rerun the installation....

R CMD check warning with CUDA *.cu files

c++,c,r,bioconductor

While the default behaviour of nvcc is to automatically deduce language from filename extension (so that CUDA code is expected to be contained in a .cu extension file), this is not a fixed requirement. nvcc supports the -x flag to manually set language for a given compilation unit, so you...

makeContrast between two different sets of data

r,bioconductor,contrast

as you have a problem of class comparison between two classes I suggest you to read the user guide of the limma package of Bioconductor, which is a popular package for identification of differentially expressed genes (http://www.bioconductor.org/packages/release/bioc/vignettes/limma/inst/doc/usersguide.pdf). You can focus on section 9.2 if you are working with one-color microarrays....

p.adjust with n < than number of tests

r,bioconductor,p-value,genome

The code: p.adjust # typed at command line prints out the code # copy the body of the function ... is really very simple and all R. Just redefine a function that comments out that stopifnot() line: my.p.adj <- function (p, method = p.adjust.methods, n = length(p)) # paste the...

Is it insecure to execute code via an HTTP URL?

r,security,bioinformatics,bioconductor,man-in-the-middle

Yes, you are correct. Loading executable code over a cleartext connection is vulnerable to a MITM. Unless loaded over HTTPS where SSL/TLS can be used to encrypt and authenticate the connection, or unless the code has been signed and verified at the client then a MITM attacker could alter the...