<commit_before>#!/usr/local/ensembl/bin/perl -w

use strict;
use warnings;
use FindBin qw( $Bin );
use Getopt::Long;
use Bio::EnsEMBL::Utils::Exception qw(warning throw verbose);

use Bio::EnsEMBL::Registry;

#use Data::Dumper;

my $species;
my $dump_file;

GetOptions('dump_file=s' => \$dump_file,
	   'species=s'   => \$species,
	   );

warn("Make sure you have a updated ensembl.registry file!\n");

$species ||= 'mouse'; #by default, dump mouse data
usage('You need to enter the file name where you want to dump the data') if (!defined $dump_file); 
my $registry_file ||= $Bin . "/ensembl.registry";

Bio::EnsEMBL::Registry->load_all( $registry_file );


my $dbCore = Bio::EnsEMBL::Registry->get_DBAdaptor($species,'core');

my $slice_adaptor = $dbCore->get_SliceAdaptor();
my $slices = $slice_adaptor->fetch_all('chromosome');
#find out all possible chromosomes we want to dump and create the different job arrays
print "Time starting to dump data: ", scalar(localtime),"\n";
my $call = "bsub  -J dump_strain'[1-" . @{$slices} . "]%3' -q long /usr/local/bin/perl dump_strain_seq.pl -dump_file $dump_file -species $species";
system($call);
#print $call,"\n";    

#wait for all the process to go to LSF
sleep(120);
$call = "bsub  -o finish_dump.txt -w 'done(dump_strain)' -J waiting_process date";<commit_msg>modified to run all processes simultaniously<commit_after>#!/usr/local/ensembl/bin/perl -w

use strict;
use warnings;
use FindBin qw( $Bin );
use Getopt::Long;
use Bio::EnsEMBL::Utils::Exception qw(warning throw verbose);

use Bio::EnsEMBL::Registry;

#use Data::Dumper;

my $species;
my $dump_file;

GetOptions('dump_file=s' => \$dump_file,
	   'species=s'   => \$species,
	   );

warn("Make sure you have a updated ensembl.registry file!\n");

$species ||= 'mouse'; #by default, dump mouse data
usage('You need to enter the file name where you want to dump the data') if (!defined $dump_file); 
my $registry_file ||= $Bin . "/ensembl.registry";

Bio::EnsEMBL::Registry->load_all( $registry_file );


my $dbCore = Bio::EnsEMBL::Registry->get_DBAdaptor($species,'core');

my $slice_adaptor = $dbCore->get_SliceAdaptor();
my $slices = $slice_adaptor->fetch_all('chromosome');
#find out all possible chromosomes we want to dump and create the different job arrays
print "Time starting to dump data: ", scalar(localtime),"\n";
my $call = "bsub  -J dump_strain'[1-" . @{$slices} . "]' -q long /usr/local/bin/perl dump_strain_seq.pl -dump_file $dump_file -species $species";
system($call);
#print $call,"\n";    

#wait for all the process to go to LSF
sleep(120);
$call = "bsub  -o finish_dump.txt -w 'done(dump_strain)' -J waiting_process date";
{'fraction_non_alphanumeric': 0.15856873822975517, 'fraction_numerical': 0.003389830508474576, 'mean_word_length': 5.119815668202765, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '1441827', 'n_tokens_mistral': 994, 'n_tokens_neox': 930, 'n_words': 273}