Reading in from NCBI using a tutorial

#Use library command to make ape functions accessible by this script
library(ape)
#Use paste() function to create a chr vector of accession numbers for Gasterosteus sequences
# These sequences all belong to one genus of sticklebacks
#Change in the tutorial to be sequences previous Endicott
#Bioinformatics students uploaded MT103163-MT103183
seq1 <- paste("JQ", seq(983161, 983255), sep = "")
# Download all sequential sequences from Genbank
# This would be really hard to do my hand
# Note that the downloaded sequences are stored in a single variable called a list
sequences <- read.GenBank(seq1,
                          seq.names = seq1,
                          species.names = TRUE,
                          as.character = TRUE)
# Write the sequences to a fasta file
write.dna(sequences, "fish.fasta", format = "fasta")

My organism: Prospium cylindraceum

# Reading in the acession list downloaded from NCBI
seq2 <- read.table("sequence.seq")

# Extracting the avvession numbers from the first column
seq2 <- seq2[,1]
# Downloading the sequences from GenBank with the acession numbers read in
sequence <- read.GenBank(seq2,
                          seq.names = seq2,
                          species.names = TRUE,
                          as.character = TRUE)
# Writing the sequences into a FASTA file
write.dna(sequence, "EQfish.fasta", format = "fasta")