samtools view for selecting the unmapped reads
1
0
Entering edit mode
9.0 years ago
zizigolu ★ 4.3k

Hi there,

I used Interactive Genome Viewer (IGV), to visualization of produced sam file from bowtie2, after loading of sorted-sam in IGV..from where and how I can select and identify the unmapped reads? Because by rolling mouse cursor around the each read, in box saying that mapped..

Don't be silent please and help me

Thank you in advance

RNA-Seq • 6.3k views
ADD COMMENT
1
Entering edit mode

Genome browser is to view mapped reads against genome and other annotations. You can filter reads based on various flags. https://broadinstitute.github.io/picard/explain-flags.html

ADD REPLY
0
Entering edit mode

I went across the link you suggested, then what I should type for flag?

ADD REPLY
0
Entering edit mode

As Devon suggested below.

ADD REPLY
0
Entering edit mode

You mean, in cmd I should type the command Devon suggested?

ADD REPLY
0
Entering edit mode

Yes.

It would be better to switch to linux or something like Cygwin ( if you intended to use Windows only ) rather than trying out to do it on windows,

ADD REPLY
0
Entering edit mode

Yes you are right but I have internet connection problem in linux, that's why I'm using Windows

Anyway I typed this command but told failed to open foo.bam

I copied the eg1.sam produced in bowtie2 folder in samtools folder and typed the command but got error

ADD REPLY
0
Entering edit mode

If you have sam file, specify that input is sam using -S option. By default, samtools expects bam file

samtools view -S -f 4 foo.sam
ADD REPLY
0
Entering edit mode

Thank you, the same error

ADD REPLY
0
Entering edit mode

Can you give exact command, the folder path where the file is and error?

ADD REPLY
0
Entering edit mode

Sorry,

I extracted samtools.zip to samtools, copied eg1.sam produced in bowtie2 folder to samtools folder and I typed in cmd:

cd D:\samtools
samtools view -S -f 4 foo.sam

It's saying that:

main_samview failed to open "foo sam" for reading
ADD REPLY
0
Entering edit mode

Does it actually say foo sam or instead foo.sam? In the former case try specifying the correct name. In the latter case check the file permissions.

ADD REPLY
0
Entering edit mode

You are right, saying foo.sam

Sorry, what is file permissions?

ADD REPLY
1
Entering edit mode

Given that you're in Berlin, perhaps you're more familiar with "Datei-Zugriffsrechte". Normally one right clicks on a file/directory and goes to "Preferences" (something along the lines of "Einstellungen" in the German version of Windows, if I remember correctly).

ADD REPLY
0
Entering edit mode

thank you, I am going to check

ADD REPLY
1
Entering edit mode
9.0 years ago

You won't see unmapped reads in IGV. If you want to extract them from a SAM/BAM/CRAM file, then use samtools (samtools view -f 4 foo.bam)

ADD COMMENT
1
Entering edit mode

Devon,

I entered samtools view -f 4 file.bam > unmapped.sam and I got result

the best

ADD REPLY
0
Entering edit mode

Sorry Devon,

Do you mean I should type this command in cmd? I am on Windows

ADD REPLY

Login before adding your answer.

Traffic: 2620 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