<commit_before>use v6;

BEGIN {
    @*INC.push('./lib');
}

use Test;
eval_lives_ok 'use Bio::PrimarySeq', 'Can use Bio::PrimarySeq';

#    use_ok('Bio::Location::Simple');
#    use_ok('Bio::Location::Fuzzy');
#    use_ok('Bio::Location::Split');

use Bio::PrimarySeq;

my $seq = Bio::PrimarySeq.new(
    seq              => 'TTGGTGGCGTCAACT',
    display_id       => 'new-id',
    alphabet         => 'dna',
    accession_number => 'X677667',
    description             => 'Sample Bio::Seq object'
);

ok($seq ~~ Bio::PrimarySeq, 'Bio::PrimarySeq object');


is($seq.accession_number(), 'X677667','Retrieving accession number');

is($seq.seq(),'TTGGTGGCGTCAACT','Retrieving sequence');
is($seq.display_id(),'new-id','Retrieving display_id');
is($seq.alphabet(),'dna','Retrieving alphabet');
is($seq.is_circular(),Any,'Determing if circular');

# ok $seq->is_circular(1);
# is $seq->is_circular(0), 0;

# # check IdentifiableI and DescribableI interfaces
# isa_ok $seq, 'Bio::IdentifiableI';
# isa_ok $seq, 'Bio::DescribableI';

# # make sure all methods are implemented
#is( $seq.authority("bioperl.org") , "bioperl.org");
# is($seq.namespace("t"),           "t");
# is($seq.namespace, "t");
# is($seq.version(0), 0);
# is($seq.lsid_string(),      "bioperl.org:t:X677667");
# is($seq.namespace_string(), "t:X677667.0");
#$seq.version(47);
#is($seq.version(), 47,'Retrieving version number');
# is($seq.namespace_string(), "t:X677667.47");
# is($seq.description(),      'Sample Bio::Seq object');
# is($seq.display_name(),     "new-id");

# my $location = Bio::Location::Simple->new(
#     '-start'  => 2,
#     '-end'    => 5,
#     '-strand' => -1
# );
# is( $seq->subseq($location), 'ACCA' );

# my $splitlocation = Bio::Location::Split->new();
# $splitlocation->add_sub_Location(
#     Bio::Location::Simple->new(
#         '-start'  => 1,
#         '-end'    => 4,
#         '-strand' => 1
#     )
# );<commit_msg>Fixed up some unit tests for PrimarySeq.t<commit_after>use v6;

BEGIN {
    @*INC.push('./lib');
}

use Test;
eval_lives_ok 'use Bio::PrimarySeq', 'Can use Bio::PrimarySeq';

#    use_ok('Bio::Location::Simple');
#    use_ok('Bio::Location::Fuzzy');
#    use_ok('Bio::Location::Split');

use Bio::PrimarySeq;

my $seq = Bio::PrimarySeq.new(
    seq              => 'TTGGTGGCGTCAACT',
    display_id       => 'new-id',
    alphabet         => 'dna',
    accession_number => 'X677667',
    description             => 'Sample Bio::Seq object'
);

ok($seq ~~ Bio::PrimarySeq, 'Bio::PrimarySeq object');


is($seq.accession_number(), 'X677667','Retrieving accession number');

is($seq.seq(),'TTGGTGGCGTCAACT','Retrieving sequence');
is($seq.display_id(),'new-id','Retrieving display_id');
is($seq.alphabet(),'dna','Retrieving alphabet');
is($seq.is_circular(),Any,'Determing if circular');
is(($seq.is_circular=True),True,'Setting circular to True');
is(($seq.is_circular=False), False,'Setting circular to False');

# check IdentifiableI and DescribableI interfaces
ok($seq ~~ Bio::Role::Identify,'Has a Bio::Role::Identify');
ok($seq ~~ Bio::Role::Describe,'Has a Bio::Role::Describe');

# make sure all methods are implemented
is(($seq.authority="bioperl.org") , "bioperl.org",'Setting authority');
is(($seq.namespace='t'),'t','Setting namespace');
is($seq.namespace, "t",'Retrieving namespace');
is(($seq.version=0), 0,'Setting version number');
is($seq.lsid_string(), "bioperl.org:t:X677667",'Retrieving lsid_string');
is($seq.namespace_string(), "t:X677667.0",'Retrieving namespace_string');
$seq.version=47;
is($seq.version(), 47,'Retrieving version number');
is($seq.namespace_string(), "t:X677667.47",'Retrieving namespace_string');
is($seq.description(), 'Sample Bio::Seq object','Has correct description');
is($seq.display_name(), "new-id",'Has correct display_name');

# my $location = Bio::Location::Simple->new(
#     '-start'  => 2,
#     '-end'    => 5,
#     '-strand' => -1
# );
# is( $seq->subseq($location), 'ACCA' );

# my $splitlocation = Bio::Location::Split->new();
# $splitlocation->add_sub_Location(
#     Bio::Location::Simple->new(
#         '-start'  => 1,
#         '-end'    => 4,
#         '-strand' => 1
#     )
# );
{'fraction_non_alphanumeric': 0.21853986551392893, 'fraction_numerical': 0.02281460134486071, 'mean_word_length': 4.590604026845638, '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': '2795665', 'n_tokens_mistral': 1567, 'n_tokens_neox': 1483, 'n_words': 262}