Samtools: Why Have I Been Using "View" Command For Mpileup
2
1
Entering edit mode
11.6 years ago
axelwilhelm ▴ 120

This is a basic question so maybe someone can make the best of it and explain some basic details so that newbies can benefit from it.

I have been using samtools commands from other people that I think know what their doing.

The commands I have been giving are view piped to mpileup

samtools view -u someones.bam chrY:2709520-57443438 | samtools mpileup -B -Q reference.fa - > outfile.txt

I tried to run the mpileup command without view and it's just as fast.

Why would I want to pipe view to mpileup?

samtools mpileup • 3.6k views
ADD COMMENT
5
Entering edit mode
11.6 years ago

I assume you can specify "chrY:2709520-57443438" as a region parameter in mpileup and it should do the same work for you (I have never tried it). For example: samtools mpileup -r STR will only generate pileup in region STR , default - all sites. May be the guy from whom you borrowed the code didn't know this OR may be mpileup didn't have region(-r) functionality at that time.
I know this doesn't answer your question directly but this is all I could come up with. Also using -u command will produce uncompressed bam or SAM format stream.

ADD COMMENT
1
Entering edit mode
11.6 years ago

The format that you have allows one to add more filters to the sam view before passing it to mpileup. That usually is a very common operation when investigating data by some property.

ADD COMMENT

Login before adding your answer.

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