Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- #
- # nuskaityti bindingdb sdf failus
- # H-Se/DB26984_50278320.sdf kaip testas imtas
- #
- # VR
- #
- #use warnings;
- use Data::Dumper;
- die "usage VR_bindingdb_parse.pl file.sdf" if (@ARGV != 1);
- $FILE = $ARGV[0];
- open FILE, "<", $FILE or die $!;
- $x=0;
- while(<FILE>) {
- chop($_);
- next if ($_ =~ /^$/); #jei eilute tuscia praleidziam
- if ($_ =~ /\$\$\$\$/) { #jei eiluteje yra: $$$$
- $x++;
- $key = 'molecule';
- next;
- }
- #print $x, $_;
- if ($_ =~ /^\>/) { #jei eilute prasideda: >
- chop();
- $_ =~ s/> <//;
- $key = $_;
- } else {
- push @{ $lines[$x]{$key} }, $_;
- }
- }
- close FILE;
- print STDERR Dumper \@lines;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement