You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the script I'm using for the genomecov command:
BAM_DIR='./sorted_bam_files'
# Loop over each BAM file in the directory
for file in "$BAM_DIR"/*_high_mapq_reads.sorted.bam
do
echo "Calculating coverage for $file..."
# Get the basename of the file
base=$(basename "$file")
# Calculate coverage
bedtools genomecov -d -pc -ibam $file > "${base%.sorted.bam}.coverage"
done
This is the output I keep getting. I've tried this with at least 30 other bam files but the output is always the same.
Any ideas on why this keeps happening? I don't think there's something wrong with my bam files because I was able to use them for DGE analyses and checked to see if most reads were getting unmapped but they weren't. Any help is appreciated.
The text was updated successfully, but these errors were encountered:
The FLAG column in the examples you show is 255, which means that the read and its mate are unmapped (plug in 255 here: https://broadinstitute.github.io/picard/explain-flags.html). If all alignments are "unmapped" (I don't know why), then there is no coverage, technically. genomecov requires the reads to be mapped.
Someone on StackExchanged answered my question here:
It was because I included the argument -pc, which is only for paired-end reads. The second column on the bam file I showed here is all 0, which indicates single-end reads. So I removed that argument and was able to get the tables I needed, which look like this:
I have bam files that I've obtained through STAR alignment. Here is the first 10 lines of one of them:
This is the script I'm using for the genomecov command:
This is the output I keep getting. I've tried this with at least 30 other bam files but the output is always the same.
Any ideas on why this keeps happening? I don't think there's something wrong with my bam files because I was able to use them for DGE analyses and checked to see if most reads were getting unmapped but they weren't. Any help is appreciated.
The text was updated successfully, but these errors were encountered: