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

« back to all changes in this revision

Viewing changes to Bio/DB/HIV/HIVQueryHelper.pm

  • Committer: Package Import Robot
  • Author(s): Charles Plessy
  • Date: 2013-09-22 13:39:48 UTC
  • mfrom: (3.1.11 sid)
  • Revision ID: package-import@ubuntu.com-20130922133948-c6z62zegjyp7ztou
Tags: 1.6.922-1
* New upstream release.
* Replaces and Breaks grinder (<< 0.5.3-3~) because of overlaping contents.
  Closes: #722910
* Stop Replacing and Breaking bioperl ( << 1.6.9 ): not needed anymore. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1172
1172
sub clone {
1173
1173
    local $_;
1174
1174
    my $self = shift;
1175
 
    my $ret = new QRY();
 
1175
    my $ret = QRY->new();
1176
1176
    foreach ($self->requests) {
1177
1177
        $ret->put_requests($_->clone);
1178
1178
    }
1346
1346
package # hide from PAUSE
1347
1347
    R;
1348
1348
use strict;
1349
 
$R::NULL = new R();
 
1349
$R::NULL = R->new();
1350
1350
 
1351
1351
 
1352
1352
## R constructor
1538
1538
sub clone {
1539
1539
    local $_;
1540
1540
    my $self = shift;
1541
 
    my $ret = new R();
 
1541
    my $ret = R->new();
1542
1542
    foreach ($self->atoms) {
1543
1543
        $ret->put_atoms($_->clone);
1544
1544
    }
1602
1602
 
1603
1603
    # common fields
1604
1604
    my @cf = grep {defined} map {my $sf = $_; grep /$sf/, $t->fields } $s->fields;
1605
 
    my $ret = new R();
 
1605
    my $ret = R->new();
1606
1606
    my $v = $t->clone;
1607
1607
    $v->del_atoms(@cf);
1608
1608
    my $u = $s->clone;
1729
1729
package # hide from PAUSE
1730
1730
    Q;
1731
1731
use strict;
1732
 
$Q::NULL = new Q();
 
1732
$Q::NULL = Q->new();
1733
1733
 
1734
1734
## Q constructor
1735
1735
 
1860
1860
sub clone {
1861
1861
    my $self = shift;
1862
1862
    Bio::Root::Root->throw("requires type Q (atom)") unless ref($self) && $self->isa('Q');
1863
 
    my $ret = new Q ($self->fld, $self->dta);
 
1863
    my $ret = Q->new($self->fld, $self->dta);
1864
1864
    return $ret;
1865
1865
}
1866
1866
 
1937
1937
    foreach my $f (@f) {
1938
1938
        my @fobjs =  grep {$_->fld eq $f} @a;
1939
1939
        my @d = unique(map {split(/\s/, $_->dta)} @fobjs );
1940
 
        my $r = new Q($f, @d);
 
1940
        my $r = Q->new($f, @d);
1941
1941
        push @ret, $r;
1942
1942
    }
1943
1943
    return @ret;
1983
1983
            foreach (@bd) {
1984
1984
                $ad{$_}++;
1985
1985
            }
1986
 
            my $r = new Q($a->fld,
 
1986
            my $r = Q->new($a->fld,
1987
1987
                          grep {$_}
1988
1988
                          map {$ad{$_} == 2 ? $_ : undef} keys %ad);
1989
1989
            return (length($r->dta) > 0) ? ($r) : ($Q::NULL);
2109
2109
        else {
2110
2110
            # replace an old value
2111
2111
            $self->remove_Annotations($_) if $a;
2112
 
            my $ac = new Bio::Annotation::Collection;
2113
 
            $self->add_Annotation(new Bio::Annotation::SimpleValue(
 
2112
            my $ac = Bio::Annotation::Collection->new();
 
2113
            $self->add_Annotation(Bio::Annotation::SimpleValue->new(
2114
2114
                                      -tagname => $_,
2115
2115
                                      -value => $ac
2116
2116
                                  )
2123
2123
        ($self->get_Annotations($lastkey))[0]->{value} = $value;
2124
2124
    }
2125
2125
    else {
2126
 
        $self->add_Annotation(new Bio::Annotation::SimpleValue(
 
2126
        $self->add_Annotation(Bio::Annotation::SimpleValue->new(
2127
2127
                                  -tagname=>$lastkey,
2128
2128
                                  -value=>$value
2129
2129
                              ));