I want to use bedtools to count reads mapping back to genes, ultimately to use for differential expression analysis in edgeR. I used trinity to assemble my metatranscriptomes de novo, and bowtie2 to map raw reads back to the assembly. I seemingly sorted and indexed the file without a problem (returned no errors at least). When I go to run the bedtools multicov command, I get the error: could not find indexes. The indexes are in the same file as the bam file. Used prodigal for ORF calling to create .gff file.
Commands used:
First I sorted
samtools sort bowtie_output.bam -o sorted_output.bam -T temp_prefix
Then I indexed
samtools index -b sorted_output.bam indexed_sample.bam.bai
Then I try to get read counts
bedtools multicov -bams bowtie_output.bam -bed prodigal_output.gff
I thought maybe I was supposed to use the bam.bai file instead of bowtie output bam file, so I tried
bedtools multicov -bams indexed_file.bam.bai -bed prodigal_output.gff
But still get 'could not find indexes'
Any idea what I am doing wrong? Disclaimer: very much a beginner!
Don't supply output names to samtools index command, only input name.