File: dbsnp.pl

package info (click to toggle)
libbio-cluster-perl 1.7.3-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 348 kB
  • sloc: perl: 1,136; xml: 361; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 558 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/perl

# allenday@ucla.edu
# parses a dbsnp xml file, prints some info for each refsnp and subsnp

use strict;
use Bio::ClusterIO;
use Bio::Root::IO;
use IO::File;

my $file = shift @ARGV;

my $io = Bio::ClusterIO->new	(	-tempfile => 0,
					-format   => 'dbsnp',
					-fh       => IO::File->new("zcat $file |"),
				);

while(my $cluster = $io->next_cluster){
	print $cluster->id,"\t", $cluster->observed, "\n";

	foreach my $subsnp ($cluster->each_subsnp){
		print "\t\t\t", $subsnp->id, "\t", $subsnp->handle, "\t", $subsnp->method, "\n";

	}
}