<jupyter_start><jupyter_text>Load the chronic fatigue dataset<jupyter_code>dat=ca.read_amplicon('./cfs.biom','./cfs.map.txt',normalize=10000,min_reads=1000)
datc=dat.cluster_features(10)<jupyter_output>2021-05-30 13:12:27 INFO After filtering, 1100 remain.<jupyter_text>Get the bacteria different between CFS Patients and Controls<jupyter_code>dd=datc.diff_abundance('Subject','Patient','Control',random_seed=2019,alpha=0.1)<jupyter_output>2021-05-30 13:12:28 INFO 87 samples with both values
2021-05-30 13:12:28 INFO After filtering, 1100 remain.
2021-05-30 13:12:28 INFO 48 samples with value 1 (['Patient'])
2021-05-30 13:12:28 INFO number of higher in Patient: 17. number of higher in Control : 46. total 63<jupyter_text>The dbBact release to use<jupyter_code># max_id = 3925 # release 10-20
max_id = 6237 # release 05-21<jupyter_output><empty_output><jupyter_text>Plot the enriched termsWe plot the 10 most enriched terms in any direction Command parameter details:* max_show - how many enriched terms to show in the bar graph - we want 10 most enriched in CFS, 10 most enriched in Controls* min_appearances - show only terms enriched in at least min_appearances differnt experiments. So if we set to 2, we will not see the terms that are enriched only in 1 experiment (e.g. physical activity, etc.)* num_results_needed - To make the enriched terms analysis faster, stop after finding the num_results_needed enriched terms. needs to be equal to max_show* add_single_exp_warning - if True, put a * next to terms that are enriched only in one experiment* ignore_exp - a list of experiment IDs to ignore when testing enriched terms. We set to [12] since experiment 12 is the CFS experiment in dbbact, and we don't want to get enriched terms derived from annotations on this experiment. Can be set to True to ignore the current experiment<jupyter_code># set the y ticks font to bigger
import matplotlib
matplotlib.rc('ytick', labelsize=15)<jupyter_output><empty_output><jupyter_text>Plot the results.We want 7 terms for each directionAlso ignore the annotations from this experiment in dbBact (expid=12)<jupyter_code>f,e=dd.plot_diff_abundance_enrichment(max_show=7, min_appearances=1, num_results_needed=7,add_single_exp_warning=False,colors=['r','g'], ignore_exp=[12], max_id=max_id)
f.set_xlim([-1,1])
e.feature_metadata.to_csv('./terms-cfs.csv')
f.figure.savefig('./fig2-query-enrichment.pdf')
f.figure.savefig('./fig2-query-enrichment.svg')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09248788368336026, 'fraction_numerical': 0.05977382875605816, 'mean_word_length': 6.242690058479532, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '138289', 'license': 'MIT', 'n_tokens_mistral': 927, 'n_tokens_neox': 779, 'n_words': 265, 'path': 'notebooks/fig2-querying/fig2-query-enrichment.ipynb', 'repo_name': 'amnona/dbbact-paper', 'size': '2476'}