-
Notifications
You must be signed in to change notification settings - Fork 14
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
Use pandas in the post treatment #59
Conversation
Still need to change the tests files (and to check if everything is the same) |
Add pandas requirements |
… into posttreat_pandas
… into posttreat_pandas
… into posttreat_pandas
|
||
def export_defense_finder_systems(defense_finder_genes, outdir, filename): | ||
systems = build_defense_finder_systems(defense_finder_genes) | ||
systems_list = systems_to_list(systems) | ||
write_defense_finder_systems(systems_list, outdir, filename) | ||
systems.to_csv(outdir+'/'+filename+'_defense_finder_systems.tsv',sep='\t',index=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use os.path.join
return [ 'sys_id', 'type', 'subtype', 'sys_beg', 'sys_end', 'protein_in_syst', 'genes_count', 'name_of_profiles_in_sys' ] | ||
sys_beg=defense_finder_genes.sort_values('hit_pos').drop_duplicates('sys_id').rename({'hit_id' : 'sys_beg'},axis=1)[['sys_id','sys_beg']] | ||
sys_end=defense_finder_genes.sort_values('hit_pos' , ascending=False).drop_duplicates('sys_id').rename({'hit_id' : 'sys_end'},axis=1)[['sys_id','sys_end']] | ||
protein_in_syst=defense_finder_genes.groupby('sys_id').hit_id.apply(lambda x: ",".join(x.sort_values())).reset_index().rename({'hit_id':'protein_in_syst'},axis=1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
simplify to get sys_beg and sys_end from protein in syst
defense_finder_posttreat/df_genes.py
Outdated
from defense_finder_posttreat import best_solution | ||
|
||
def export_defense_finder_genes(defense_finder_genes, outdir, filename): | ||
defense_finder_genes_list = defense_finder_genes_to_list(defense_finder_genes) | ||
write_defense_finder_genes(defense_finder_genes_list, outdir, filename) | ||
defense_finder_genes.to_csv(outdir+'/'+filename+'_defense_finder_genes.tsv',sep='\t',index=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idem os.path.join
This PR has been inactive for 60 days and is now marked as stale. It will be closed in 7 days without further activity. We might have missed your issue, if you still have it, don't hesitate to comment again. |
This could be merged @FlorianTesson ? |
Close in favor to PR #64 |
No description provided.