# # Make your own RP sequence file # # This script will create a RP sequence file using the user's choices of # Taxonomy Groups and RPG cutoffs. # # The perl module "LWP::Simple" is required # #!/usr/bin/perl use LWP::Simple; if(@ARGV != 2) { print "Usage: perl getMyRPSeq.pl mypick.txt output.seq\n"; exit 1; } # configuration file of tab-delimited txt file with three columns: # TaxonGroup TaxonId RPCutoff # Note: for each row in the file, only the third column should be changed. # The possible values are 15, 35, 55, 75, 95 my $mypick = $ARGV[0]; # path to the output sequence file my $output = $ARGV[1]; my %taxonId = (); my $url = 'http://pir.georgetown.edu/rps/viruses/data/rp_seq_tax_group/current/'; open(PICK, $mypick) or die "Can't open $!\n"; while($line=) { chomp($line); if(!($line =~ /^Virus Taxonomic Group/ || $line =~ /^#/ || $line =~ /^$/)) { my ($taxId, $cutoff) = (split(/\t/, $line))[1, 2]; my $seqUrl = $url."/".$cutoff."/".$taxId.".seq"; my $file = $taxId.".seq"; $taxonId{$taxId} = 1; my $status = getstore($seqUrl, $file); die "Error $status on $seqUrl" unless is_success($status); } } close(PICK); open(OUT, ">", $output) or die "Can't open $!\n"; for my $key (sort keys %taxonId) { my $seqFile = $key.".seq"; if(-e $key.".seq") { open(FH, $seqFile) or die "Can't open $!\n"; while($line=) { print OUT $line; } close(FH); unlink($seqFile); } } close(OUT);