-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path03pipeline_filtersequence.R
24 lines (20 loc) · 1.06 KB
/
03pipeline_filtersequence.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# D. Filter out the primer/barcode sequence using SeqFilters.jar from
#https://github.com/rdpstaff/SeqFilters
ptm <- proc.time()
#Files with dimension
fasta.files <-paste(fastq.convert.fasta.dir,list.files(fastq.convert.fasta.dir,pattern="fna"),sep="")
filtered.dir.wpath <- paste(filtered.dir,paste(list.files(fastq.convert.fasta.dir,pattern="fna"),sep=""),sep="")
#Delete any folders in the SFBR_SeqFiltered directory...the java script will not run if files already exist
unlink(filtered.dir.wpath,recursive=TRUE, force=FALSE)
#D. Filter out the primer/barcode sequence
#1. Download SeqFilters.jar from https://github.com/rdpstaff/SeqFilters
#2. Run SeqFilters.jar with this command: java -jar /path/to/SeqFilters.jar
#File command
seqfilter.command <- paste("java -jar ",seq_filter.dir, "SeqFilters.jar", " --forward-primers ", forward.p,
" --max-forward 2 --reverse-primers ", reverse.p, " --max-reverse 1 --seq-file ", fasta.files," -o ", filtered.dir.wpath, sep="")
for(command in seqfilter.command){
system(command)
}
fasta.files
filtered.dir.wpath
proc.time() - ptm