Comments (1)
I'm seeing this bit here:
def run(self, protein_files):
logging.info('Annotating input genomes with DIAMOND using {} threads'.format(self.threads))
if len(protein_files) <= self.chunksize:
protein_chunks = self.__concatenate_proteins(protein_files)
diamond_out = os.path.join(self.diamond_out, "DIAMOND_RESULTS.tsv")
self.__call_diamond(protein_chunks, diamond_out)
else:
#break file list into chunks of size 'chunksize'
chunk_list = [protein_files[i:i + self.chunksize] for i in range(0, len(protein_files), self.chunksize)]
for number, chunk in enumerate(chunk_list):
diamond_out = os.path.join(self.diamond_out, "DIAMOND_RESULTS_{}.tsv".format(number))
self.__call_diamond(self.__concatenate_proteins(chunk), diamond_out)
diamond_out_list = [x for x in os.listdir(self.diamond_out) if x.startswith('DIAMOND_RESULTS')]
if len(diamond_out_list) == 0:
logging.error("Error: DIAMOND failed to generate output.")
sys.exit(1)
else:
return diamond_out_list
Could be REALLY useful to have something like this:
from tqdm import tqdm
def run(self, protein_files):
logging.info('Annotating input genomes with DIAMOND using {} threads'.format(self.threads))
if len(protein_files) <= self.chunksize:
protein_chunks = self.__concatenate_proteins(protein_files)
diamond_out = os.path.join(self.diamond_out, "DIAMOND_RESULTS.tsv")
self.__call_diamond(protein_chunks, diamond_out)
else:
#break file list into chunks of size 'chunksize'
chunk_list = [protein_files[i:i + self.chunksize] for i in range(0, len(protein_files), self.chunksize)]
for number, chunk in tqdm(enumerate(chunk_list), desc="Diamond annotation on chunks", total=len(chunk_list)):
diamond_out = os.path.join(self.diamond_out, "DIAMOND_RESULTS_{}.tsv".format(number))
self.__call_diamond(self.__concatenate_proteins(chunk), diamond_out)
diamond_out_list = [x for x in os.listdir(self.diamond_out) if x.startswith('DIAMOND_RESULTS')]
if len(diamond_out_list) == 0:
logging.error("Error: DIAMOND failed to generate output.")
sys.exit(1)
else:
return diamond_out_list
from checkm2.
Related Issues (20)
- TypeError: metaclass conflict HOT 7
- coding density
- Can Checkm2 be fine-tuned for euMAGs? HOT 1
- running checkm2 issue HOT 8
- KeyError: 'key' while downloading database HOT 6
- N50 values
- checkm2 database --download fail HOT 2
- Can I use protein fasta as input? HOT 2
- Average_Gene_Length HOT 1
- How to remove the contamination sequence from MAGs HOT 2
- Cannot install ChekM2 HOT 1
- Question about Checkm2 Annotation HOT 1
- Checkm2 flags certain species and genera as contaminated on a consistent basis.
- the version checkm2 v1.0.2 was not available on conda HOT 1
- Error in DIAMOND execution HOT 2
- [Feature Request] Use #!/usr/bin/env python instead of hardcoding python path
- AttributeError: 'Predictor' object has no attribute '__set_up_prodigal_thread' HOT 2
- Random errors on clusters HOT 3
- Database update? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from checkm2.