Open ghost opened 4 years ago
Hi @Schrnz25
in addition to "truly" unmapped reads, the Unmapped file contains reads that are mapped as PE reads, but one of the mates is not mapped. Note that this should not happen for default parameters if mates have the same lengths. It does happen in your case, since the samtools view -c -f 4 and -f 8 are different.
To differentiate these cases in the Unmapped file, next to the readsID, there is a tag = 00 for both mates unmapped, and 01 and 10 for one of the mates mapped and the other unmapped.
Cheers Alex
Hi Alex,
So if I understand correctly, both mate1/2 contain "truly" unmapped mates as well as unmapped reads whose opposite mapped (and those mapped opposites should not be present in the other mate file)? If so, why do mate1/2 possess the exact same number of sequences? Is it pure chance?
Also, you mentioned that this should not happen for default parameters. What are the parameters involved in this? Here are mine:
##### Final user re-defined parameters-----------------:
runMode alignReads
runThreadN 22
genomeDir /home/genomeDir/
genomeLoad LoadAndKeep
readFilesIn S1084_S5_L001_1_paired.fq.gz,S1084_S5_L002_1_paired.fq.gz,S1084_S5_L003_1_paired.fq.gz,S1084_S5_L004_1_paired.fq.gz S1084_S5_L001_2_paired.fq.gz,S1084_S5_L002_2_paired.fq.gz,S1084_S5_L003_2_paired.fq.gz,S1084_S5_L004_2_paired.fq.gz
readFilesCommand gunzip -c
outFileNamePrefix /home/STAR_output/S1084_S5_L001/S1084_S5_L001_
outReadsUnmapped Fastx
outSAMtype BAM Unsorted
outSAMunmapped Within
outFilterMultimapNmax 1000
chimSegmentMin 20
chimOutType Junctions
quantMode GeneCounts
Kind regards
Hi @Schrnz25
the Unmapped1/2.fasta file have to preserve the order of the reads, so even if only one mate does not map, both mates are output. Such reads will be tagged with 01 or 10 tags.
The single-mate mapping could happen even with default parameters, if the mates have different lengths (say, after trimming). This should be why you see them.
Cheers Alex
Hi,
I am using STAR 2.7.3a for extracting unmapped reads with the --outReadsUnmapped Fastx. I found that the number of unmapped reads in both mate1/2 is different from the Log.final.out output. The post #282 already mentioned the difference in unmapped reads number between the Log.final.out and the BAM flag and the answer is clear to me.
Here is the Log.final.out:
Then I made some calculation as explained in post #282 to get the number of unmapped reads:
Now, when calculating the number of unmapped reads present in both mate1 and 2 files, the number of unmapped reads is inconsistent with samtools and the Log.final.out.
Why is there a difference between the Log.final.out and the Unmapped.out.mate1/2 in the number of unmapped reads?