I've mapped some fruitfly data against BDGP5 using
STAR --genomeDir ${igenome}/Sequence/StarIndex --readFilesIn $fastqFile --runThreadN 6 --readFilesCommand zcat --outSAMtype BAM SortedByCoordinate --outSAMstrandField intronMotif --sjdbGTFfile $igenome/Annotation/Genes/genes.gtf --outFilterIntronMotifs RemoveNoncanonicalUnannotated --outFilterType BySJout --quantMode GeneCounts --outFilterMultimapNmax 4
STAR creates my bam-file and when looking at in IGV at a region (3R:7,779,682-7,786,669) containing 2 copies (one forward and one reverse strand) of the same gene it seems that STAR is not randomly assigning the primary flag but has a strong bias towards the first gene copy:
1) All alignments:
Almost all alignments have an NH of 2 and the corresponding alignments always have the same AS.
2) When displaying just primary ones (using IGV's build in filter) it looks as follows:
Obviously it's not random. Is this a bug or am I doing something wrong?
In contrast when using tophat's -g 1 filter to perform the same filtering scheme, I get a well balanced picture with proper random selection of the primary alignment in case of equal mapping scores:
Best regards,
Holger