Skip to content

Commit

Permalink
Fix on making the cog2ko file available
Browse files Browse the repository at this point in the history
It's always downloading it
Also fix on demanding some column with functional IDs
  • Loading branch information
iquasere committed Dec 22, 2023
1 parent 3d59b5d commit dce95b9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion cicd/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ build:
script: >
mkdir -p $PREFIX/bin &&
mkdir -p $PREFIX/share &&
cp *.py resources/*.txt resources/*.tsv $PREFIX/share &&
cp *.py resources/KEGGCharter_prokaryotic_maps.txt resources/cog2ko_keggcharter.tsv $PREFIX/share &&
chmod +x $PREFIX/share/keggcharter.py &&
ln -s $PREFIX/share/keggcharter.py $PREFIX/bin/keggcharter
Expand All @@ -33,6 +33,7 @@ requirements:
- poppler
- mscorefonts
- lxml
- requests

test:
commands:
Expand Down
8 changes: 5 additions & 3 deletions keggcharter.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from lxml import html
from keggpathway_map import KEGGPathwayMap, expand_by_list_column

__version__ = "1.0.0"
__version__ = "1.0.1"


def get_arguments():
Expand Down Expand Up @@ -84,6 +84,8 @@ def get_arguments():
if args.show_available_maps:
print(kegg_metabolic_maps().to_string(index=False))
sys.exit()
if not (args.kegg_column or args.ko_column or args.ec_column or args.cog_column):
error_exit('Need to specify a column with either KEGG IDs, KOs, EC numbers or COGs!')
args.output = args.output.rstrip('/')
for directory in [
f'{args.output}/{folder}' for folder in ['maps', 'json']] + [
Expand Down Expand Up @@ -393,8 +395,8 @@ def get_cross_references(
lambda x: ','.join(set([elem for elem in x if elem is not np.nan])), axis=1)
data['EC number (KEGGCharter)'] = data['EC number (KEGGCharter)'].apply(
lambda x: ','.join(sorted(set(x.split(',')))))
if not (kegg_column or ko_column or ec_column):
error_exit('Need to specify a column with either KEGG IDs, KOs or EC numbers!')
if not (kegg_column or ko_column or ec_column or cog_column):
error_exit('Need to specify a column with either KEGG IDs, KOs, EC numbers or COGs!')
return data


Expand Down

0 comments on commit dce95b9

Please sign in to comment.