[Biopython-dev] Pull Request: MafIO.py

Andrew Sczesnak andrewscz at gmail.com
Thu Nov 1 20:32:10 UTC 2012


Thanks Nick! I updated the MafIO branch to allow reading of other key
names not specified in the MAF spec. However, writing is still
restricted to "score" and "pass" keys.

On Thu, Nov 1, 2012 at 4:51 AM, Nick Loman <n.j.loman at bham.ac.uk> wrote:
> Hi Andrew
>
> Here you go:
>
> https://gist.github.com/58bc53d492ecc112d926
>
> Thanks for your help
>
> Regards
>
> Nick
>
>
>
> On Wed, Oct 31, 2012 at 6:10 PM, Andrew Sczesnak <andrewscz at gmail.com>
> wrote:
>>
>> Nick,
>>
>> Can you provide a snippet of a file from mugsy for the unit tests?
>>
>> Thanks,
>> Andrew
>>
>> On Oct 31, 2012, at 9:00 AM, biopython-dev-request at lists.open-bio.org
>> wrote:
>>
>> > From: Nick Loman <n.j.loman at bham.ac.uk>
>> > Date: Tue, Oct 30, 2012 at 6:34 AM
>> > Subject: Pull Request: MafIO.py
>> >
>> >
>> > Hi there
>> >
>> > Thanks for the MafIO branch. In order to get it to read MAF files
>> > produced
>> > by Mugsy (mugsy.sourceforge.net) I had to make the following change:
>> >
>> > diff --git a/Bio/AlignIO/MafIO.py b/Bio/AlignIO/MafIO.py
>> > index 6eda0ca..4bb1407 100644
>> > --- a/Bio/AlignIO/MafIO.py
>> > +++ b/Bio/AlignIO/MafIO.py
>> > @@ -178,7 +178,7 @@ def MafIterator(handle, seq_count = None, alphabet =
>> > single_letter_alphabet):
>> >
>> >              annotations = dict([x.split("=") for x in
>> > line.strip().split()[1:]])
>> >
>> > -            if len([x for x in annotations.keys() if x not in ("score",
>> > "pass")]) > 0:
>> > +            if len([x for x in annotations.keys() if x not in ("score",
>> > "pass", "label", "mult")]) > 0:
>> >                 raise ValueError("Error parsing alignment - invalid key
>> > in
>> > 'a' line")
>> >         elif line.startswith("#"):
>> >             # ignore comments
>> >
>> >
>> > My Python fork is a bit confusing right now so hope you don't mind me
>> > sending this pull request via email!
>> >
>> > Cheers
>> >
>> > Nick
>
>



More information about the Biopython-dev mailing list