SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
samtools mpileup questions go2seq Genomic Resequencing 1 09-05-2011 07:09 PM
Samtools variant calling questions Chiel Bioinformatics 2 06-07-2011 09:10 AM
[B]Bowtie and Samtools questions[/B] dicty Bioinformatics 3 12-07-2010 12:15 PM
Bowtie and samtools questions dicty Bioinformatics 0 12-01-2010 12:51 PM
questions about samtools rjjwind Bioinformatics 0 07-26-2010 07:52 PM

Reply
 
Thread Tools
Old 10-13-2016, 03:52 AM   #1
finswimmer
Member
 
Location: Europe

Join Date: Oct 2016
Posts: 34
Default Questions concerning samtools bedcov

Hello,
I have some question concerning samtools bedcov to which I didn't found answers until now.

1. Does bedcov ignore reads marked as PCR/optical duplicates when calculating the coverage?

2. It seems that bedcov needs the index bam file. Right?
So I have a batch of bam files in which pcr duplicates are not flagged. I need to run PicardTools MarkDuplicates on them. I would like to pipe the output directly to bedcov, but because the output have no index it doesn't work. Is there a way to pipe to bedcov without creating intermediate files?

Thanks for your help.

fin swimmer
finswimmer is offline   Reply With Quote
Old 10-14-2016, 12:23 PM   #2
dpryan
Devon Ryan
 
Location: Freiburg, Germany

Join Date: Jul 2011
Posts: 3,475
Default

1. This is completely undocumented, but it skips marked duplicates, entries marked as "unaligned", secondary alignments, and alignments marked as QC failed (bit 512, which is rarely seen).
2. Correct, you need to "samtools index" the file first.

There's no way for you to pipe into samtools bedcov.
dpryan is offline   Reply With Quote
Old 10-14-2016, 01:53 PM   #3
HESmith
Senior Member
 
Location: Washington DC

Join Date: Oct 2009
Posts: 487
Default

Point of clarification; the BAM needs to be sorted before indexing (use samtools 'sort').
HESmith is offline   Reply With Quote
Old 10-16-2016, 09:12 PM   #4
finswimmer
Member
 
Location: Europe

Join Date: Oct 2016
Posts: 34
Default

Thank you all for your answers.

It's a pitty that I cannot pipe to bedcov. So I have to write a small shell script that do all neccessary steps and clean up the intermediate files afterwards.

Do I have to sort bam files everytime I manipulated (markduplicateds, using samtools view ...) them? Or is it just to be sure, that they are sorted?

fin swimmer
finswimmer is offline   Reply With Quote
Old 10-16-2016, 10:33 PM   #5
dpryan
Devon Ryan
 
Location: Freiburg, Germany

Join Date: Jul 2011
Posts: 3,475
Default

You only need to sort a BAM file once. Marking duplicates/filtering/etc. on a sorted file results in another sorted file. Just reindex it if appropriate.

Regarding needing to write a script to streamline things, I think many of us find snakemake a convenient way to do that (it can handle removing intermediate files for you).
dpryan is offline   Reply With Quote
Old 10-16-2016, 11:29 PM   #6
finswimmer
Member
 
Location: Europe

Join Date: Oct 2016
Posts: 34
Default

Quote:
Originally Posted by dpryan View Post
Regarding needing to write a script to streamline things, I think many of us find snakemake a convenient way to do that (it can handle removing intermediate files for you).
Thanks for that hint. Didn't know it before. It looks very useful. I will have a closer look at it.

fin swimmer
finswimmer is offline   Reply With Quote
Reply

Tags
bedcov, samtools

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT -8. The time now is 06:37 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO