~ubuntu-branches/ubuntu/trusty/bioperl/trusty

« back to all changes in this revision

Viewing changes to Bio/SeqFeatureI.pm

  • Committer: Package Import Robot
  • Author(s): Charles Plessy
  • Date: 2014-01-18 11:41:11 UTC
  • mfrom: (3.1.12 sid)
  • Revision ID: package-import@ubuntu.com-20140118114111-zcjaq5edb49dhlat
Tags: 1.6.923-1
* New upstream release.
* Does not need non-free libmath-random-perl anymore.
* Build-depend on libmodule-build-perl (>= 0.420000).  Despite Lintian's
  warning that it is useless, the package does not build without.
* Conforms to Policy version 3.9.5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
597
597
                # in turn returns a string.  Confused?
598
598
            $seqstr .= $called_seq->subseq($s,$e)->seq()->seq();
599
599
        } else {
600
 
            # This is dumb, subseq should work on locations...
601
 
            if( $loc->strand == 1 ) {
 
600
            # If guide_strand is defined, assemble the sequence first and revcom later if needed,
 
601
            # if its not defined, apply revcom immediately to proper locations
 
602
            if (defined $self->location->guide_strand) {
602
603
                $seqstr .= $called_seq->subseq($loc->start,$loc->end);
603
604
            } else {
604
 
                if( $nosort ) {
605
 
                    $seqstr = $called_seq->trunc($loc->start,$loc->end)->revcom->seq() . $seqstr;
 
605
                my $strand = defined ($loc->strand) ? ($loc->strand) : 0;
 
606
                if ($strand == -1) {
 
607
                    $seqstr .= $called_seq->trunc($loc->start,$loc->end)->revcom->seq;
606
608
                } else {
607
 
                    $seqstr .= $called_seq->trunc($loc->start,$loc->end)->revcom->seq();
 
609
                    $seqstr .= $called_seq->subseq($loc->start,$loc->end);
608
610
                }
609
611
            }
610
612
        }
611
613
    }
 
614
    # Use revcom only after the whole sequence has been assembled
 
615
    my $guide_strand = defined ($self->location->guide_strand) ? ($self->location->guide_strand) : 0;
 
616
    if ($guide_strand == -1) {
 
617
        my $seqstr_obj = Bio::Seq->new(-seq => $seqstr);
 
618
        $seqstr = $seqstr_obj->revcom->seq;
 
619
    }
612
620
    
613
621
    if (defined($phase)) {
614
622
        $seqstr = substr($seqstr, $phase);