|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|
|05-16-2014, 07:56 AM||#1|
Join Date: May 2014
Bam file to Consensus Fasta/fastq in python
I want to get the same result as I get from this command, but in python (BioPython/Pysam):
samtools mpileup -uf ref.fa aln.bam | bcftools view -cg - | vcfutils.pl vcf2fq > cns.fq
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.
|05-17-2014, 10:59 AM||#2|
Location: East Cost
Join Date: May 2011
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.
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