9 my $io = CXGN::SNPsIO->new( { file => 't/data/test.file' }); #cassava_test.vcf' });
12 while (my $line = $io->next_line()) {
16 like($io->header(), qr/header/, "header test");
17 like($lines[0], qr/1/, "first line test");
18 like($lines[9], qr/10/, "last line test");
22 my $io = CXGN::SNPsIO->new( { file => 't/data/test_missing_header.txt' });
25 while (my $snp_data = $io->next_line()) {
30 like($@, qr/Header not seen/, "missing header test");
34 $io = CXGN::SNPsIO->new( { file => 't/data/cassava_test.vcf' }); #cassava_test.vcf' });
56 my @depths = (24235,24235,24206,24235,24235,24235,24235,24235,25058,25058,25037,25058,25058,25058,25058);
58 my $format = "GT:AD:DP:GQ:PL";
78 my @ref_counts = (3,3,3,3,3,3,3,3,0,0,0,0,0,0,0);
79 my @alt_counts = (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
82 while (my $snps = $io->next()) {
83 print STDERR "Processing snp ".$snps->id()."\n";
84 is($snps->id, $ids[$line], "ID test");
85 is($snps->depth, $depths[$line], "depth test");
86 is($snps->format, $format, "format test");
87 is($snps->snps->{'1002:250060174'}->vcf_string(), $snp_raw[$line], "raw data test line $line");
88 is($snps->snps->{'1002:250060174'}->ref_count(), $ref_counts[$line], "ref_count test line $line");
89 is($snps->snps->{'1002:250060174'}->alt_count(), $alt_counts[$line], "alt_count test line $line");
90 is($snps->snps->{'1002:250060174'}->accession(), '1002:250060174', "accession test");
91 my $af = $snps->calculate_allele_frequency_using_counts();
92 print STDERR " AF = $af\n";
93 $snps->calculate_dosages();
94 # print STDERR "Calculating Hardy Weinberg filter...\n";
95 my %scores = $snps->hardy_weinberg_filter();
96 print STDERR Dumper(\%scores);