Question: featureCounts Does Not Correctly Parse File Names
0
7 months ago by
wunderl20
wunderl20 wrote:

When using Rsubread v 1.28.1 it sucessfully parsed my input file names by removing the file path and just keeping the names. As of the current version, however, the names contain the entire file path, this makes for very long and ugly column names.

## Setup

files: /path/to/file/here/file1.bam; /path/to/file/here/file2.bam countData=featureCounts(.....)

colnames(countData$counts) [1] file1.bam [2] file2.bam ## 1.34.0 colnames(countData$counts) [1] X.path.to.file.here.file1.bam [2] X.path.to.file.here.file2.bam

modified 7 months ago by Gordon Smyth39k • written 7 months ago by wunderl20
Answer: featureCounts Does Not Correctly Parse File Names
1
7 months ago by
Gordon Smyth39k
Walter and Eliza Hall Institute of Medical Research, Melbourne, Australia
Gordon Smyth39k wrote:

I guess the reason for the change was probably because file names without paths might not be unique. For example, we might have

files <- c("path1/file1.bam", "path2/file1.bam")


so that removing the paths would result in duplicate column names.

If you don't like it you can easily change the column names yourself by

colnames(countData$counts) <- basename(colnames(countData$counts))