<commit_before>package Bio::EnsEMBL::Variation::StructuralVariationOverlap;

use strict;
use warnings;

use Bio::EnsEMBL::Variation::StructuralVariationOverlapAllele;

use Bio::EnsEMBL::Utils::Scalar qw(assert_ref);
use Bio::EnsEMBL::Utils::Exception qw(throw warning);
use Bio::EnsEMBL::Utils::Argument qw(rearrange);

use base qw(Bio::EnsEMBL::Variation::BaseVariationFeatureOverlap);

sub new {

    my $class = shift;
    
    my %args = @_;

    # swap a '-structural_variation_feature' argument for a '-base_variation_feature' one for the superclass

    for my $arg (keys %args) {
        if (lc($arg) eq '-structural_variation_feature') {
            $args{'-base_variation_feature'} = delete $args{$arg};
        }
    }

    # call the superclass constructor
    my $self = $class->SUPER::new(%args) || return undef;

    return $self;
}

sub new_fast {
    my ($class, $hashref) = @_;
    
    # swap a 'structural_variation_feature' argument for a 'base_variation_feature' one for the superclass
    
    if ($hashref->{structural_variation_feature}) {
        $hashref->{base_variation_feature} = delete $hashref->{structural_variation_feature};
    }
    
    # and call the superclass

    my $self = $class->SUPER::new_fast($hashref);

    for my $ssv (@{ $self->structural_variation_feature->structural_variation->get_all_SupportingStructuralVariants }) {
        for my $ssvf (@{ $ssv->get_all_StructuralVariationFeatures }) {
            $self->add_StructuralVariationOverlapAllele(
                Bio::EnsEMBL::Variation::StructuralVariationOverlapAllele->new_fast({
                    structural_variation_overlap    => $self,
                })
            );
        }
    }

    unless (@{ $self->get_all_alternate_StructuralVariationOverlapAlleles }) {

        # construct a fake 'allele'
        
        $self->add_StructuralVariationOverlapAllele(
            Bio::EnsEMBL::Variation::StructuralVariationOverlapAllele->new_fast({
                structural_variation_overlap    => $self,
            })
        );
    }

    return $self;
}

sub structural_variation_feature {
    my $self = shift;
    return $self->base_variation_feature(@_);
}

=head2 add_StructuralVariationOverlapAllele

  Arg [1]    : A Bio::EnsEMBL::Variation::StructuralVariationOverlapAllele instance
  Description: Add an allele to this StructuralVariationOverlap
  Returntype : none
  Exceptions : throws if the argument is not the expected type
  Status     : At Risk

=cut
<commit_msg>comment out broken code<commit_after>package Bio::EnsEMBL::Variation::StructuralVariationOverlap;

use strict;
use warnings;

use Bio::EnsEMBL::Variation::StructuralVariationOverlapAllele;

use Bio::EnsEMBL::Utils::Scalar qw(assert_ref);
use Bio::EnsEMBL::Utils::Exception qw(throw warning);
use Bio::EnsEMBL::Utils::Argument qw(rearrange);

use base qw(Bio::EnsEMBL::Variation::BaseVariationFeatureOverlap);

sub new {

    my $class = shift;
    
    my %args = @_;

    # swap a '-structural_variation_feature' argument for a '-base_variation_feature' one for the superclass

    for my $arg (keys %args) {
        if (lc($arg) eq '-structural_variation_feature') {
            $args{'-base_variation_feature'} = delete $args{$arg};
        }
    }

    # call the superclass constructor
    my $self = $class->SUPER::new(%args) || return undef;

    return $self;
}

sub new_fast {
    my ($class, $hashref) = @_;
    
    # swap a 'structural_variation_feature' argument for a 'base_variation_feature' one for the superclass
    
    if ($hashref->{structural_variation_feature}) {
        $hashref->{base_variation_feature} = delete $hashref->{structural_variation_feature};
    }
    
    # and call the superclass

    my $self = $class->SUPER::new_fast($hashref);

#    for my $ssv (@{ $self->structural_variation_feature->structural_variation->get_all_SupportingStructuralVariants }) {
#        for my $ssvf (@{ $ssv->get_all_StructuralVariationFeatures }) {
#            $self->add_StructuralVariationOverlapAllele(
#                Bio::EnsEMBL::Variation::StructuralVariationOverlapAllele->new_fast({
#                    structural_variation_overlap    => $self,
#                })
#            );
#        }
#    }

    unless (@{ $self->get_all_alternate_StructuralVariationOverlapAlleles }) {

        # construct a fake 'allele'
        
        $self->add_StructuralVariationOverlapAllele(
            Bio::EnsEMBL::Variation::StructuralVariationOverlapAllele->new_fast({
                structural_variation_overlap    => $self,
            })
        );
    }

    return $self;
}

sub structural_variation_feature {
    my $self = shift;
    return $self->base_variation_feature(@_);
}

=head2 add_StructuralVariationOverlapAllele

  Arg [1]    : A Bio::EnsEMBL::Variation::StructuralVariationOverlapAllele instance
  Description: Add an allele to this StructuralVariationOverlap
  Returntype : none
  Exceptions : throws if the argument is not the expected type
  Status     : At Risk

=cut

{'fraction_non_alphanumeric': 0.11155457992416683, 'fraction_numerical': 0.0007982438635002994, 'mean_word_length': 3.3964912280701753, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6985253', 'n_tokens_mistral': 1645, 'n_tokens_neox': 1567, 'n_words': 305}