[Biopython-dev] BWA Wrapper

Saket Choudhary saketkc at gmail.com
Thu Feb 14 16:02:21 UTC 2013


Theres one more issue that I have run into . Consider the following command
, the outout generated is written by piping it to a file called aln_sa.sai,


bwa aln database.fasta short_read.fastq > aln_sa.sai

Now if we look into the _call method
here<https://github.com/saketkc/biopython/blob/master/Bio/Application/__init__.py#L372>
,
it takes as its inout a boolean for stdout. So should I modify this so that
it can take 'stdout' as on opened file  instance which I can invoke while
unvoking my BwaAlnCommandLine functions as follwos:

a=BwaAlnCommandLine()
b=a(stdout=open("aln_sa.sai","wb"))



On 12 February 2013 23:08, Peter Cock <p.j.a.cock at googlemail.com> wrote:

> On Tue, Feb 12, 2013 at 9:51 AM, Saket Choudhary <saketkc at gmail.com>
> wrote:
> > Hi,
> >
> > I am writing a bwa wrapper for bio-python. I have infact got the "index"
> >  option working. However I have a concern:
> >
> > bwa has these options :
> >
> > bwa index -a bwtsw database.fasta
> >
> > bwa aln database.fasta short_read.fastq > aln_sa.sai
> >
> > bwa samse database.fasta aln_sa.sai short_read.fastq > aln.sam
> >
> > bwa sampe database.fasta aln_sa1.sai aln_sa2.sai read1.fq read2.fq >
> aln.sam
> >
> > bwa bwasw database.fasta long_read.fastq > aln.sam
> >
> >
> > If you read the documentation here<
> http://bio-bwa.sourceforge.net/bwa.shtml>,
> > you will see that  "-r" is an option with "aln" command as well as the
> > "samse" command. In the former it is of type INT and in the latter of
> type
> > STR. Now I am not sure how can this be taken care of in the wrapper,
> > because I also plan to implement a checker_function.  One way is to make
> a
> > new class, lets say BwaAlignCommand which will take care of all options
> > inside the "aln" command and separately implement another class say
> > "BwaSamseCommand", and implement all the options of the "samse" command.
> > But I am not sure if that is indeed the correct way of addressing the
> > problem.
> >
> >
> > Any pointers on this issue ?
>
> I would treat "bwa samse", "bwa sampe", "bwa ..." as separate tools and
> write a wrapper class for each of them. This would probably fit under the
> Bio.Sequencing.Applications namespace.
>
> Peter
>



More information about the Biopython-dev mailing list