Saving unmapped reads from STAR
1
2
Entering edit mode
8.6 years ago
mihaell ▴ 20

Hello,

I'm trying to save de unmapped reads from STAR aligner and I have some issues.

I would like to save the unmapped reads in a different output file. According to STAR Manual it's possible to save the unmapped reads using -outSAMunmapped Within parameter. Then the unmapped reads will be saved within Alignment.out.sam

I also tried the --outReadsUnmapped Fastx parameter and got Unmapped.out.mate1 and Unmapped.out.mate2. However I didn't understand how can I handle with these files.

I'm not sure about the results and I would like to know if exists another way to perform it.

Could anyone please let me know how to do this?

Thank you in advance

RNA-Seq alignment STAR Aligner • 16k views
ADD COMMENT
0
Entering edit mode

Hey Your question is exactly what I'm looking for I also tried the --outReadsUnmapped Fastx parameter and got Unmapped.out.mate1 , Unmapped.out.mate2.... until Unmapped.out.mate6 Can you tell me if it's right to use it? And why was it divided into 6 files?

Do you know any other way to extract the unmapped reads from STAR ?

Thanks in advance

ADD REPLY
0
Entering edit mode

What's wrong with samtools view -hf 4 Aligned.sortedByCoord.out.bam > unmapped.bam. That's bam format, but you can change that to fastq easily enough.

ADD REPLY
0
Entering edit mode

thx, I tried what you said but I got an error : "open: No such file or directory [main_samview] fail to open "Aligned.sortedByCoord.out.bam" for reading."

P.S. my file is Alignment.out.sam

ADD REPLY
0
Entering edit mode

Okay... what happens when you run that command line using the name of your file? And why are you keeping giant sam files around instead of bam files?

ADD REPLY
0
Entering edit mode

error: "[bam_header_read] EOF marker is absent. The input is probably truncated. [bam_header_read] invalid BAM binary header (this is not a BAM file). [main_samview] fail to read the header from "Aligned.out.sam"."

As for the sam file, I do not know STAR well and just wrote the commands I saw in the manual

ADD REPLY
3
Entering edit mode
8.6 years ago

Aren't the Unmapped.out.mate1 and Unmapped.out.mate2 files fastq files?

ADD COMMENT

Login before adding your answer.

Traffic: 2788 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6