This is a test version of Biostars. For the public version, visit https://www.biostars.org.
FeatureCounts output .txt file not tab delimited

Hi all,

I ran the unix version of featureCounts on ChIPseq data using the following script:

featureCounts -F SAF -p -O -T 8 -a $MACS2/All_samples_peaks.saf -o $FEATURECOUNTS/All_samples_counts.txt $BAM/*.dedup.q30.bam

which ran successfully, no issues in the log or in the txt summary file. However, the output does not look as expected. It seems as though it is ";" delimited rather than tab delimited and I'm not sure what could have caused this output:

# Program:featureCounts v2.0.1; Command:"featureCounts" "-F" "SAF" "-p" "-O" "-T" "8" "-a" "/rds/general/user/mt2920/home/ChIPseq/bowtie2/BAM/macs2/All_samples_peaks.saf" "-o" "/rds/general/user/mt2920/home/ChIPseq/bowtie2/BAM/dedup_q30/All_samples_counts.txt" "/rds/general/user/mt2920/home/ChIPseq/bowtie2/BAM/dedup_q30/MT-290621-striatum-rotenone-input5_S15_L008.dedup.q30.bam" "/rds/general/user/mt2920/home/ChIPseq/bowtie2/BAM/dedup_q30/MT-290621-striatum-rotenone-sample5_S12_L008.dedup.q30.bam" "/rds/general/user/mt2920/home/ChIPseq/bowtie2/BAM/dedup_q30/MT-290621-striatum-rotenone-sample6_S13_L008.dedup.q30.bam" "/rds/general/user/mt2920/home/ChIPseq/bowtie2/BAM/dedup_q30/MT-290621-striatum-vehicle-input2_S14_L008.dedup.q30.bam" "/rds/general/user/mt2920/home/ChIPseq/bowtie2/BAM/dedup_q30/MT-290621-striatum-vehicle-sample1_S10_L008.dedup.q30.bam" "/rds/general/user/mt2920/home/ChIPseq/bowtie2/BAM/dedup_q30/MT-290621-striatum-vehicle-sample2_S11_L008.dedup.q30.bam" 
Geneid  Chr Start   End Strand  Length  /rds/general/user/mt2920/home/ChIPseq/bowtie2/BAM/dedup_q30/MT-290621-striatum-rotenone-input5_S15_L008.dedup.q30.bam   /rds/general/user/mt2920/home/ChIPseq/bowtie2/BAM/dedup_q30/MT-290621-striatum-rotenone-sample5_S12_L008.dedup.q30.bam  /rds/general/user/mt2920/home/ChIPseq/bowtie2/BAM/dedup_q30/MT-290621-striatum-rotenone-sample6_S13_L008.dedup.q30.bam  /rds/general/user/mt2920/home/ChIPseq/bowtie2/BAM/dedup_q30/MT-290621-striatum-vehicle-input2_S14_L008.dedup.q30.bam    /rds/general/user/mt2920/home/ChIPseq/bowtie2/BAM/dedup_q30/MT-290621-striatum-vehicle-sample1_S10_L008.dedup.q30.bam   /rds/general/user/mt2920/home/ChIPseq/bowtie2/BAM/dedup_q30/MT-290621-striatum-vehicle-sample2_S11_L008.dedup.q30.bam
gene_id 1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1

etc etc.

Any thoughts or advice?

Thanks!

featurecounts

1 answer

This is just the first row that summarizes the command, and the header line that look "odd". The actual counts and the header itself are tabbed. When you read it into R do something like:

read.delim(x, skip=1, header=TRUE)

...and it should be fine.

When I try to do this I get 12 columns but just 1 rowwhich looks like the screenshot below

I also tried read.table("All_samples_counts.txt", sep=";", header=TRUE) however it errored with the message

Error in read.table("All_samples_counts.txt", sep = ";", header = TRUE) : 
  more columns than column names

What I meant is when I tried to do read.delim(x, skip=1, header=TRUE) all I got was 12 columns and 1 row, and a lot of counts still missing

Log in to answer this question.