<commit_before>FIG = results/figures
TAB = results/tables
PROCESS = data/process
MOTHUR = data/mothur
NB = doc/notebook


$(NB)/%_data_acquisition.Rmd:
	R -e 'render("doc/notebook/%_data_acquisition.Rmd")'




$(PROCESS)/bacteria.v123.metadata : #
	wget --no-check-certificate -O $@.gz https://ndownloader.figshare.com/files/3672195
	gunzip $@.gz

$(PROCESS)/all_bacteria.filter.unique.precluster.an.rarefaction : #
	wget --no-check-certificate -O $@.gz https://ndownloader.figshare.com/files/3672069
	gunzip $@.gz

$(PROCESS)/all_bacteria.all_categories.groups.rarefaction : #
	wget --no-check-certificate -O $@.gz https://ndownloader.figshare.com/files/3672075
	gunzip $@.gz

$(PROCESS)/all_bacteria.env_category.groups.rarefaction : #
	wget --no-check-certificate -O $@.gz https://ndownloader.figshare.com/files/3672060
	gunzip $@.gz


$(PROCESS)/archaea.v123.metadata : #
	wget --no-check-certificate -O $@.gz https://ndownloader.figshare.com/files/3672198
	gunzip $@.gz

$(PROCESS)/all_archaea.filter.unique.precluster.an.rarefaction : #
	wget --no-check-certificate -O $@.gz https://ndownloader.figshare.com/files/3672057
	gunzip $@.gz

$(PROCESS)/all_archaea.all_categories.groups.rarefaction : #
	wget --no-check-certificate -O $@.gz https://ndownloader.figshare.com/files/3672078
	gunzip $@.gz

$(PROCESS)/all_archaea.env_category.groups.rarefaction : #
	wget --no-check-certificate -O $@.gz https://ndownloader.figshare.com/files/3672066
	gunzip $@.gz

FIGSHARE : 	$(PROCESS)/bacteria.v123.metadata\
			$(PROCESS)/all_bacteria.filter.unique.precluster.an.rarefaction\
			$(PROCESS)/all_bacteria.all_categories.groups.rarefaction\
			$(PROCESS)/all_bacteria.env_category.groups.rarefaction\
			$(PROCESS)/archaea.v123.metadata\
			$(PROCESS)/all_archaea.filter.unique.precluster.an.rarefaction\
			$(PROCESS)/all_archaea.all_categories.groups.rarefaction\
			$(PROCESS)/all_archaea.env_category.groups.rarefaction




#done
$(PROCESS)/coverage_by_category_and_time.tsv : code/get_coverage_by_category_and_time.R\
												code/partition_data.R\
												$(PROCESS)/bacteria.v123.metadata\
												$(PROCESS)/archaea.v123.metadata
	R -e 'source("code/get_coverage_by_category_and_time.R")'

#done
$(PROCESS)/by_year_analysis.tsv : code/get_time_course_submission_data.R\
									code/partition_data.R\
									$(PROCESS)/archaea.v123.metadata\
									$(PROCESS)/bacteria.v123.metadata
	R -e 'source("code/get_time_course_submission_data.R")'

#done
$(PROCESS)/bacteria.phyla.counts.tsv : code/get_phylum_counts.R\
									code/partition_data.R\
									$(PROCESS)/bacteria.v123.metadata
	R -e 'source("code/get_phylum_counts.R"); generate_table("bacteria")'

#done
$(PROCESS)/archaea.phyla.counts.tsv : code/get_phylum_counts.R\
									code/partition_data.R\
									$(PROCESS)/archaea.v123.metadata
	R -e 'source("code/get_phylum_counts.R"); generate_table("archaea")'

#done
$(PROCESS)/phylum_category_counts.tsv : code/get_phylum_category_counts.R\
									code/partition_data.R\
									$(PROCESS)/archaea.v123.metadata\
									$(PROCESS)/bacteria.v123.metadata
	R -e 'source("code/get_phylum_category_counts.R")'

#done
$(PROCESS)/bacteria.cultured_by_time_counts.tsv : code/get_culture_by_time_counts.R\
										code/partition_data.R\
										$(PROCESS)/bacteria.v123.metadata
	R -e 'source("code/get_culture_by_time_counts.R"); run_domain("bacteria")'

#done
$(PROCESS)/archaea.cultured_by_time_counts.tsv : code/get_culture_by_time_counts.R\
										code/partition_data.R\
										$(PROCESS)/archaea.v123.metadata
	R -e 'source("code/get_culture_by_time_counts.R"); run_domain("archaea")'

#xxx
$(PROCESS)/otu_overlap_by_method.tsv : code/get_otu_overlap_by_method.R\
								$(PROCESS)/archaea.v123.metadata\
								$(PROCESS)/bacteria.v123.metadata
	R -e 'source("code/get_otu_overlap_by_method.R")'


SUMMARY_TABLES: $(PROCESS)/coverage_by_category_and_time.tsv \
				$(PROCESS)/by_year_analysis.tsv \
				$(PROCESS)/bacteria.phyla.counts.tsv \
				$(PROCESS)/archaea.phyla.counts.tsv \
				$(PROCESS)/phylum_category_counts.tsv \
				$(PROCESS)/bacteria.cultured_by_time_counts.tsv \
				$(PROCESS)/archaea.cultured_by_time_counts.tsv \
				$(PROCESS)/otu_overlap_by_method.tsv




#Figure 1
$(FIG)/domain_rarefaction.pdf : $(PROCESS)/all_bacteria.filter.unique.precluster.an.rarefaction\
								$(PROCESS)/all_archaea.filter.unique.precluster.an.rarefaction\
								$(PROCESS)/all_bacteria.env_category.groups.rarefaction\
								$(PROCESS)/all_archaea.env_category.groups.rarefaction\
								code/build_domain_rarefaction_plot.R
	R -e 'source("code/build_domain_rarefaction_plot.R")'
<commit_msg>Screwing around with white space<commit_after>FIG = results/figures
TAB = results/tables
PROCESS = data/process
MOTHUR = data/mothur
NB = doc/notebook


$(NB)/%_data_acquisition.Rmd:
	R -e 'render("doc/notebook/%_data_acquisition.Rmd")'




$(PROCESS)/bacteria.v123.metadata : #
	wget --no-check-certificate -O $@.gz https://ndownloader.figshare.com/files/3672195
	gunzip $@.gz

$(PROCESS)/all_bacteria.filter.unique.precluster.an.rarefaction : #
	wget --no-check-certificate -O $@.gz https://ndownloader.figshare.com/files/3672069
	gunzip $@.gz

$(PROCESS)/all_bacteria.all_categories.groups.rarefaction : #
	wget --no-check-certificate -O $@.gz https://ndownloader.figshare.com/files/3672075
	gunzip $@.gz

$(PROCESS)/all_bacteria.env_category.groups.rarefaction : #
	wget --no-check-certificate -O $@.gz https://ndownloader.figshare.com/files/3672060
	gunzip $@.gz


$(PROCESS)/archaea.v123.metadata : #
	wget --no-check-certificate -O $@.gz https://ndownloader.figshare.com/files/3672198
	gunzip $@.gz

$(PROCESS)/all_archaea.filter.unique.precluster.an.rarefaction : #
	wget --no-check-certificate -O $@.gz https://ndownloader.figshare.com/files/3672057
	gunzip $@.gz

$(PROCESS)/all_archaea.all_categories.groups.rarefaction : #
	wget --no-check-certificate -O $@.gz https://ndownloader.figshare.com/files/3672078
	gunzip $@.gz

$(PROCESS)/all_archaea.env_category.groups.rarefaction : #
	wget --no-check-certificate -O $@.gz https://ndownloader.figshare.com/files/3672066
	gunzip $@.gz

FIGSHARE : 	$(PROCESS)/bacteria.v123.metadata\
			$(PROCESS)/all_bacteria.filter.unique.precluster.an.rarefaction\
			$(PROCESS)/all_bacteria.all_categories.groups.rarefaction\
			$(PROCESS)/all_bacteria.env_category.groups.rarefaction\
			$(PROCESS)/archaea.v123.metadata\
			$(PROCESS)/all_archaea.filter.unique.precluster.an.rarefaction\
			$(PROCESS)/all_archaea.all_categories.groups.rarefaction\
			$(PROCESS)/all_archaea.env_category.groups.rarefaction




#done
$(PROCESS)/coverage_by_category_and_time.tsv : code/get_coverage_by_category_and_time.R\
												code/partition_data.R\
												$(PROCESS)/bacteria.v123.metadata\
												$(PROCESS)/archaea.v123.metadata
	R -e 'source("code/get_coverage_by_category_and_time.R")'

#done
$(PROCESS)/by_year_analysis.tsv : code/get_time_course_submission_data.R\
									code/partition_data.R\
									$(PROCESS)/archaea.v123.metadata\
									$(PROCESS)/bacteria.v123.metadata
	R -e 'source("code/get_time_course_submission_data.R")'

#done
$(PROCESS)/bacteria.phyla.counts.tsv : code/get_phylum_counts.R\
									code/partition_data.R\
									$(PROCESS)/bacteria.v123.metadata
	R -e 'source("code/get_phylum_counts.R"); generate_table("bacteria")'

#done
$(PROCESS)/archaea.phyla.counts.tsv : code/get_phylum_counts.R\
									code/partition_data.R\
									$(PROCESS)/archaea.v123.metadata
	R -e 'source("code/get_phylum_counts.R"); generate_table("archaea")'

#done
$(PROCESS)/phylum_category_counts.tsv : code/get_phylum_category_counts.R\
									code/partition_data.R\
									$(PROCESS)/archaea.v123.metadata\
									$(PROCESS)/bacteria.v123.metadata
	R -e 'source("code/get_phylum_category_counts.R")'

#done
$(PROCESS)/bacteria.cultured_by_time_counts.tsv : \
									code/get_culture_by_time_counts.R\
									code/partition_data.R\
									$(PROCESS)/bacteria.v123.metadata
	R -e 'source("code/get_culture_by_time_counts.R"); run_domain("bacteria")'

#done
$(PROCESS)/archaea.cultured_by_time_counts.tsv : code/get_culture_by_time_counts.R\
										code/partition_data.R\
										$(PROCESS)/archaea.v123.metadata
	R -e 'source("code/get_culture_by_time_counts.R"); run_domain("archaea")'

#xxx
$(PROCESS)/otu_overlap_by_method.tsv : code/get_otu_overlap_by_method.R\
								$(PROCESS)/archaea.v123.metadata\
								$(PROCESS)/bacteria.v123.metadata
	R -e 'source("code/get_otu_overlap_by_method.R")'


SUMMARY_TABLES: $(PROCESS)/coverage_by_category_and_time.tsv \
				$(PROCESS)/by_year_analysis.tsv \
				$(PROCESS)/bacteria.phyla.counts.tsv \
				$(PROCESS)/archaea.phyla.counts.tsv \
				$(PROCESS)/phylum_category_counts.tsv \
				$(PROCESS)/bacteria.cultured_by_time_counts.tsv \
				$(PROCESS)/archaea.cultured_by_time_counts.tsv \
				$(PROCESS)/otu_overlap_by_method.tsv




#Figure 1
$(FIG)/domain_rarefaction.pdf : \
				code/build_domain_rarefaction_plot.R\
				$(PROCESS)/all_bacteria.filter.unique.precluster.an.rarefaction\
				$(PROCESS)/all_archaea.filter.unique.precluster.an.rarefaction\
				$(PROCESS)/all_bacteria.env_category.groups.rarefaction\
				$(PROCESS)/all_archaea.env_category.groups.rarefaction
	R -e 'source("code/build_domain_rarefaction_plot.R")'

{'fraction_non_alphanumeric': 0.14990349560368862, 'fraction_numerical': 0.02251769247265709, 'mean_word_length': 4.063517915309446, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 16, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6084386', 'n_tokens_mistral': 4346, 'n_tokens_neox': 3543, 'n_words': 360}