Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EVA-3323 Count remapped variants from logs only if remapping was done #7

Merged
merged 3 commits into from
Sep 26, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions eva_assembly_ingestion/assembly_ingestion_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ def process_one_assembly(self, source_assembly, instance, resume):

remapping_log = os.path.join(assembly_directory, 'remapping_process.log')
remap_cluster_config_file = os.path.join(assembly_directory, 'remap_cluster_config.yaml')
remapping_required = self.check_remapping_required(source_assembly)
remap_cluster_config = {
'taxonomy_id': self.taxonomy,
'source_assembly_accession': source_assembly,
Expand All @@ -183,7 +184,7 @@ def process_one_assembly(self, source_assembly, instance, resume):
'clustering_properties': clustering_template_file,
'clustering_instance': instance,
'remapping_config': cfg.config_file,
'remapping_required': self.check_remapping_required(source_assembly)
'remapping_required': remapping_required
}

for part in ['executable', 'nextflow', 'jar']:
Expand All @@ -210,7 +211,10 @@ def process_one_assembly(self, source_assembly, instance, resume):
finally:
os.chdir(curr_working_dir)
self.set_status_end(source_assembly)
self.count_variants_from_logs(assembly_directory, source_assembly)
if remapping_required:
self.count_variants_from_logs(assembly_directory, source_assembly, remapping_required)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.count_variants_from_logs(assembly_directory, source_assembly, remapping_required)
self.count_variants_from_logs(assembly_directory, source_assembly)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

corrected

else:
self.info(f"No remapping required. Skipping variant counts from logs")

def check_remapping_required(self, source_assembly):
return source_assembly != self.target_assembly
Expand Down
Loading