[Bioperl-guts-l] [BioPerl - Bug #3181] XMFA strandedness not parsed correctly

redmine at redmine.open-bio.org redmine at redmine.open-bio.org
Tue Mar 29 12:32:56 EDT 2011


Issue #3181 has been updated by Chris Fields.


Actually, this seems to be parsing as expected.  Note that the strand is checked against the third match (latest master branch code, note added arrow):

<pre>
    my ($start, $end, $strand, $seqname, $desc, $all);
    # put away last name and sequence
    if ( $entry =~ m{^>\s*\d+:(\d+)-(\d+)\s([+-]{1})(?:\s+(\S+)\s*(\S\.*)?)?} ) {
        ($start, $end, $seqname, $desc) = ($1, $2, $4, $5);
        $strand = ($3 eq '+')  ?  1  : -1; # <-------
    } else {
        $self->throw("Line does not comform to XMFA format:\n$entry");
    }
</pre>

Adding some test cases for this.  The current test alignment has sequences with strand information, and everything passes. If the latest code is still failing, could you provide a test case where it is failing?  Otherwise I'll likely close this out.
----------------------------------------
Bug #3181: XMFA strandedness not parsed correctly
https://redmine.open-bio.org/issues/3181

Author: Lee Katz
Status: New
Priority: Normal
Assignee: Bioperl Guts
Category: Bio::SeqIO
Target version: 1.6 branch
URL: 


This is actually for AlignIO.  When parsing a mauve xmfa file, strandedness is not found.  Actually this is because of the private subfunction _process_seq() which looks at $4 instead of $3.  I have copied and pasted a relevant block of code from AlignIO::xmfa to point it out.

Some sample sequence headers are
> 11:0-0 + /foo/bar/NM_alpha14.fna
> 6:826578-826627 + /foo/bar/NM_Z2491.fna

# excerpt from AlignIO::xmfa
sub _process_seq {
    my ($self, $entry, $seq) = @_;
    my ($start, $end, $strand, $seqname, $desc, $all);
    # put away last name and sequence
    if ( $entry =~ m{^>\s*\d+:(\d+)-(\d+)\s([+-]{1})(?:\s+(\S+)\s*(\S\.*)?)?} ) {
        ($start, $end, $seqname, $desc) = ($1, $2, $4, $5);
        $strand = ($3 eq '+')  ?  1  : -1; # I changed this from $4 -LK
        print $entry."\n\n".join("\t",$start,$end,$strand)."\n\n";
    } else {
        $self->throw("Line does not comform to XMFA format:\n$entry");
    }


-- 
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here and login: http://redmine.open-bio.org



More information about the Bioperl-guts-l mailing list