<p>It's hard to say without looking more closely at the data, but you may be able to find a few guides that are drastically different in your counting, and see how prevalent they are within the original BAM file (before filtering). Perhaps the <code>-F 2048</code> being used to filter out chimeric reads is overfiltering, and causing the discrepancy? Are unaligned reads included in the BAM - if not, does this explain the discrepancy?</p>
<p>Since the total reads doesn't match the original, I'd look into this. Are the extracted FASTQs consistent read length? Maybe some trimming was performed that removed the guides?</p>
<p>Do you know what reference the BAM files were mapped to? Perhaps this reference did not include the guide sequences, and were mapped to the genome instead? You may be able to extract this information from the BAM like this:</p>
<pre><code> samtools view -H filename.bam &gt; filename.header
</code></pre>
<p>Ideally you'd have the original FASTQs to work with, but it sounds like those are unavailable...</p>

CC BY-SA 4.0
2022-12-08T20:19:45.393Z
2022-12-08T23:24:11.147Z
2022-12-08T23:24:11.147Z
Scot
<p>Sorry if this question seems basic. I am trying to run the MAGeCK pipeline to analyze CRISPR knockout screen data produced by someone in my lab around 5 years ago. I was given the data as bam files and also have the sequencing sample statistics from when the samples were run including the number of total reads, aligned reads, and unaligned reads. I converted the bam files back to fastq files using</p>
<pre><code>samtools view -h -F 2048 filename.bam &gt; tmp.bam

bedtools bamtofastq -i tmp.bam -fq filename.fastq
</code></pre>
<p>After converting the bam files back to fastq files, I ran the MAGeCK count function. I saw that none of the total reads matched between the MAGeCK count summary output file and the original sequencing statistics.</p>
<p>More problematically, a few samples had significantly fewer total reads (like 50,000) shown on the MAGeCK count summary output files relative to the original sequencing statistics (~44 million). As a result, many of the sgRNAs are not represented at all in the sample (there are ~61,000 zero counts relative to the total 77441 sgRNAs) which is impacting my analysis.</p>
<p>Can anyone help me understand why I might be losing sgRNAs using MAGeCK? Is it a problem with my source files? I would appreciate any help!</p>

CC BY-SA 4.0
2024-06-18T20:23:56.253Z
I know this is quite an old thread, but as I am experiencing something very similar, can I kindly ask you if you were eventually able to solve the issue and how?
Thank you very much in advance!
Marty
<samtools><fastq><crispr>
CRISPR genome wide screen analysis using MAGeCK-- Loss of reads/sgRNA using MAGeCK count function?
# CRISPR genome wide screen analysis using MAGeCK-- Loss of reads/sgRNA using MAGeCK count function?

(Asked by: username_0 on 2022-12-05)

Sorry if this question seems basic. I am trying to run the MAGeCK pipeline to analyze CRISPR knockout screen data produced by someone in my lab around 5 years ago. I was given the data as bam files and also have the sequencing sample statistics from when the samples were run including the number of total reads, aligned reads, and unaligned reads. I converted the bam files back to fastq files using
samtools view -h -F 2048 filename.bam > tmp.bam

bedtools bamtofastq -i tmp.bam -fq filename.fastq

After converting the bam files back to fastq files, I ran the MAGeCK count function. I saw that none of the total reads matched between the MAGeCK count summary output file and the original sequencing statistics.
More problematically, a few samples had significantly fewer total reads (like 50,000) shown on the MAGeCK count summary output files relative to the original sequencing statistics (~44 million). As a result, many of the sgRNAs are not represented at all in the sample (there are ~61,000 zero counts relative to the total 77441 sgRNAs) which is impacting my analysis.
Can anyone help me understand why I might be losing sgRNAs using MAGeCK? Is it a problem with my source files? I would appreciate any help!

**Tags:** samtools, fastq, crispr
> **Comments:**
> **username_1**: I know this is quite an old thread, but as I am experiencing something very similar, can I kindly ask you if you were eventually able to solve the issue and how? Thank you very much in advance!  

---

## 1 answers

### Answer by username_2 on 2022-12-08. Score: 1

It's hard to say without looking more closely at the data, but you may be able to find a few guides that are drastically different in your counting, and see how prevalent they are within the original BAM file (before filtering). Perhaps the -F 2048 being used to filter out chimeric reads is overfiltering, and causing the discrepancy? Are unaligned reads included in the BAM - if not, does this explain the discrepancy?
Since the total reads doesn't match the original, I'd look into this. Are the extracted FASTQs consistent read length? Maybe some trimming was performed that removed the guides?
Do you know what reference the BAM files were mapped to? Perhaps this reference did not include the guide sequences, and were mapped to the genome instead? You may be able to extract this information from the BAM like this:
 samtools view -H filename.bam > filename.header

Ideally you'd have the original FASTQs to work with, but it sounds like those are unavailable...


---

