SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
Consensus FASTA from BAM files mixter Bioinformatics 14 05-19-2014 09:07 AM
Python counting bases fasta file illinu Bioinformatics 9 08-22-2013 08:17 AM
building a consensus FASTA from BAM(s) adaptivegenome Bioinformatics 3 06-18-2013 07:10 PM
converting consensus fastq to fasta zlu Bioinformatics 18 08-17-2011 09:11 AM
Consensus part from sequence read(fastq) and align(BAM) files culmen Bioinformatics 5 12-21-2010 03:57 AM

Reply
 
Thread Tools
Old 05-16-2014, 07:56 AM   #1
daniel_navarro
Junior Member
 
Location: MA

Join Date: May 2014
Posts: 1
Default Bam file to Consensus Fasta/fastq in python

Hello!

Summary:
I want to get the same result as I get from this command, but in python (BioPython/Pysam):
Code:
samtools mpileup -uf ref.fa aln.bam | bcftools view -cg - | vcfutils.pl vcf2fq > cns.fq
Full story:
I need to extract the consensus fasta from an aligned bam file, currently I'm doing it with samtools, but I'll be more than happy if I can implement it in python without 3rd party tools. That's important because this step is an intermediate step, so I need this fasta sequence to play with it.

Thanks everyone for your help.

Best,

Daniel.
daniel_navarro is offline   Reply With Quote
Old 05-17-2014, 10:59 AM   #2
rnaeye
Member
 
Location: East Cost

Join Date: May 2011
Posts: 77
Default

Can't you call these tools within your Python script? As long as machine you are running have the tools installed, it should be fine.

Editing:
Sorry, when read you message a second time, I realized that you said you do not want to use third party tools.

Last edited by rnaeye; 05-17-2014 at 11:01 AM. Reason: made mistake
rnaeye is offline   Reply With Quote
Reply

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 12:57 AM.


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