#Additional file 4. Scripts and parameters used in the study. #------------------------------------- #Scripts to align and trim scaffold 0 sequences. #added an E.coli MG1655 sequence to scaffold_0_only file and called it scaffold_0_only_MG1655 (sequence from Silva database, found by searching for accession U00096) #Aligned the scaffold 0 sequences to trim of primer ends; Mothur aligner replaces wobble characters with N's and this is creating problems for OTU clustering; therefore, used the default PyNAST aligner in QIIME; min. sequence length set to 33. nohup align_seqs.py -i scaffold_0_only_MG1655.fa -e 33 -o scaffold0_pynast & #Get the reverse complement of failures and then try alignment again. adjust_seq_orientation.py -i scaffold0_pynast/scaffold_0_only_MG1655_failures.fasta -o scaffold0_pynast/scaffold_0_only_MG1655_failures_rc.fasta nohup align_seqs.py -i scaffold0_pynast/scaffold_0_only_MG1655_failures_rc.fasta -o scaffold0_pynast/failures_rc_alignment & #some sequences still failing alignment - appear to be bad assemblies --> continued with file scaffold_0_only_MG1655_aligned.fasta #Opened the alignment file in Aliview and manually removed R primer sequences (i.e. reverse complement of the R primer (TGYACACACCGCCCGTC) and the forward primer AGAGTTTGATCMTGGCTCAG). Alignment starts at position 28 and ends at position 1390 of the E.coli genome. #used Mothur to remove gaps from alignment; nohup mothur ¨#degap.seqs(fasta=scaffold_0_only_MG1655_alignment_trimmed.fasta)¨ & #------------------------------------- #Working in Oracle VM VirtualBox to Version 5.0.26 r108824; QIIME 1.9.1 #manually deleted E.coli sequence from scaffold_0_only_MG1655_aligned_trimmed_nogaps2.fa #select sequences from file scaffold_0_only_MG1655_aligned_trimmed_nogaps2.fasta that are between 1300 and 1500 bp split_libraries.py -f scaffold_0_only_MG1655_aligned_trimmed_nogaps2.fasta -b 0 -p -j run_prefix -l 1300 -L 1500 -o 1300_split -m mapping2.txt #open ref OTU picking using the seqs.fna file output from above (default min OTU size is 2) #parameters0.99gg.txt file #pick_otus:similarity 0.99 #assign_taxonomy:assignment_method rdp #assign_taxonomy:reference_seqs_fp gg_13_5_otus/rep_set/99_otus.fasta #assign_taxonomy:id_to_taxonomy_fp gg_13_5_otus/taxonomy/99_otu_taxonomy.txt pick_open_reference_otus.py -i 1300_split/seqs.fna -o 1300_openref/99_otus_gg -p parameters0.99gg.txt -r gg_13_5_otus/rep_set/99_otus.fasta summarize_taxa_through_plots.py -i 1300_openref/99_otus_gg/otu_table_mc2_w_tax_no_pynast_failures.biom -o 1300_openref/99_otus_gg/taxa_summary biom convert -i 1300_openref/99_otus_gg/otu_table_mc2_w_tax_no_pynast_failures.biom -o 1300_openref/99_otus_gg/otu_table_convert.txt --to-tsv --header-key taxonomy --output-metadata-id "ConsensusLineage" biom summarize-table -i 1300_openref/99_otus_gg/otu_table_mc2_w_tax_no_pynast_failures.biom -o 1300_openref/99_otus_gg/otu_qualitative.txt --qualitative biom summarize-table -i 1300_openref/99_otus_gg/otu_table_mc2_w_tax_no_pynast_failures.biom -o 1300_openref/99_otus_gg/otu_scaffold_num.txt #manually removed chloroplast sequences from file otu_table_convert.txt --> otu_table_convert_no_chloro.txt biom convert -i 1300_openref/99_otus_gg/otu_table_convert_no_chloro.txt -o 1300_openref/99_otus_gg/otu_table_convert_no_chloro.biom --to-hdf5 --table-type="OTU table" --process-obs-metadata taxonomy #alpha rarefaction curves multiple_rarefactions.py -i 1300_openref/99_otus_gg/otu_table_convert_no_chloro.biom -m 10 -x 260 -s 10 -n 1000 -o 1300_openref/99_otus_gg/rare_10-260_n=1000/ alpha_diversity.py -i 1300_openref/99_otus_gg/rare_10-260_n=1000/ -o 1300_openref/99_otus_gg/alpha_rare_10-260_n=1000/ -t 1300_openref/99_otus_gg/rep_set.tre -m observed_species,chao1,PD_whole_tree collate_alpha.py -i 1300_openref/99_otus_gg/alpha_rare_10-260_n=1000/ -o 1300_openref/99_otus_gg/alpha_collated_10-260_n=1000/ make_rarefaction_plots.py -i 1300_openref/99_otus_gg/alpha_collated_10-260_n=1000/ -m mapping2.txt -o 1300_openref/99_otus_gg/alpha_collated_plots_10-260_n=1000/ #------------------------------------- #Obtaining sequences belonging to dominant Asaia OTU 808997 using asaiaunaligned.pl script ./asaiaunaligned.pl seqs.fna final_otu_map_mc2.txt 808997 > asaia_unaln.fa # asaiaunaligned.pl script #!/usr/bin/env perl use strict; use warnings; open(OTUMAP, $ARGV[1]); my %otuseqs; while(my $line = ){ chomp $line; my @o = split(/\t/, $line); next unless $o[0] eq $ARGV[2]; for(my $i=1; $i<@o; $i++){ $otuseqs{$o[$i]}=1; } } open(SEQFILE, $ARGV[0]); while(my $line = ){ next unless $line =~ />(.+) (.+) orig_bc/; if(exists $otuseqs{$1}){ my $seq = ; print ">$1\n$seq"; } } #------------------------------------- #Clustering at 100% similiarity the V4 region of sequences that clustered to the dominant Asaia OTU at 99% similairty #aligned the sequences in QIIME using the default settings in align_seqs.py align_seqs.py -i asaia_unaln.fna #used pcr.seqs in Mothur to trim the alignment to the positions of the 515F and 806R primers (V4 region - GTGCCAGCMGCCGCGGTAA;GACTACHVGGGTWTCTAAT) pcr.seqs(fasta=pynast_aligned/asaia_unaln_aligned.fasta, oligos=v4oligos.txt, pdiffs=4, keepprimer=t) #removed all gaps from the alignment using Mothur degap.seqs(fasta=pynast_aligned/asaia_unaln_aligned.pcr.fasta) #repeated previous analysis steps that were applied to the full length seqs split_libraries.py -m mapping3.txt -f v4asaia_unaln_aligned.pcr.ng.fasta -b 0 -p -j run_prefix -L 1500 -o v4Asaia_split #pick OTUs 1.00 similarity, min OTU size 1 pick_open_reference_otus.py -i v4Asaia_split/seqs.fna -o v4Asaia_openref/100_otus_gg -p parameters1.00gg.txt -r gg_13_5_otus/rep_set/99_otus.fasta --min_otu_size 1 summarize_taxa_through_plots.py -i v4Asaia_openref/100_otus_gg/otu_table_mc1_w_tax_no_pynast_failures.biom -o v4Asaia_openref/100_otus_gg/taxa_summary biom convert -i v4Asaia_openref/100_otus_gg/otu_table_mc1_w_tax_no_pynast_failures.biom -o v4Asaia_openref/100_otus_gg/otu_table_convert.txt --to-tsv --header-key taxonomy --output-metadata-id "ConsensusLineage" #------------------------------------- #Clustering at 100% similiarity the near full-length sequences that clustered to the dominant Asaia OTU at 99% similairty #select sequences from file asaia_unaln.fna that are between 1300 and 1500 bp split_libraries.py -f asaia_unaln.fna -b 0 -p -j run_prefix -l 1300 -L 1500 -o Asaia_split -m mapping3.txt #open ref OTU picking using the seqs.fna file output from above #parameters1.00gg.txt pick_otus:similarity 1.00 assign_taxonomy:assignment_method rdp assign_taxonomy:reference_seqs_fp gg_13_5_otus/rep_set/99_otus.fasta assign_taxonomy:id_to_taxonomy_fp gg_13_5_otus/taxonomy/99_otu_taxonomy.txt #pick OTUs 1.00 similarity, min OTU size 1 pick_open_reference_otus.py -i Asaia_split/seqs.fna -o Asaia_openref/100_otus_gg -p parameters1.00gg.txt -r gg_13_5_otus/rep_set/99_otus.fasta --min_otu_size 1 summarize_taxa_through_plots.py -i Asaia_openref/100_otus_gg/otu_table_mc1_w_tax_no_pynast_failures.biom -o Asaia_openref/100_otus_gg/taxa_summary biom convert -i Asaia_openref/100_otus_gg/otu_table_mc1_w_tax_no_pynast_failures.biom -o Asaia_openref/100_otus_gg/otu_table_convert.txt --to-tsv --header-key taxonomy --output-metadata-id "ConsensusLineage" biom summarize-table -i Asaia_openref/100_otus_gg/otu_table_mc1_w_tax_no_pynast_failures.biom -o Asaia_openref/100_otus_gg/otu_qualitative.txt --qualitative biom summarize-table -i Asaia_openref/100_otus_gg/otu_table_mc1_w_tax_no_pynast_failures.biom -o Asaia_openref/100_otus_gg/otu_scaffold_num.txt