+ ofstream out;
+ m->openOutputFile(outputFileName, out);
+ outputNames.push_back(outputFileName); outputTypes["tsv"].push_back(outputFileName);
+
+ out << "#This is a tab-delimited file. Additional Documentation can be found at http://www.mothur.org/wiki/MIMarks_Data_Packages." << endl;
+ out << "#Please fill all the required fields indicated with '*'" << endl;
+ out << "#Unknown or inapplicable fields can be assigned NA value." << endl;
+ out << "#You may add extra custom fields to this template. Make sure all the fields are separated by tabs." << endl;
+ out << "#You may remove any fields not required (marked with '*'). Make sure all the fields are separated by tabs." << endl;
+ out << "#You can edit this template using Microsoft Excel or any other editor. But while saving the file please make sure to save them as 'TAB-DELIMITED' TEXT FILE." << endl;
+
+ if (package == "air") {
+ out << "#Environmental:MIMARKS.specimen.air.3.0" << endl;
+ if (requiredonly) {
+ out << "*sample_name *organism *collection_date *biome *feature *material *geo_loc_name *lat_lon *title *seq_methods *altitude" << endl;
+ }else {
+ out << "*sample_name description bioproject_id sample_title *organism *collection_date *biome *feature *material *geo_loc_name *lat_lon *title *seq_methods rel_to_oxygen samp_collect_device samp_mat_process *altitude barometric_press carb_dioxide carb_monoxide chem_administration elev humidity methane misc_param organism_count oxygen oxy_stat_samp perturbation pollutants resp_part_matter samp_size samp_salinity samp_store_dur samp_store_loc samp_store_temp solar_irradiance temp ventilation_rate ventilation_type volatile_org_comp wind_direction wind_speed" << endl;
+ }
+ }else if (package == "host_associated") {
+ out << "#Environmental:MIMARKS.specimen.host-associated.3.0" << endl;
+ if (requiredonly) {
+ out << "*sample_name *organism *collection_date *biome *feature *material *geo_loc_name *lat_lon *title *seq_methods *host " << endl;
+ }else {
+ out << "*sample_name description bioproject_id sample_title *organism *collection_date *biome *feature *material *geo_loc_name *lat_lon *title *seq_methods rel_to_oxygen samp_collect_device samp_mat_process *host age altitude blood_press_diast blood_press_syst body_habitat body_product tissue chem_administration depth diet disease_stat dry_mass elev family_relationship genotype gravidity height_or_length host_body_temp host_color host_growth_cond host_shape host_subject_id host_taxid infra_specific_name infra_specific_rank last_meal life_stage misc_param organism_count oxy_stat_samp perturbation phenotype samp_size samp_salinity samp_store_dur samp_store_loc samp_store_temp sex substrate temp tot_mass" << endl;
+ }
+ }else if (package == "human_associated") {
+ out << "#Environmental:MIMARKS.specimen.human-associated.3.0" << endl;
+ if (requiredonly) {
+ out << "*sample_name *organism *collection_date *biome *feature *material *geo_loc_name *lat_lon *title *seq_methods *host" << endl;
+ }else {
+ out << "*sample_name description bioproject_id sample_title *organism *collection_date *biome *feature *material *geo_loc_name *lat_lon *title *seq_methods rel_to_oxygen samp_collect_device samp_mat_process *host hiv_stat ihmc_ethnicity ihmc_medication_code age amniotic_fluid_color foetal_health_stat gestation_state maternal_health_stat blood_blood_disord body_product tissue body_mass_index chem_administration diet disease_stat drug_usage family_relationship genotype height host_body_temp host_subject_id last_meal nose_throat_disord pulmonary_disord diet_last_six_month medic_hist_perform misc_param occupation organism_count oxy_stat_samp perturbation phenotype pet_farm_animal pulse samp_size samp_salinity samp_store_dur samp_store_loc samp_store_temp sex smoker study_complt_stat temp tot_mass travel_out_six_month twin_sibling urine_collect_meth kidney_disord urogenit_tract_disor weight_loss_3_month" << endl;
+ }
+ }else if (package == "human_gut") {
+ out << "#Environmental:MIMARKS.specimen.human-gut.3.0" << endl;
+ if (requiredonly) {
+ out << "*sample_name *organism *collection_date *biome *feature *material *geo_loc_name *lat_lon *title *seq_methods *host" << endl;
+ }else {
+ out << "*sample_name description bioproject_id sample_title *organism *collection_date *biome *feature *material *geo_loc_name *lat_lon *title *seq_methods rel_to_oxygen samp_collect_device samp_mat_process *host ihmc_ethnicity ihmc_medication_code age body_product tissue body_mass_index chem_administration diet disease_stat family_relationship gastrointest_disord genotype height host_body_temp host_subject_id last_meal liver_disord medic_hist_perform misc_param occupation organism_count oxy_stat_samp perturbation phenotype pulse samp_size samp_salinity samp_store_dur samp_store_loc samp_store_temp sex special_diet temp tot_mass" << endl;
+ }
+ }else if (package == "human_oral") {
+ out << "#Environmental:MIMARKS.specimen.human-oral.3.0" << endl;
+ if (requiredonly) {
+ out << "*sample_name *organism *collection_date *biome *feature *material *geo_loc_name *lat_lon *title *seq_methods *host" << endl;
+ }else {
+ out << "*sample_name description bioproject_id sample_title *organism *collection_date *biome *feature *material *geo_loc_name *lat_lon *title *seq_methods rel_to_oxygen samp_collect_device samp_mat_process *host ihmc_ethnicity ihmc_medication_code age body_product tissue body_mass_index chem_administration diet disease_stat family_relationship genotype height host_body_temp host_subject_id last_meal medic_hist_perform misc_param nose_mouth_teeth_throat_disord occupation organism_count oxy_stat_samp perturbation phenotype pulse samp_size samp_salinity samp_store_dur samp_store_loc samp_store_temp sex temp time_last_toothbrush tot_mass" << endl;
+ }
+ }else if (package == "human_skin") {
+ out << "#Environmental:MIMARKS.specimen.human-skin.3.0" << endl;
+ if (requiredonly) {
+ out << "*sample_name *organism *collection_date *biome *feature *material *geo_loc_name *lat_lon *title *seq_methods *host" << endl;
+ }else {
+ out << "*sample_name description bioproject_id sample_title *organism *collection_date *biome *feature *material *geo_loc_name *lat_lon *title *seq_methods rel_to_oxygen samp_collect_device samp_mat_process *host ihmc_ethnicity ihmc_medication_code age body_product tissue body_mass_index chem_administration dermatology_disord diet disease_stat dominant_hand family_relationship genotype height host_body_temp host_subject_id last_meal medic_hist_perform misc_param occupation organism_count oxy_stat_samp perturbation phenotype pulse samp_size samp_salinity samp_store_dur samp_store_loc samp_store_temp sex temp time_since_last_wash tot_mass" << endl;
+ }
+ }else if (package == "human_vaginal") {
+ out << "#Environmental:MIMARKS.specimen.human-vaginal.3.0" << endl;
+ if (requiredonly) {
+ out << "*sample_name *organism *collection_date *biome *feature *material *geo_loc_name *lat_lon *title *seq_methods *host" << endl;
+ }else {
+ out << "*sample_name description bioproject_id sample_title *organism *collection_date *biome *feature *material *geo_loc_name *lat_lon *title *seq_methods rel_to_oxygen samp_collect_device samp_mat_process *host hrt ihmc_ethnicity ihmc_medication_code age birth_control body_product tissue body_mass_index chem_administration diet disease_stat douche family_relationship genotype gynecologic_disord height host_body_temp host_subject_id hysterectomy last_meal medic_hist_perform menarche menopause misc_param occupation organism_count oxy_stat_samp perturbation phenotype pregnancy pulse samp_size samp_salinity samp_store_dur samp_store_loc samp_store_temp sex sexual_act temp tot_mass urogenit_disord" << endl;
+ }
+ }else if (package == "microbial") {
+ out << "#Environmental:MIMARKS.specimen.microbial.3.0" << endl;
+ if (requiredonly) {
+ out << "*sample_name *organism *collection_date *biome *feature *material *geo_loc_name *lat_lon *title *seq_methods *depth *elev" << endl;
+ }else {
+ out << "*sample_name description bioproject_id sample_title *organism *collection_date *biome *feature *material *geo_loc_name *lat_lon *title *seq_methods rel_to_oxygen samp_collect_device samp_mat_process *depth *elev alkalinity alkyl_diethers altitude aminopept_act ammonium bacteria_carb_prod biomass bishomohopanol bromide calcium carb_nitro_ratio chem_administration chloride chlorophyll diether_lipids diss_carb_dioxide diss_hydrogen diss_inorg_carb diss_org_carb diss_org_nitro diss_oxygen glucosidase_act magnesium mean_frict_vel mean_peak_frict_vel methane misc_param n_alkanes nitrate nitrite nitro org_carb org_matter org_nitro organism_count oxy_stat_samp ph part_org_carb perturbation petroleum_hydrocarb phaeopigments phosphate phosplipid_fatt_acid potassium pressure redox_potential salinity samp_size samp_store_dur samp_store_loc samp_store_temp silicate sodium sulfate sulfide temp tot_carb tot_nitro tot_org_carb turbidity water_content" << endl;
+ }
+ }else if (package == "miscellaneous") {
+ out << "#Environmental:MIMARKS.specimen.miscellaneous.3.0" << endl;
+ if (requiredonly) {
+ out << "*sample_name *organism *collection_date *biome *feature *material *geo_loc_name *title *seq_methods *lat_lon" << endl;
+ }else {
+ out << "*sample_name description bioproject_id sample_title *organism *collection_date *biome *feature *material *geo_loc_name *lat_lon *title *seq_methods rel_to_oxygen samp_collect_device samp_mat_process alkalinity altitude ammonium biomass bromide calcium chem_administration chloride chlorophyll current density depth diether_lipids diss_carb_dioxide diss_hydrogen diss_inorg_carb diss_org_nitro diss_oxygen elev misc_param nitrate nitrite nitro org_carb org_matter org_nitro organism_count oxy_stat_samp ph perturbation phosphate phosplipid_fatt_acid potassium pressure salinity samp_size samp_store_dur samp_store_loc samp_store_temp silicate sodium sulfate sulfide temp" << endl;
+ }
+ }else if (package == "plant_associated") {
+ out << "#Environmental:MIMARKS.specimen.plant-associated.3.0" << endl;
+ if (requiredonly) {
+ out << "*sample_name *organism *collection_date *biome *feature *material *geo_loc_name *lat_lon *title *seq_methods *host" << endl;
+ }else {
+ out << "*sample_name description bioproject_id sample_title *organism *collection_date *biome *feature *material *geo_loc_name *lat_lon *title *seq_methods rel_to_oxygen samp_collect_device samp_mat_process *host age air_temp_regm altitude antibiotic_regm body_product chem_administration chem_mutagen climate_environment depth disease_stat dry_mass elev fertilizer_regm fungicide_regm gaseous_environment genotype gravity growth_hormone_regm growth_med height_or_length herbicide_regm host_taxid humidity_regm infra_specific_name infra_specific_rank life_stage mechanical_damage mineral_nutr_regm misc_param non_mineral_nutr_regm organism_count oxy_stat_samp ph_regm perturbation pesticide_regm phenotype tissue plant_product radiation_regm rainfall_regm salt_regm samp_size samp_salinity samp_store_dur samp_store_loc samp_store_temp season_environment standing_water_regm temp tiss_cult_growth_med tot_mass water_temp_regm watering_regm wet_mass" << endl;
+ }
+ }else if (package == "sediment") {
+ out << "#Environmental:MIMARKS.specimen.sediment.3.0" << endl;
+ if (requiredonly) {
+ out << "*sample_name *organism *collection_date *biome *feature *material *geo_loc_name *lat_lon *title *seq_methods *depth *elev" << endl;
+ }else {
+ out << "*sample_name description bioproject_id sample_title *organism *collection_date *biome *feature *material *geo_loc_name *lat_lon *title *seq_methods rel_to_oxygen samp_collect_device samp_mat_process *depth *elev alkalinity alkyl_diethers aminopept_act ammonium bacteria_carb_prod biomass bishomohopanol bromide calcium carb_nitro_ratio chem_administration chloride chlorophyll density diether_lipids diss_carb_dioxide diss_hydrogen diss_inorg_carb diss_org_carb diss_org_nitro diss_oxygen glucosidase_act magnesium mean_frict_vel mean_peak_frict_vel methane misc_param n_alkanes nitrate nitrite nitro org_carb org_matter org_nitro organism_count oxy_stat_samp ph particle_class part_org_carb perturbation petroleum_hydrocarb phaeopigments phosphate phosplipid_fatt_acid porosity potassium pressure redox_potential salinity samp_size samp_store_dur samp_store_loc samp_store_temp sediment_type silicate sodium sulfate sulfide temp tidal_stage tot_carb tot_nitro tot_org_carb turbidity water_content" << endl;
+ }
+ }else if (package == "soil") {
+ out << "#Environmental:MIMARKS.specimen.soil.3.0" << endl;
+ if (requiredonly) {
+ out << "*sample_name *organism *collection_date *biome *feature *material *geo_loc_name *lat_lon *title *seq_methods *depth *elev" << endl;
+ }else {
+ out << "*sample_name description bioproject_id sample_title *organism *collection_date *biome *feature *material *geo_loc_name *lat_lon *title *seq_methods rel_to_oxygen samp_collect_device samp_mat_process *depth *elev altitude sieving cur_land_use cur_vegetation_meth cur_vegetation drainage_class al_sat al_sat_meth heavy_metals_meth heavy_metals salinity_meth extreme_salinity fao_class agrochem_addition crop_rotation extreme_event fire flooding previous_land_use_meth previous_land_use tillage horizon_meth horizon link_class_info link_climate_info link_addit_analys annual_season_precpt annual_season_temp microbial_biomass_meth microbial_biomass misc_param other ph_meth ph pool_dna_extracts profile_position samp_size samp_weight_dna_ext slope_aspect slope_gradient soil_type_meth soil_type local_class_meth local_class store_cond texture_meth texture tot_n_meth tot_n tot_org_c_meth tot_org_carb water_content_soil_meth water_content_soil" << endl;
+ }
+ }else if (package == "wastewater") {
+ out << "#Environmental:MIMARKS.specimen.wastewater.3.0" << endl;
+ if (requiredonly) {
+ out << "*sample_name *organism *collection_date *biome *feature *material *geo_loc_name *lat_lon *title *seq_methods" << endl;
+ }else {
+ out << "*sample_name description bioproject_id sample_title *organism *collection_date *biome *feature *material *geo_loc_name *lat_lon *title *seq_methods rel_to_oxygen samp_collect_device samp_mat_process alkalinity biochem_oxygen_dem chem_administration chem_oxygen_dem depth efficiency_percent emulsions gaseous_substances indust_eff_percent inorg_particles misc_param nitrate org_particles organism_count oxy_stat_samp ph perturbation phosphate pre_treatment primary_treatment reactor_type samp_size samp_salinity samp_store_dur samp_store_loc samp_store_temp secondary_treatment sewage_type sludge_retent_time sodium soluble_inorg_mat soluble_org_mat suspend_solids temp tertiary_treatment tot_nitro tot_phosphate wastewater_type" << endl;
+ }
+ }else if (package == "water") {
+ out << "#Environmental:MIMARKS.specimen.water.3.0" << endl;
+ if (requiredonly) {
+ out << "*sample_name *organism *collection_date *biome *feature *material *geo_loc_name *lat_lon *title *seq_methods *depth" << endl;
+ }else {
+ out << "*sample_name description bioproject_id sample_title *organism *collection_date *biome *feature *material *geo_loc_name *lat_lon *title *seq_methods rel_to_oxygen samp_collect_device samp_mat_process *depth alkalinity alkyl_diethers aminopept_act ammonium atmospheric_data bacteria_carb_prod biomass bishomohopanol bromide calcium carb_nitro_ratio chem_administration chloride chlorophyll current density diether_lipids diss_carb_dioxide diss_hydrogen diss_inorg_carb diss_inorg_nitro diss_inorg_phosp diss_org_carb diss_org_nitro diss_oxygen elev glucosidase_act light_intensity magnesium mean_frict_vel mean_peak_frict_vel misc_param n_alkanes nitrate nitrite nitro org_carb org_matter org_nitro organism_count oxy_stat_samp ph part_org_carb part_org_nitro perturbation petroleum_hydrocarb phaeopigments phosphate phosplipid_fatt_acid photon_flux potassium pressure primary_prod redox_potential salinity samp_size samp_store_dur samp_store_loc samp_store_temp silicate sodium soluble_react_phosp sulfate sulfide suspend_part_matter temp tidal_stage tot_depth_water_col tot_diss_nitro tot_inorg_nitro tot_nitro tot_part_carb tot_phosp" << endl;
+ }
+ }
+
+ for (int i = 0; i < Groups.size(); i++) { out << Groups[i] << '\t' << endl; }
+
+ out.close();
+