This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
feature_tab <- paste0(paste0(">Feature", " ", reduced_table$otherCatalogNumbers, "_", gene_name),"\n", # | |
"1", "\t", ">", nchar(reduced_table$nucleotides_CYTB), "\t", "gene", "\n", # | |
"\t", "\t", "\t", "gene", "\t", gene_name, "\n", # | |
"1", "\t", ">", nchar(reduced_table$nucleotides_CYTB), "\t", "CDS", "\t", "\t", "\n", # | |
"\t", "\t", "\t", "product", "\t", prod_name, "\n", # | |
"\t", "\t", "\t", "codon_start", "\t", "1") | |
write(feature_tab, file="features.tbl", append=FALSE)# write out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gene_name <- "CYTB" | |
prod_name <- "cytochrome b" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fasta_description <- paste0(">", paste0(reduced_table$otherCatalogNumbers, "_", gene_name), " ", # | |
"[organism=", reduced_table$genus, " ", reduced_table$specificEpithet, "]", " ", # | |
"[Bio_material=", reduced_table$otherCatalogNumbers, "]", " ", "[Specimen-voucher=", # | |
reduced_table$institutionCode, ":", reduced_table$catalogNumber, "]", " ", "[location=mitochondrion] [mgcode=2]") | |
fasta_complete <- paste(fasta_description, reduced_table$nucleotides_CYTB, sep="\n")# add data to fasta | |
write(fasta_complete, file="sequences.fsa", append=FALSE)# write out the fasta file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tab <- read.table("master.tsv", header=TRUE, sep="\t", stringsAsFactors=FALSE) | |
reduced_table <- tab[-which(is.na(tab$nucleotides_CYTB)), ] |
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 8 columns, instead of 14. in line 1.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
otherCatalogNumbers genus specificEpithet institutionCode catalogNumber country nucleotides_CYTB nucleotides_16S | |
BB-001 Boops boops MNHN 1978-0632 Spain NA TATGGAGCTTAA | |
BB-002 Boops boops MNHN 1978-0632 Spain ATGGCTAGCCT NA | |
BB-003 Boops boops MNHN 1978-0632 Spain ATGGCTAGCCT TATGGAGCTTAA |
NewerOlder