Skip to content

Commit

Permalink
use batch genome save in GenbankToGenome.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiangs18 committed Aug 16, 2024
1 parent a2fabf4 commit 330d6c2
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions lib/GenomeFileUtil/core/GenbankToGenome.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ def _import_genbank_mass(self, params):
for genome_obj in genome_objs:
shutil.rmtree(genome_obj.input_directory)

# TODO make an internal mass function save_genomes
results = self._save_genomes(workspace_id, genome_objs)

# return the result
Expand All @@ -220,17 +219,18 @@ def _import_genbank_mass(self, params):
return details

def _save_genomes(self, workspace_id, genome_objs):
results = [
self.gi.save_one_genome(
{
'workspace_id': workspace_id,
'name': genome_obj.genome_name,
'data': genome_obj.genome_data,
"meta": genome_obj.genome_meta,
}
) for genome_obj in genome_objs
]

results = self.gi.save_genome_mass(
{
"workspace_id": workspace_id,
"inputs": [
{
"name": genome_obj.genome_name,
"data": genome_obj.genome_data,
"meta": genome_obj.genome_meta,
} for genome_obj in genome_objs
],
}
)
return results

def _validate_params(self, params):
Expand Down

0 comments on commit 330d6c2

Please sign in to comment.