Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 29

Please supplement your question with a minimal reproducible example. Use dput() for data and specify all non-base packages with library calls. For statistical questions please use http://stats.stackexchange.com.

6 votes
Accepted

Count genomic ranges

GenomicRanges::countOverlaps seems to be what you’re after: position_range = GRanges(position$chrom, IRanges(position, position, width = 1)) ranges_at_position = countOverlaps(position_ranges, grange …
Konrad Rudolph's user avatar
3 votes
Accepted

Identifying outlier loci in R

As Devon said, removing the which will give you W as a logical vector that can be used to index the sorted p-values. To get a logical vector that can be used to subset the original (unsorted) values y …
Konrad Rudolph's user avatar
4 votes

Multiple sequence alignment with R

The ‹msa› package on Bioconductor does exactly that. It doesn’t hand the results on a silver platter, though: you’ll need to read the vignette carefully to learn how to use it. But after that it’s pr …
Konrad Rudolph's user avatar
6 votes
Accepted

Off-by-one error when mapping Ensembl IDs to gene symbols

There’s no 1:1 mapping between the IDs of different database schemas. As a consequence, some Ensembl gene IDs map to multiple MGI symbols, or to none (and vice versa). Therefore, you can’t assume tha …
Konrad Rudolph's user avatar
13 votes

What methods are available to find a cutoff value for non-expressed genes in RNA-seq?

I'd like to find genes that were not expressed in a group of samples and were expressed in another group. This is, fundamentally, a differential expression analysis, with a twist. To solve this, …
Konrad Rudolph's user avatar
18 votes

R package development: How does one automatically install Bioconductor packages upon package...

As suggested, here’s an example showing the relevant lines from a DESCRIPTION file from a CRAN/GitHub hosted project that has Bioconductor dependencies (truncated): Depends: R (>= 3.3.0) biocViews …
Konrad Rudolph's user avatar
9 votes
0 answers
512 views

How can I read multiple different regions from a BAM file in R?

Since the process function is nontrivial and written in R, I’m stuck with R for now. And there’s no reason why this shouldn’t work in R. Am I overlooking something? Is this a bug in {Rsamtools}? …
Konrad Rudolph's user avatar
2 votes
Accepted

Write the output of the VariantAnnotation package to file

Is there any way to force R to give me the same representation as head? head just cuts off everything after the first six entries. …
Konrad Rudolph's user avatar
4 votes

How to subset a GRanges via an argument passed into a function?

In addition to Devon’s answer, you can use non-standard evaluation to make this work with R symbol names rather than string arguments: subsetter = function (gr, cname) { cname = as.character(substitute …
Konrad Rudolph's user avatar
3 votes

Combine Fastq by writeFastq is not working properly

Apart from this, your R code contains several errors. For instance, your variable names change throughout, and you’re using the fsep parameter wrongly. …
Konrad Rudolph's user avatar
6 votes

How can I extract normalized read count values from DESeq2 results?

It depends what you mean by “normalised”. As Devon said, the normalized = TRUE argument to the count function gives you normalised counts. However, these are “only” library-size normalised (i.e. divid …
Konrad Rudolph's user avatar
6 votes
Accepted

Is there an efficient way to check an input BAM in R?

For a very quick check™ you could also pass the file through gunzip and test whether the “magic bytes” at the beginning of the file equal 'BAM\1': bgzf_stream = gzfile(filename, 'r') on.exit(close(bgzf_stream …
Konrad Rudolph's user avatar
32 votes
Accepted

How to compute RPKM in R?

That said, FPKM can be calculated in R as follows. …
Konrad Rudolph's user avatar
9 votes

What are the ways to keep track of branches in the analysis?

or in a declarative workflow.2 Document the alternative analysis approaches; once again, this could be a declarative workflow with different rules for alternative analyses, or a set of notebooks (via R … This is much harder in R Markdown. Some time ago I create an example analysis workflow to show how this can be structured. …
Konrad Rudolph's user avatar