alexdobin / STAR

RNA-seq aligner

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Aligned BAM files have some reads with not its paired mates

teryyoung opened this issue · comments

I run STAR with pair-end reads and get bam file, I sorted it with picard in queryname order, but when I run downstream analysis, It told me there is some reads E150030108L1C007R02000101377 did not have a primary R1 record.
I checked the fastq file and bam file, maybe the STAR filtered this R1 reads, but retained the R2. Is there options to filter paired reads simultaneously?
the fastq file is like this:
`$ grep 'E150030108L1C007R02000101377' tmp/CT.uBAM_1.fq -A 4
@E150030108L1C007R02000101377/1
GGGGCCGCGGCCGGGGACCGCTCCCCGCCGCGGCCCCAGTTGGC
+
GGGGFGCBFF<GFFIG-F?F:FFF7D;FFGF
@E150030108L1C007R02000101839/1

$ grep 'E150030108L1C007R02000101377' tmp/CT.uBAM_2.fq -A 4
@E150030108L1C007R02000101377/2
TGATACGTGGGCTCCCGCTGGCCTGTACATTCCTGGAGGTAAGTGTTGTGTCTAGAGGGAAGCAGAACAAACAATGAAATGGAAGTGAGTTCCTGGTGAAAACCCAGTTTGGGAGACAGAGCCTCCTACCCGTACTCCCAGGC
+
9E/AEDF8B<B@:;8B@99B?>A4?9@BB9?B3C@81;:;C6B:=*AB@E;6CCB6>:9/93+5B25=+8<91@998<6;D;6;57105.B;?4<<1A:<9:-9=D5B,5-*C140A)E.7B?0C9)D;5+23BE:C>C592>
@E150030108L1C007R02000101839/2
I search the PE reads in bam file, results is like this:samtools view 0.1.uBAM/CT.umi.mapped.bam |grep 'E150030108L1C007R02000101377'
E150030108L1C007R02000101377 137 chr1 19084648 60 143M * 0 0 TGATACGTGGGCTCCCGCTGGCCTGTACATTCCTGGAGGTAAGTGTTGTGTCTAGAGGGAAGCAGAACAAACAATGAAATGGAAGTGAGTTCCTGGTGAAAACCCAGTTTGGGAGACAGAGCCTCCTACCCGTACTCCCAGGC 9E/AEDF8B<B@:;8B@99B?>A4?9@BB9?B3C@81;:;C6B:=*AB@E;6CCB6>:9/93+5B25=+8<91@998<6;D;6;57105.B;?4<<1A:<9:-9=D5B,5-*C140A)E.7B?0C9)D;5+23BE:C>C592> RG:Z:A NH:i:1 HI:i:1 nM:i:2 AS:i:137 RX:Z:GCCAA-GTTGA`
there isn't another "E150030108L1C007R02000101377" entry.

If one of the mate is unmapped, you need to use --outSAMunmapped Within to keep it in the SAM/BAM file.

@alexdobin thanks very much!I got it successfully.