Search
Question: Fraction arguments for multi mapping reads in featureCounts in Rsubread
0
gravatar for tg369
3.0 years ago by
tg36910
United Kingdom
tg36910 wrote:

I was using featureCounts function from the R package ("Rsubread"). I need to count reads which are mapped to multiple regions but want to represent that as 1/n (where n= number of alignments). However I am unable to find the argument 'fraction' in the R function featureCounts.

DEseq2 doesn't take fraction values, do you suggest to round up those values? if yes then can we implement that in featureCounts.

Thank you for your advice on the above points.

ADD COMMENTlink modified 3.0 years ago • written 3.0 years ago by tg36910
1

Your R and/or Rsubread are probably old? Update them to the latest version and you should be able to see the 'fraction' argument.

ADD REPLYlink written 3.0 years ago by Wei Shi2.9k

I am using Rsubread_1.16.1 and updated all.

My R version is:

R version 3.1.2 (2014-10-31)

Platform: x86_64-unknown-linux-gnu (64-bit)

Still it is not working.

ADD REPLYlink modified 3.0 years ago by Gordon Smyth35k • written 3.0 years ago by tg36910

The current version of R is 3.2.2 and the current version of Rsubread is 1.20.2.

Your software is two Bioconductor releases out of date, which is why it doesn't have the latest features.

You need to update to the latest versions of R and Bioconductor, as Wei already advised you.

ADD REPLYlink modified 3.0 years ago • written 3.0 years ago by Gordon Smyth35k

Many thanks Gordon and Wei,  that is working now after updating R version.

ADD REPLYlink written 3.0 years ago by tg36910

Thank you very much Gordon. 

However, I wonder why I am getting this error message:

Error in featureCounts(file = "co2a_STAR_gencodeAligned.out.sam",  : 

  unused argument (fraction = TRUE)

Please could you advice me.

ADD REPLYlink modified 3.0 years ago by Gordon Smyth35k • written 3.0 years ago by tg36910
2
gravatar for Gordon Smyth
3.0 years ago by
Gordon Smyth35k
Walter and Eliza Hall Institute of Medical Research, Melbourne, Australia
Gordon Smyth35k wrote:

You simply run featureCounts() with countMultiMappingReads=TRUE and fraction=TRUE.

The help page for featureCounts() says

"fraction:

logical indicating if fractional counts will be produced for multi-mapping reads. If TRUE, a fractional count, 1/n, will be generated for each reported alignment of a multi-mapping read, where n is the total number of alignments reported for that read. countMultiMappingReads must be set to TRUE when fraction is TRUE."

Both edgeR and limma accept fractional counts for analyzing RNA-seq data.

If you must round the counts, then rounding to the nearest integer (up or down) would be far better than rounding up. You can easily do this by:

fc <- featureCounts(files,countMultiMappingReads=TRUE,fraction=TRUE)
fc$counts[] <- round(fc$counts)

Note: fractional counting was introduced in Rsubread 1.20.0, so you must be using the latest release of R and Bioconductor.

ADD COMMENTlink modified 3.0 years ago • written 3.0 years ago by Gordon Smyth35k

Is this option available for the command line version of FeatureCounts as well?    

ADD REPLYlink modified 2.6 years ago • written 2.9 years ago by geparada8810

Yes, it is called '--fraction'.

ADD REPLYlink written 2.9 years ago by Wei Shi2.9k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 313 users visited in the last hour