Skip to content
Snippets Groups Projects
Commit 481378f8 authored by Ian Longden's avatar Ian Longden
Browse files

more checks done now on the mapping files

parent 4e94d2ad
No related branches found
No related tags found
No related merge requests found
...@@ -879,6 +879,9 @@ sub parse_mappings { ...@@ -879,6 +879,9 @@ sub parse_mappings {
# Note %object_xref_mappings is global # Note %object_xref_mappings is global
my @dna_check=();
my @pep_check=();
foreach my $file (glob("$dir/*.map")) { foreach my $file (glob("$dir/*.map")) {
#print "Parsing results from " . basename($file) . "\n"; #print "Parsing results from " . basename($file) . "\n";
...@@ -886,10 +889,20 @@ sub parse_mappings { ...@@ -886,10 +889,20 @@ sub parse_mappings {
$total_files++; $total_files++;
# files are named Method_(dna|peptide)_N.map # files are named Method_(dna|peptide)_N.map
my $type = get_ensembl_object_type($file); # my $type = get_ensembl_object_type($file);
#
my $method = get_method($file); # my $method = get_method($file);
my ($method, $type, $part) = get_parts($file);
if($type =~ 'Translation'){
$pep_check[$part] = $part;
}
elsif($type =~ 'Transcript'){
$dna_check[$part] = $part;
}
else{
die "unknown type $type\n";
}
# get or create the appropriate analysis ID # get or create the appropriate analysis ID
# XXX restore when using writeable database # XXX restore when using writeable database
my $analysis_id = $self->get_analysis_id($type); my $analysis_id = $self->get_analysis_id($type);
...@@ -950,12 +963,31 @@ sub parse_mappings { ...@@ -950,12 +963,31 @@ sub parse_mappings {
print "Read $total_lines lines from $total_files exonerate output files\n"; print "Read $total_lines lines from $total_files exonerate output files\n";
if(!defined($self->use_existing_mappings()) if($self->jobcount() != $total_files){
and $self->jobcount() != $total_files){ print $dna_check[-1]." dna map files\n";
print "There should be ".$self->jobcount()." files. Please check\n"; print $pep_check[-1]." peptide map files\n";
print "As this is the number of jobs submitted\n"; my $test_failed = 0;
die "There should be ".$self->jobcount()." files. Please check\n"; for(my $i=1; $i < $dna_check[-1]; $i++){
} if($dna_check[$i] != $i){
print "DNA $i file not found\n";
$test_failed = 1;
}
}
for(my $i=1; $i < $pep_check[-1]; $i++){
if($pep_check[$i] != $i){
print "PEPTIDE $i file not found\n";
$test_failed = 1;
}
}
if($test_failed){
die "Missing Files aborting run\n";
}
if(!defined($self->use_existing_mappings())){
print "There should be ".$self->jobcount()." files. Please check\n";
print "As this is the number of jobs submitted\n";
die "There should be ".$self->jobcount()." files. Please check\n";
}
}
# write relevant xrefs to file # write relevant xrefs to file
$max_object_xref_id = $self->dump_core_xrefs(\%primary_xref_ids, $object_xref_id+1, $xref_id_offset, $object_xref_id_offset, \%ensembl_object_types); $max_object_xref_id = $self->dump_core_xrefs(\%primary_xref_ids, $object_xref_id+1, $xref_id_offset, $object_xref_id_offset, \%ensembl_object_types);
...@@ -1325,6 +1357,30 @@ sub get_ensembl_object_type { ...@@ -1325,6 +1357,30 @@ sub get_ensembl_object_type {
} }
sub get_parts {
my $filename = shift;
$filename = basename($filename);
my ($method,$type,$part) = $filename =~ /^(.*)_(dna|peptide)_(\d+)\.map/;
if ($type eq "dna" ) {
$type = "Transcript";
} elsif ($type eq "peptide") {
$type = "Translation";
} else {
print STDERR "Cannot deduce Ensembl object type from filename $filename\n";
}
return ($method, $type, $part);
}
sub get_method { sub get_method {
my $filename = shift; my $filename = shift;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment