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 |
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)), ] |
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
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
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
reduced_table <- tab[-which(is.na(tab$nucleotides_16S)), ] | |
gene_name <- "rRNA" | |
prod_name <- "16S ribosomal RNA" | |
# note that we deleted the genetic code element, as this is not a coding sequence | |
# also note that 'append' is now set to 'TRUE' to add the data to previously written files | |
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]") | |
fasta_complete <- paste(fasta_description, reduced_table$nucleotides_16S, sep="\n")# add data to fasta |
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
# Here we use -a flag to specify fasta file format type, | |
# the -V flag to request verification (v) and a GenBank flatfile as part of the output (b), | |
# and the -T flag to tell the program to generate the higher taxonomic classifications for our record. | |
# Use 'tbl2asn --help' for a full list of the options | |
# To run if in PATH | |
tbl2asn -t template.sbt -i sequences.fsa -f features.tbl -a s -V vb -T | |
# To run if local | |
./tbl2asn -t template.sbt -i sequences.fsa -f features.tbl -a s -V vb -T |
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
>BB-002_CYTB [organism=Boops boops] [Bio_material=BB-002] [Specimen-voucher=MNHN:1978-0632] [location=mitochondrion] [mgcode=2] | |
ATGGCTAGCCTTCGAAAAACGCACCCCCTATTAAAAATTGCTAATCACGCATTAGTTGATCTCCCTGCACCCTCCAATATTTCCGTCTGATGAAATTTTGGCTCCCTGCTTGGCCTCTGTCTTATTTCCCAGCTCCTTACAGGGCTATTCCTCGCCATACACTATACCTCCGATATCGCTACAGCCTTCTCTTCCGTTGCC | |
>BB-003_CYTB [organism=Boops boops] [Bio_material=BB-003] [Specimen-voucher=MNHN:1978-0632] [location=mitochondrion] [mgcode=2] | |
ATGGCTAGCCTTCGAAAAACGCACCCCCTATTAAAAATTGCTAATCACGCATTAGTTGATCTCCCTGCACCCTCCAATATTTCCGTCTGATGAAATTTTGGCTCCCTGCTTGGCCTCTGTCTTATTTCCCAGCTCCTTACAGGGCTATTCCTCGCCATACACTATACCTCCGATATCGCTACAGCCTTCTCTTCCGTTGCC |
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 BB-002_CYTB | |
1 >201 gene | |
gene CYTB | |
1 >201 CDS | |
product cytochrome b | |
codon_start 1 | |
>Feature BB-003_CYTB | |
1 >201 gene | |
gene CYTB | |
1 >201 CDS |
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 BB-002_CYTB | |
1 >201 gene | |
gene CYTB | |
1 >201 CDS | |
product cytochrome b | |
codon_start 1 | |
>Feature BB-003_CYTB | |
1 >201 gene | |
gene CYTB | |
1 >201 CDS |
OlderNewer